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