add OptionRowHandlerGameCommand to cut out unnecessary level of indirection in metrics
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
_Arial 14 shadow
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
_blank
|
||||||
@@ -2114,7 +2114,7 @@ MeterX=SCREEN_CENTER_X+170
|
|||||||
MeterY=SCREEN_CENTER_Y-20
|
MeterY=SCREEN_CENTER_Y-20
|
||||||
SourceMeterX=SCREEN_CENTER_X+170
|
SourceMeterX=SCREEN_CENTER_X+170
|
||||||
SourceMeterY=SCREEN_CENTER_Y+60
|
SourceMeterY=SCREEN_CENTER_Y+60
|
||||||
RowLabelsX=SCREEN_LEFT+40
|
RowTitleX=SCREEN_LEFT+40
|
||||||
RowLabelOnCommand=zoom,0.7
|
RowLabelOnCommand=zoom,0.7
|
||||||
RowValue1X=SCREEN_CENTER_X
|
RowValue1X=SCREEN_CENTER_X
|
||||||
RowValue2X=SCREEN_CENTER_X+60
|
RowValue2X=SCREEN_CENTER_X+60
|
||||||
@@ -2435,9 +2435,6 @@ RowInitCommand=
|
|||||||
RowOnCommand=
|
RowOnCommand=
|
||||||
RowOffCommand=
|
RowOffCommand=
|
||||||
RowPositionTransformFunction=function(self,positionIndex,itemIndex,numItems) self:y(SCREEN_CENTER_Y-152+34*positionIndex) end
|
RowPositionTransformFunction=function(self,positionIndex,itemIndex,numItems) self:y(SCREEN_CENTER_Y-152+34*positionIndex) end
|
||||||
RowOffScreenTopTransformFunction=function(self,positionIndex,itemIndex,numItems) self:y(SCREEN_CENTER_Y-152+34*(-0.5)) end
|
|
||||||
RowOffScreenCenterTransformFunction=function(self,positionIndex,itemIndex,numItems) self:y(SCREEN_CENTER_Y-152+34*(4.5)) end
|
|
||||||
RowOffScreenBottomTransformFunction=function(self,positionIndex,itemIndex,numItems) self:y(SCREEN_CENTER_Y-152+34*(9.5)) end
|
|
||||||
ExplanationP1X=SCREEN_CENTER_X-250
|
ExplanationP1X=SCREEN_CENTER_X-250
|
||||||
ExplanationP1Y=SCREEN_CENTER_Y+172
|
ExplanationP1Y=SCREEN_CENTER_Y+172
|
||||||
ExplanationP2X=SCREEN_CENTER_X+250
|
ExplanationP2X=SCREEN_CENTER_X+250
|
||||||
@@ -2493,10 +2490,10 @@ IconsP1X=SCREEN_CENTER_X-280
|
|||||||
IconsP2X=SCREEN_CENTER_X+280
|
IconsP2X=SCREEN_CENTER_X+280
|
||||||
BulletX=SCREEN_CENTER_X-232
|
BulletX=SCREEN_CENTER_X-232
|
||||||
BulletOnCommand=
|
BulletOnCommand=
|
||||||
LabelsX=SCREEN_CENTER_X-180
|
TitleX=SCREEN_CENTER_X-180
|
||||||
LabelsOnCommand=zoom,0.7;horizalign,right;ShadowLength,0
|
TitleOnCommand=zoom,0.7;horizalign,right;ShadowLength,0
|
||||||
LabelGainFocusCommand=
|
TitleGainFocusCommand=
|
||||||
LabelLoseFocusCommand=
|
TitleLoseFocusCommand=
|
||||||
ItemsStartX=SCREEN_CENTER_X-160
|
ItemsStartX=SCREEN_CENTER_X-160
|
||||||
ItemsEndX=SCREEN_CENTER_X+280
|
ItemsEndX=SCREEN_CENTER_X+280
|
||||||
ItemsGapX=14
|
ItemsGapX=14
|
||||||
@@ -3595,7 +3592,7 @@ CourseBannerX=SCREEN_CENTER_X+170
|
|||||||
CourseBannerY=SCREEN_CENTER_Y-170
|
CourseBannerY=SCREEN_CENTER_Y-170
|
||||||
CourseBannerWidth=130
|
CourseBannerWidth=130
|
||||||
CourseBannerHeight=40
|
CourseBannerHeight=40
|
||||||
RowLabelsX=SCREEN_CENTER_X-300
|
RowTitleX=SCREEN_CENTER_X-300
|
||||||
RowValue1X=SCREEN_CENTER_X+0
|
RowValue1X=SCREEN_CENTER_X+0
|
||||||
RowValue2X=SCREEN_CENTER_X+60
|
RowValue2X=SCREEN_CENTER_X+60
|
||||||
RowValue3X=SCREEN_CENTER_X+60
|
RowValue3X=SCREEN_CENTER_X+60
|
||||||
@@ -3616,9 +3613,16 @@ Row8Y=SCREEN_CENTER_Y+120
|
|||||||
[EditCoursesSongMenu]
|
[EditCoursesSongMenu]
|
||||||
Fallback=EditCoursesMenu
|
Fallback=EditCoursesMenu
|
||||||
|
|
||||||
|
[ScreenOptionsSimple]
|
||||||
|
Fallback=ScreenOptionsMaster
|
||||||
|
TitleX=SCREEN_CENTER_X-180
|
||||||
|
TitleOnCommand=zoom,0.5;horizalign,left;ShadowLength,0
|
||||||
|
TitleGainFocusCommand=diffuseshift;EffectColor1,1.3,1.3,1.3,1;EffectColor2,0.3,0.3,0.3,1
|
||||||
|
TitleLoseFocusCommand=stopeffect
|
||||||
|
|
||||||
[ScreenOptionsService]
|
[ScreenOptionsService]
|
||||||
Class=ScreenOptionsMaster
|
Class=ScreenOptionsMaster
|
||||||
Fallback=ScreenOptions
|
Fallback=ScreenOptionsSimple
|
||||||
NextScreen=@ScreenTitleBranch()
|
NextScreen=@ScreenTitleBranch()
|
||||||
PrevScreen=@ScreenTitleBranch()
|
PrevScreen=@ScreenTitleBranch()
|
||||||
# "Rows" sets the number of rows; this field is required.
|
# "Rows" sets the number of rows; this field is required.
|
||||||
@@ -3637,34 +3641,38 @@ PrevScreen=@ScreenTitleBranch()
|
|||||||
|
|
||||||
IconsOnCommand=x,-30
|
IconsOnCommand=x,-30
|
||||||
|
|
||||||
Fallback=ScreenOptionsMaster
|
|
||||||
TimerOnCommand=hidden,1
|
TimerOnCommand=hidden,1
|
||||||
StyleIcon=0
|
StyleIcon=0
|
||||||
TimerSeconds=0
|
TimerSeconds=0
|
||||||
|
|
||||||
AllowOperatorMenuButton=0
|
AllowOperatorMenuButton=0
|
||||||
LineNames=1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17
|
LineNames=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
|
||||||
OptionMenuFlags=together;forceallplayers;smnavigation
|
OptionMenuFlags=together;forceallplayers;smnavigation
|
||||||
# This NextScreen is only used for the "exit" choice.
|
# This NextScreen is only used for the "exit" choice.
|
||||||
Line1=list,Appearance Options
|
Line1=gamecommand;screen,ScreenAppearanceOptions;name,Appearance Options
|
||||||
Line2=list,Background Options
|
Line2=gamecommand;screen,ScreenBackgroundOptions;name,Background Options
|
||||||
Line3=list,Bookkeeping
|
Line3=gamecommand;screen,ScreenCenterImage;name,Center Image
|
||||||
Line4=list,Center Image
|
Line4=gamecommand;screen,ScreenCoinOptions;name,Coin Options
|
||||||
Line5=list,Coin Options
|
Line5=gamecommand;screen,ScreenMapControllers;name,Key Joy Mappings
|
||||||
Line6=list,Config Key/Joy Mappings
|
Line6=gamecommand;screen,ScreenInputOptions;name,Input Options
|
||||||
Line7=list,Input Options
|
Line7=gamecommand;screen,ScreenGameplayOptions;name,Gameplay Options
|
||||||
Line8=list,Gameplay Options
|
Line8=gamecommand;screen,ScreenGraphicOptions;name,Graphic Options
|
||||||
Line9=list,Graphic Options
|
Line9=gamecommand;screen,ScreenMachineOptions;name,Machine Options
|
||||||
Line10=list,Machine Options
|
Line10=gamecommand;screen,ScreenSoundOptions;name,Sound Options
|
||||||
Line12=list,Sound Options
|
Line11=gamecommand;screen,ScreenOptionsManageProfiles;name,Profiles
|
||||||
Line13=list,Profiles
|
Line12=gamecommand;screen,ScreenOtherOptions;name,Other Options
|
||||||
Line14=list,Other Options
|
Line13=gamecommand;screen,ScreenNetworkOptions;name,Network Options
|
||||||
Line15=list,Network Options
|
Line14=gamecommand;screen,ScreenReloadSongs;name,Reload Songs
|
||||||
Line16=list,Reload Songs/Courses
|
Line15=gamecommand;screen,ScreenTestInput;name,Test Input
|
||||||
Line17=list,Test Input
|
|
||||||
|
|
||||||
[ScreenOptionsServiceChild]
|
[ScreenOptionsServiceChild]
|
||||||
Fallback=ScreenOptionsService
|
Fallback=ScreenOptionsMaster
|
||||||
|
IconsOnCommand=x,-30
|
||||||
|
TimerOnCommand=hidden,1
|
||||||
|
StyleIcon=0
|
||||||
|
TimerSeconds=0
|
||||||
|
AllowOperatorMenuButton=0
|
||||||
|
OptionMenuFlags=together;forceallplayers;smnavigation
|
||||||
PrevScreen=ScreenOptionsService
|
PrevScreen=ScreenOptionsService
|
||||||
NextScreen=ScreenOptionsService
|
NextScreen=ScreenOptionsService
|
||||||
|
|
||||||
@@ -3865,6 +3873,7 @@ HelperY=SCREEN_CENTER_Y+80
|
|||||||
|
|
||||||
[ScreenOptionsMaster]
|
[ScreenOptionsMaster]
|
||||||
Fallback=ScreenOptions
|
Fallback=ScreenOptions
|
||||||
|
Class=ScreenOptionsMaster
|
||||||
|
|
||||||
# Player options
|
# Player options
|
||||||
Speed=12
|
Speed=12
|
||||||
@@ -4023,98 +4032,23 @@ SaveScoresDefault=
|
|||||||
SaveScores,1=mod,no savescore;name,Off
|
SaveScores,1=mod,no savescore;name,Off
|
||||||
SaveScores,2=mod,savescore;name,On
|
SaveScores,2=mod,savescore;name,On
|
||||||
|
|
||||||
# ScreenOptionsService
|
|
||||||
Appearance Options=1;together;SelectNone
|
|
||||||
Appearance OptionsDefault=
|
|
||||||
Appearance Options,1=screen,ScreenAppearanceOptions;name,Appearance Options
|
|
||||||
Other Options=1;together;SelectNone
|
|
||||||
Other OptionsDefault=
|
|
||||||
Other Options,1=screen,ScreenOtherOptions;name,Other Options
|
|
||||||
Background Options=1;together;SelectNone
|
|
||||||
Background OptionsDefault=
|
|
||||||
Background Options,1=screen,ScreenBackgroundOptions;name,Background Options
|
|
||||||
Bookkeeping=1;together;SelectNone
|
|
||||||
BookkeepingDefault=
|
|
||||||
Bookkeeping,1=screen,ScreenBookkeeping;name,Bookkeeping
|
|
||||||
Clear Bookkeeping Data=1;together;SelectNone
|
|
||||||
Clear Bookkeeping DataDefault=
|
|
||||||
Clear Bookkeeping Data,1=ClearBookkeepingData;name,Clear Bookkeeping Data
|
|
||||||
Center Image=1;together;SelectNone
|
|
||||||
Center ImageDefault=
|
|
||||||
Center Image,1=screen,ScreenCenterImage;name,Center Image
|
|
||||||
Coin Options=1;together;SelectNone
|
|
||||||
Coin OptionsDefault=
|
|
||||||
Coin Options,1=screen,ScreenCoinOptions;name,Coin Options
|
|
||||||
Config Key/Joy Mappings=1;together;SelectNone
|
|
||||||
Config Key/Joy MappingsDefault=
|
|
||||||
Config Key/Joy Mappings,1=screen,ScreenMapControllers;name,Key Joy Mappings
|
|
||||||
Clear Machine Stats=1;together;SelectNone
|
|
||||||
Clear Machine StatsDefault=
|
|
||||||
Clear Machine Stats,1=ClearMachineStats;screen,ScreenOptionsService;name,Clear Machine Stats
|
|
||||||
Clear Machine Edits=1;together;SelectNone
|
|
||||||
Clear Machine EditsDefault=
|
|
||||||
Clear Machine Edits,1=ClearMachineEdits;screen,ScreenOptionsService;name,Clear Machine Edits
|
|
||||||
Fill Machine Stats=1;together;SelectNone
|
|
||||||
Fill Machine StatsDefault=
|
|
||||||
Fill Machine Stats,1=screen,ScreenOptionsService;FillMachineStats;name,Fill Machine Stats
|
|
||||||
Input Options=1;together;SelectNone
|
|
||||||
Input OptionsDefault=
|
|
||||||
Input Options,1=screen,ScreenInputOptions;name,Input Options
|
|
||||||
Insert Credit=1;together;SelectNone
|
|
||||||
Insert CreditDefault=
|
|
||||||
Insert Credit,1=screen,ScreenOptionsService;InsertCredit;name,Insert Credit
|
|
||||||
Gameplay Options=1;together;SelectNone
|
|
||||||
Gameplay OptionsDefault=
|
|
||||||
Gameplay Options,1=screen,ScreenGameplayOptions;name,Gameplay Options
|
|
||||||
Graphic Options=1;together;SelectNone
|
|
||||||
Graphic OptionsDefault=
|
|
||||||
Graphic Options,1=screen,ScreenGraphicOptions;name,Graphic Options
|
|
||||||
Machine Options=1;together;SelectNone
|
|
||||||
Machine OptionsDefault=
|
|
||||||
Machine Options,1=screen,ScreenMachineOptions;name,Machine Options
|
|
||||||
Sound Options=1;together;SelectNone
|
|
||||||
Sound OptionsDefault=
|
|
||||||
Sound Options,1=screen,ScreenSoundOptions;name,Sound Options
|
|
||||||
Profiles=1;together;SelectNone
|
|
||||||
ProfilesDefault=
|
|
||||||
Profiles,1=screen,ScreenOptionsManageProfiles;name,Profiles
|
|
||||||
Reload Songs/Courses=1;together;SelectNone
|
|
||||||
Reload Songs/CoursesDefault=
|
|
||||||
Reload Songs/Courses,1=screen,ScreenReloadSongs;name,Reload Songs
|
|
||||||
Reset To Defaults=1;together;SelectNone
|
|
||||||
Reset To DefaultsDefault=
|
|
||||||
Reset To Defaults,1=ResetToFactoryDefaults;screen,ScreenOptionsService;name,Reset To Defaults
|
|
||||||
Test Input=1;together;SelectNone
|
|
||||||
Test InputDefault=
|
|
||||||
Test Input,1=screen,ScreenTestInput;name,Test Input
|
|
||||||
Test Lights=1;together;SelectNone
|
|
||||||
Test LightsDefault=
|
|
||||||
Test Lights,1=screen,ScreenTestLights;name,Test Lights
|
|
||||||
Transfer Stats From Machine=1;together;SelectNone
|
|
||||||
Transfer Stats From MachineDefault=
|
|
||||||
Transfer Stats From Machine,1=TransferStatsFromMachine;screen,ScreenOptionsService;name,Transfer Stats From Machine
|
|
||||||
Transfer Stats To Machine=1;together;SelectNone
|
|
||||||
Transfer Stats To MachineDefault=
|
|
||||||
Transfer Stats To Machine,1=TransferStatsToMachine;screen,ScreenOptionsService;name,Transfer Stats To Machine
|
|
||||||
Copy Edits To Machine=1;together;SelectNone
|
|
||||||
Copy Edits To MachineDefault=
|
|
||||||
Copy Edits To Machine,1=CopyEditsToMachine;screen,ScreenOptionsService;name,Copy Edits To Machine
|
|
||||||
Copy Edits From Machine=1;together;SelectNone
|
|
||||||
Copy Edits From MachineDefault=
|
|
||||||
Copy Edits From Machine,1=CopyEditsFromMachine;screen,ScreenOptionsService;name,Copy Edits From Machine
|
|
||||||
Set Machine Time=1;together;SelectNone
|
|
||||||
Set Machine TimeDefault=
|
|
||||||
Set Machine Time,1=screen,ScreenSetTime;name,Set Machine Time
|
|
||||||
Network Options=1;together;SelectNone
|
|
||||||
Network OptionsDefault=
|
|
||||||
Network Options,1=screen,ScreenNetworkOptions;name,Network Options
|
|
||||||
|
|
||||||
#ScreenJukeboxMenu
|
#ScreenJukeboxMenu
|
||||||
RandomModifiers=2;together
|
RandomModifiers=2;together
|
||||||
RandomModifiersDefault=mod,clear
|
RandomModifiersDefault=mod,clear
|
||||||
RandomModifiers,1=name,Off
|
RandomModifiers,1=name,Off
|
||||||
RandomModifiers,2=mod,random;name,Random
|
RandomModifiers,2=mod,random;name,Random
|
||||||
|
|
||||||
|
# ScreenOptionsEditMode
|
||||||
|
Edit Steps=1;together;SelectNone
|
||||||
|
Edit StepsDefault=
|
||||||
|
Edit Steps,1=screen,ScreenOptionsManageEditSteps;name,Transfer To USB Drive
|
||||||
|
Transfer To USB Drive=1;together;SelectNone
|
||||||
|
Transfer To USB DriveDefault=
|
||||||
|
Transfer To USB Drive,1=screen,ScreenOptionsManageEditSteps;name,Transfer To USB Drive
|
||||||
|
Transfer From USB Drive=1;together;SelectNone
|
||||||
|
Transfer From USB DriveDefault=
|
||||||
|
Transfer From USB Drive,1=screen,ScreenOptionsManageEditSteps;name,Transfer From USB Drive
|
||||||
|
|
||||||
[ScreenReloadSongs]
|
[ScreenReloadSongs]
|
||||||
Class=ScreenReloadSongs
|
Class=ScreenReloadSongs
|
||||||
Fallback=Screen
|
Fallback=Screen
|
||||||
@@ -4317,8 +4251,8 @@ IconsP1X=SCREEN_CENTER_X-280
|
|||||||
IconsP2X=SCREEN_CENTER_X+280
|
IconsP2X=SCREEN_CENTER_X+280
|
||||||
IconsOnCommand=x,-30
|
IconsOnCommand=x,-30
|
||||||
BulletX=SCREEN_CENTER_X-232
|
BulletX=SCREEN_CENTER_X-232
|
||||||
LabelsX=SCREEN_CENTER_X-150
|
TitleX=SCREEN_CENTER_X-150
|
||||||
LabelsOnCommand=zoom,0.5;horizalign,left;ShadowLength,2
|
TitleOnCommand=zoom,0.5;horizalign,left;ShadowLength,2
|
||||||
ItemsStartX=SCREEN_CENTER_X-160
|
ItemsStartX=SCREEN_CENTER_X-160
|
||||||
ItemsEndX=SCREEN_CENTER_X+280
|
ItemsEndX=SCREEN_CENTER_X+280
|
||||||
ItemsGapX=14
|
ItemsGapX=14
|
||||||
@@ -4339,7 +4273,7 @@ ColorDisabled=1,1,1,1
|
|||||||
[ScreenMiniMenuMainMenu]
|
[ScreenMiniMenuMainMenu]
|
||||||
Fallback=ScreenMiniMenu
|
Fallback=ScreenMiniMenu
|
||||||
|
|
||||||
LabelsX=SCREEN_CENTER_X-80
|
TitleX=SCREEN_CENTER_X-80
|
||||||
|
|
||||||
[ScreenMiniMenuAreaMenu]
|
[ScreenMiniMenuAreaMenu]
|
||||||
Fallback=ScreenMiniMenu
|
Fallback=ScreenMiniMenu
|
||||||
@@ -4445,11 +4379,11 @@ Fallback=ScreenMiniMenu
|
|||||||
NumRowsShown=10
|
NumRowsShown=10
|
||||||
RowPositionTransformFunction=function(self,positionIndex,itemIndex,numItems) self:y(24*(positionIndex-(numItems-1)/2)) end
|
RowPositionTransformFunction=function(self,positionIndex,itemIndex,numItems) self:y(24*(positionIndex-(numItems-1)/2)) end
|
||||||
ItemsLongRowSharedX=0
|
ItemsLongRowSharedX=0
|
||||||
LabelsX=0
|
TitleX=0
|
||||||
LabelsX=-54
|
TitleX=-54
|
||||||
LabelsOnCommand=zoom,0.7;horizalign,left;ShadowLength,2
|
TitleOnCommand=zoom,0.7;horizalign,left;ShadowLength,2
|
||||||
LabelGainFocusCommand=diffuseshift;EffectColor1,0.3,0.3,0.3,1;EffectColor2,1.3,1.3,1.3,1
|
TitleGainFocusCommand=diffuseshift;EffectColor1,0.3,0.3,0.3,1;EffectColor2,1.3,1.3,1.3,1
|
||||||
LabelLoseFocusCommand=stopeffect
|
TitleLoseFocusCommand=stopeffect
|
||||||
ItemsStartX=0
|
ItemsStartX=0
|
||||||
LineHighlightX=0
|
LineHighlightX=0
|
||||||
HelpText=
|
HelpText=
|
||||||
@@ -4460,9 +4394,6 @@ Fallback=ScreenGameplay DifficultyMeterP1
|
|||||||
[ScreenJukebox DifficultyMeterP2]
|
[ScreenJukebox DifficultyMeterP2]
|
||||||
Fallback=ScreenGameplay DifficultyMeterP2
|
Fallback=ScreenGameplay DifficultyMeterP2
|
||||||
|
|
||||||
[ScreenOptionsSimple]
|
|
||||||
Fallback=ScreenOptions
|
|
||||||
|
|
||||||
[ScreenOptionsManageCourses]
|
[ScreenOptionsManageCourses]
|
||||||
Class=ScreenOptionsManageCourses
|
Class=ScreenOptionsManageCourses
|
||||||
Fallback=ScreenOptionsSimple
|
Fallback=ScreenOptionsSimple
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
#include "arch/Dialog/Dialog.h"
|
#include "arch/Dialog/Dialog.h"
|
||||||
#include "LuaManager.h"
|
#include "LuaManager.h"
|
||||||
|
#include "Foreach.h"
|
||||||
|
|
||||||
|
|
||||||
void IncorrectNumberArgsWarning( const Command &command, int iMaxIndexAccessed )
|
void IncorrectNumberArgsWarning( const Command &command, int iMaxIndexAccessed )
|
||||||
@@ -115,6 +116,14 @@ static void SplitWithQuotes( const CString sSource, const char Delimitor, vector
|
|||||||
} while( startpos <= sSource.size() );
|
} while( startpos <= sSource.size() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CString Commands::GetOriginalCommandString() const
|
||||||
|
{
|
||||||
|
CString s;
|
||||||
|
FOREACH_CONST( Command, v, c )
|
||||||
|
s += c->GetOriginalCommandString();
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
void ParseCommands( const CString &sCommands, Commands &vCommandsOut )
|
void ParseCommands( const CString &sCommands, Commands &vCommandsOut )
|
||||||
{
|
{
|
||||||
CStringArray vsCommands;
|
CStringArray vsCommands;
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ class Commands
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
vector<Command> v;
|
vector<Command> v;
|
||||||
|
|
||||||
|
CString GetOriginalCommandString() const; // used when reporting an error in number of args
|
||||||
};
|
};
|
||||||
|
|
||||||
// Take a command list string and return pointers to each of the tokens in the
|
// Take a command list string and return pointers to each of the tokens in the
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#include "GameSoundManager.h"
|
#include "GameSoundManager.h"
|
||||||
#include "CommonMetrics.h"
|
#include "CommonMetrics.h"
|
||||||
#include "CharacterManager.h"
|
#include "CharacterManager.h"
|
||||||
|
#include "ScreenManager.h"
|
||||||
|
|
||||||
#define ENTRY(s) THEME->GetMetric ("ScreenOptionsMaster",s)
|
#define ENTRY(s) THEME->GetMetric ("ScreenOptionsMaster",s)
|
||||||
#define ENTRY_MODE(s,i) THEME->GetMetric ("ScreenOptionsMaster",ssprintf("%s,%i",(s).c_str(),(i+1)))
|
#define ENTRY_MODE(s,i) THEME->GetMetric ("ScreenOptionsMaster",ssprintf("%s,%i",(s).c_str(),(i+1)))
|
||||||
@@ -71,8 +72,12 @@ public:
|
|||||||
m_bUseModNameForIcon = false;
|
m_bUseModNameForIcon = false;
|
||||||
m_vsBroadcastOnExport.clear();
|
m_vsBroadcastOnExport.clear();
|
||||||
}
|
}
|
||||||
virtual void Load( OptionRowDefinition &defOut, CString sParam )
|
virtual void LoadInternal( OptionRowDefinition &defOut, const Commands &cmds )
|
||||||
{
|
{
|
||||||
|
ASSERT( cmds.v.size() == 1 );
|
||||||
|
const Command &command = cmds.v[0];
|
||||||
|
CString sParam = command.GetArg(1);
|
||||||
|
ASSERT( command.m_vsArgs.size() == 2 );
|
||||||
ASSERT( sParam.size() );
|
ASSERT( sParam.size() );
|
||||||
|
|
||||||
if( sParam.CompareNoCase("NoteSkins")==0 ) { FillNoteSkins( defOut, sParam ); return; }
|
if( sParam.CompareNoCase("NoteSkins")==0 ) { FillNoteSkins( defOut, sParam ); return; }
|
||||||
@@ -93,6 +98,7 @@ public:
|
|||||||
|
|
||||||
Default.Load( -1, ParseCommands(ENTRY_DEFAULT(sParam)) );
|
Default.Load( -1, ParseCommands(ENTRY_DEFAULT(sParam)) );
|
||||||
|
|
||||||
|
{
|
||||||
/* Parse the basic configuration metric. */
|
/* Parse the basic configuration metric. */
|
||||||
Commands cmds = ParseCommands( ENTRY(sParam) );
|
Commands cmds = ParseCommands( ENTRY(sParam) );
|
||||||
if( cmds.v.size() < 1 )
|
if( cmds.v.size() < 1 )
|
||||||
@@ -159,6 +165,7 @@ public:
|
|||||||
defOut.m_vsChoices.push_back( sChoice );
|
defOut.m_vsChoices.push_back( sChoice );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
void ImportOption( const OptionRowDefinition &def, const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
|
void ImportOption( const OptionRowDefinition &def, const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
|
||||||
{
|
{
|
||||||
int iFallbackOption = -1;
|
int iFallbackOption = -1;
|
||||||
@@ -213,7 +220,7 @@ public:
|
|||||||
{
|
{
|
||||||
if( iFallbackOption == -1 )
|
if( iFallbackOption == -1 )
|
||||||
{
|
{
|
||||||
CString s = ssprintf("No options in row \"%s\" were selected, and no fallback row found; selected entry 0", m_sName.c_str());
|
CString s = ssprintf("No options in row \"%s\" were selected, and no fallback row found; selected entry 0", m_cmds.v[0].GetName().c_str());
|
||||||
LOG->Warn( s );
|
LOG->Warn( s );
|
||||||
CHECKPOINT_M( s );
|
CHECKPOINT_M( s );
|
||||||
iFallbackOption = 0;
|
iFallbackOption = 0;
|
||||||
@@ -265,7 +272,6 @@ public:
|
|||||||
defOut.Init();
|
defOut.Init();
|
||||||
|
|
||||||
ASSERT( sParam.size() );
|
ASSERT( sParam.size() );
|
||||||
m_sName = sParam;
|
|
||||||
|
|
||||||
defOut.m_sName = "NoteSkins";
|
defOut.m_sName = "NoteSkins";
|
||||||
defOut.m_bOneChoiceForAllPlayers = false;
|
defOut.m_bOneChoiceForAllPlayers = false;
|
||||||
@@ -290,7 +296,6 @@ public:
|
|||||||
defOut.Init();
|
defOut.Init();
|
||||||
|
|
||||||
ASSERT( sParam.size() );
|
ASSERT( sParam.size() );
|
||||||
m_sName = sParam;
|
|
||||||
|
|
||||||
defOut.m_sName = "Steps";
|
defOut.m_sName = "Steps";
|
||||||
defOut.m_bOneChoiceForAllPlayers = bLockedTogether;
|
defOut.m_bOneChoiceForAllPlayers = bLockedTogether;
|
||||||
@@ -352,7 +357,6 @@ public:
|
|||||||
defOut.Init();
|
defOut.Init();
|
||||||
|
|
||||||
ASSERT( sParam.size() );
|
ASSERT( sParam.size() );
|
||||||
m_sName = sParam;
|
|
||||||
|
|
||||||
defOut.m_bOneChoiceForAllPlayers = false;
|
defOut.m_bOneChoiceForAllPlayers = false;
|
||||||
defOut.m_bAllowThemeItems = false;
|
defOut.m_bAllowThemeItems = false;
|
||||||
@@ -387,7 +391,6 @@ public:
|
|||||||
defOut.Init();
|
defOut.Init();
|
||||||
|
|
||||||
ASSERT( sParam.size() );
|
ASSERT( sParam.size() );
|
||||||
m_sName = sParam;
|
|
||||||
|
|
||||||
defOut.m_bOneChoiceForAllPlayers = true;
|
defOut.m_bOneChoiceForAllPlayers = true;
|
||||||
defOut.m_sName = "Style";
|
defOut.m_sName = "Style";
|
||||||
@@ -413,7 +416,6 @@ public:
|
|||||||
defOut.Init();
|
defOut.Init();
|
||||||
|
|
||||||
ASSERT( sParam.size() );
|
ASSERT( sParam.size() );
|
||||||
m_sName = sParam;
|
|
||||||
|
|
||||||
defOut.m_bOneChoiceForAllPlayers = true;
|
defOut.m_bOneChoiceForAllPlayers = true;
|
||||||
defOut.m_bAllowThemeItems = false; // we theme the text ourself
|
defOut.m_bAllowThemeItems = false; // we theme the text ourself
|
||||||
@@ -446,7 +448,6 @@ public:
|
|||||||
defOut.Init();
|
defOut.Init();
|
||||||
|
|
||||||
ASSERT( sParam.size() );
|
ASSERT( sParam.size() );
|
||||||
m_sName = sParam;
|
|
||||||
|
|
||||||
defOut.m_bOneChoiceForAllPlayers = true;
|
defOut.m_bOneChoiceForAllPlayers = true;
|
||||||
defOut.m_sName = "Difficulty";
|
defOut.m_sName = "Difficulty";
|
||||||
@@ -477,7 +478,6 @@ public:
|
|||||||
defOut.Init();
|
defOut.Init();
|
||||||
|
|
||||||
ASSERT( sParam.size() );
|
ASSERT( sParam.size() );
|
||||||
m_sName = sParam;
|
|
||||||
|
|
||||||
vector<Song*> vpSongs;
|
vector<Song*> vpSongs;
|
||||||
SONGMAN->GetSongs( vpSongs, GAMESTATE->m_sPreferredSongGroup );
|
SONGMAN->GetSongs( vpSongs, GAMESTATE->m_sPreferredSongGroup );
|
||||||
@@ -512,14 +512,17 @@ public:
|
|||||||
OptionRowHandler::Init();
|
OptionRowHandler::Init();
|
||||||
m_pLuaTable->Unset();
|
m_pLuaTable->Unset();
|
||||||
}
|
}
|
||||||
virtual void Load( OptionRowDefinition &defOut, CString sLuaFunction )
|
virtual void LoadInternal( OptionRowDefinition &defOut, const Commands &cmds )
|
||||||
{
|
{
|
||||||
|
ASSERT( cmds.v.size() == 1 );
|
||||||
|
const Command &command = cmds.v[0];
|
||||||
|
ASSERT( command.m_vsArgs.size() == 2 );
|
||||||
|
CString sLuaFunction = command.m_vsArgs[1];
|
||||||
ASSERT( sLuaFunction.size() );
|
ASSERT( sLuaFunction.size() );
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
defOut.Init();
|
defOut.Init();
|
||||||
|
|
||||||
m_sName = sLuaFunction;
|
|
||||||
defOut.m_bAllowThemeItems = false; // Lua options are always dynamic and can theme themselves.
|
defOut.m_bAllowThemeItems = false; // Lua options are always dynamic and can theme themselves.
|
||||||
|
|
||||||
Lua *L = LUA->Get();
|
Lua *L = LUA->Get();
|
||||||
@@ -660,15 +663,17 @@ public:
|
|||||||
|
|
||||||
LUA->Release(L);
|
LUA->Release(L);
|
||||||
}
|
}
|
||||||
virtual void Reload( OptionRowDefinition &defOut )
|
virtual void ReLoadInternal( OptionRowDefinition &defOut )
|
||||||
{
|
{
|
||||||
Lua *L = LUA->Get();
|
Lua *L = LUA->Get();
|
||||||
|
|
||||||
/* Run the Lua expression. It should return a table. */
|
/* Run the Lua expression. It should return a table. */
|
||||||
m_pLuaTable->SetFromExpression( m_sName );
|
const Command &command = m_cmds.v[0];
|
||||||
|
CString sName = command.m_vsArgs[0];
|
||||||
|
m_pLuaTable->SetFromExpression( sName );
|
||||||
|
|
||||||
if( m_pLuaTable->GetLuaType() != LUA_TTABLE )
|
if( m_pLuaTable->GetLuaType() != LUA_TTABLE )
|
||||||
RageException::Throw( "Result of \"%s\" is not a table", m_sName.c_str() );
|
RageException::Throw( "Result of \"%s\" is not a table", sName.c_str() );
|
||||||
|
|
||||||
m_pLuaTable->PushSelf( L );
|
m_pLuaTable->PushSelf( L );
|
||||||
|
|
||||||
@@ -679,7 +684,7 @@ public:
|
|||||||
if( !lua_isnil( L, -1 ) )
|
if( !lua_isnil( L, -1 ) )
|
||||||
{
|
{
|
||||||
if( !lua_istable( L, -1 ) )
|
if( !lua_istable( L, -1 ) )
|
||||||
RageException::Throw( "\"%s\" \"EnabledForPlayers\" is not a table", m_sName.c_str() );
|
RageException::Throw( "\"%s\" \"EnabledForPlayers\" is not a table", sName.c_str() );
|
||||||
|
|
||||||
defOut.m_vEnabledForPlayers.clear(); // and fill in with supplied PlayerNumbers below
|
defOut.m_vEnabledForPlayers.clear(); // and fill in with supplied PlayerNumbers below
|
||||||
|
|
||||||
@@ -825,8 +830,12 @@ public:
|
|||||||
OptionRowHandler::Init();
|
OptionRowHandler::Init();
|
||||||
opt = NULL;
|
opt = NULL;
|
||||||
}
|
}
|
||||||
virtual void Load( OptionRowDefinition &defOut, CString sParam )
|
virtual void LoadInternal( OptionRowDefinition &defOut, const Commands &cmds )
|
||||||
{
|
{
|
||||||
|
ASSERT( cmds.v.size() == 1 );
|
||||||
|
const Command &command = cmds.v[0];
|
||||||
|
CString sParam = command.GetArg(1);
|
||||||
|
ASSERT( command.m_vsArgs.size() == 2 );
|
||||||
ASSERT( sParam.size() );
|
ASSERT( sParam.size() );
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
@@ -902,8 +911,12 @@ public:
|
|||||||
m_vStepsTypesToShow.clear();
|
m_vStepsTypesToShow.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Load( OptionRowDefinition &defOut, CString sParam )
|
virtual void LoadInternal( OptionRowDefinition &defOut, const Commands &cmds )
|
||||||
{
|
{
|
||||||
|
ASSERT( cmds.v.size() == 1 );
|
||||||
|
const Command &command = cmds.v[0];
|
||||||
|
CString sParam = command.GetArg(1);
|
||||||
|
ASSERT( command.m_vsArgs.size() == 2 );
|
||||||
ASSERT( sParam.size() );
|
ASSERT( sParam.size() );
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
@@ -926,7 +939,6 @@ public:
|
|||||||
RageException::Throw( "invalid StepsType param \"%s\"", sParam.c_str() );
|
RageException::Throw( "invalid StepsType param \"%s\"", sParam.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_sName = sParam;
|
|
||||||
defOut.m_sName = sParam;
|
defOut.m_sName = sParam;
|
||||||
defOut.m_bOneChoiceForAllPlayers = true;
|
defOut.m_bOneChoiceForAllPlayers = true;
|
||||||
defOut.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
|
defOut.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
|
||||||
@@ -1001,8 +1013,12 @@ public:
|
|||||||
m_vDifficulties.clear();
|
m_vDifficulties.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Load( OptionRowDefinition &defOut, CString sParam )
|
virtual void LoadInternal( OptionRowDefinition &defOut, const Commands &cmds )
|
||||||
{
|
{
|
||||||
|
ASSERT( cmds.v.size() == 1 );
|
||||||
|
const Command &command = cmds.v[0];
|
||||||
|
CString sParam = command.GetArg(1);
|
||||||
|
ASSERT( command.m_vsArgs.size() == 2 );
|
||||||
ASSERT( sParam.size() );
|
ASSERT( sParam.size() );
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
@@ -1028,7 +1044,6 @@ public:
|
|||||||
RageException::Throw( "invalid StepsType param \"%s\"", sParam.c_str() );
|
RageException::Throw( "invalid StepsType param \"%s\"", sParam.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_sName = sParam;
|
|
||||||
defOut.m_sName = sParam;
|
defOut.m_sName = sParam;
|
||||||
defOut.m_bOneChoiceForAllPlayers = true;
|
defOut.m_bOneChoiceForAllPlayers = true;
|
||||||
defOut.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
|
defOut.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
|
||||||
@@ -1049,7 +1064,7 @@ public:
|
|||||||
GAMESTATE->m_pCurSong->GetSteps( m_vSteps, *m_pst, DIFFICULTY_EDIT );
|
GAMESTATE->m_pCurSong->GetSteps( m_vSteps, *m_pst, DIFFICULTY_EDIT );
|
||||||
m_vDifficulties.resize( m_vSteps.size(), DIFFICULTY_EDIT );
|
m_vDifficulties.resize( m_vSteps.size(), DIFFICULTY_EDIT );
|
||||||
|
|
||||||
if( m_sName == "EditSteps" )
|
if( sParam == "EditSteps" )
|
||||||
{
|
{
|
||||||
m_vSteps.push_back( NULL );
|
m_vSteps.push_back( NULL );
|
||||||
m_vDifficulties.push_back( DIFFICULTY_EDIT );
|
m_vDifficulties.push_back( DIFFICULTY_EDIT );
|
||||||
@@ -1142,25 +1157,69 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class OptionRowHandlerGameCommand : public OptionRowHandler
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
GameCommand m_gc;
|
||||||
|
|
||||||
|
OptionRowHandlerGameCommand::OptionRowHandlerGameCommand() { Init(); }
|
||||||
|
void Init()
|
||||||
|
{
|
||||||
|
m_gc.Init();
|
||||||
|
}
|
||||||
|
virtual void LoadInternal( OptionRowDefinition &defOut, const Commands &cmds )
|
||||||
|
{
|
||||||
|
ASSERT( cmds.v.size() > 1 );
|
||||||
|
|
||||||
|
Init();
|
||||||
|
defOut.Init();
|
||||||
|
|
||||||
|
Commands temp = cmds;
|
||||||
|
temp.v.erase( temp.v.begin() );
|
||||||
|
m_gc.Load( 0, temp );
|
||||||
|
ASSERT( !m_gc.m_sName.empty() );
|
||||||
|
defOut.m_sName = m_gc.m_sName;
|
||||||
|
defOut.m_bOneChoiceForAllPlayers = true;
|
||||||
|
defOut.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW;
|
||||||
|
defOut.m_selectType = SELECT_NONE;
|
||||||
|
defOut.m_vsChoices.push_back( "" );
|
||||||
|
}
|
||||||
|
virtual void ImportOption( const OptionRowDefinition &row, const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
|
||||||
|
{
|
||||||
|
}
|
||||||
|
virtual int ExportOption( const OptionRowDefinition &def, const vector<PlayerNumber> &vpns, const vector<bool> vbSelected[NUM_PLAYERS] ) const
|
||||||
|
{
|
||||||
|
if( vbSelected[PLAYER_1][0] )
|
||||||
|
m_gc.ApplyToAllPlayers();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
virtual void GetIconTextAndGameCommand( const OptionRowDefinition &def, int iFirstSelection, CString &sIconTextOut, GameCommand &gcOut ) const
|
||||||
|
{
|
||||||
|
sIconTextOut = "";
|
||||||
|
gcOut = m_gc;
|
||||||
|
}
|
||||||
|
virtual bool HasScreen( int iChoice ) const
|
||||||
|
{
|
||||||
|
return !m_gc.m_sScreen.empty();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
OptionRowHandler* OptionRowHandlerUtil::Make( const Command &command, OptionRowDefinition &defOut )
|
OptionRowHandler* OptionRowHandlerUtil::Make( const Commands &cmds, OptionRowDefinition &defOut )
|
||||||
{
|
{
|
||||||
OptionRowHandler* pHand = NULL;
|
OptionRowHandler* pHand = NULL;
|
||||||
|
|
||||||
BeginHandleArgs;
|
const CString &name = cmds.v[0].GetName();
|
||||||
|
|
||||||
const CString &name = command.GetName();
|
#define MAKE( type ) { type *p = new type; p->Load( defOut, cmds ); pHand = p; }
|
||||||
|
|
||||||
#define MAKE( type ) { type *p = new type; p->Load( defOut, sArg(1) ); pHand = p; }
|
|
||||||
|
|
||||||
if( name == "list" ) MAKE( OptionRowHandlerList )
|
if( name == "list" ) MAKE( OptionRowHandlerList )
|
||||||
else if( name == "lua" ) MAKE( OptionRowHandlerLua )
|
else if( name == "lua" ) MAKE( OptionRowHandlerLua )
|
||||||
else if( name == "conf" ) MAKE( OptionRowHandlerConfig )
|
else if( name == "conf" ) MAKE( OptionRowHandlerConfig )
|
||||||
else if( name == "stepstype" ) MAKE( OptionRowHandlerStepsType )
|
else if( name == "stepstype" ) MAKE( OptionRowHandlerStepsType )
|
||||||
else if( name == "steps" ) MAKE( OptionRowHandlerSteps )
|
else if( name == "steps" ) MAKE( OptionRowHandlerSteps )
|
||||||
|
else if( name == "gamecommand" ) MAKE( OptionRowHandlerGameCommand )
|
||||||
EndHandleArgs;
|
|
||||||
|
|
||||||
return pHand;
|
return pHand;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,18 +13,23 @@ struct ConfOption;
|
|||||||
class OptionRowHandler
|
class OptionRowHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CString m_sName;
|
Commands m_cmds;
|
||||||
vector<CString> m_vsReloadRowMessages; // refresh this row on on these messages
|
vector<CString> m_vsReloadRowMessages; // refresh this row on on these messages
|
||||||
|
|
||||||
OptionRowHandler::OptionRowHandler() { Init(); }
|
OptionRowHandler::OptionRowHandler() { Init(); }
|
||||||
virtual ~OptionRowHandler() { }
|
virtual ~OptionRowHandler() { }
|
||||||
virtual void Init()
|
virtual void Init()
|
||||||
{
|
{
|
||||||
m_sName = "";
|
m_cmds.v.clear();
|
||||||
m_vsReloadRowMessages.clear();
|
m_vsReloadRowMessages.clear();
|
||||||
}
|
}
|
||||||
virtual void Load( OptionRowDefinition &defOut, CString sParam ) = 0;
|
virtual void Load( OptionRowDefinition &defOut, const Commands &cmds )
|
||||||
virtual void Reload( OptionRowDefinition &defOut ) { this->Load(defOut,m_sName); }
|
{
|
||||||
|
m_cmds = cmds;
|
||||||
|
this->LoadInternal( defOut, cmds );
|
||||||
|
}
|
||||||
|
virtual void LoadInternal( OptionRowDefinition &defOut, const Commands &cmds ) = 0;
|
||||||
|
virtual void Reload( OptionRowDefinition &defOut ) { this->Load(defOut,m_cmds); }
|
||||||
virtual void ImportOption( const OptionRowDefinition &row, const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const = 0;
|
virtual void ImportOption( const OptionRowDefinition &row, const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const = 0;
|
||||||
/* Returns an OPT mask. */
|
/* Returns an OPT mask. */
|
||||||
virtual int ExportOption( const OptionRowDefinition &def, const vector<PlayerNumber> &vpns, const vector<bool> vbSelected[NUM_PLAYERS] ) const = 0;
|
virtual int ExportOption( const OptionRowDefinition &def, const vector<PlayerNumber> &vpns, const vector<bool> vbSelected[NUM_PLAYERS] ) const = 0;
|
||||||
@@ -35,7 +40,7 @@ public:
|
|||||||
|
|
||||||
namespace OptionRowHandlerUtil
|
namespace OptionRowHandlerUtil
|
||||||
{
|
{
|
||||||
OptionRowHandler* Make( const Command &cmd, OptionRowDefinition &defOut );
|
OptionRowHandler* Make( const Commands &cmds, OptionRowDefinition &defOut );
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void VerifySelected( SelectType st, const vector<bool> &vbSelected, const CString &sName )
|
inline void VerifySelected( SelectType st, const vector<bool> &vbSelected, const CString &sName )
|
||||||
|
|||||||
@@ -72,34 +72,6 @@ static bool ValidateLocalProfileName( const CString &sAnswer, CString &sErrorOut
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class OptionRowHandlerSimple : public OptionRowHandler
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
GameCommand m_gc;
|
|
||||||
|
|
||||||
virtual void Load( OptionRowDefinition &defOut, CString sParam )
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
virtual void ImportOption( const OptionRowDefinition &row, const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
virtual int ExportOption( const OptionRowDefinition &def, const vector<PlayerNumber> &vpns, const vector<bool> vbSelected[NUM_PLAYERS] ) const
|
|
||||||
{
|
|
||||||
if( vbSelected[PLAYER_1][0] )
|
|
||||||
m_gc.ApplyToAllPlayers();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
virtual void GetIconTextAndGameCommand( const OptionRowDefinition &def, int iFirstSelection, CString &sIconTextOut, GameCommand &gcOut ) const
|
|
||||||
{
|
|
||||||
sIconTextOut = "";
|
|
||||||
gcOut = m_gc;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
REGISTER_SCREEN_CLASS( ScreenOptionsManageProfiles );
|
REGISTER_SCREEN_CLASS( ScreenOptionsManageProfiles );
|
||||||
ScreenOptionsManageProfiles::ScreenOptionsManageProfiles( CString sName ) : ScreenOptions( sName )
|
ScreenOptionsManageProfiles::ScreenOptionsManageProfiles( CString sName ) : ScreenOptions( sName )
|
||||||
{
|
{
|
||||||
@@ -144,15 +116,13 @@ void ScreenOptionsManageProfiles::BeginScreen()
|
|||||||
|
|
||||||
if( SHOW_CREATE_NEW )
|
if( SHOW_CREATE_NEW )
|
||||||
{
|
{
|
||||||
def.m_vsChoices.clear();
|
OptionRowDefinition def;
|
||||||
def.m_vsChoices.push_back( "Create New" );
|
OptionRowHandler *pHand = OptionRowHandlerUtil::Make( ParseCommands("gamecommand;screen,ScreenOptionsEditProfile;name,Create New"), def );
|
||||||
vDefs.push_back( def );
|
vDefs.push_back( def );
|
||||||
|
|
||||||
OptionRowHandlerSimple *pHand = new OptionRowHandlerSimple;
|
|
||||||
m_OptionRowHandlers.push_back( pHand );
|
m_OptionRowHandlers.push_back( pHand );
|
||||||
GameCommand &gc = pHand->m_gc;
|
|
||||||
CString sCommand = "screen,ScreenOptionsEditProfile";
|
// FIXME
|
||||||
gc.Load( iIndex++, ParseCommands(sCommand) );
|
// gc.Load( iIndex++, );
|
||||||
}
|
}
|
||||||
|
|
||||||
PROFILEMAN->GetLocalProfileIDs( m_vsLocalProfileID );
|
PROFILEMAN->GetLocalProfileIDs( m_vsLocalProfileID );
|
||||||
@@ -162,16 +132,15 @@ void ScreenOptionsManageProfiles::BeginScreen()
|
|||||||
Profile *pProfile = PROFILEMAN->GetLocalProfile( *s );
|
Profile *pProfile = PROFILEMAN->GetLocalProfile( *s );
|
||||||
ASSERT( pProfile );
|
ASSERT( pProfile );
|
||||||
|
|
||||||
|
OptionRowDefinition def;
|
||||||
|
CString sCommand = ssprintf( "gamecommand;screen,ScreenOptionsEditProfile;profileid,%s;name,%s", s->c_str(), pProfile->m_sDisplayName.c_str() );
|
||||||
|
OptionRowHandler *pHand = OptionRowHandlerUtil::Make( ParseCommands(sCommand), def );
|
||||||
def.m_sName = ssprintf( "%d", iIndex );
|
def.m_sName = ssprintf( "%d", iIndex );
|
||||||
def.m_vsChoices.clear();
|
|
||||||
def.m_vsChoices.push_back( pProfile->m_sDisplayName );
|
|
||||||
vDefs.push_back( def );
|
vDefs.push_back( def );
|
||||||
|
|
||||||
OptionRowHandlerSimple *pHand = new OptionRowHandlerSimple;
|
|
||||||
m_OptionRowHandlers.push_back( pHand );
|
m_OptionRowHandlers.push_back( pHand );
|
||||||
GameCommand &gc = pHand->m_gc;
|
|
||||||
CString sCommand = "screen,ScreenOptionsEditProfile;profileid,"+*s;
|
// FIXME
|
||||||
gc.Load( iIndex++, ParseCommands(sCommand) );
|
// gc.Load( iIndex++, );
|
||||||
}
|
}
|
||||||
|
|
||||||
ScreenOptions::InitMenu( vDefs, m_OptionRowHandlers );
|
ScreenOptions::InitMenu( vDefs, m_OptionRowHandlers );
|
||||||
|
|||||||
@@ -82,15 +82,12 @@ void ScreenOptionsMaster::Init()
|
|||||||
OptionRowHandler* &pHand = m_OptionRowHandlers[i];
|
OptionRowHandler* &pHand = m_OptionRowHandlers[i];
|
||||||
pHand = NULL;
|
pHand = NULL;
|
||||||
|
|
||||||
Commands vCommands;
|
Commands cmds;
|
||||||
ParseCommands( sRowCommands, vCommands );
|
ParseCommands( sRowCommands, cmds );
|
||||||
if( vCommands.v.size() != 1 )
|
|
||||||
RageException::Throw( "Parse error in %s::Line%i", m_sName.c_str(), i+1 );
|
|
||||||
|
|
||||||
Command& command = vCommands.v[0];
|
pHand = OptionRowHandlerUtil::Make( cmds, def );
|
||||||
pHand = OptionRowHandlerUtil::Make( command, def );
|
|
||||||
if( pHand == NULL )
|
if( pHand == NULL )
|
||||||
RageException::Throw( "Invalid OptionRowHandler '%s' in %s::Line%i", command.GetOriginalCommandString().c_str(), m_sName.c_str(), i );
|
RageException::Throw( "Invalid OptionRowHandler '%s' in %s::Line%i", cmds.GetOriginalCommandString().c_str(), m_sName.c_str(), i );
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT( m_OptionRowHandlers.size() == asLineNames.size() );
|
ASSERT( m_OptionRowHandlers.size() == asLineNames.size() );
|
||||||
|
|||||||
Reference in New Issue
Block a user