From 179c00cf403f04f8a0b819d9610a56e00971facb Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 15 Jun 2006 03:39:25 +0000 Subject: [PATCH] DeviceButtonToLocalizedAndTranslatedString -> DeviceInputToTranslatedString DeviceInputToTranslatedString -> DeviceInputToLocalizedAndTranslatedString --- stepmania/src/RageInputDevice.cpp | 16 ++++++++-------- stepmania/src/RageInputDevice.h | 5 +++-- stepmania/src/ScreenEdit.cpp | 4 ++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/stepmania/src/RageInputDevice.cpp b/stepmania/src/RageInputDevice.cpp index 1a148d86a1..3833d465cf 100644 --- a/stepmania/src/RageInputDevice.cpp +++ b/stepmania/src/RageInputDevice.cpp @@ -148,14 +148,14 @@ RString DeviceButtonToString( DeviceButton key ) return "unknown"; } -RString DeviceButtonToTranslatedString( DeviceButton key ) +RString DeviceInputToTranslatedString( DeviceInput di ) { /* All printable ASCII except for uppercase alpha characters line up. */ - if( key >= 33 && key < 127 && - !(key >= 'A' && key <= 'Z' ) ) - return WStringToRString( wstring()+INPUTMAN->DeviceButtonToChar(key,false) ); + if( di.button >= 33 && di.button < 127 && + !(di.button >= 'A' && di.button <= 'Z' ) ) + return WStringToRString( wstring()+INPUTMAN->DeviceInputToChar(di,false) ); - return DeviceButtonToString( key ); + return DeviceButtonToString( di.button ); } static LocalizedString HOME ( "DeviceButton", "Home" ); @@ -172,9 +172,9 @@ static LocalizedString PGUP ( "DeviceButton", "PgUp" ); static LocalizedString PGDN ( "DeviceButton", "PgDn" ); static LocalizedString BACKSLASH ( "DeviceButton", "Backslash" ); -RString DeviceButtonToLocalizedAndTranslatedString( DeviceButton key ) +RString DeviceInputToLocalizedAndTranslatedString( DeviceInput di ) { - switch( key ) + switch( di.button ) { case KEY_HOME: return HOME.GetValue(); case KEY_END: return END.GetValue(); @@ -189,7 +189,7 @@ RString DeviceButtonToLocalizedAndTranslatedString( DeviceButton key ) case KEY_PGUP: return PGUP.GetValue(); case KEY_PGDN: return PGDN.GetValue(); case KEY_BACKSLASH: return BACKSLASH.GetValue(); - default: return Capitalize( DeviceButtonToTranslatedString(key) ); + default: return Capitalize( DeviceInputToTranslatedString(di) ); } } diff --git a/stepmania/src/RageInputDevice.h b/stepmania/src/RageInputDevice.h index 20ac298e56..8c99aa9b53 100644 --- a/stepmania/src/RageInputDevice.h +++ b/stepmania/src/RageInputDevice.h @@ -292,8 +292,6 @@ enum DeviceButton }; RString DeviceButtonToString( DeviceButton i ); -RString DeviceButtonToTranslatedString( DeviceButton i ); -RString DeviceButtonToLocalizedAndTranslatedString( DeviceButton i ); DeviceButton StringToDeviceButton( const RString& s ); struct DeviceInput @@ -341,6 +339,9 @@ public: bool IsJoystick() const { return ::IsJoystick(device); } }; +RString DeviceInputToTranslatedString( DeviceInput di ); +RString DeviceInputToLocalizedAndTranslatedString( DeviceInput di ); + #endif /* * Copyright (c) 2001-2002 Chris Danford diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 9e50a93196..70882ffde4 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -3585,9 +3585,9 @@ static RString GetDeviceButtonsLocalized( const vector &veb, const M DeviceInput diPress = editmap.button[*eb][s]; DeviceInput diHold = editmap.hold[*eb][s]; if( diPress.IsValid() ) - vsPress.push_back( DeviceButtonToLocalizedAndTranslatedString(diPress.button) ); + vsPress.push_back( DeviceInputToLocalizedAndTranslatedString(diPress) ); if( diHold.IsValid() ) - vsHold.push_back( DeviceButtonToLocalizedAndTranslatedString(diHold.button) ); + vsHold.push_back( DeviceInputToLocalizedAndTranslatedString(diHold) ); } }