refresh mapping screen text when automapping is applied because of a joystick plug/unplug
This commit is contained in:
@@ -558,6 +558,7 @@ bool InputMapper::CheckForChangedInputDevicesAndRemap( RString &sMessage )
|
||||
sMessage += REMAPPING_ALL_JOYSTICKS.GetValue();
|
||||
AutoMapJoysticksForCurrentGame();
|
||||
SaveMappingsToDisk();
|
||||
MESSAGEMAN->Broadcast( Message_AutoJoyMappingApplied );
|
||||
}
|
||||
|
||||
LOG->Info( sMessage );
|
||||
|
||||
@@ -65,6 +65,7 @@ static const char *MessageNames[] = {
|
||||
"LessonCleared",
|
||||
"LessonFailed",
|
||||
"StorageDevicesChanged",
|
||||
"AutoJoyMappingApplied",
|
||||
};
|
||||
XToString( Message, NUM_Message );
|
||||
|
||||
|
||||
@@ -80,6 +80,7 @@ enum Message
|
||||
Message_LessonCleared,
|
||||
Message_LessonFailed,
|
||||
Message_StorageDevicesChanged,
|
||||
Message_AutoJoyMappingApplied,
|
||||
NUM_Message, // leave this at the end
|
||||
Message_Invalud
|
||||
};
|
||||
|
||||
@@ -25,6 +25,11 @@ static const int NUM_CHANGABLE_SLOTS = NUM_SHOWN_GAME_TO_DEVICE_SLOTS-1;
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenMapControllers );
|
||||
|
||||
ScreenMapControllers::ScreenMapControllers()
|
||||
{
|
||||
this->SubscribeToMessage( Message_AutoJoyMappingApplied );
|
||||
}
|
||||
|
||||
static LocalizedString PLAYER_SLOTS( "ScreenMapControllers", "%s slots" );
|
||||
void ScreenMapControllers::Init()
|
||||
{
|
||||
@@ -449,6 +454,17 @@ void ScreenMapControllers::Refresh()
|
||||
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
|
||||
* All rights reserved.
|
||||
|
||||
@@ -14,6 +14,7 @@ enum { NUM_SHOWN_GAME_TO_DEVICE_SLOTS = 3 };
|
||||
class ScreenMapControllers : public ScreenWithMenuElements
|
||||
{
|
||||
public:
|
||||
ScreenMapControllers();
|
||||
virtual void Init();
|
||||
virtual void BeginScreen();
|
||||
|
||||
@@ -23,6 +24,8 @@ public:
|
||||
virtual void TweenOffScreen();
|
||||
|
||||
private:
|
||||
virtual void HandleMessage( const RString& sMessage );
|
||||
|
||||
Actor *GetActorWithFocus();
|
||||
void BeforeChangeFocus();
|
||||
void AfterChangeFocus();
|
||||
|
||||
Reference in New Issue
Block a user