From 8f09e3c33705e74c02bac3c99dd7b2df9a46f080 Mon Sep 17 00:00:00 2001 From: Jonathan Payne Date: Mon, 27 Sep 2010 22:41:11 -0700 Subject: [PATCH] Theme changes --- .../Fonts/ScreenGameplay DeltaSeconds.redir | 1 + .../Fonts/ScreenGameplay RemainingTime.redir | 1 + .../BGAnimations/ScreenGameplay overlay.lua | 40 +++++++++++++++++++ .../Graphics/Player judgment/default.lua | 10 +++-- .../Graphics/ScreenGameplay DeltaSeconds.lua | 21 ++++++++++ .../Graphics/ScreenGameplay RemainingTime.lua | 9 +++++ Themes/default/metrics.ini | 39 ++++++++++++------ 7 files changed, 105 insertions(+), 16 deletions(-) create mode 100644 Themes/_fallback/Fonts/ScreenGameplay DeltaSeconds.redir create mode 100644 Themes/_fallback/Fonts/ScreenGameplay RemainingTime.redir create mode 100644 Themes/default/BGAnimations/ScreenGameplay overlay.lua create mode 100644 Themes/default/Graphics/ScreenGameplay DeltaSeconds.lua create mode 100644 Themes/default/Graphics/ScreenGameplay RemainingTime.lua diff --git a/Themes/_fallback/Fonts/ScreenGameplay DeltaSeconds.redir b/Themes/_fallback/Fonts/ScreenGameplay DeltaSeconds.redir new file mode 100644 index 0000000000..5c6053f7f1 --- /dev/null +++ b/Themes/_fallback/Fonts/ScreenGameplay DeltaSeconds.redir @@ -0,0 +1 @@ +Common Normal \ No newline at end of file diff --git a/Themes/_fallback/Fonts/ScreenGameplay RemainingTime.redir b/Themes/_fallback/Fonts/ScreenGameplay RemainingTime.redir new file mode 100644 index 0000000000..5c6053f7f1 --- /dev/null +++ b/Themes/_fallback/Fonts/ScreenGameplay RemainingTime.redir @@ -0,0 +1 @@ +Common Normal \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenGameplay overlay.lua b/Themes/default/BGAnimations/ScreenGameplay overlay.lua new file mode 100644 index 0000000000..35cb2aebc6 --- /dev/null +++ b/Themes/default/BGAnimations/ScreenGameplay overlay.lua @@ -0,0 +1,40 @@ +local t = Def.ActorFrame {}; +local function UpdateTime(self) + local c = self:GetChildren(); + for pn in ivalues(PlayerNumber) do + local vStats = STATSMAN:GetCurStageStats():GetPlayerStageStats( pn ); + local vTime; + local obj = self:GetChild( string.format("RemainingTime" .. PlayerNumberToString(pn) ) ); + if vStats then + vTime = vStats:GetLifeRemainingSeconds() + obj:settext( SecondsToMMSSMsMs( vTime ) ); + end; + end; +end +if GAMESTATE:GetCurrentCourse() then + if GAMESTATE:GetCurrentCourse():GetCourseType() == "CourseType_Survival" then + -- RemainingTime + for pn in ivalues(PlayerNumber) do + local MetricsName = "RemainingTime" .. PlayerNumberToString(pn); + t[#t+1] = LoadActor( THEME:GetPathG( Var "LoadingScreen", "RemainingTime"), pn ) .. { + InitCommand=function(self) + self:player(pn); + self:name(MetricsName); + ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); + end; + }; + end + for pn in ivalues(PlayerNumber) do + local MetricsName = "DeltaSeconds" .. PlayerNumberToString(pn); + t[#t+1] = LoadActor( THEME:GetPathG( Var "LoadingScreen", "DeltaSeconds"), pn ) .. { + InitCommand=function(self) + self:player(pn); + self:name(MetricsName); + ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); + end; + }; + end + end; +end; --]] +t.InitCommand=cmd(SetUpdateFunction,UpdateTime); +return t \ No newline at end of file diff --git a/Themes/default/Graphics/Player judgment/default.lua b/Themes/default/Graphics/Player judgment/default.lua index b47075ae15..a051ded80a 100644 --- a/Themes/default/Graphics/Player judgment/default.lua +++ b/Themes/default/Graphics/Player judgment/default.lua @@ -103,8 +103,8 @@ t[#t+1] = Def.ActorFrame { Def.Quad { Name="ProtimingGraphAverage"; InitCommand=cmd(visible,false;y,32;zoomto,2,7;); - ResetCommand=cmd(finishtweening;diffusealpha,0.5;visible,false); - OnCommand=cmd(diffuse,Color("Blue");diffusealpha,0.5;glowshift); + ResetCommand=cmd(finishtweening;diffusealpha,0.85;visible,false); + OnCommand=cmd(diffuse,Color("Orange");diffusealpha,0.85); }; Def.Quad { Name="ProtimingGraphCenter"; @@ -147,8 +147,10 @@ t[#t+1] = Def.ActorFrame { bUseNegative = false; end; - -- we're safe, you can push the values - tTotalJudgments[#tTotalJudgments+1] = bUseNegative and fTapNoteOffset or math.abs( fTapNoteOffset ); + if fTapNoteOffset ~= 1 then + -- we're safe, you can push the values + tTotalJudgments[#tTotalJudgments+1] = bUseNegative and fTapNoteOffset or math.abs( fTapNoteOffset ); + end self:playcommand("Reset"); diff --git a/Themes/default/Graphics/ScreenGameplay DeltaSeconds.lua b/Themes/default/Graphics/ScreenGameplay DeltaSeconds.lua new file mode 100644 index 0000000000..91590401a7 --- /dev/null +++ b/Themes/default/Graphics/ScreenGameplay DeltaSeconds.lua @@ -0,0 +1,21 @@ +local PlayerNumber = ...; +assert( PlayerNumber ); + +local t = LoadFont("ScreenGameplay","RemainingTime") .. { + Name="RemainingTime"; + Text=""; + JudgmentMessageCommand=function(self,params) + if params.Player == PlayerNumber then + if params.TapNoteScore then + self:playcommand( "GainSeconds" ); + self:playcommand( ToEnumShortString( params.TapNoteScore ) ); + self:settextf( "%+1.1fs", PREFSMAN:GetPreference( string.format("TimeMeterSecondsChange%s", ToEnumShortString( params.TapNoteScore ) ) ) ); + else + return + end + else + return + end + end; +}; +return t \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenGameplay RemainingTime.lua b/Themes/default/Graphics/ScreenGameplay RemainingTime.lua new file mode 100644 index 0000000000..593acc15aa --- /dev/null +++ b/Themes/default/Graphics/ScreenGameplay RemainingTime.lua @@ -0,0 +1,9 @@ +local PlayerNumber = ...; +assert( PlayerNumber ); + +local t = LoadFont("ScreenGameplay","RemainingTime") .. { + Name="SurvivalTime"; + Text=""; +}; + +return t \ No newline at end of file diff --git a/Themes/default/metrics.ini b/Themes/default/metrics.ini index 6fd73f81c1..d9ece03880 100644 --- a/Themes/default/metrics.ini +++ b/Themes/default/metrics.ini @@ -343,20 +343,15 @@ TextOffCommand= [ScoreDisplayLifeTime] FrameX= FrameY= -FrameOnCommand= +FrameOnCommand=visible,false;spin FrameOffCommand= # -TextX= -TextY= -TextOnCommand=shadowlength,1;diffusebottomedge,BoostColor(Color('White'),0.75) -TextOffCommand= -# TimeRemainingX= -TimeRemainingY= -TimeRemainingOnCommand=zoom,1;shadowlength,1 +TimeRemainingY=80 +TimeRemainingOnCommand=zoom,1;shadowlength,1;settext,"Hi!"; TimeRemainingOffCommand= # -DeltaSecondsOnCommand=y,-40;zoom,0.5;settext,""; +DeltaSecondsOnCommand=y,80;settext,Hi;spin; DeltaSecondsNoneCommand= DeltaSecondsHitMineCommand= DeltaSecondsAvoidMineCommand= @@ -370,7 +365,7 @@ DeltaSecondsW2Command= DeltaSecondsW1Command= DeltaSecondsLetGoCommand= DeltaSecondsHeldCommand= -DeltaSecondsGainLifeCommand= +DeltaSecondsGainLifeCommand=zoom,0.5;settext,"Hi!"; [ScoreDisplayPercentage Percent] PercentP1OnCommand=shadowlength,1;diffuse,PlayerColor(PLAYER_1);diffusetopedge,BoostColor(PlayerColor(PLAYER_1),1.5) PercentP2OnCommand=shadowlength,1;diffuse,PlayerColor(PLAYER_2);diffusetopedge,BoostColor(PlayerColor(PLAYER_2),1.5) @@ -1435,15 +1430,35 @@ ToastyDisplayP2Y=SCREEN_CENTER_Y ToastyDisplayP2OnCommand=visible,false ToastyDisplayP2OffCommand= # -SongNumberP1X=THEME:GetMetric(Var "LoadingScreen","PlayerP1OnePlayerOneSideX") - 60 +SongNumberP1X=Center1Player() and SCREEN_CENTER_X - 60 or THEME:GetMetric(Var "LoadingScreen","PlayerP1OnePlayerOneSideX") - 60 SongNumberP1Y=SCREEN_TOP+24+7 SongNumberP1OnCommand=zoom,0.75;diffuse,PlayerColor(PLAYER_1);strokecolor,BoostColor(PlayerColor(PLAYER_1),0.5) SongNumberP1OffCommand= -SongNumberP2X=THEME:GetMetric(Var "LoadingScreen","PlayerP2OnePlayerOneSideX") + 60 +SongNumberP2X=Center1Player() and SCREEN_CENTER_X + 60 or THEME:GetMetric(Var "LoadingScreen","PlayerP2OnePlayerOneSideX") + 60 SongNumberP2Y=SCREEN_TOP+24+7 SongNumberP2OnCommand=zoom,0.75;diffuse,PlayerColor(PLAYER_2);strokecolor,BoostColor(PlayerColor(PLAYER_2),0.5) SongNumberP2OffCommand= # +RemainingTimeP1X=THEME:GetMetric(Var "LoadingScreen","PlayerP1OnePlayerOneSideX") + 32 +RemainingTimeP1Y=THEME:GetMetric(Var "LoadingScreen","ScoreP1Y") - 22 +RemainingTimeP1OnCommand=shadowlength,1;diffuse,PlayerColor(PLAYER_1);diffusebottomedge,ColorMidTone(PlayerColor(PLAYER_1)); +RemainingTimeP1OffCommand= +RemainingTimeP2X=THEME:GetMetric(Var "LoadingScreen","PlayerP2OnePlayerOneSideX") + 32 +RemainingTimeP2Y=THEME:GetMetric(Var "LoadingScreen","ScoreP2Y") - 22 +RemainingTimeP2OnCommand=shadowlength,1;diffuse,PlayerColor(PLAYER_2);diffusebottomedge,ColorMidTone(PlayerColor(PLAYER_2)); +RemainingTimeP2OffCommand= +# +DeltaSecondsP1X=THEME:GetMetric(Var "LoadingScreen","RemainingTimeP1X") - 80 +DeltaSecondsP1Y=THEME:GetMetric(Var "LoadingScreen","RemainingTimeP1Y") +DeltaSecondsP1OnCommand=shadowlength,1;skewx,-0.125 +DeltaSecondsP1GainSecondsCommand=finishtweening;diffusealpha,1;zoom,1;decelerate,0.3;zoom,0.75;sleep,0.5;linear,0.2;diffusealpha,0;zoom,0 +DeltaSecondsP1OffCommand= +DeltaSecondsP2X=THEME:GetMetric(Var "LoadingScreen","RemainingTimeP2X") - 80 +DeltaSecondsP2Y=THEME:GetMetric(Var "LoadingScreen","RemainingTimeP2Y") +DeltaSecondsP2OnCommand=shadowlength,1;skewx,-0.125 +DeltaSecondsP2GainSecondsCommand=finishtweening;diffusealpha,1;zoom,1;decelerate,0.3;zoom,0.75;sleep,0.5;linear,0.2;diffusealpha,0;zoom,0 +DeltaSecondsP2OffCommand= +# ScoreP1X=Center1Player() and SCREEN_CENTER_X or THEME:GetMetric(Var "LoadingScreen","PlayerP1OnePlayerOneSideX") # ScoreP1X=(PREFSMAN:GetPreference("Center1Player") and GAMESTATE:GetNumPlayersEnabled() == 1) and SCREEN_CENTER_X or THEME:GetMetric(Var "LoadingScreen","PlayerP1OnePlayerOneSideX") ScoreP1Y=SCREEN_BOTTOM-28