add EditMenuAction enum
add Lua constants
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
#include "Foreach.h"
|
#include "Foreach.h"
|
||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
#include "LuaManager.h"
|
#include "LuaManager.h"
|
||||||
|
#include "GameManager.h"
|
||||||
|
|
||||||
|
|
||||||
static const CString RadarCategoryNames[NUM_RADAR_CATEGORIES] = {
|
static const CString RadarCategoryNames[NUM_RADAR_CATEGORIES] = {
|
||||||
@@ -25,6 +26,19 @@ XToString( RadarCategory );
|
|||||||
XToThemedString( RadarCategory, NUM_RADAR_CATEGORIES );
|
XToThemedString( RadarCategory, NUM_RADAR_CATEGORIES );
|
||||||
|
|
||||||
|
|
||||||
|
void LuaStepsType(lua_State* L)
|
||||||
|
{
|
||||||
|
FOREACH_StepsType( st )
|
||||||
|
{
|
||||||
|
CString s = GAMEMAN->StepsTypeToString( st );
|
||||||
|
s.MakeUpper();
|
||||||
|
s.Replace('-','_');
|
||||||
|
LUA->SetGlobal( "STEPS_TYPE_"+s, st );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
REGISTER_WITH_LUA_FUNCTION( LuaStepsType );
|
||||||
|
|
||||||
|
|
||||||
static const CString PlayModeNames[NUM_PLAY_MODES] = {
|
static const CString PlayModeNames[NUM_PLAY_MODES] = {
|
||||||
"Regular",
|
"Regular",
|
||||||
"Nonstop",
|
"Nonstop",
|
||||||
@@ -279,6 +293,28 @@ void LuaGoalType(lua_State* L)
|
|||||||
REGISTER_WITH_LUA_FUNCTION( LuaGoalType );
|
REGISTER_WITH_LUA_FUNCTION( LuaGoalType );
|
||||||
|
|
||||||
|
|
||||||
|
static const CString EditMenuActionNames[NUM_EDIT_MENU_ACTIONS] = {
|
||||||
|
"Edit",
|
||||||
|
"Delete",
|
||||||
|
"Copy",
|
||||||
|
"Autogen",
|
||||||
|
"Blank"
|
||||||
|
};
|
||||||
|
XToString( EditMenuAction );
|
||||||
|
StringToX( EditMenuAction );
|
||||||
|
void LuaEditMenuAction(lua_State* L)
|
||||||
|
{
|
||||||
|
FOREACH_EditMenuAction( ema )
|
||||||
|
{
|
||||||
|
CString s = EditMenuActionNames[ema];
|
||||||
|
s.MakeUpper();
|
||||||
|
LUA->SetGlobal( "EDIT_MENU_ACTION_"+s, ema );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
REGISTER_WITH_LUA_FUNCTION( LuaEditMenuAction );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "LuaFunctions.h"
|
#include "LuaFunctions.h"
|
||||||
LuaFunction_NoArgs( CoinMode, CoinModeToString(PREFSMAN->m_CoinMode) )
|
LuaFunction_NoArgs( CoinMode, CoinModeToString(PREFSMAN->m_CoinMode) )
|
||||||
LuaFunction_NoArgs( Premium, PremiumToString(PREFSMAN->m_Premium) )
|
LuaFunction_NoArgs( Premium, PremiumToString(PREFSMAN->m_Premium) )
|
||||||
|
|||||||
@@ -368,6 +368,21 @@ const CString& GoalTypeToString( GoalType gt );
|
|||||||
GoalType StringToGoalType( const CString& s );
|
GoalType StringToGoalType( const CString& s );
|
||||||
|
|
||||||
|
|
||||||
|
enum EditMenuAction
|
||||||
|
{
|
||||||
|
EDIT_MENU_ACTION_EDIT,
|
||||||
|
EDIT_MENU_ACTION_DELETE,
|
||||||
|
EDIT_MENU_ACTION_COPY,
|
||||||
|
EDIT_MENU_ACTION_AUTOGEN,
|
||||||
|
EDIT_MENU_ACTION_BLANK,
|
||||||
|
NUM_EDIT_MENU_ACTIONS
|
||||||
|
};
|
||||||
|
#define FOREACH_EditMenuAction( ema ) FOREACH_ENUM( EditMenuAction, NUM_EDIT_MENU_ACTIONS, ema )
|
||||||
|
const CString& EditMenuActionToString( EditMenuAction ema );
|
||||||
|
EditMenuAction StringToEditMenuAction( const CString& s );
|
||||||
|
const CString& EditMenuActionToThemedString( EditMenuAction ema );
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user