refresh mapping screen text when automapping is applied because of a joystick plug/unplug

This commit is contained in:
Chris Danford
2006-01-26 04:51:07 +00:00
parent f44603d19b
commit 6a1ef9d858
5 changed files with 22 additions and 0 deletions
+1
View File
@@ -558,6 +558,7 @@ bool InputMapper::CheckForChangedInputDevicesAndRemap( RString &sMessage )
sMessage += REMAPPING_ALL_JOYSTICKS.GetValue(); sMessage += REMAPPING_ALL_JOYSTICKS.GetValue();
AutoMapJoysticksForCurrentGame(); AutoMapJoysticksForCurrentGame();
SaveMappingsToDisk(); SaveMappingsToDisk();
MESSAGEMAN->Broadcast( Message_AutoJoyMappingApplied );
} }
LOG->Info( sMessage ); LOG->Info( sMessage );
+1
View File
@@ -65,6 +65,7 @@ static const char *MessageNames[] = {
"LessonCleared", "LessonCleared",
"LessonFailed", "LessonFailed",
"StorageDevicesChanged", "StorageDevicesChanged",
"AutoJoyMappingApplied",
}; };
XToString( Message, NUM_Message ); XToString( Message, NUM_Message );
+1
View File
@@ -80,6 +80,7 @@ enum Message
Message_LessonCleared, Message_LessonCleared,
Message_LessonFailed, Message_LessonFailed,
Message_StorageDevicesChanged, Message_StorageDevicesChanged,
Message_AutoJoyMappingApplied,
NUM_Message, // leave this at the end NUM_Message, // leave this at the end
Message_Invalud Message_Invalud
}; };
+16
View File
@@ -25,6 +25,11 @@ static const int NUM_CHANGABLE_SLOTS = NUM_SHOWN_GAME_TO_DEVICE_SLOTS-1;
REGISTER_SCREEN_CLASS( ScreenMapControllers ); REGISTER_SCREEN_CLASS( ScreenMapControllers );
ScreenMapControllers::ScreenMapControllers()
{
this->SubscribeToMessage( Message_AutoJoyMappingApplied );
}
static LocalizedString PLAYER_SLOTS( "ScreenMapControllers", "%s slots" ); static LocalizedString PLAYER_SLOTS( "ScreenMapControllers", "%s slots" );
void ScreenMapControllers::Init() void ScreenMapControllers::Init()
{ {
@@ -449,6 +454,17 @@ void ScreenMapControllers::Refresh()
m_LineScroller.SetDestinationItem( (float) m_iCurButton ); m_LineScroller.SetDestinationItem( (float) m_iCurButton );
} }
void ScreenMapControllers::HandleMessage( const RString& sMessage )
{
if( sMessage == MessageToString(Message_AutoJoyMappingApplied) )
{
Refresh();
}
ScreenWithMenuElements::HandleMessage( sMessage );
}
/* /*
* (c) 2001-2005 Chris Danford, Glenn Maynard * (c) 2001-2005 Chris Danford, Glenn Maynard
* All rights reserved. * All rights reserved.
+3
View File
@@ -14,6 +14,7 @@ enum { NUM_SHOWN_GAME_TO_DEVICE_SLOTS = 3 };
class ScreenMapControllers : public ScreenWithMenuElements class ScreenMapControllers : public ScreenWithMenuElements
{ {
public: public:
ScreenMapControllers();
virtual void Init(); virtual void Init();
virtual void BeginScreen(); virtual void BeginScreen();
@@ -23,6 +24,8 @@ public:
virtual void TweenOffScreen(); virtual void TweenOffScreen();
private: private:
virtual void HandleMessage( const RString& sMessage );
Actor *GetActorWithFocus(); Actor *GetActorWithFocus();
void BeforeChangeFocus(); void BeforeChangeFocus();
void AfterChangeFocus(); void AfterChangeFocus();