Add the ResetPlayerOptions lua binding.
This commit is contained in:
@@ -8,6 +8,10 @@ ________________________________________________________________________________
|
||||
StepMania 5.0 $next | 2011xxxx
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
2011/10/29
|
||||
----------
|
||||
* [GameState] Add the ResetPlayerOptions lua binding. [Wolfman2000]
|
||||
|
||||
2011/10/28
|
||||
----------
|
||||
* [ScoreKeeperRave] Fix an issue where the super meter would not decrease back
|
||||
|
||||
@@ -790,6 +790,7 @@
|
||||
<Function name='PlayerIsUsingModifier'/>
|
||||
<Function name='PlayersCanJoin'/>
|
||||
<Function name='Reset'/>
|
||||
<Function name='ResetPlayerOptions'/>
|
||||
<Function name='SaveLocalData'/>
|
||||
<Function name='SetCharacter'/>
|
||||
<Function name='SetCurrentCourse'/>
|
||||
|
||||
@@ -2121,6 +2121,9 @@
|
||||
<Function name='Reset' return='void' arguments=''>
|
||||
Resets the GameState.
|
||||
</Function>
|
||||
<Function name='ResetPlayerOptions' return='void' arguments='PlayerNumber pn'>
|
||||
Resets the specific Player's mods to the default settings.
|
||||
</Function>
|
||||
<Function name='SaveLocalData' return='void' arguments=''>
|
||||
Saves the bookkeeping and machine profile data.
|
||||
</Function>
|
||||
|
||||
@@ -261,7 +261,11 @@ void GameState::ResetPlayer( PlayerNumber pn )
|
||||
m_pCurTrail[pn].Set( NULL );
|
||||
m_pPlayerState[pn]->Reset();
|
||||
PROFILEMAN->UnloadProfile( pn );
|
||||
ResetPlayerOptions(pn);
|
||||
}
|
||||
|
||||
void GameState::ResetPlayerOptions( PlayerNumber pn )
|
||||
{
|
||||
PlayerOptions po;
|
||||
GetDefaultPlayerOptions( po );
|
||||
m_pPlayerState[pn]->m_PlayerOptions.Assign( ModsLevel_Preferred, po );
|
||||
@@ -2445,6 +2449,13 @@ public:
|
||||
static int GetExpandedSectionName( T* p, lua_State *L ) { lua_pushstring(L, p->sExpandedSectionName); return 1; }
|
||||
static int AddStageToPlayer( T* p, lua_State *L ) { p->AddStageToPlayer(Enum::Check<PlayerNumber>(L, 1)); return 0; }
|
||||
static int CurrentOptionsDisqualifyPlayer( T* p, lua_State *L ) { lua_pushboolean(L, p->CurrentOptionsDisqualifyPlayer(Enum::Check<PlayerNumber>(L, 1))); return 1; }
|
||||
|
||||
static int ResetPlayerOptions( T* p, lua_State *L )
|
||||
{
|
||||
p->ResetPlayerOptions(Enum::Check<PlayerNumber>(L, 1));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int Dopefish( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushboolean(L, p->m_bDopefish);
|
||||
@@ -2554,6 +2565,7 @@ public:
|
||||
ADD_METHOD( GetExpandedSectionName );
|
||||
ADD_METHOD( AddStageToPlayer );
|
||||
ADD_METHOD( CurrentOptionsDisqualifyPlayer );
|
||||
ADD_METHOD( ResetPlayerOptions );
|
||||
ADD_METHOD( Dopefish );
|
||||
}
|
||||
};
|
||||
|
||||
@@ -48,6 +48,7 @@ public:
|
||||
/** @brief Reset the GameState back to initial values. */
|
||||
void Reset();
|
||||
void ResetPlayer( PlayerNumber pn );
|
||||
void ResetPlayerOptions( PlayerNumber pn );
|
||||
void ApplyCmdline(); // called by Reset
|
||||
void ApplyGameCommand( const RString &sCommand, PlayerNumber pn=PLAYER_INVALID );
|
||||
/** @brief Start the game when the first player joins in. */
|
||||
|
||||
Reference in New Issue
Block a user