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();
|
sMessage += REMAPPING_ALL_JOYSTICKS.GetValue();
|
||||||
AutoMapJoysticksForCurrentGame();
|
AutoMapJoysticksForCurrentGame();
|
||||||
SaveMappingsToDisk();
|
SaveMappingsToDisk();
|
||||||
|
MESSAGEMAN->Broadcast( Message_AutoJoyMappingApplied );
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG->Info( sMessage );
|
LOG->Info( sMessage );
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ static const char *MessageNames[] = {
|
|||||||
"LessonCleared",
|
"LessonCleared",
|
||||||
"LessonFailed",
|
"LessonFailed",
|
||||||
"StorageDevicesChanged",
|
"StorageDevicesChanged",
|
||||||
|
"AutoJoyMappingApplied",
|
||||||
};
|
};
|
||||||
XToString( Message, NUM_Message );
|
XToString( Message, NUM_Message );
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user