Skip to content
Permalink
Browse files

Allow MemoryCard switching in event mode

  • Loading branch information...
electromuis committed Jul 10, 2019
1 parent 818e081 commit fbc817c95850f4d85ea660f4493e032dbe6c6181
@@ -1,5 +1,15 @@
local tweentime = 0.325

if GAMESTATE:IsEventMode() == true then
for pn in ivalues( GAMESTATE:GetHumanPlayers() ) do
state = MEMCARDMAN:GetCardState(pn)
if state == "MemoryCardState_late" or state == "MemoryCardState_error" or state == 'MemoryCardState_removed' then
GAMESTATE:UnjoinPlayer(pn)
GAMESTATE:JoinPlayer(pn)
end
end
end

return Def.ActorFrame{
InitCommand=function(self)
self:Center():draworder(101)
@@ -2,6 +2,7 @@ local t = Def.ActorFrame{
ChangeStepsMessageCommand=function(self, params)
self:playcommand("StepsHaveChanged", params)
end,
StorageDevicesChangedMessageCommand=ReloadProfiles,

-- make the MusicWheel appear to cascade down
LoadActor("./MusicWheelAnimation.lua"),
@@ -252,3 +252,14 @@ Branch.AfterProfileSaveSummary = function()
return Branch.AfterInit()
end
end

Branch.AfterProfileLoad = function()
screen = "ScreenSelectPlayMode"

if not SL.Global.BranchOverride == nil then
screen = SL.Global.BranchOverride
SL.Global.BranchOverride = nil
end

return screen
end
@@ -79,6 +79,9 @@ end

-- Hook called during profile save
function SaveProfileCustom(profile, dir)
if GAMESTATE:IsEventMode() == false then
return
end

local path = dir .. filename

@@ -106,4 +109,19 @@ function ReadProfileCustom(profile, dir)
return IniFile.ReadFile(path)[theme_name]
end
return false
end

function ReloadProfiles()
change = true
for pn in ivalues( GAMESTATE:GetHumanPlayers() ) do
state = MEMCARDMAN:GetCardState(pn)
if state == "MemoryCardState_late" or state == "MemoryCardState_error" or state == 'MemoryCardState_removed' then
change = true
end
end

if change == true then
SL.Global.BranchOverride = "ScreenSelectMusic"
SCREENMAN:SetNewScreen("ScreenProfileLoad")
end
end

0 comments on commit fbc817c

Please sign in to comment.
You can’t perform that action at this time.