Merge pull request #45 from kyzentun/SetAllowLateJoin
Added SetAllowLateJoin to ScreenWithMenuElements.
This commit is contained in:
@@ -1378,6 +1378,7 @@
|
||||
</Class>
|
||||
<Class base='Screen' name='ScreenWithMenuElements'>
|
||||
<Function name='Cancel'/>
|
||||
<Function name='SetAllowLateJoin'/>
|
||||
</Class>
|
||||
<Class base='ScreenWithMenuElements' name='ScreenWithMenuElementsSimple'/>
|
||||
<Class name='Song'>
|
||||
|
||||
@@ -3906,6 +3906,9 @@ save yourself some time, copy this for undocumented things:
|
||||
<Function name='Cancel' return='void' arguments=''>
|
||||
Tells the screen to go to the previous screen.
|
||||
</Function>
|
||||
<Function name='SetAllowLateJoin' return='void' arguments='bool'>
|
||||
Sets whether the screen allows late joining. This only works for screens that are just ScreenWithMenuElements, as most derived screens have their own hard coded function for whether late joining is allowed.
|
||||
</Function>
|
||||
</Class>
|
||||
<Class name='Song'>
|
||||
<Function name='GetAllSteps' return='{Steps}' arguments=''>
|
||||
|
||||
@@ -25,6 +25,7 @@ ScreenWithMenuElements::ScreenWithMenuElements()
|
||||
FOREACH_PlayerNumber( p )
|
||||
m_MemoryCardDisplay[p] = NULL;
|
||||
m_MenuTimer = NULL;
|
||||
m_bShouldAllowLateJoin= false;
|
||||
}
|
||||
|
||||
void ScreenWithMenuElements::Init()
|
||||
@@ -377,11 +378,18 @@ class LunaScreenWithMenuElements: public Luna<ScreenWithMenuElements>
|
||||
public:
|
||||
static int Cancel( T* p, lua_State *L ) { p->Cancel( SM_GoToPrevScreen ); return 0; }
|
||||
static int IsTransitioning( T* p, lua_State *L ) { lua_pushboolean( L, p->IsTransitioning() ); return 1; }
|
||||
static int SetAllowLateJoin( T* p, lua_State *L )
|
||||
{
|
||||
p->m_bShouldAllowLateJoin= BArg(1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
LunaScreenWithMenuElements()
|
||||
{
|
||||
ADD_METHOD( Cancel );
|
||||
ADD_METHOD( IsTransitioning );
|
||||
ADD_METHOD( SetAllowLateJoin );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -33,6 +33,9 @@ public:
|
||||
// Lua
|
||||
virtual void PushSelf( lua_State *L );
|
||||
|
||||
virtual bool AllowLateJoin() const { return m_bShouldAllowLateJoin; }
|
||||
bool m_bShouldAllowLateJoin; // So that it can be exposed to Lua.
|
||||
|
||||
protected:
|
||||
virtual void StartPlayingMusic();
|
||||
void SetHelpText( RString s );
|
||||
|
||||
Reference in New Issue
Block a user