Fix UserPrefAutoSetStyle.

Also took care of some other lua issues with
NotePosition and ComboUnderField.
This commit is contained in:
Jason Felds
2011-06-04 21:43:00 -04:00
parent e1649784b0
commit 0e834467ba
4 changed files with 25 additions and 29 deletions
+1
View File
@@ -12,6 +12,7 @@ StepMania 5.0 Preview 2 | 20110???
----------
* Changed default MusicWheelSwitchSpeed to 15 (was 10). [AJ]
* [AnnouncerManager] Fixed a bug where no announcers would be loaded. [AJ]
* Restored the UserPrefAutoSetStyle behavior. [Wolfman2000]
================================================================================
StepMania 5.0 Preview 1a | 20110603
@@ -7,10 +7,8 @@ function InitGamePrefs()
local BPrefs =
{
{ "AutoSetStyle", false },
{ "NotePosition", true },
{ "ComboOnRolls", false },
{ "ComboUnderField", true },
};
for idx,pref in ipairs(Prefs) do
@@ -41,6 +39,9 @@ function InitUserPrefs()
local BPrefs =
{
{ "UserPrefComboUnderField", true },
{ "UserPrefAutoSetStyle", false },
{ "UserPrefNotePosition", true },
{ "UserPrefShowLotsaOptions", true},
{ "UserPrefLongFail", false},
{ "UserPrefProtimingP1", false},
@@ -398,23 +399,23 @@ function GamePrefComboOnRolls()
setmetatable( t, t );
return t;
end
function GamePrefComboUnderField()
function UserPrefComboUnderField()
local t = {
Name = "GamePrefComboUnderField";
Name = "UserPrefComboUnderField";
LayoutType = "ShowAllInRow";
SelectType = "SelectOne";
OneChoiceForAllPlayers = true;
ExportOnChange = false;
Choices = { 'Off','On' };
LoadSelections = function(self, list, pn)
if ReadGamePrefFromFile("ComboUnderField") ~= nil then
if GetGamePrefB("ComboUnderField") then
if ReadPrefFromFile("UserPrefComboUnderField") ~= nil then
if GetUserPrefB("UserPrefComboUnderField") then
list[2] = true;
else
list[1] = true;
end;
else
WriteGamePrefToFile("ComboUnderField",true);
WritePrefToFile("UserPrefComboUnderField",true);
list[2] = true;
end;
end;
@@ -425,7 +426,7 @@ function GamePrefComboUnderField()
else
val = false;
end;
WriteGamePrefToFile("ComboUnderField",val);
WritePrefToFile("UserPrefComboUnderField",val);
MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } );
THEME:ReloadMetrics();
end;
@@ -469,23 +470,23 @@ function UserPrefAutoSetStyle()
setmetatable( t, t );
return t;
end
function GamePrefNotePosition()
function UserPrefNotePosition()
local t = {
Name = "GamePrefNotePosition";
Name = "UserPrefNotePosition";
LayoutType = "ShowAllInRow";
SelectType = "SelectOne";
OneChoiceForAllPlayers = true;
ExportOnChange = false;
Choices = { 'Normal','Lower' };
LoadSelections = function(self, list, pn)
if ReadGamePrefFromFile("NotePosition") ~= nil then
if GetGamePrefB("NotePosition") then
if ReadPrefFromFile("UserPrefNotePosition") ~= nil then
if GetUserPrefB("UserPrefNotePosition") then
list[1] = true;
else
list[2] = true;
end;
else
WriteGamePrefToFile("NotePosition",false);
WritePrefToFile("UserPrefNotePosition",false);
list[1] = true;
end;
end;
@@ -496,7 +497,7 @@ function GamePrefNotePosition()
else
val = false;
end;
WriteGamePrefToFile("NotePosition",val);
WritePrefToFile("UserPrefNotePosition",val);
MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } );
THEME:ReloadMetrics();
end;
+1 -1
View File
@@ -25,7 +25,7 @@ ScreenHeight=480
# Allows you to pick all available game modes for your gametype: for example,
# inserting enough coins for 1p would let you choose between solo, single
# and double before each game
AutoSetStyle=GetGamePrefB("AutoSetStyle")
AutoSetStyle=GetUserPrefB("UserPrefAutoSetStyle")
# Default modifiers and noteskin.
DefaultModifiers="default,1.5x"
+7 -13
View File
@@ -409,8 +409,7 @@ MeterSetCommand=%function(self,param) \
end;
#
ShowDescription=true
DescriptionX=GetGamePrefB("AutoSetStyle") and (-64-8+20) or (-64-8)
# DescriptionX=GetUserPrefB("UserPrefAutoSetStyle") and (-64-8+20) or (-64-8)
DescriptionX=GetUserPrefB("UserPrefAutoSetStyle") and (-64-8+20) or (-64-8)
DescriptionOnCommand=shadowlength,1;horizalign,left;zoom,0.65;maxwidth,128+8-20;uppercase,true;
DescriptionSetCommand=%function(self,param) \
if self:GetText() == "" then \
@@ -428,7 +427,7 @@ AutogenY=0
#AutogenOnCommand=diffuseshift;effectcolor1,Colors.Alpha( Color("Green") , 0.5 );effectcolor2,ColorLightTone( Color("Green") );
AutogenOnCommand=blend,Blend.Add;diffuseshift;effectcolor1,color("#FFCC00FF");effectcolor2,color("#FFCC0088");
#
ShowStepsType=GetGamePrefB("AutoSetStyle")
ShowStepsType=GetUserPrefB("UserPrefAutoSetStyle")
StepsTypeX=-64-8
StepsTypeY=0
StepsTypeOnCommand=
@@ -883,8 +882,7 @@ StageDisplayY=SCREEN_TOP+24+3
StageDisplayOnCommand=skewx,-0.125;draworder,105;fov,90;zoom,0.675;zoomy,0;sleep,0.35;smooth,0.35;zoomy,0.675
StageDisplayOffCommand=linear,0.25;zoomy,0;
#
ShowDifficultyDisplay=not GetGamePrefB("AutoSetStyle") and not GAMESTATE:IsCourseMode()
# ShowDifficultyDisplay=not GetUserPrefB("UserPrefAutoSetStyle") and not GAMESTATE:IsCourseMode()
ShowDifficultyDisplay=not GetUserPrefB("UserPrefAutoSetStyle") and not GAMESTATE:IsCourseMode()
DifficultyDisplayX=SCREEN_CENTER_X-160
DifficultyDisplayY=SCREEN_TOP+160-96+2
DifficultyDisplayOnCommand=draworder,105;fov,90;zoom,1;zoomy,0;sleep,0.35;smooth,0.35;zoomy,1
@@ -1069,8 +1067,7 @@ end;
#
ShowDescription=true
DescriptionX=-20-32
DescriptionY=GetGamePrefB("AutoSetStyle") and -5 or 0
# DescriptionY=GetUserPrefB("UserPrefAutoSetStyle") and -5 or 0
DescriptionY=GetUserPrefB("UserPrefAutoSetStyle") and -5 or 0
DescriptionOnCommand=shadowlength,1;uppercase,true;zoom,0.75;maxwidth,128+8
DescriptionSetCommand=%function(self,param) \
if self:GetText() == "" then \
@@ -1088,8 +1085,7 @@ AutogenY=0
AutogenOnCommand=
AutogenSetCommand=%function(self,param) if param.Difficulty then self:diffuse(CustomDifficultyToLightColor(param.Difficulty)); self:strokecolor(CustomDifficultyToDarkColor(param.Difficulty)); end end
#
ShowStepsType=GetGamePrefB("AutoSetStyle")
# ShowStepsType=GetUserPrefB("UserPrefAutoSetStyle")
ShowStepsType=GetUserPrefB("UserPrefAutoSetStyle")
StepsTypeX=-20-32
StepsTypeY=7
StepsTypeOnCommand=zoom,0.45
@@ -1119,8 +1115,7 @@ end;
#
ShowDescription=true
DescriptionX=-20
DescriptionY=GetGamePrefB("AutoSetStyle") and -5 or 0
# DescriptionY=GetUserPrefB("UserPrefAutoSetStyle") and -5 or 0
DescriptionY=GetUserPrefB("UserPrefAutoSetStyle") and -5 or 0
DescriptionOnCommand=shadowlength,1;uppercase,true;zoom,0.75;maxwidth,128+8
DescriptionSetCommand=%function(self,param) \
if self:GetText() == "" then \
@@ -1139,8 +1134,7 @@ AutogenY=0
AutogenOnCommand=
AutogenSetCommand=%function(self,param) if param.Difficulty then self:diffuse(CustomDifficultyToLightColor(param.Difficulty)); self:strokecolor(CustomDifficultyToDarkColor(param.Difficulty)); end end
#
ShowStepsType=GetGamePrefB("AutoSetStyle")
# ShowStepsType=GetUserPrefB("UserPrefAutoSetStyle")
ShowStepsType=GetUserPrefB("UserPrefAutoSetStyle")
StepsTypeX=-20
StepsTypeY=7
StepsTypeOnCommand=zoom,0.45