Massively improved Config Key/Joy Mappings screen.

Warning is dismissable now, and cursor does not start in a position that will change a setting.
New special actions added:  ClearToDefault, ReloadFromDisk, SaveToDisk, SetListMode.  Exit is a special action.
Player is prompted to save when exiting screen instead of saving after every action.
Special actions fallback on Graphics/SMC action if they don't have their own.
Moved SMC overlay to Graphics/SMC warning.
Metrics for configuring input lock time, warning autodismiss time, lines visible, and NoSetListPrompt autodismiss time.
Header row added for cursor to start on.
ScreenMapControllers2 deleted as obsolete.
BitmapText:maxwidth changed to factor the zoom of the actor into the calculation.
This commit is contained in:
Kyzentun
2014-09-04 01:23:28 -06:00
parent e3f8d272c1
commit f2fdaa0cf5
17 changed files with 574 additions and 815 deletions
+67 -3
View File
@@ -13,23 +13,38 @@ class ScreenMapControllers : public ScreenWithMenuElements
{
public:
ScreenMapControllers();
~ScreenMapControllers();
virtual void Init();
virtual void BeginScreen();
virtual void Update( float fDeltaTime );
virtual bool Input( const InputEventPlus &input );
virtual void HandleMessage( const Message &msg );
virtual void HandleScreenMessage( const ScreenMessage SM );
private:
virtual void HandleMessage( const Message &msg );
Actor *GetActorWithFocus();
void BeforeChangeFocus();
void AfterChangeFocus();
void Refresh();
void DismissWarning();
bool CursorOnAction();
bool CursorOnHeader();
bool CursorOnKey();
bool CursorCanGoUp();
bool CursorCanGoDown();
int CurKeyIndex();
int CurActionIndex();
void SetCursorFromSetListCurrent();
void StartWaitingForPress();
int m_iCurController;
int m_iCurButton;
int m_iCurSlot;
int m_MaxDestItem;
bool m_ChangeOccurred;
RageTimer m_WaitingForPress;
DeviceInput m_DeviceIToMap;
@@ -46,10 +61,58 @@ private:
BitmapText m_textDevices;
BitmapText m_textLabel[NUM_GameController];
BitmapText m_headerCenter;
BitmapText m_headerLabels[NUM_GameController][NUM_SHOWN_GAME_TO_DEVICE_SLOTS];
AutoActor m_sprExit;
float m_AutoDismissWarningSecs;
AutoActor m_sprWarning;
ActorFrame m_Line[NUM_GameButton+2]; // label, normal lines, exit
float m_AutoDismissNoSetListPromptSecs;
AutoActor m_NoSetListPrompt;
struct SetListEntry
{
int m_button;
int m_controller;
int m_slot;
SetListEntry(int b, int c, int s)
:m_button(b), m_controller(c), m_slot(s) {}
bool operator<(SetListEntry const& rhs) const
{
if(m_controller != rhs.m_controller)
{
return m_controller < rhs.m_controller;
}
if(m_button != rhs.m_button)
{
return m_button < rhs.m_button;
}
return m_slot < rhs.m_slot;
}
};
set<SetListEntry> m_SetList;
set<SetListEntry>::iterator m_SetListCurrent;
bool m_InSetListMode;
typedef void (ScreenMapControllers::* action_fun_t)();
struct ActionRow
{
RString m_name;
AutoActor m_actor;
action_fun_t m_action;
void Load(RString const& scr_name, RString const& name,
ScreenMapControllers::action_fun_t action, ActorFrame* line,
ActorScroller* scroller);
};
void ClearToDefault();
void ReloadFromDisk();
void SaveToDisk();
void SetListMode();
void ExitAction();
vector<ActionRow> m_Actions;
vector<ActorFrame*> m_Line;
ActorScroller m_LineScroller;
RageSound m_soundChange;
@@ -60,6 +123,7 @@ private:
/*
* (c) 2001-2004 Chris Danford
* 2014 Eric Reese
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a