Skip to content

Commit

Permalink
Call ApplyMods for all human players when GameMode change
Browse files Browse the repository at this point in the history
  • Loading branch information
SimplyViper16 authored and teejusb committed Oct 7, 2022
1 parent ea25167 commit c1d9b14
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ local input = function(event)
sortmenu:GetChild("start_sound"):play()
local focus = sort_wheel:get_actor_item_at_focus_pos()
if focus.kind == "SortBy" then
MESSAGEMAN:Broadcast('Sort',{order=focus.sort_by})
MESSAGEMAN:Broadcast('Sort', { order = focus.sort_by })
overlay:queuecommand("DirectInputToEngine")

-- the player wants to change modes, for example from ITG to FA+
-- the player wants to change modes, for example from ITG to FA+
elseif focus.kind == "ChangeMode" then
SL.Global.GameMode = focus.change
for player in ivalues(GAMESTATE:GetHumanPlayers()) do
ApplyMods(player)
end
SetGameModePreferences()
THEME:ReloadMetrics()
-- Broadcast that the SL GameMode has changed
Expand All @@ -38,7 +41,7 @@ local input = function(event)
screen:SetNextScreenName("ScreenSelectMusicCasual")
screen:StartTransitioningScreen("SM_GoToNextScreen")
end
-- the player wants to change styles, for example from single to double
-- the player wants to change styles, for example from single to double
elseif focus.kind == "ChangeStyle" then
-- If the MenuTimer is in effect, make sure to grab its current
-- value before reloading the screen.
Expand All @@ -48,7 +51,7 @@ local input = function(event)
-- Get the style we want to change to
local new_style = focus.change:lower()
-- accommodate techno game
if GAMESTATE:GetCurrentGame():GetName()=="techno" then new_style = new_style.."8" end
if GAMESTATE:GetCurrentGame():GetName() == "techno" then new_style = new_style .. "8" end
-- set it in the engine
GAMESTATE:SetCurrentStyle(new_style)
-- finally, reload the screen
Expand All @@ -73,4 +76,4 @@ local input = function(event)
end
return false
end
return input
return input

0 comments on commit c1d9b14

Please sign in to comment.