gnModHeight = self:GetHeight();
end"
OffCommand="accelerate,0.3;addx,EvalTweenDistance()"
- />
-
- <!--[OBSOLETE BUT HAS CALCULATIONS] Restore Rate Mod-->
- <BitmapText Font="_eurostile normal" Text=""
- Condition="GAMESTATE:IsPlayerEnabled(PLAYER_1)"
- OnCommand="%function(self)
- if GetRateMod() ~= '1' or gnRateRestore == 1 then
- GAMESTATE:ApplyGameCommand('mod, 1.0xmusic',1);
- self:hidden(1);
- self:settext(GetRateMod()..'X Rate');
- self:zoom(0.5);
- self:x(SCREEN_CENTER_X-154);
- self:y(SCREEN_CENTER_Y-92);
- self:shadowlength(0);
- self:horizalign('center');
- self:draworder(6);
- gnRateRestore = 1;
- end
- end"
- />
- <BitmapText Font="_eurostile normal" Text=""
- Condition="GAMESTATE:IsPlayerEnabled(PLAYER_2)"
- OnCommand="%function(self)
- if GetRateMod() ~= '1' or gnRateRestore == 1 then
- GAMESTATE:ApplyGameCommand('mod, 1.0xmusic',2);
- self:hidden(1);
- self:settext(GetRateMod() .. 'X Rate');
- self:zoom(0.5);
- self:x(SCREEN_CENTER_X+155);
- self:y(SCREEN_CENTER_Y-92);
- self:shadowlength(0);
- self:horizalign('center');
- self:draworder(6);
- gnRateRestore = 1;
- end
- end"
- />
-
- <BitmapText Font="_eurostile normal" Text=""
- OnCommand="%function(self)
- if GetRateMod() ~= '1' then
- curRate = 1;
- end
- end"
- />
+ />
<!--Current Song-->
<BitmapText
local bpm = DisplayBPM(pn, true, false)
- if GetRateMod() ~= '1' then
+ if GetRateMod() ~= '1.0x' then
gnSongLengthDisplay = string.gsub(gnSongLength,'Patched','Length Patched');
gnSongLengthDisplay = string.gsub(gnSongLength,'Length Length Patched','Length Patched');
- self:settext(bpm .. ' BPM ('..GetRateMod()..'x Music Rate) - '..gnSongLengthDisplay);
+ self:settext(bpm .. ' BPM ('..GetRateMod()..' Music Rate) - '..gnSongLengthDisplay);
else
gnSongLengthDisplay = string.gsub(gnSongLength,'Patched','Length Patched');
gnSongLengthDisplay = string.gsub(gnSongLength,'Length Length Patched','Length Patched');
bpm[2] = string.gsub(songBPM,'%d+-','');
if bpm[2] == bpm[1] then bpm[2] = '';
end
- bpm[3] = SCREENMAN:GetTopScreen():GetChild('BPMDisplay'):GetChild('Text'):GetText();
- if not OPENITG then bpm[3] = math.floor(bpm[3] * modRate + 0.5)
- end
end"
CurrentSongChangedMessageCommand="queuecommand,BPMCapture"
CurrentStepsP1ChangedMessageCommand="queuecommand,BPMCapture"
+++ /dev/null
-<ActorFrame> <children>
-
-<!--Capture BPM-->
-<Layer Type="Quad"
- InitCommand="queuecommand,BPMCapture;"
- BPMCaptureCommand="%function(self)
- songBPM = SCREENMAN:GetTopScreen():GetChild('BPMDisplay'):GetChild('Text'):GetText();
- bpm[1] = string.gsub(songBPM,'-%d+','');
- bpm[2] = string.gsub(songBPM,'%d+-','');
- if bpm[2] == bpm[1] then bpm[2] = '';
- end
- bpm[3] = SCREENMAN:GetTopScreen():GetChild('BPMDisplay'):GetChild('Text'):GetText();
- if not OPENITG then bpm[3] = math.floor(bpm[3] * modRate + 0.5)
- end
- end"
- CurrentSongChangedMessageCommand="queuecommand,BPMCapture"
- CurrentStepsP1ChangedMessageCommand="queuecommand,BPMCapture"
- CurrentStepsP2ChangedMessageCommand="queuecommand,BPMCapture"
-/>
-
-</children></ActorFrame>
\ No newline at end of file
end"
CalculateCommand="%function(self)
-if gnRateRestore == nil then
- gnRateRestore = 0;
- end
-
gnJudgeTotal = tonumber(SCREENMAN:GetTopScreen():GetChild('MarvelousNumberP'..gnPlayerCount):GetText()) + tonumber(SCREENMAN:GetTopScreen():GetChild('PerfectNumberP'..gnPlayerCount):GetText()) + tonumber(SCREENMAN:GetTopScreen():GetChild('GreatNumberP'..gnPlayerCount):GetText()) + tonumber(SCREENMAN:GetTopScreen():GetChild('GoodNumberP'..gnPlayerCount):GetText()) + tonumber(SCREENMAN:GetTopScreen():GetChild('BooNumberP'..gnPlayerCount):GetText()) + tonumber(SCREENMAN:GetTopScreen():GetChild('MissNumberP'..gnPlayerCount):GetText());
gnJumpsNumber = SCREENMAN:GetTopScreen():GetChild('JumpsTextP'..gnPlayerCount):GetText();
SOUND:PlayOnce(gnPath);
end"> <children>
<!--Rate Message-->
- <Layer Type="Quad"
- InitCommand="%function(self)
- self:diffusealpha(0);
- if gnRateRestore == 1 then
- SCREENMAN:SystemMessage('Rate Modifier has been restored to 1.0x');
- end
- end"
- />
+ <Layer Type="Quad" InitCommand="%function(self) if GetRateMod() ~= '1.0x' then GAMESTATE:ApplyGameCommand('mod, 1.0xmusic',1); SCREENMAN:SystemMessage('Rate Modifier has been restored to 1.0x') end end" />
+
<Layer File="base frame B" InitCommand="@'diffuse,'..BackgroundColor()..';'"/>
<Layer File="base frame F" InitCommand="@'diffuse,'..FrameColor()..';'"/>
<!-- +7s are for 4:3, will need to make them +6s if using widescreen -->
OffCommand=""
/>
-<!--Remove any restoration messages-->
- <Layer
- Type="Quad"
- InitCommand="%function(self)
- self:diffusealpha(0);
- gnRateRestore = 0;
- end"
- />
<Layer File="ScreenNameEntryTraditional banner frame p1"
InitCommand="@'x,SCREEN_CENTER_X-18;y,SCREEN_CENTER_Y-134-41;diffuse,'..FrameColor()..';'"
OnCommand="shadowlength,0;diffusealpha,0;Decelerate,0.3;diffusealpha,1;"
OffCommand="accelerate,0.3;diffusealpha,0;"
/>
-<!--Rate Message-->
- <Layer Type="Quad"
- InitCommand="%function(self)
- self:diffusealpha(0);
- if gnRateRestore == 1 then
- SCREENMAN:SystemMessage('Rate Modifier has been restored to 1.0x');
- gnRateRestore = 0;
- end
- end"
- />
<!--Avatar + Info Display-->
<Layer
self:queuecommand('CountDown');
end"
/>
-<!--Rate Message-->
- <Layer Type="Quad"
- InitCommand="%function(self)
- self:diffusealpha(0);
- if gnRateRestore == 1 then
- SCREENMAN:SystemMessage('Rate Modifier has been restored to 1.0x');
- end
- end"
- />
+
<Layer
File="../ScreenSelectMusic divider B"
InitCommand="@'x,-120;y,18;diffuse,'..BackgroundColor()..';draworder,-1000;'"
bpm = { "1", "2", "3" }
-Rate = { "1.0x", "1.1x", "1.2x", "1.3x", "1.4x", "1.5x", "1.6x", "1.7x", "2.0x"}
+
+function GetRateMods()
+ return { "1.0x", "1.1x", "1.2x", "1.3x", "1.4x", "1.5x", "1.6x", "1.7x", "2.0x"}
+end
function RateMods()
- local modList = Rate
+ local modList = GetRateMods();
local function Load(self, list, pn)
for n = 1, table.getn(modList) do
- s = string.gsub(modList[n],'x','')
- if GAMESTATE:PlayerIsUsingModifier(pn,modList[n]..'music') then list[n] = true; modRate = tonumber(s) else list[n] = false end
+ if GAMESTATE:PlayerIsUsingModifier(pn,modList[n]..'music') then list[n] = true else list[n] = false end
end
end
local function Save(self, list, pn)
for n = 1, table.getn(modList) do
- if list[n] then s = modList[n] end
+ if list[n] then
+ GAMESTATE:ApplyGameCommand('mod,'..modList[n]..'music',pn+1)
+ ApplyRateAdjust()
+ MESSAGEMAN:Broadcast('RateModChanged')
+ end
end
- s = string.gsub(s,'x','')
- modRate = s
- GAMESTATE:ApplyGameCommand('mod,'..s..'xmusic',pn+1)
- ApplyRateAdjust()
- MESSAGEMAN:Broadcast('RateModChanged')
end
local Params = { Name = "Rate" }
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/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
+ 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
return s
end
-function GetRateModHelper( rate )
- return GAMESTATE:PlayerIsUsingModifier(0, rate) or GAMESTATE:PlayerIsUsingModifier(1, rate)
-end
-
-
function GetRateMod()
- if GetRateModHelper('1.0xmusic') then return '1'
- elseif GetRateModHelper('1.1xmusic') then return '1.1'
- elseif GetRateModHelper('1.2xmusic') then return '1.2'
- elseif GetRateModHelper('1.3xmusic') then return '1.3'
- elseif GetRateModHelper('1.4xmusic') then return '1.4'
- elseif GetRateModHelper('1.5xmusic') then return '1.5'
- elseif GetRateModHelper('1.6xmusic') then return '1.6'
- elseif GetRateModHelper('1.7xmusic') then return '1.7'
- elseif GetRateModHelper('1.8xmusic') then return '1.8'
- elseif GetRateModHelper('1.9xmusic') then return '1.9'
- elseif GetRateModHelper('2.0xmusic') then return '2'
- elseif GetRateModHelper('0.1xmusic') then return '0.1'
- elseif GetRateModHelper('0.2xmusic') then return '0.2'
- elseif GetRateModHelper('0.3xmusic') then return '0.3'
- elseif GetRateModHelper('0.4xmusic') then return '0.4'
- elseif GetRateModHelper('0.5xmusic') then return '0.5'
- elseif GetRateModHelper('0.6xmusic') then return '0.6'
- elseif GetRateModHelper('0.7xmusic') then return '0.7'
- elseif GetRateModHelper('0.8xmusic') then return '0.8'
- elseif GetRateModHelper('0.9xmusic') then return '0.9'
- else return '(Unknown rate mod)' end
+ local RateMods = GetRateMods()
+ for n = 1, table.getn(RateMods) do
+ if GAMESTATE:PlayerIsUsingModifier(0, RateMods[n] .. 'music') or GAMESTATE:PlayerIsUsingModifier(1, RateMods[n] .. 'music') then
+ return RateMods[n]
+ end
+ end
+
+ return '(Unknown rate mod)'
end
function oitgACoptions()
end
function ApplySpeedMods()
+ local modRate = GetRateMod()
+
for pn=1, 2 do
if GAMESTATE:IsPlayerEnabled( pn - 1 ) then
speed = string.gsub(modSpeed[pn],modType[pn],"")
function DisplayBPM(pn, includeRate, includeSpeed)
local lowBPM = bpm[1]
- local highBPM = bpm[2]
- local rateMod = modRate
+ local highBPM = bpm[2]
+ local rateMod = string.gsub(GetRateMod(),'x','')
+ rateMod = tonumber(rateMod)
local speedMod = modSpeed[pn]
speedMod = string.gsub(speedMod,'x','')
if scn == 'ScreenSelectMusic' then
- if gnRateRestore == nil then
- gnRateRestore = 0;
- end
if curRate == nil then curRate = 1 end
gnBlazedP1 = 0;
gnBlazedP2 = 0;
if scn == 'ScreenPlayerOptions' then
- if gnRateRestore == nil then
- gnRateRestore = 0;
- end
if GAMESTATE:IsPlayerEnabled(PLAYER_1) then
gnP1Sound = 0;
else
gnSameGrade = 0;
gnSoundCheck = true;
gnAward = 0;
- if modRate == nil then modRate = 1 end
end