#7 Things are working! Options menu is not remembering the choices at the moment...
authorCameron Ball <c.ball1729@gmail.com>
Fri, 6 Dec 2013 17:33:28 +0000 (01:33 +0800)
committerCameron Ball <c.ball1729@gmail.com>
Fri, 6 Dec 2013 17:33:28 +0000 (01:33 +0800)
Themes/GrooveNights/BGAnimations/ScreenPlayerOptions overlay/default.xml
Themes/GrooveNights/Scripts/GrooveNights.lua
Themes/GrooveNights/Scripts/Other.lua

index 16ff89c..ffeb98e 100644 (file)
                        InitCommand="%function(self) self:stoptweening(); self:zoom(0.5); self:shadowlength(0); self:x(SCREEN_CENTER_X-200); self:y(SCREEN_CENTER_Y+118); self:maxwidth(140); end"
                        SpeedModChangedMessageCommand="queuecommand,Update"
                        RateModChangedMessageCommand="queuecommand,Update"
-                       UpdateCommand="%function(self) self:settext(DisplayBPM(1, true, false)) end"
+                       UpdateCommand="%function(self) self:settext(DisplayBPM(PLAYER_1, true, false)) end"
                        OnCommand="horizalign,left;zoom,0.5;"                   
                />
                <BitmapText
                        OnCommand="horizalign,left;zoom,0.5;queuecommand,loop;"
                        SpeedModChangedMessageCommand="queuecommand,Update"
                        RateModChangedMessageCommand="queuecommand,Update"
-                       UpdateCommand="%function(self) self:settext(DisplayBPM(1, true, true)) end"                     
+                       UpdateCommand="%function(self) self:settext(DisplayBPM(PLAYER_1, true, true)) end"                      
                        
                        loopCommand="%function(self)
                        getModP1 = 0;
                        OnCommand="horizalign,left;zoom,0.5;"                   
                        SpeedModChangedMessageCommand="queuecommand,Update"
                        RateModChangedMessageCommand="queuecommand,Update"
-                       UpdateCommand="%function(self) self:settext(DisplayBPM(2, true, false)) end"
+                       UpdateCommand="%function(self) self:settext(DisplayBPM(PLAYER_2, true, false)) end"
                />
                <BitmapText
                        Text="Speed:"
                        OnCommand="horizalign,left;zoom,0.5;queuecommand,loop;"
                        SpeedModChangedMessageCommand="queuecommand,Update"
                        RateModChangedMessageCommand="queuecommand,Update"
-                       UpdateCommand="%function(self) self:settext(DisplayBPM(2, true, true)) end"                     
+                       UpdateCommand="%function(self) self:settext(DisplayBPM(PLAYER_2, true, true)) end"                      
                        
                        loopCommand="%function(self)
                        getModP2 = 0;
index ef14d90..70fe917 100644 (file)
@@ -1309,6 +1309,7 @@ function RateMods()
                        if list[n] then
                                GAMESTATE:ApplyGameCommand('mod,'..modList[n]..'music',pn)
                                --ApplyRateAdjust()
+                               Trace("The pn for ratemod is " .. pn)
                                MESSAGEMAN:Broadcast('RateModChanged')
                        end
                end
@@ -1318,30 +1319,6 @@ function RateMods()
        return CreateOptionRow( Params, modList, Load, Save )
 end
 
-function ApplyRateAdjust()
-       local rateMod = string.gsub(GetRateMod(),'x','')
-       rateMod = tonumber(rateMod)
-
-       for pn=1, 2 do
-               if GAMESTATE:IsPlayerEnabled( pn - 1 ) then
-                       speed = string.gsub(modSpeed[pn],modType[pn],"")
-                       if modType[pn] == "x" then speed = math.ceil(100*speed/RateMod)/100 .. "x" end
-                       if modType[pn] == "c" then speed = "c" .. math.ceil(speed/RateMod) end
-                       if modType[pn] == "m" then speed = "m" .. math.ceil(speed/RateMod) end
-                       GAMESTATE:ApplyGameCommand('mod,' .. speed,pn)
-               end
-       end
-end
-
--- I doubt we will ever use this but it's nice to have for completeness
-function RevertRateAdjust()
-       for pn=1, 2 do
-               if modSpeed and modSpeed[pn] then GAMESTATE:ApplyGameCommand('mod,' .. modSpeed[pn],pn) end
-       end
-end
-
-
-
 -- Stamina Mod
 StaminaMods = { 0, 0.01, 0.02, 0.03, 0.04, 0.05 }
 Stamina = { "None", "Aoreo", "Jayce", "SteveReen", "WinDEU", "Zetorux" }
index 3ef9007..5832bd4 100644 (file)
@@ -612,41 +612,28 @@ function SpeedMods(name)
         for i = 1, table.getn(modList) do
             if list[i] then
                 if name == "Base" then ModBase = modList[i] end
-                if name == "Extra" then ModExtra = modList[i] end
+                if name == "Extra" then ModExtra = string.gsub(modList[i], '+0.', '') end
                 if name == "Type" then ModType = modList[i] end
             end
         end
 
-        Trace("LEEROY " .. ModBase .. '.' .. ModExtra)
-
         SpeedMod = tonumber(ModBase .. '.' .. ModExtra);
 
         if ModType == 'c-mod' then SpeedMod = 'c' .. SpeedMod*100 end
         if ModType == 'm-mod' then SpeedMod = 'm' .. SpeedMod*100 end
         if ModType == 'x-mod' then SpeedMod = SpeedMod .. 'x' end      
                     
-        --GAMESTATE:ApplyGameCommand('mod,'..SpeedMod,pn)
+               Trace("THE SPEEDMOD IS " .. SpeedMod)
+               Trace("Trying to apply to " .. pn)
+               Trace("PLAYER 1 is " .. PLAYER_1)
+        GAMESTATE:ApplyGameCommand('mod,'..SpeedMod,pn+1) --this is so annoying, the player number has to be 1 or 2 for ApplyGameCommand
         --ApplySpeedMods()
-        --MESSAGEMAN:Broadcast('SpeedModChanged')
+        MESSAGEMAN:Broadcast('SpeedModChanged')
     end
 
     return CreateOptionRow( Params, modList, Load, Save )
 end
 
-function ApplySpeedMods()
-    local modRate = GetRateMod()
-
-    for pn=1, 2 do
-        if GAMESTATE:IsPlayerEnabled( pn - 1 ) then
-            speed = string.gsub(modSpeed[pn],modType[pn],"")
-            if modType[pn] == "x" then speed = math.ceil(100*speed/modRate)/100 .. "x" end
-            if modType[pn] == "c" then speed = "c" .. math.ceil(speed/modRate) end
-            if modType[pn] == "m" then speed = "m" .. math.ceil(speed/modRate) end
-            GAMESTATE:ApplyGameCommand('mod,' .. speed,pn)
-        end
-    end
-end
-
 function DisplayBPM(pn, includeRate, includeSpeed) 
         local lowBPM = bpm[1]
         local highBPM = bpm[2]