From 0ea12b21d019058eee22e24f6a9c543be523b09d Mon Sep 17 00:00:00 2001 From: Jonathan Payne Date: Wed, 23 Feb 2011 18:19:40 -0800 Subject: [PATCH] + Fix stupid glow, 1/3rd of MIGS/StepMania Online Display. --- Themes/_fallback/Scripts/02 StageMods.lua | 2 + .../ScreenEvaluation overlay/default.lua | 63 ++++++++++++++ .../ScreenEvaluation overlay/original.lua | 86 +++++++++++++++++++ Themes/default/metrics.ini | 2 +- 4 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 Themes/default/BGAnimations/ScreenEvaluation overlay/default.lua create mode 100644 Themes/default/BGAnimations/ScreenEvaluation overlay/original.lua diff --git a/Themes/_fallback/Scripts/02 StageMods.lua b/Themes/_fallback/Scripts/02 StageMods.lua index 37bd927a5a..d61db7c252 100644 --- a/Themes/_fallback/Scripts/02 StageMods.lua +++ b/Themes/_fallback/Scripts/02 StageMods.lua @@ -50,6 +50,8 @@ function ScreenSelectMusic:setupmusicstagemods() GAMESTATE:SetPreferredDifficulty( pn, difficulty ) MESSAGEMAN:Broadcast( "PlayerOptionsChanged", {PlayerNumber = pn} ) end + +-- if PREFSMAN:GetPreference(" GAMESTATE:SetSongOptions( "ModsLevel_Stage", so ) MESSAGEMAN:Broadcast( "SongOptionsChanged" ) diff --git a/Themes/default/BGAnimations/ScreenEvaluation overlay/default.lua b/Themes/default/BGAnimations/ScreenEvaluation overlay/default.lua new file mode 100644 index 0000000000..8bf1f85bb4 --- /dev/null +++ b/Themes/default/BGAnimations/ScreenEvaluation overlay/default.lua @@ -0,0 +1,63 @@ +local vStats = STATSMAN:GetCurStageStats(); +local function CreateStats( pnPlayer ) + -- Actor Templates + local aLabel = LoadFont("Common Normal") .. { Text="..."; InitCommand=cmd(zoom,0.5;shadowlength,1;horizalign,left); }; + local aText = LoadFont("Common Normal") .. { Text="..."; InitCommand=cmd(zoom,0.5;shadowlength,1;horizalign,left); }; + -- DA STATS, JIM!! + local pnStageStats = vStats:GetPlayerStageStats( pnPlayer ); + -- Organized Stats. + local tStats = { + W1 = pnStageStats:GetTapNoteScores('TapNoteScore_W1'); + W2 = pnStageStats:GetTapNoteScores('TapNoteScore_W2'); + W3 = pnStageStats:GetTapNoteScores('TapNoteScore_W3'); + W4 = pnStageStats:GetTapNoteScores('TapNoteScore_W4'); + W5 = pnStageStats:GetTapNoteScores('TapNoteScore_W5'); + Miss = pnStageStats:GetTapNoteScores('TapNoteScore_Miss'); + HitMine = pnStageStats:GetTapNoteScores('TapNoteScore_HitMine'); + AvoidMine = pnStageStats:GetTapNoteScores('TapNoteScore_AvoidMine'); + Held = pnStageStats:GetHoldNoteScores('HoldNoteScore_Held'); + LetGo = pnStageStats:GetHoldNoteScores('HoldNoteScore_LetGo'); + }; + -- Organized Equation Values + local tValues = { + -- marvcount*7 + perfcount*6 + greatcount*5 + goodcount*4 + boocount*2 + okcount*7 + ITG = ( tStats["W1"]*7 + tStats["W2"]*6 + tStats["W3"]*5 + tStats["W4"]*4 + tStats["W5"]*2 + tStats["Held"]*7 ), + -- (marvcount + perfcount + greatcount + goodcount + boocount + misscount + okcount + ngcount)*7 + ITG_MAX = ( tStats["W1"] + tStats["W2"] + tStats["W3"] + tStats["W4"] + tStats["W5"] + tStats["Miss"] + tStats["Held"] + tStats["LetGo"] )*7, + -- marvcount*3 + perfcount*2 + greatcount*1 - boocount*4 - misscount*8 + okcount*6 + MIGS = ( tStats["W1"]*3 + tStats["W2"]*2 + tStats["W3"] - tStats["W5"]*4 - tStats["Miss"]*8 + tStats["Held"]*6 ), + -- (marvcount + perfcount + greatcount + goodcount + boocount + misscount)*3 + (okcount + ngcount)*6 + MIGS_MAX = ( (tStats["W1"] + tStats["W2"] + tStats["W3"] + tStats["W4"] + tStats["W5"] + tStats["Miss"])*3 + (tStats["Held"] + tStats["LetGo"])*6 ), + + }; + -- + local t = Def.ActorFrame {}; + t[#t+1] = Def.ActorFrame { + InitCommand=cmd(y,-16); + LoadActor(THEME:GetPathG("ScreenTitleMenu","PreferenceFrame")) .. { + InitCommand=cmd(zoom,0.875;diffuse,PlayerColor( pnPlayer )); + }; + aLabel .. { Text="ITG DP:"; InitCommand=cmd(x,-64) }; + aText .. { Text=string.format("%04i",tValues["ITG"]); InitCommand=cmd(x,-8;y,5;vertalign,bottom;zoom,0.675); }; + aText .. { Text="/"; InitCommand=cmd(x,28;y,5;vertalign,bottom;zoom,0.5;diffusealpha,0.5); }; + aText .. { Text=string.format("%04i",tValues["ITG_MAX"]); InitCommand=cmd(x,32;y,5;vertalign,bottom;zoom,0.5); }; + }; + t[#t+1] = Def.ActorFrame { + InitCommand=cmd(y,16); + LoadActor(THEME:GetPathG("ScreenTitleMenu","PreferenceFrame")) .. { + InitCommand=cmd(zoom,0.875;diffuse,PlayerColor( pnPlayer )); + }; + aLabel .. { Text="MIGS DP:"; InitCommand=cmd(x,-64) }; + aText .. { Text=string.format("%04i",tValues["MIGS"]); InitCommand=cmd(x,-8;y,5;vertalign,bottom;zoom,0.675); }; + aText .. { Text="/"; InitCommand=cmd(x,28;y,5;vertalign,bottom;zoom,0.5;diffusealpha,0.5); }; + aText .. { Text=string.format("%04i",tValues["MIGS_MAX"]); InitCommand=cmd(x,32;y,5;vertalign,bottom;zoom,0.5); }; + }; + return t +end; +local t = Def.ActorFrame {}; +t[#t+1] = Def.ActorFrame { + InitCommand=cmd(x,math.floor(SCREEN_CENTER_X*0.5)-8;y,SCREEN_CENTER_Y); + -- + CreateStats( PLAYER_1 ); +}; +return t \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenEvaluation overlay/original.lua b/Themes/default/BGAnimations/ScreenEvaluation overlay/original.lua new file mode 100644 index 0000000000..df3f8441cb --- /dev/null +++ b/Themes/default/BGAnimations/ScreenEvaluation overlay/original.lua @@ -0,0 +1,86 @@ +local ss = STATSMAN:GetCurStageStats(); +local pss = ss:GetPlayerStageStats('PlayerNumber_P1'); +local misscount = pss:GetTapNoteScores('TapNoteScore_Miss'); +local boocount = pss:GetTapNoteScores('TapNoteScore_W5'); +local goodcount = pss:GetTapNoteScores('TapNoteScore_W4'); +local greatcount = pss:GetTapNoteScores('TapNoteScore_W3'); +local perfcount = pss:GetTapNoteScores('TapNoteScore_W2'); +local marvcount = pss:GetTapNoteScores('TapNoteScore_W1'); +local minehitcount = pss:GetTapNoteScores('TapNoteScore_HitMine'); +local minemisscount = pss:GetTapNoteScores('TapNoteScore_AvoidMine'); +local okcount = pss:GetHoldNoteScores('HoldNoteScore_Held'); +local ngcount = pss:GetHoldNoteScores('HoldNoteScore_LetGo'); +local ITGdp = marvcount*7 + perfcount*6 + greatcount*5 + goodcount*4 + boocount*2 + okcount*7 +local ITGdpmax = (marvcount + perfcount + greatcount + goodcount + boocount + misscount + okcount + ngcount)*7 +local MIGSdp = marvcount*3 + perfcount*2 + greatcount*1 - boocount*4 - misscount*8 + okcount*6 +local MIGSdpmax = (marvcount + perfcount + greatcount + goodcount + boocount + misscount)*3 + (okcount + ngcount)*6 +local histogram = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} +local total = 0 +local maxValue = 0; +print("John11length: "..#histogram); + +for i=1,#tTotalJudgmentsSigned do + print("John11Timings: "..i.." - "..tTotalJudgmentsSigned[i]) + local index = math.floor((0.18-tTotalJudgmentsSigned[i])*(#histogram/.36)); + print("John11Index: "..i.." - "..index) + if index >= 0 and index <= #histogram - 1 then + histogram[index] = histogram[index] + 1 + total = total + 1 + if histogram[index] > maxValue then + maxValue = histogram[index] + end + end +end + +for i=1,#histogram do + print("John11Judgments: "..i.." - "..histogram[i]) +end + +local t = Def.ActorFrame {} +t[#t+1] = Def.ActorFrame { + InitCommand=cmd(x,SCREEN_CENTER_X/3;y,SCREEN_CENTER_Y); + LoadFont("Common Normal") .. { + Text="MIGS DP: "..tostring(MIGSdp).."/"..tostring(MIGSdpmax).."\nITG DP: "..tostring(ITGdp).."/"..tostring(ITGdpmax).."\nOffset Avg: "..RoundTo(tTimingDifferenceAverage,5).."\nAbs Offset Avg: "..RoundTo(tTimingDifferenceAbsAverage,5).."\nEarly Taps: "..tEarlyHits.."\nLate Taps: "..tLateHits; + InitCommand=cmd(y,-4;shadowlength,1;diffuse,Color("Red");zoom,0.5) + }; +} + +for i=1,#histogram do + local offset = -1 + if i > #histogram/2 then + offset = 1 + end + t[#t+1] = Def.Quad { + InitCommand=cmd(diffuse,Color("Red");zoomtowidth,300/#histogram-1;zoomtoheight,histogram[#histogram-i]/maxValue*150;x,SCREEN_CENTER_X+100+300/#histogram*i+offset;y,SCREEN_CENTER_Y-histogram[#histogram-i]/maxValue*150/2); + } +end + +t[#t+1] = Def.Quad { + InitCommand=cmd(x,SCREEN_CENTER_X+250;y,SCREEN_CENTER_Y+3;zoomtowidth,300;zoomtoheight,5;diffuse,color("#FFFFFF")); +} + +t[#t+1] = Def.Quad { + InitCommand=cmd(x,SCREEN_CENTER_X+252;y,SCREEN_CENTER_Y-75;zoomtowidth,1;zoomtoheight,150;diffuse,color("#000000")); +} + + +t[#t+1] = Def.ActorFrame { + InitCommand=cmd(x,SCREEN_CENTER_X+125;y,SCREEN_CENTER_Y+15); + LoadFont("Common Normal") .. { + Text="Early"; + InitCommand=cmd(shadowlength,1;diffuse,Color("#FF0000");zoom,0.5) + }; +} + +t[#t+1] = Def.ActorFrame { + InitCommand=cmd(x,SCREEN_CENTER_X+375;y,SCREEN_CENTER_Y+15); + LoadFont("Common Normal") .. { + Text="Late"; + InitCommand=cmd(shadowlength,1;diffuse,Color("#FF0000");zoom,0.5) + }; +} + +print("John11Total: "..total) +print("John11MaxValue: "..maxValue) + +return t \ No newline at end of file diff --git a/Themes/default/metrics.ini b/Themes/default/metrics.ini index 97bf7a4d3a..29d9ea8bb0 100644 --- a/Themes/default/metrics.ini +++ b/Themes/default/metrics.ini @@ -638,7 +638,7 @@ ShowMeter=true ZeroMeterString="0" MeterX=56 MeterY=0 -MeterOnCommand=shadowlength,1;zoom,0.65 +MeterOnCommand=shadowlength,1;zoom,0.65;textglowmode,'TextGlowMode_Inner'; MeterOffCommand= MeterSetCommand=%function(self,param) \ if param.CustomDifficulty then \