diff --git a/stepmania/Themes/default/Sounds/ScreenMapControllers change.redir b/stepmania/Themes/default/Sounds/ScreenMapControllers change.redir new file mode 100644 index 0000000000..5bb896bf54 --- /dev/null +++ b/stepmania/Themes/default/Sounds/ScreenMapControllers change.redir @@ -0,0 +1 @@ +_common value diff --git a/stepmania/Themes/default/Sounds/ScreenMapControllers delete.redir b/stepmania/Themes/default/Sounds/ScreenMapControllers delete.redir new file mode 100644 index 0000000000..6f735d4f15 --- /dev/null +++ b/stepmania/Themes/default/Sounds/ScreenMapControllers delete.redir @@ -0,0 +1 @@ +MusicWheel expand diff --git a/stepmania/src/ScreenMapControllers.cpp b/stepmania/src/ScreenMapControllers.cpp index b2c5be542f..0edbe56039 100644 --- a/stepmania/src/ScreenMapControllers.cpp +++ b/stepmania/src/ScreenMapControllers.cpp @@ -35,6 +35,9 @@ void ScreenMapControllers::Init() { ScreenWithMenuElements::Init(); + m_soundChange.Load( THEME->GetPathS(m_sName,"change"), true ); + m_soundDelete.Load( THEME->GetPathS(m_sName,"delete"), true ); + CString sButtons = BUTTONS_TO_MAP; if( sButtons.empty() ) { @@ -147,6 +150,7 @@ void ScreenMapControllers::Update( float fDeltaTime ) BitmapText *pText = pKey->m_textMappedTo[m_iCurController][m_iCurSlot]; pText->PlayCommand( "MappedInput" ); + SCREENMAN->PlayStartSound(); } } @@ -264,9 +268,13 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) { const KeyToMap *pKey = &m_KeysToMap[m_iCurButton]; GameInput curGameI( (GameController)m_iCurController, pKey->m_GameButton ); - INPUTMAPPER->ClearFromInputMap( curGameI, m_iCurSlot ); + if( !INPUTMAPPER->ClearFromInputMap(curGameI, m_iCurSlot) ) + break; + INPUTMAPPER->AddDefaultMappingsForCurrentGameIfUnmapped(); - + + m_soundDelete.Play(); + // commit to disk after each change INPUTMAPPER->SaveMappingsToDisk(); } @@ -282,6 +290,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) m_iCurController--; } AfterChangeFocus(); + m_soundChange.Play(); break; case KEY_RIGHT: /* Move the selection right, wrapping down. */ if( m_iCurSlot == NUM_CHANGABLE_SLOTS-1 && m_iCurController == MAX_GAME_CONTROLLERS-1 ) @@ -294,6 +303,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) m_iCurController++; } AfterChangeFocus(); + m_soundChange.Play(); break; case KEY_UP: /* Move the selection up. */ if( m_iCurButton == 0 ) @@ -301,6 +311,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) BeforeChangeFocus(); m_iCurButton--; AfterChangeFocus(); + m_soundChange.Play(); break; case KEY_DOWN: /* Move the selection down. */ if( m_iCurButton == (int) m_KeysToMap.size()-1 ) @@ -308,6 +319,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) BeforeChangeFocus(); m_iCurButton++; AfterChangeFocus(); + m_soundChange.Play(); break; case KEY_ESC: /* Quit the screen. */ if( !IsTransitioning() ) @@ -328,6 +340,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) } m_WaitingForPress.Touch(); m_DeviceIToMap.MakeInvalid(); + SCREENMAN->PlayStartSound(); break; } } diff --git a/stepmania/src/ScreenMapControllers.h b/stepmania/src/ScreenMapControllers.h index f44d8dde3f..88053a9e75 100644 --- a/stepmania/src/ScreenMapControllers.h +++ b/stepmania/src/ScreenMapControllers.h @@ -7,6 +7,7 @@ #include "BitmapText.h" #include "InputMapper.h" #include "ActorScroller.h" +#include "RageSound.h" enum { NUM_SHOWN_GAME_TO_DEVICE_SLOTS = 3 }; @@ -46,6 +47,9 @@ private: ActorFrame m_Line[MAX_GAME_BUTTONS]; ActorScroller m_LineScroller; + + RageSound m_soundChange; + RageSound m_soundDelete; }; #endif