From 2b52d487dc6f8a354c58c04deadb8deb9a9fa85e Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sun, 19 Dec 2010 14:40:22 -0600 Subject: [PATCH] [Style] Add ColumnsPerPlayer and NeedsZoomOutWith2Players bindings. --- Docs/Changelog_sm-ssc.txt | 1 + src/Style.cpp | 4 ++++ src/Style.h | 26 +++++++++++++------------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index e39af70123..27b21ec445 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -19,6 +19,7 @@ sm-ssc v1.2 | 201012xx * [GameCommand] Add GetScreen, GetSteps, GetCourse, GetTrail, and GetCharacter Lua bindings. [freem] * [StreamDisplay] Remove UseThreePartMethod. +* [Style] Add ColumnsPerPlayer and NeedsZoomOutWith2Players bindings. [freem] 20101218 -------- diff --git a/src/Style.cpp b/src/Style.cpp index e034c2e63f..b8a41a8dbd 100644 --- a/src/Style.cpp +++ b/src/Style.cpp @@ -120,12 +120,16 @@ public: static int GetName( T* p, lua_State *L ) { LuaHelpers::Push( L, (RString) p->m_szName ); return 1; } DEFINE_METHOD( GetStyleType, m_StyleType ) DEFINE_METHOD( GetStepsType, m_StepsType ) + DEFINE_METHOD( ColumnsPerPlayer, m_iColsPerPlayer ) + DEFINE_METHOD( NeedsZoomOutWith2Players, m_bNeedsZoomOutWith2Players ) LunaStyle() { ADD_METHOD( GetName ); ADD_METHOD( GetStyleType ); ADD_METHOD( GetStepsType ); + ADD_METHOD( ColumnsPerPlayer ); + ADD_METHOD( NeedsZoomOutWith2Players ); } }; diff --git a/src/Style.h b/src/Style.h index 05e2c3b913..dbec066973 100644 --- a/src/Style.h +++ b/src/Style.h @@ -19,15 +19,15 @@ struct lua_State; class Style { public: - bool m_bUsedForGameplay; // Can be used only for gameplay? - bool m_bUsedForEdit; // Can be used for editing? - bool m_bUsedForDemonstration; // Can be used for demonstration? - bool m_bUsedForHowToPlay; // Can be used for HowToPlay? + bool m_bUsedForGameplay; // Can be used only for gameplay? + bool m_bUsedForEdit; // Can be used for editing? + bool m_bUsedForDemonstration; // Can be used for demonstration? + bool m_bUsedForHowToPlay; // Can be used for HowToPlay? - /* The name of the style. (This is currently unused.) */ + // The name of the style. (This is currently unused.) const char * m_szName; - /* Steps format used for each player. For example, "dance versus" reads + /* Steps format used for each player. For example, "dance versus" reads * the Steps with the tag "dance-single". */ StepsType m_StepsType; @@ -36,21 +36,21 @@ public: int m_iColsPerPlayer; // number of total tracks this style expects (e.g. 4 for versus, but 8 for double) struct ColumnInfo { - int track; // take note data from this track - float fXOffset; // x position of the column relative to player center - const char *pzName; // name of this column, or NULL to use the name of a button mapped to it + int track; // take note data from this track + float fXOffset; // x position of the column relative to player center + const char *pzName; // name of this column, or NULL to use the name of a button mapped to it }; ColumnInfo m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER]; // maps each players' column to a track in the NoteData - /* This maps from game inputs to columns. More than one button may map to a + /* This maps from game inputs to columns. More than one button may map to a * single column. */ enum { NO_MAPPING = -1, END_MAPPING = -2 }; int m_iInputColumn[NUM_GameController][NUM_GameButton]; // maps each input to a column, or GameButton_Invalid int m_iColumnDrawOrder[MAX_COLS_PER_PLAYER]; - bool m_bNeedsZoomOutWith2Players; - bool m_bCanUseBeginnerHelper; - bool m_bLockDifficulties; // used in couple Styles + bool m_bNeedsZoomOutWith2Players; + bool m_bCanUseBeginnerHelper; + bool m_bLockDifficulties; // used in couple Styles GameInput StyleInputToGameInput( int iCol, PlayerNumber pn ) const; // Returns Column_Invalid if the input is an invalid column, such as UL corner in 4 pad mode