GetDeviceSpecificInputString and DeviceInputToLocalizedString are

the same: "a string suitable for display", but just formatted slightly
differently.  Handle these the same way (so hopefully a way to merge
them will become visible).

This also fixes the RageInputDevice dependency on RageInput.
This commit is contained in:
Glenn Maynard
2006-06-15 06:07:45 +00:00
parent 7578717a5a
commit 3c9897989c
7 changed files with 63 additions and 48 deletions
+17
View File
@@ -97,6 +97,23 @@ RString RageInput::GetDeviceSpecificInputString( const DeviceInput &di )
return di.ToString();
}
RString RageInput::GetLocalizedInputString( const DeviceInput &di )
{
FOREACH( InputHandler*, m_pDevices, i )
{
vector<InputDeviceInfo> vDevices;
(*i)->GetDevicesAndDescriptions( vDevices );
FOREACH_CONST( InputDeviceInfo, vDevices, idi )
{
if( idi->id == di.device )
return (*i)->GetLocalizedInputString(di);
}
}
return Capitalize( DeviceButtonToString(di.button) );
}
wchar_t RageInput::DeviceInputToChar( DeviceInput di, bool bUseCurrentKeyModifiers )
{
FOREACH( InputHandler*, m_pDevices, i )