fix fail bug ( no preference existed for it.. )
This commit is contained in:
@@ -18,9 +18,17 @@ function ScreenSelectMusic:setupmusicstagemods()
|
|||||||
local pm = GAMESTATE:GetPlayMode()
|
local pm = GAMESTATE:GetPlayMode()
|
||||||
|
|
||||||
if pm == "PlayMode_Battle" or pm == "PlayMode_Rave" then
|
if pm == "PlayMode_Battle" or pm == "PlayMode_Rave" then
|
||||||
local so = GAMESTATE:GetDefaultSongOptions() .. ",failoff"
|
-- FIX DAT BUG;
|
||||||
GAMESTATE:SetSongOptions( "ModsLevel_Stage", so )
|
local sFail = "";
|
||||||
MESSAGEMAN:Broadcast( "SongOptionsChanged" )
|
if GetGamePref("DefaultFail") then
|
||||||
|
sFail = string.format("Fail%s", GetGamePref("DefaultFail") );
|
||||||
|
else
|
||||||
|
sFail = "Failoff";
|
||||||
|
end;
|
||||||
|
--
|
||||||
|
local so = GAMESTATE:GetDefaultSongOptions() .. "," .. sFail;
|
||||||
|
GAMESTATE:SetSongOptions( "ModsLevel_Stage", so );
|
||||||
|
MESSAGEMAN:Broadcast( "SongOptionsChanged" );
|
||||||
elseif GAMESTATE:IsAnExtraStage() then
|
elseif GAMESTATE:IsAnExtraStage() then
|
||||||
if GAMESTATE:GetPreferredSongGroup() == "---Group All---" then
|
if GAMESTATE:GetPreferredSongGroup() == "---Group All---" then
|
||||||
local song = GAMESTATE:GetCurrentSong()
|
local song = GAMESTATE:GetCurrentSong()
|
||||||
@@ -51,7 +59,7 @@ function ScreenSelectMusic:setupmusicstagemods()
|
|||||||
MESSAGEMAN:Broadcast( "PlayerOptionsChanged", {PlayerNumber = pn} )
|
MESSAGEMAN:Broadcast( "PlayerOptionsChanged", {PlayerNumber = pn} )
|
||||||
end
|
end
|
||||||
|
|
||||||
-- if PREFSMAN:GetPreference("
|
|
||||||
|
|
||||||
GAMESTATE:SetSongOptions( "ModsLevel_Stage", so )
|
GAMESTATE:SetSongOptions( "ModsLevel_Stage", so )
|
||||||
MESSAGEMAN:Broadcast( "SongOptionsChanged" )
|
MESSAGEMAN:Broadcast( "SongOptionsChanged" )
|
||||||
|
|||||||
@@ -479,7 +479,18 @@ function GamePrefDefaultFail()
|
|||||||
LoadSelections = function(self, list, pn)
|
LoadSelections = function(self, list, pn)
|
||||||
if ReadGamePrefFromFile("DefaultFail") ~= nil then
|
if ReadGamePrefFromFile("DefaultFail") ~= nil then
|
||||||
if GetGamePref("DefaultFail") then
|
if GetGamePref("DefaultFail") then
|
||||||
list[table.find( list, GetGamePref("DefaultFail") )] = true;
|
if GetGamePref("DefaultFail") == "Immediate" then
|
||||||
|
list[1] = true;
|
||||||
|
elseif GetGamePref("DefaultFail") == "ImmediateContinue" then
|
||||||
|
list[2] = true;
|
||||||
|
elseif GetGamePref("DefaultFail") == "AtEnd" then
|
||||||
|
list[3] = true;
|
||||||
|
elseif GetGamePref("DefaultFail") == "Off" then
|
||||||
|
list[4] = true;
|
||||||
|
else
|
||||||
|
list[1] = true;
|
||||||
|
end
|
||||||
|
-- list[table.find( list, GetGamePref("DefaultFail") )] = true;
|
||||||
else
|
else
|
||||||
list[1] = true;
|
list[1] = true;
|
||||||
end;
|
end;
|
||||||
@@ -492,14 +503,18 @@ function GamePrefDefaultFail()
|
|||||||
-- This is so stupid.
|
-- This is so stupid.
|
||||||
local tChoices = { "Immediate","ImmediateContinue", "AtEnd", "Off" };
|
local tChoices = { "Immediate","ImmediateContinue", "AtEnd", "Off" };
|
||||||
local val;
|
local val;
|
||||||
for i=1,#list do
|
if list[1] then
|
||||||
if list[i] then
|
val = tChoices[1];
|
||||||
val = i;
|
elseif list[2] then
|
||||||
else
|
val = tChoices[2];
|
||||||
val = 1;
|
elseif list[3] then
|
||||||
end
|
val = tChoices[3];
|
||||||
|
elseif list[4] then
|
||||||
|
val = tChoices[4];
|
||||||
|
else
|
||||||
|
val = tChoices[1];
|
||||||
end
|
end
|
||||||
WriteGamePrefToFile("DefaultFail",tChoices[val]);
|
WriteGamePrefToFile("DefaultFail",val);
|
||||||
MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } );
|
MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } );
|
||||||
THEME:ReloadMetrics();
|
THEME:ReloadMetrics();
|
||||||
end;
|
end;
|
||||||
|
|||||||
Reference in New Issue
Block a user