diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index 910258fdfe..9608fbc6ce 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -2532,10 +2532,11 @@ MappedToP1S3X=SCREEN_CENTER_X-120 MappedToP2S1X=SCREEN_CENTER_X+120 MappedToP2S2X=SCREEN_CENTER_X+195 MappedToP2S3X=SCREEN_CENTER_X+270 -MappedToOnCommand=zoom,0.5;shadowlength,0 +MappedToOnCommand=diffuse,#808080;zoom,0.5;shadowlength,0 MappedToWaitingCommand=diffuse,#FF8080;pulse;effectperiod,0.5;effectmagnitude,0.5,0.6,1 -MappedToSelectedCommand=diffuse,#FFFFFF;stopeffect -MappedToUnselectedCommand=diffuse,#808080;stopeffect +MappedToMappedInputCommand=diffuse,#FFFFFF;stopeffect +MappedToGainFocusCommand=diffuse,#FFFFFF;stopeffect +MappedToLoseFocusCommand=diffuse,#808080;stopeffect [ScreenCenterImage] Class=ScreenCenterImage diff --git a/stepmania/src/ScreenMapControllers.cpp b/stepmania/src/ScreenMapControllers.cpp index 932e7329a4..b2c5be542f 100644 --- a/stepmania/src/ScreenMapControllers.cpp +++ b/stepmania/src/ScreenMapControllers.cpp @@ -118,6 +118,7 @@ void ScreenMapControllers::BeginScreen() m_WaitingForPress.SetZero(); Refresh(); + AfterChangeFocus(); } @@ -143,6 +144,9 @@ void ScreenMapControllers::Update( float fDeltaTime ) INPUTMAPPER->SaveMappingsToDisk(); Refresh(); + + BitmapText *pText = pKey->m_textMappedTo[m_iCurController][m_iCurSlot]; + pText->PlayCommand( "MappedInput" ); } } @@ -270,33 +274,40 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) case KEY_LEFT: /* Move the selection left, wrapping up. */ if( m_iCurSlot == 0 && m_iCurController == 0 ) break; // can't go left any more + BeforeChangeFocus(); m_iCurSlot--; if( m_iCurSlot < 0 ) { m_iCurSlot = NUM_CHANGABLE_SLOTS-1; m_iCurController--; } - + AfterChangeFocus(); break; case KEY_RIGHT: /* Move the selection right, wrapping down. */ if( m_iCurSlot == NUM_CHANGABLE_SLOTS-1 && m_iCurController == MAX_GAME_CONTROLLERS-1 ) break; // can't go right any more + BeforeChangeFocus(); m_iCurSlot++; if( m_iCurSlot > NUM_CHANGABLE_SLOTS-1 ) { m_iCurSlot = 0; m_iCurController++; } + AfterChangeFocus(); break; case KEY_UP: /* Move the selection up. */ if( m_iCurButton == 0 ) break; // can't go up any more + BeforeChangeFocus(); m_iCurButton--; + AfterChangeFocus(); break; case KEY_DOWN: /* Move the selection down. */ if( m_iCurButton == (int) m_KeysToMap.size()-1 ) break; // can't go down any more + BeforeChangeFocus(); m_iCurButton++; + AfterChangeFocus(); break; case KEY_ESC: /* Quit the screen. */ if( !IsTransitioning() ) @@ -310,6 +321,11 @@ void ScreenMapControllers::Input( const InputEventPlus &input ) break; case KEY_ENTER: /* Change the selection. */ case KEY_KP_ENTER: + { + const KeyToMap *pKey = &m_KeysToMap[m_iCurButton]; + BitmapText *pText = pKey->m_textMappedTo[m_iCurController][m_iCurSlot]; + pText->PlayCommand( "Waiting" ); + } m_WaitingForPress.Touch(); m_DeviceIToMap.MakeInvalid(); break; @@ -330,6 +346,20 @@ void ScreenMapControllers::TweenOffScreen() OFF_COMMAND( m_LineScroller ); } +void ScreenMapControllers::BeforeChangeFocus() +{ + const KeyToMap *pKey = &m_KeysToMap[m_iCurButton]; + BitmapText *pText = pKey->m_textMappedTo[m_iCurController][m_iCurSlot]; + pText->PlayCommand( "LoseFocus" ); +} + +void ScreenMapControllers::AfterChangeFocus() +{ + const KeyToMap *pKey = &m_KeysToMap[m_iCurButton]; + BitmapText *pText = pKey->m_textMappedTo[m_iCurController][m_iCurSlot]; + pText->PlayCommand( "GainFocus" ); +} + void ScreenMapControllers::Refresh() { FOREACH_GameController( p ) @@ -339,8 +369,6 @@ void ScreenMapControllers::Refresh() const KeyToMap *pKey = &m_KeysToMap[b]; for( int s=0; sm_textMappedTo[p][s]; GameInput cur_gi( p, pKey->m_GameButton ); DeviceInput di; @@ -348,16 +376,6 @@ void ScreenMapControllers::Refresh() if( INPUTMAPPER->GameToDevice( cur_gi, s, di ) ) sText = INPUTMAN->GetDeviceSpecificInputString( di ); pText->SetText( sText ); - - if( bSelected ) - { - if( !m_WaitingForPress.IsZero() ) - pText->PlayCommand( "Waiting" ); - else - pText->PlayCommand( "Selected" ); - } - else - pText->PlayCommand( "Unselected" ); } } } diff --git a/stepmania/src/ScreenMapControllers.h b/stepmania/src/ScreenMapControllers.h index 8cb7e90f22..f44d8dde3f 100644 --- a/stepmania/src/ScreenMapControllers.h +++ b/stepmania/src/ScreenMapControllers.h @@ -23,6 +23,8 @@ public: virtual void TweenOffScreen(); private: + void BeforeChangeFocus(); + void AfterChangeFocus(); virtual bool GenericTweenOn() const { return true; } void Refresh();