Skip to content

Commit

Permalink
allow 0.05 increments in music select when changing rates and fix upd…
Browse files Browse the repository at this point in the history
…ates in msd tab
  • Loading branch information
MinaciousGrace committed Dec 25, 2016
1 parent 2224f32 commit 71ada86
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ local t = Def.ActorFrame{
update = false
end
end,
CurrentRateChangedMessageCommand=cmd(queuecommand,"Set"),
RefreshChartInfoMessageCommand=cmd(queuecommand,"Set"),
TabChangedMessageCommand=cmd(queuecommand,"Set"),
PlayerJoinedMessageCommand=cmd(queuecommand,"Set"),
Expand Down Expand Up @@ -123,12 +124,10 @@ t[#t+1] = LoadFont("Common Large")..{
-- Music Rate Display
t[#t+1] = LoadFont("Common Large") .. {
InitCommand=cmd(xy,frameX+frameWidth-100,frameY+offsetY+65;visible,true;halign,0;zoom,0.4;maxwidth,capWideScale(get43size(360),360)/capWideScale(get43size(0.45),0.45)),
BeginCommand=function(self)
SetCommand=function(self)
self:settext(getCurRateDisplayString())
end,
CurrentRateChangedCommand=function(self)
self:settext(getCurRateDisplayString())
end
CurrentRateChangedCommand=cmd(queuecommand,"set")
}

--Difficulty
Expand Down
12 changes: 12 additions & 0 deletions Themes/Til Death/Scripts/WifeSundries.lua
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,16 @@ function ChangeMusicRate(rate,params)
GAMESTATE:GetSongOptionsObject('ModsLevel_Current'):MusicRate(rate-0.1)
MESSAGEMAN:Broadcast("CurrentRateChanged")
end

if params.Name == "PrevRate" and rate < 2 and (getTabIndex() == 0 or getTabIndex() == 1) then
GAMESTATE:GetSongOptionsObject('ModsLevel_Preferred'):MusicRate(rate+0.05)
GAMESTATE:GetSongOptionsObject('ModsLevel_Song'):MusicRate(rate+0.05)
GAMESTATE:GetSongOptionsObject('ModsLevel_Current'):MusicRate(rate+0.05)
MESSAGEMAN:Broadcast("CurrentRateChanged")
elseif params.Name == "NextRate" and rate > 0.7 and (getTabIndex() == 0 or getTabIndex() == 1) then
GAMESTATE:GetSongOptionsObject('ModsLevel_Preferred'):MusicRate(rate-0.05)
GAMESTATE:GetSongOptionsObject('ModsLevel_Song'):MusicRate(rate-0.05)
GAMESTATE:GetSongOptionsObject('ModsLevel_Current'):MusicRate(rate-0.05)
MESSAGEMAN:Broadcast("CurrentRateChanged")
end
end

0 comments on commit 71ada86

Please sign in to comment.