wip code for #15. JudgeSkin.lua will probably be a temporary thing as I want to write...
authorCameron Ball <c.ball1729@gmail.com>
Wed, 18 Dec 2013 07:51:47 +0000 (15:51 +0800)
committerCameron Ball <c.ball1729@gmail.com>
Wed, 18 Dec 2013 07:51:47 +0000 (15:51 +0800)
Themes/GrooveNights/Graphics/_Judgements/Chromatic 2x6.png [new file with mode: 0755]
Themes/GrooveNights/Graphics/_Judgements/Deco 2x6.png [new file with mode: 0755]
Themes/GrooveNights/Graphics/_Judgements/FP 2x6.png [new file with mode: 0755]
Themes/GrooveNights/Graphics/_Judgements/ITG2 2x6.png [new file with mode: 0755]
Themes/GrooveNights/Graphics/_Judgements/Love 2x6.png [new file with mode: 0755]
Themes/GrooveNights/Graphics/_Judgements/Tactics 2x6.png [new file with mode: 0755]
Themes/GrooveNights/Languages/english.ini
Themes/GrooveNights/Scripts/04 JudgeSkin.lua [new file with mode: 0644]
Themes/GrooveNights/Scripts/Other.lua
Themes/GrooveNights/Scripts/gnSystem.lua
Themes/GrooveNights/metrics.ini

diff --git a/Themes/GrooveNights/Graphics/_Judgements/Chromatic 2x6.png b/Themes/GrooveNights/Graphics/_Judgements/Chromatic 2x6.png
new file mode 100755 (executable)
index 0000000..c5c3800
Binary files /dev/null and b/Themes/GrooveNights/Graphics/_Judgements/Chromatic 2x6.png differ
diff --git a/Themes/GrooveNights/Graphics/_Judgements/Deco 2x6.png b/Themes/GrooveNights/Graphics/_Judgements/Deco 2x6.png
new file mode 100755 (executable)
index 0000000..7a59324
Binary files /dev/null and b/Themes/GrooveNights/Graphics/_Judgements/Deco 2x6.png differ
diff --git a/Themes/GrooveNights/Graphics/_Judgements/FP 2x6.png b/Themes/GrooveNights/Graphics/_Judgements/FP 2x6.png
new file mode 100755 (executable)
index 0000000..02bd1d1
Binary files /dev/null and b/Themes/GrooveNights/Graphics/_Judgements/FP 2x6.png differ
diff --git a/Themes/GrooveNights/Graphics/_Judgements/ITG2 2x6.png b/Themes/GrooveNights/Graphics/_Judgements/ITG2 2x6.png
new file mode 100755 (executable)
index 0000000..5fc9ab1
Binary files /dev/null and b/Themes/GrooveNights/Graphics/_Judgements/ITG2 2x6.png differ
diff --git a/Themes/GrooveNights/Graphics/_Judgements/Love 2x6.png b/Themes/GrooveNights/Graphics/_Judgements/Love 2x6.png
new file mode 100755 (executable)
index 0000000..12b3177
Binary files /dev/null and b/Themes/GrooveNights/Graphics/_Judgements/Love 2x6.png differ
diff --git a/Themes/GrooveNights/Graphics/_Judgements/Tactics 2x6.png b/Themes/GrooveNights/Graphics/_Judgements/Tactics 2x6.png
new file mode 100755 (executable)
index 0000000..82b127a
Binary files /dev/null and b/Themes/GrooveNights/Graphics/_Judgements/Tactics 2x6.png differ
index 1b977db..84e0e8b 100644 (file)
@@ -334,6 +334,7 @@ Base Speed=Base Speed
 Extra Speed=Extra Speed
 Speed Type=Speed Type
 Accel=Acceleration
+JudgeSkin=Judgement Skin
 Effect=Effect
 Appearance=Fade
 Turn=Turn
diff --git a/Themes/GrooveNights/Scripts/04 JudgeSkin.lua b/Themes/GrooveNights/Scripts/04 JudgeSkin.lua
new file mode 100644 (file)
index 0000000..83d2ef0
--- /dev/null
@@ -0,0 +1,42 @@
+local CurrentSkin = {}
+local WasInOptions = {PLAYER_1 = false, PLAYER_2 = false}
+
+function JudgeSkinOptionsRow(Names, ThemeJudgeSkin)  
+
+    local function Load(self, list, pn)
+            WasInOptions[pn] = true
+
+            -- If this is the first round, reset the skin as it may still be set from earlier
+            if GetStageText() == "1" then CurrentSkin[pn] = nil end
+
+            -- what we're doing here is checking what we got from profileman against the valid names.
+            for i=1,table.getn(Names) do
+                    if CurrentSkin[pn] == Names[i] then list[i] = true return end
+            end
+
+            list[1] = true
+    end
+
+    local function Save(self, list, pn)
+            -- go through each item in the list and save the first one that is set to true
+            for i=1,table.getn(Names) do
+                    if list[i] then
+                            if Names[i] == ThemeJudgeSkin then CurrentSkin[pn] = nil else CurrentSkin[pn] = Names[i] end
+                            return
+                    end
+            end
+    end
+
+    return CreateOptionRow( {Name = "JudgeSkin", OneChoiceForAllPlayers = false}, Names, Load, Save )
+end
+
+function LoadSkin(Actor, pn)
+    --if this is the first stage and the user was NOT in the options, reset the skin to default
+    if GetStageText() == "1" and not WasInOptions[pn] then CurrentSkin[pn] = nil end
+
+    if CurrentSkin[pn] ~= nil then
+        Actor:Load( THEME:GetPath( EC_GRAPHICS, '', '_Judgements/' .. CurrentSkin[pn] ))
+    end
+
+    WasInOptions[pn] = false
+end
\ No newline at end of file
index ce56405..1f22fdc 100644 (file)
@@ -438,7 +438,7 @@ end
 
 function SongModifiers()
     -- this is very basic right now, but it can be modified to take in to account OITG specific stuff
-    return SpeedLines() .. "4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24"
+    return SpeedLines() .. "4,5,25,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24"
 end
 
 function SpeedLines()
index f64db08..4a9518b 100644 (file)
@@ -431,4 +431,9 @@ end
 function GoodLuckCameronOptionsRow()
     local Params = { Name = "GoodLuckCameron" }
     return CreateProfileRowBool( Params )
+end
+
+function gnJudgementSkinsOptionRow()
+    local Names = { "GrooveNights", "Love", "Tactics", "Chromatic", "Deco", "FP", "ITG2" }
+    return JudgeSkinOptionsRow(Names, "GrooveNights")
 end
\ No newline at end of file
index ec95d76..81d5e6b 100644 (file)
@@ -2560,6 +2560,8 @@ CombinedLifeX=SCREEN_CENTER_X
 CombinedLifeY=SCREEN_TOP+54
 CombinedLifeOnCommand=addy,-100;addy,+100
 CombinedLifeOffCommand=
+PlayerP1OnCommand=%function(self) LoadSkin(self:GetChild('Judgment'):GetChild(''), PLAYER_1) end
+PlayerP2OnCommand=%function(self) LoadSkin(self:GetChild('Judgment'):GetChild(''), PLAYER_2) end
 
 [ScreenGameplayTraining]
 Fallback=ScreenGameplay
@@ -4046,6 +4048,7 @@ Line2=lua,SpeedMods('Extra')
 Line3=lua,SpeedMods('Type')
 Line4=list,Persp
 Line5=lua,RateMods()
+Line25=lua,gnJudgementSkinsOptionRow()
 Line6=list,NoteSkins2
 Line7=list,Accel
 Line8=list,Mini
@@ -4066,7 +4069,7 @@ Line22=list,HideBG
 Line23=lua,BackButton()
 Line24=list,Steps
 #Removed from GrooveNights
-Line25=lua,StaminaMod()
+#Line25=lua,StaminaMod()
 
 CancelAllP1X=SCREEN_CENTER_X-160
 CancelAllP1Y=SCREEN_CENTER_Y