Cleaned up the way the crowns work plus added some extra fun.
authorCameron Ball <c.ball1729@gmail.com>
Tue, 17 Dec 2013 09:32:44 +0000 (17:32 +0800)
committerCameron Ball <c.ball1729@gmail.com>
Tue, 17 Dec 2013 09:32:44 +0000 (17:32 +0800)
Themes/GrooveNights/BGAnimations/ScreenGameplay overlay/default.xml
Themes/GrooveNights/Languages/english.ini
Themes/GrooveNights/Scripts/EasterEggs.lua
Themes/GrooveNights/Scripts/Other.lua
Themes/GrooveNights/Scripts/gnSystem.lua
Themes/GrooveNights/metrics.ini

index 2f491f8..272e0d5 100644 (file)
@@ -1,3 +1,5 @@
+
+
 <ActorFrame InitCommand="%function(self) 
 self:queuecommand('KillBPM');
 if GAMESTATE:GetEnv('Vibrate') == 'On' then
@@ -19,6 +21,7 @@ SCREENMAN:GetTopScreen():GetChild('BPMDisplay'):addy(-10000);
                                        end
                                end
 end"> <children>
+    
 <Layer Type="Quad"
 OnCommand="%function(self) self:diffusealpha(0); InitScreen('ScreenGameplay'); end"
 />
@@ -106,55 +109,23 @@ OnCommand="%function(self) self:diffusealpha(0); InitScreen('ScreenGameplay'); e
                        </children>
                </ActorFrame>
                
-<!--Determine Who is Winning-->
+<!-- Crowns -->
 <ActorFrame Condition="GAMESTATE:IsHumanPlayer(PLAYER_1) and GAMESTATE:IsHumanPlayer(PLAYER_2)"
-InitCommand="%function(self) 
-gnCrownOn = TournamentCrownEnabled();
-if gnCrownOn == true then
-       self:sleep(0.05); 
-       self:queuecommand('Loop');
-       end
-end"
-LoopCommand="%function(self)
-self:stoptweening();
-if gnP1Winning then
-       if gnLastWinP1 ~= 1 then
-               MESSAGEMAN:Broadcast('P1Winning');
-               gnLastWinP1 = 1;
-               end
-       else
-       if gnLastWinP1 == 1 then
-               MESSAGEMAN:Broadcast('P1Losing');
-               gnLastWinP1 = 0;
-               end
-       end
-       
-if gnP2Winning then
-       if gnLastWinP2 ~= 1 then
-               MESSAGEMAN:Broadcast('P2Winning');
-               gnLastWinP2 = 1;
-               end
-       else
-       if gnLastWinP2 == 1 then
-               MESSAGEMAN:Broadcast('P2Losing');
-               gnLastWinP2 = 0;
-               end
-       end
-self:sleep(0.1);
-self:queuecommand('Loop');
-end">
+>
 <children>
 <Layer File="winning"
 InitCommand="diffusealpha,0;"
-OnCommand="x,SCREEN_LEFT+23-9+(13*HorizontalRecovery());y,SCREEN_TOP+55+76;zoom,0.5;rotationz,-30;"
-P1WinningMessageCommand="queuecommand,On;stoptweening;sleep,0.2;linear,0.2;diffusealpha,1;"
-P1LosingMessageCommand="queuecommand,On;stoptweening;sleep,0.2;linear,0.2;diffusealpha,0;"
+OnCommand="x,SCREEN_LEFT+23-9+(13*HorizontalRecovery());y,SCREEN_TOP+55+76;zoom,0.5;rotationz,-30;queuecommand,Go"
+GoCommand="%function(self) DoEasterEgg('GoodLuckCameron', { Actor = self }) end"
+P1AheadMessageCommand="linear,0.2;diffusealpha,1;"
+P1BehindMessageCommand="linear,0.2;diffusealpha,0;"
 />
 <Layer File="winning"
 InitCommand="diffusealpha,0;"
-OnCommand="x,SCREEN_RIGHT-23+9-(13*HorizontalRecovery());y,SCREEN_TOP+55+76;zoom,0.5;rotationz,30;"
-P2WinningMessageCommand="queuecommand,On;stoptweening;sleep,0.2;linear,0.2;diffusealpha,1;"
-P2LosingMessageCommand="queuecommand,On;stoptweening;sleep,0.2;linear,0.2;diffusealpha,0;"
+OnCommand="x,SCREEN_RIGHT-23+9-(13*HorizontalRecovery());y,SCREEN_TOP+55+76;zoom,0.5;rotationz,30;queuecommand,Go"
+GoCommand="%function(self) DoEasterEgg('GoodLuckCameron', { Actor = self }) end"
+P2AheadMessageCommand="linear,0.2;diffusealpha,1;"
+P2BehindMessageCommand="linear,0.2;diffusealpha,0;"
 />
 </children>
 </ActorFrame>
index 43f2fdf..1b977db 100644 (file)
@@ -363,6 +363,7 @@ JudgeDifficulty=Judge Diff.
 DefaultFailType=Fail Type
 Theme=Swap Theme
 SpeedModType=Speed Mods
+GoodLuckCameron=Good Luck Cameron
 
 
 Windowed=Display
index a93d992..6c848d9 100644 (file)
@@ -62,7 +62,6 @@ if PROFILEMAN ~= nil then
 end\r
 \r
 local choices = { "OFF", "ON" }\r
-local FunctionTable = {}\r
 \r
 function EasterEggsEnabled()\r
     --Default to off\r
index 15f9a52..ce56405 100644 (file)
@@ -429,10 +429,11 @@ function GetModifierNames( num )
 end
 
 function oitgACoptions()
-    -- Right now we return the same line names for both OITG and whatever else happens to be running. But in the future they might be different.
-    if OPENITG then return "1,2,3,4,5,6,7,8,9,10,11,12" end
+    local OptionLines = "1,2,3,4,5,6,7,8,9,10,11,12"
+    
+    if EasterEggsEnabled() then OptionLines = OptionLines .. ",13" end
 
-    return "1,2,3,4,5,6,7,8,9,10,11,12"
+    return OptionLines
 end
 
 function SongModifiers()
index e2da466..8a6c3a9 100644 (file)
@@ -232,8 +232,6 @@ if scn == 'ScreenGameplay' then
        if FinalBPM == nil then FinalBPM = 0; end
        if curRate == nil then curRate = 1; end
        
-       gnP1Winning = false;
-       gnP2Winning = false;
        gnLowHealth = false;
        gnLowHealth = false;
        gnVoiceTimer = 0;
@@ -354,7 +352,6 @@ function ScreenTransitionWhoosh(i)
        SOUND:PlayOnce(Path);
 end
 
-
 --easter eggs
 local function BPMEasterEggs(Params)
     local ScrollSpeed = DisplayScrollSpeed(Params.pn)
@@ -369,8 +366,15 @@ local function BPMEasterEggs(Params)
     end
 end
 
+local function GoodLuckCameronEasterEgg(Params)
+    if GoodLuckCameronEnabled() then
+        Params.Actor:Load(THEME:GetPath(EC_BGANIMATIONS, '', 'ScreenGameplay overlay/winning2.png'))
+    end
+end
 RegisterEasterEgg("BlazeIt", BPMEasterEggs)
 RegisterEasterEgg("NoScope", BPMEasterEggs)
+RegisterEasterEgg("GoodLuckCameron", GoodLuckCameronEasterEgg)
 
 --global variable callbacks
 local function LowBPM( BPMDisplay )
@@ -423,3 +427,41 @@ end
 function SetFromDisplaySongLength( Actor )
     Actor:settext(DisplaySongLength())
 end
+
+
+
+--throwing this down here until all this code is refactored and neatened
+local ProfileTable
+
+-- Without this check, when StepMania starts it will report a lua runtime error as PROFILEMAN apparently doesn't exist yet.
+if PROFILEMAN ~= nil then
+    ProfileTable = PROFILEMAN:GetMachineProfile():GetSaved()
+end
+
+local choices = { "OFF", "ON" }
+
+function GoodLuckCameronEnabled()
+    --Default to off
+    if ProfileTable.GoodLuckCameron == nil then return false end
+
+    return ProfileTable.GoodLuckCameron
+end
+
+function ToggleGoodLuckCameron()
+    ProfileTable.GoodLuckCameron = not ProfileTable.GoodLuckCameron
+end
+
+function GoodLuckCameronOptionsRow()
+    local function Load(self, list, pn)
+        if GoodLuckCameronEnabled() then list[2] = true else list[1] = true end
+    end
+
+    local function Save(self, list, pn)
+        if list[1] then ProfileTable.GoodLuckCameron = false else ProfileTable.GoodLuckCameron = true end
+        PROFILEMAN:SaveMachineProfile()
+        return
+    end
+
+    local Params = { Name = "GoodLuckCameron" }
+    return CreateOptionRow( Params, choices, Load, Save )
+end
\ No newline at end of file
index c94c61a..ec95d76 100644 (file)
@@ -2515,10 +2515,11 @@ ScoreP1OffCommand=addy,0;
 ScoreP1OnCommand=addy,-100;addy,100;
 ScoreP1X=SCREEN_CENTER_X-180-CourseHorizontal()+(48*HorizontalRecovery())
 ScoreP1Y=SCREEN_TOP+56
-ScoreP1BehindCommand=%function(self) gnP1Winning = false; end
-ScoreP2BehindCommand=%function(self) gnP2Winning = false; end
-ScoreP1AheadCommand=%function(self) gnP1Winning = true; end
-ScoreP2AheadCommand=%function(self) gnP2Winning = true; end
+#Rebroadcase these bad boys so we can use them on other actors
+ScoreP1BehindCommand=%function(self) MESSAGEMAN:Broadcast('P1Behind') end
+ScoreP2BehindCommand=%function(self) MESSAGEMAN:Broadcast('P2Behind') end
+ScoreP1AheadCommand=%function(self) MESSAGEMAN:Broadcast('P1Ahead') end
+ScoreP2AheadCommand=%function(self) MESSAGEMAN:Broadcast('P2Ahead') end
 ScoreP2OffCommand=addy,0;
 ScoreP2OnCommand=addy,-100;addy,100;
 ScoreP2X=SCREEN_CENTER_X+180+CourseHorizontal()-(24*HorizontalRecovery())
@@ -3967,6 +3968,7 @@ Line9=conf,DefaultFailType
 Line10=conf,Theme
 Line11=lua,SpeedModTypeRow()
 Line12=lua,EasterEggsOptionsRow()
+Line13=lua,GoodLuckCameronOptionsRow()
 
 [ScreenGraphicOptions]
 Fallback=ScreenOptionsSubmenu