fixing stuff.

This commit is contained in:
Jonathan Payne
2011-02-27 16:47:20 -08:00
parent 8be622c969
commit d404736c33
5 changed files with 84 additions and 6 deletions
+4 -2
View File
@@ -476,7 +476,8 @@ Play=Play the course.
Save=Save the course.
Edit Course=Edit Course contents.
Shuffle=Shuffle the songs around.
#
GamePrefDefaultFail=Immediate fail causes a player to die when their life bar reaches 0. ImmediateContinue allows you to continue playing afterwards.
[OptionNames]
0=0
0.25x=0.25x
@@ -1036,7 +1037,8 @@ Max Minutes=Max Minutes
Play=Play
Edit Course=Edit Course
Shuffle=Shuffle
#
GamePrefDefaultFail=Default Fail Type
[PaneDisplay]
Steps=Steps
Holds=Holds
+16
View File
@@ -123,6 +123,22 @@ function table.deviation( t )
end
return offset
end
-- See if this exists
function table.search( t, sFind )
for i=1,#t do
if t[i] == sFind then
return true
end
end
end
-- Retreive the entry that has this
function table.find( t, sFind )
for i=1,#t do
if t[i] == sFind then
return i
end
end
end
function round(val, decimal)
if (decimal) then
@@ -1,6 +1,11 @@
-- sm-ssc Default Theme Preferences Handler
function InitGamePrefs()
local Prefs =
local Prefs =
{
{ "DefaultFail", "Immediate" },
};
local BPrefs =
{
{ "AutoSetStyle", false },
{ "NotePosition", true },
@@ -9,6 +14,12 @@ function InitGamePrefs()
};
for idx,pref in ipairs(Prefs) do
if GetGamePref( pref[1] ) == nil then
SetGamePref( pref[1], pref[2] );
end;
end;
for idx,pref in ipairs(BPrefs) do
if GetGamePrefB( pref[1] ) == nil then
SetGamePref( pref[1], pref[2] );
end;
@@ -456,3 +467,43 @@ function GamePrefNotePosition()
setmetatable( t, t );
return t;
end
function GamePrefDefaultFail()
local t = {
Name = "GamePrefDefaultFail";
LayoutType = "ShowAllInRow";
SelectType = "SelectOne";
OneChoiceForAllPlayers = true;
ExportOnChange = false;
Choices = { "Immediate","ImmediateContinue", "AtEnd", "Off" };
LoadSelections = function(self, list, pn)
if ReadGamePrefFromFile("DefaultFail") ~= nil then
if GetGamePref("DefaultFail") then
list[table.find( list, GetGamePref("DefaultFail") )] = true;
else
list[1] = true;
end;
else
WriteGamePrefToFile("DefaultFail","Immediate");
list[1] = true;
end;
end;
SaveSelections = function(self, list, pn)
-- This is so stupid.
local tChoices = { "Immediate","ImmediateContinue", "AtEnd", "Off" };
local val;
for i=1,#list do
if list[i] then
val = i;
else
val = 1;
end
end
WriteGamePrefToFile("DefaultFail",tChoices[val]);
MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } );
THEME:ReloadMetrics();
end;
};
setmetatable( t, t );
return t;
end
+2 -1
View File
@@ -2732,7 +2732,8 @@ LineNames="2,3,4,8,11,13,14,15,16,28,29,30"
Line2="conf,ScoringType"
Line3="conf,TimingWindowScale"
Line4="conf,LifeDifficulty"
Line8="conf,DefaultFailType"
Line8="lua,GamePrefDefaultFail()"
# Line8="conf,DefaultFailType"
Line11="conf,AllowW1"
Line13="conf,HiddenSongs"
Line14="conf,EasterEggs"
@@ -33,7 +33,7 @@ local function CreateStats( pnPlayer )
--
local t = Def.ActorFrame {};
t[#t+1] = Def.ActorFrame {
InitCommand=cmd(y,-16);
InitCommand=cmd(y,-32);
LoadActor(THEME:GetPathG("ScreenTitleMenu","PreferenceFrame")) .. {
InitCommand=cmd(zoom,0.875;diffuse,PlayerColor( pnPlayer ));
};
@@ -43,7 +43,7 @@ local function CreateStats( pnPlayer )
aText .. { Text=string.format("%04i",tValues["ITG_MAX"]); InitCommand=cmd(x,32;y,5;vertalign,bottom;zoom,0.5); };
};
t[#t+1] = Def.ActorFrame {
InitCommand=cmd(y,16);
InitCommand=cmd(y,-16);
LoadActor(THEME:GetPathG("ScreenTitleMenu","PreferenceFrame")) .. {
InitCommand=cmd(zoom,0.875;diffuse,PlayerColor( pnPlayer ));
};
@@ -52,6 +52,14 @@ local function CreateStats( pnPlayer )
aText .. { Text="/"; InitCommand=cmd(x,28;y,5;vertalign,bottom;zoom,0.5;diffusealpha,0.5); };
aText .. { Text=string.format("%04i",tValues["MIGS_MAX"]); InitCommand=cmd(x,32;y,5;vertalign,bottom;zoom,0.5); };
};
t[#t+1] = Def.ActorFrame {
InitCommand=cmd(y,0);
LoadActor(THEME:GetPathG("ScreenTitleMenu","PreferenceFrame")) .. {
InitCommand=cmd(zoom,0.875;diffuse,PlayerColor( pnPlayer ));
};
aLabel .. { Text="Signed:"; InitCommand=cmd(x,-64) };
aText .. { Text=string.format( #(tPlayerData[PLAYER_1].SignedJudgments) ); InitCommand=cmd(x,-8;y,5;vertalign,bottom;zoom,0.675); };
};
return t
end;
local t = Def.ActorFrame {};