Improved three-key support. Default theme should be completely usable with three-key cabinets if ThreeKeyNavigation pref is true. Added ThreeKeyNavigation pref. ScreenOptions:NavigationMode metric now uses that pref to decide between normal and toggle modes. Added GoToFirstOnStart to OptionRowHandlerLua so an option row can control that behavior. Rewrote input for default's ScreenSelectProfile to use an input callback to take advantage of menu button mapping. Fixed inconsistent indentation in ORHL documentation.

This commit is contained in:
Kyzentun
2014-08-02 00:38:46 -07:00
committed by Jonathan Payne
parent ea74aa74bc
commit 3945a4a34b
16 changed files with 141 additions and 79 deletions
+6 -1
View File
@@ -803,7 +803,7 @@ bool OptionRow::SetSelected( PlayerNumber pn, int iChoice, bool b )
bool OptionRow::NotifyHandlerOfSelection(PlayerNumber pn, int choice)
{
bool changed= m_pHand->NotifyOfSelection(pn, choice);
bool changed= m_pHand->NotifyOfSelection(pn, choice - m_bFirstItemGoesDown);
if(changed)
{
ChoicesChanged(m_RowType, false);
@@ -820,6 +820,11 @@ bool OptionRow::NotifyHandlerOfSelection(PlayerNumber pn, int choice)
return changed;
}
bool OptionRow::GoToFirstOnStart()
{
return m_pHand->GoToFirstOnStart();
}
void OptionRow::SetExitText( RString sExitText )
{
BitmapText *bt = m_textItems.back();
+1
View File
@@ -112,6 +112,7 @@ public:
// ScreenOptions calls positions m_FrameDestination, then m_Frame tween to that same TweenState.
unsigned GetTextItemsSize() const { return m_textItems.size(); }
bool GetFirstItemGoesDown() const { return m_bFirstItemGoesDown; }
bool GoToFirstOnStart();
RString GetThemedItemText( int iChoice ) const;
+10 -1
View File
@@ -833,8 +833,9 @@ public:
LuaReference m_EnabledForPlayersFunc;
bool m_TableIsSane;
bool m_GoToFirstOnStart;
OptionRowHandlerLua(): m_TableIsSane(false)
OptionRowHandlerLua(): m_TableIsSane(false), m_GoToFirstOnStart(false)
{ m_pLuaTable = new LuaReference; Init(); }
virtual ~OptionRowHandlerLua() { delete m_pLuaTable; }
void Init()
@@ -1030,6 +1031,10 @@ public:
m_Def.m_sName = pStr;
lua_pop( L, 1 );
lua_getfield(L, -1, "GoToFirstOnStart");
m_GoToFirstOnStart= lua_toboolean(L, -1);
lua_pop(L, 1);
lua_getfield(L, -1, "OneChoiceForAllPlayers");
m_Def.m_bOneChoiceForAllPlayers = lua_toboolean( L, -1 );
lua_pop( L, 1 );
@@ -1253,6 +1258,10 @@ public:
LUA->Release(L);
return changed;
}
virtual bool GoToFirstOnStart()
{
return m_GoToFirstOnStart;
}
};
class OptionRowHandlerConfig : public OptionRowHandler
+1
View File
@@ -180,6 +180,7 @@ public:
virtual RString GetScreen( int /* iChoice */ ) const { return RString(); }
// Exists so that a lua function can act on the selection. Returns true if the choices should be reloaded.
virtual bool NotifyOfSelection(PlayerNumber pn, int choice) { return false; }
virtual bool GoToFirstOnStart() { return true; }
};
/** @brief Utilities for the OptionRowHandlers. */
+1
View File
@@ -199,6 +199,7 @@ PrefsManager::PrefsManager() :
m_bShowCaution ( "ShowCaution", true ),
m_bShowNativeLanguage ( "ShowNativeLanguage", true ),
m_iArcadeOptionsNavigation ( "ArcadeOptionsNavigation", 0 ),
m_ThreeKeyNavigation("ThreeKeyNavigation", false),
m_MusicWheelUsesSections ( "MusicWheelUsesSections", MusicWheelUsesSections_ALWAYS ),
m_iMusicWheelSwitchSpeed ( "MusicWheelSwitchSpeed", 15 ),
m_AllowW1 ( "AllowW1", ALLOW_W1_EVERYWHERE ),
+1
View File
@@ -191,6 +191,7 @@ public:
Preference<bool> m_bShowCaution;
Preference<bool> m_bShowNativeLanguage;
Preference<int> m_iArcadeOptionsNavigation;
Preference<bool> m_ThreeKeyNavigation;
Preference<MusicWheelUsesSections> m_MusicWheelUsesSections;
Preference<int> m_iMusicWheelSwitchSpeed;
Preference<AllowW1> m_AllowW1; // this should almost always be on, given use cases. -aj
+6
View File
@@ -79,6 +79,11 @@ public:
lua_pushnumber( L, pRect->bottom );
return 4;
}
static int GetNumFrames(T* p, lua_State* L)
{
lua_pushnumber(L, p->GetNumFrames());
return 1;
}
LunaRageTexture()
{
@@ -86,6 +91,7 @@ public:
ADD_METHOD( loop );
ADD_METHOD( rate );
ADD_METHOD( GetTextureCoordRect );
ADD_METHOD( GetNumFrames );
}
};
+1 -1
View File
@@ -916,7 +916,7 @@ void ScreenOptions::ProcessMenuStart( const InputEventPlus &input )
msg.SetParam( "Selected", bSelected );
MESSAGEMAN->Broadcast( msg );
if( row.GetFirstItemGoesDown() )
if(row.GetFirstItemGoesDown() && row.GoToFirstOnStart())
{
// move to the first choice in the row
ChangeValueInRowRelative( m_iCurrentRow[pn], pn, -row.GetChoiceInRowWithFocus(pn), input.type != IET_FIRST_PRESS );
+1
View File
@@ -705,6 +705,7 @@ static void InitializeConfOptions()
ADD( ConfOption( "AutoPlay", MovePref<PlayerController>, "Off","On","CPU-Controlled" ) );
ADD( ConfOption( "DelayedBack", MovePref<bool>, "Instant","Hold" ) );
ADD( ConfOption( "ArcadeOptionsNavigation", MovePref<bool>, "StepMania Style","Arcade Style" ) );
ADD( ConfOption( "ThreeKeyNavigation", MovePref<bool>, "Five Key Menu", "Three Key Menu" ) );
ADD( ConfOption( "MusicWheelSwitchSpeed", MusicWheelSwitchSpeed, "Slow","Normal","Fast","Really Fast" ) );
// Gameplay options
+1 -1
View File
@@ -14,7 +14,7 @@ public:
Sprite();
Sprite( const Sprite &cpy );
virtual ~Sprite();
// See explanation in source.
static Sprite* NewBlankSprite();