modify Input() on screens to return boolean
This commit is contained in:
+16
-15
@@ -363,7 +363,7 @@ void OptionsList::MoveItem( const RString &sRowName, int iMove )
|
||||
{
|
||||
}
|
||||
|
||||
void OptionsList::Input( const InputEventPlus &input )
|
||||
bool OptionsList::Input( const InputEventPlus &input )
|
||||
{
|
||||
Message msg("");
|
||||
if( m_Codes.InputMessage(input, msg) )
|
||||
@@ -377,14 +377,14 @@ void OptionsList::Input( const InputEventPlus &input )
|
||||
if( input.MenuI == GAME_BUTTON_LEFT || input.MenuI == GAME_BUTTON_RIGHT )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return;
|
||||
return false;
|
||||
|
||||
m_bAcceptStartRelease = false;
|
||||
|
||||
const RString &sCurrentRow = m_asMenuStack.back();
|
||||
vector<bool> &bSelections = m_bSelections[sCurrentRow];
|
||||
if( m_iMenuStackSelection == (int)bSelections.size() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
RString sDest = pHandler->GetScreen( m_iMenuStackSelection );
|
||||
if( m_setDirectRows.find(sDest) != m_setDirectRows.end() && sDest.size() )
|
||||
@@ -406,20 +406,20 @@ void OptionsList::Input( const InputEventPlus &input )
|
||||
MESSAGEMAN->Broadcast( lMsg );
|
||||
}
|
||||
}
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if( input.MenuI == GAME_BUTTON_LEFT )
|
||||
{
|
||||
if( input.type == IET_RELEASE )
|
||||
return;
|
||||
return false;
|
||||
|
||||
if( INPUTMAPPER->IsBeingPressed(GAME_BUTTON_RIGHT, pn) )
|
||||
{
|
||||
if( input.type == IET_FIRST_PRESS )
|
||||
SwitchMenu( -1 );
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
--m_iMenuStackSelection;
|
||||
@@ -429,18 +429,18 @@ void OptionsList::Input( const InputEventPlus &input )
|
||||
Message lMsg("OptionsListLeft");
|
||||
lMsg.SetParam( "Player", input.pn );
|
||||
MESSAGEMAN->Broadcast( lMsg );
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
else if( input.MenuI == GAME_BUTTON_RIGHT )
|
||||
{
|
||||
if( input.type == IET_RELEASE )
|
||||
return;
|
||||
return false;
|
||||
|
||||
if( INPUTMAPPER->IsBeingPressed(GAME_BUTTON_LEFT, pn) )
|
||||
{
|
||||
if( input.type == IET_FIRST_PRESS )
|
||||
SwitchMenu( +1 );
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
++m_iMenuStackSelection;
|
||||
@@ -450,7 +450,7 @@ void OptionsList::Input( const InputEventPlus &input )
|
||||
Message lMsg("OptionsListRight");
|
||||
lMsg.SetParam( "Player", input.pn );
|
||||
MESSAGEMAN->Broadcast( lMsg );
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
else if( input.MenuI == GAME_BUTTON_START )
|
||||
{
|
||||
@@ -458,7 +458,7 @@ void OptionsList::Input( const InputEventPlus &input )
|
||||
{
|
||||
m_bStartIsDown = true;
|
||||
m_bAcceptStartRelease = true;
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
if( input.type == IET_RELEASE )
|
||||
{
|
||||
@@ -467,19 +467,20 @@ void OptionsList::Input( const InputEventPlus &input )
|
||||
m_bStartIsDown = false;
|
||||
}
|
||||
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
else if( input.MenuI == GAME_BUTTON_SELECT )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return;
|
||||
return false;
|
||||
// if( input.type == IET_RELEASE )
|
||||
{
|
||||
Close();
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void OptionsList::SwitchToCurrentRow()
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ public:
|
||||
/** @brief Close all menus (for menu timer). */
|
||||
void Close();
|
||||
|
||||
void Input( const InputEventPlus &input );
|
||||
bool Input( const InputEventPlus &input );
|
||||
bool IsOpened() const { return m_asMenuStack.size() > 0; }
|
||||
|
||||
bool Start(); // return true if the last menu was popped in response to this press
|
||||
|
||||
+14
-13
@@ -186,13 +186,14 @@ bool Screen::OverlayInput( const InputEventPlus &input )
|
||||
return false;
|
||||
}
|
||||
|
||||
void Screen::Input( const InputEventPlus &input )
|
||||
/* Returns true if the input was handled, or false if not handled. */
|
||||
bool Screen::Input( const InputEventPlus &input )
|
||||
{
|
||||
Message msg("");
|
||||
if( m_Codes.InputMessage(input, msg) )
|
||||
{
|
||||
this->HandleMessage( msg );
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Don't send release messages with the default handler.
|
||||
@@ -202,7 +203,7 @@ void Screen::Input( const InputEventPlus &input )
|
||||
case IET_REPEAT:
|
||||
break; // OK
|
||||
default:
|
||||
return; // don't care
|
||||
return false; // don't care
|
||||
}
|
||||
|
||||
// Always broadcast mouse input so themers can grab it. -aj
|
||||
@@ -221,22 +222,22 @@ void Screen::Input( const InputEventPlus &input )
|
||||
// default input handler used by most menus
|
||||
switch( input.MenuI )
|
||||
{
|
||||
case GAME_BUTTON_MENUUP: this->MenuUp ( input ); return;
|
||||
case GAME_BUTTON_MENUDOWN: this->MenuDown ( input ); return;
|
||||
case GAME_BUTTON_MENULEFT: this->MenuLeft ( input ); return;
|
||||
case GAME_BUTTON_MENURIGHT: this->MenuRight ( input ); return;
|
||||
case GAME_BUTTON_MENUUP: return this->MenuUp ( input );
|
||||
case GAME_BUTTON_MENUDOWN: return this->MenuDown ( input );
|
||||
case GAME_BUTTON_MENULEFT: return this->MenuLeft ( input );
|
||||
case GAME_BUTTON_MENURIGHT: return this->MenuRight( input );
|
||||
case GAME_BUTTON_BACK:
|
||||
// Don't make the user hold the back button if they're pressing escape and escape is the back button.
|
||||
if( !PREFSMAN->m_bDelayedBack || input.type==IET_REPEAT || (input.DeviceI.device == DEVICE_KEYBOARD && input.DeviceI.button == KEY_ESC) )
|
||||
{
|
||||
if( HANDLE_BACK_BUTTON )
|
||||
this->MenuBack( input );
|
||||
return this->MenuBack( input );
|
||||
}
|
||||
return;
|
||||
case GAME_BUTTON_START: this->MenuStart ( input ); return;
|
||||
case GAME_BUTTON_SELECT:this->MenuSelect( input ); return;
|
||||
case GAME_BUTTON_COIN: this->MenuCoin ( input ); return;
|
||||
default: return;
|
||||
return false;
|
||||
case GAME_BUTTON_START: return this->MenuStart ( input );
|
||||
case GAME_BUTTON_SELECT: return this->MenuSelect( input );
|
||||
case GAME_BUTTON_COIN: return this->MenuCoin ( input );
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+14
-14
@@ -60,7 +60,7 @@ public:
|
||||
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual bool OverlayInput( const InputEventPlus &input );
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
void SetLockInputSecs( float f ) { m_fLockInputSecs = f; }
|
||||
|
||||
@@ -126,20 +126,20 @@ public:
|
||||
RString GetPrevScreen() const;
|
||||
|
||||
// let subclass override if they want
|
||||
virtual void MenuUp(const InputEventPlus &) { }
|
||||
virtual void MenuDown(const InputEventPlus &) { }
|
||||
virtual void MenuLeft(const InputEventPlus &) { }
|
||||
virtual void MenuRight(const InputEventPlus &) { }
|
||||
virtual void MenuStart(const InputEventPlus &) { }
|
||||
virtual void MenuSelect(const InputEventPlus &) { }
|
||||
virtual void MenuBack(const InputEventPlus &) { }
|
||||
virtual void MenuCoin(const InputEventPlus &) { }
|
||||
virtual bool MenuUp(const InputEventPlus &) { return false; }
|
||||
virtual bool MenuDown(const InputEventPlus &) { return false; }
|
||||
virtual bool MenuLeft(const InputEventPlus &) { return false; }
|
||||
virtual bool MenuRight(const InputEventPlus &) { return false; }
|
||||
virtual bool MenuStart(const InputEventPlus &) { return false; }
|
||||
virtual bool MenuSelect(const InputEventPlus &) { return false; }
|
||||
virtual bool MenuBack(const InputEventPlus &) { return false; }
|
||||
virtual bool MenuCoin(const InputEventPlus &) { return false; }
|
||||
// todo? -aj
|
||||
//virtual void LeftClick(const InputEventPlus &) { }
|
||||
//virtual void RightClick(const InputEventPlus &) { }
|
||||
//virtual void MiddleClick(const InputEventPlus &) { }
|
||||
//virtual void MouseWheelUp(const InputEventPlus &) { }
|
||||
//virtual void MouseWheelDown(const InputEventPlus &) { }
|
||||
//virtual bool LeftClick(const InputEventPlus &) { }
|
||||
//virtual bool RightClick(const InputEventPlus &) { }
|
||||
//virtual bool MiddleClick(const InputEventPlus &) { }
|
||||
//virtual bool MouseWheelUp(const InputEventPlus &) { }
|
||||
//virtual bool MouseWheelDown(const InputEventPlus &) { }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+13
-12
@@ -36,13 +36,15 @@ void ScreenAttract::BeginScreen()
|
||||
ScreenWithMenuElements::BeginScreen();
|
||||
}
|
||||
|
||||
void ScreenAttract::Input( const InputEventPlus &input )
|
||||
bool ScreenAttract::Input( const InputEventPlus &input )
|
||||
{
|
||||
bool handled;
|
||||
// LOG->Trace( "ScreenAttract::Input()" );
|
||||
|
||||
AttractInput( input, this );
|
||||
handled = AttractInput( input, this );
|
||||
|
||||
ScreenWithMenuElements::Input( input );
|
||||
// Always run both AttractInput and ScreenWithMenuElements::Input
|
||||
return ScreenWithMenuElements::Input( input ) || handled;
|
||||
}
|
||||
|
||||
void ScreenAttract::SetAttractVolume( bool bInAttract )
|
||||
@@ -68,10 +70,10 @@ void ScreenAttract::Cancel( ScreenMessage smSendWhenDone )
|
||||
ScreenWithMenuElements::Cancel( smSendWhenDone );
|
||||
}
|
||||
|
||||
void ScreenAttract::AttractInput( const InputEventPlus &input, ScreenWithMenuElements *pScreen )
|
||||
bool ScreenAttract::AttractInput( const InputEventPlus &input, ScreenWithMenuElements *pScreen )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return; // don't care
|
||||
return false; // don't care
|
||||
|
||||
switch( input.MenuI )
|
||||
{
|
||||
@@ -89,37 +91,36 @@ void ScreenAttract::AttractInput( const InputEventPlus &input, ScreenWithMenuEle
|
||||
PREFSMAN->m_iCoinsPerCredit.Get(),
|
||||
GAMESTATE->GetNumSidesJoined() );
|
||||
if( GAMESTATE->m_iCoins < PREFSMAN->m_iCoinsPerCredit && GAMESTATE->GetNumSidesJoined() == 0 )
|
||||
break; // don't fall through
|
||||
return true;
|
||||
// fall through
|
||||
case CoinMode_Home:
|
||||
case CoinMode_Free:
|
||||
if( pScreen->IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
// HandleGlobalInputs() already played the coin sound. Don't play it again.
|
||||
if( input.MenuI != GAME_BUTTON_COIN )
|
||||
SCREENMAN->PlayStartSound();
|
||||
|
||||
pScreen->Cancel( SM_GoToStartScreen );
|
||||
break;
|
||||
return true;
|
||||
default: FAIL_M("Invalid Coin Mode! Aborting...");
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
|
||||
if( pScreen->IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
switch( input.MenuI )
|
||||
{
|
||||
case GAME_BUTTON_LEFT:
|
||||
case GAME_BUTTON_RIGHT:
|
||||
SCREENMAN->PostMessageToTopScreen( SM_BeginFadingOut, 0 );
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Screen::Input( input );
|
||||
}
|
||||
|
||||
void ScreenAttract::StartPlayingMusic()
|
||||
|
||||
+2
-2
@@ -13,11 +13,11 @@ public:
|
||||
virtual void Init();
|
||||
virtual void BeginScreen();
|
||||
|
||||
static void AttractInput( const InputEventPlus &input, ScreenWithMenuElements *pScreen );
|
||||
static bool AttractInput( const InputEventPlus &input, ScreenWithMenuElements *pScreen );
|
||||
static void GoToStartScreen( RString sScreenName );
|
||||
static void SetAttractVolume( bool bInAttract );
|
||||
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
virtual void Cancel( ScreenMessage smSendWhenDone );
|
||||
|
||||
|
||||
+23
-19
@@ -68,53 +68,57 @@ void ScreenBookkeeping::Update( float fDelta )
|
||||
ScreenWithMenuElements::Update( fDelta );
|
||||
}
|
||||
|
||||
void ScreenBookkeeping::Input( const InputEventPlus &input )
|
||||
bool ScreenBookkeeping::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS && input.type != IET_REPEAT )
|
||||
return; // ignore
|
||||
return false; // ignore
|
||||
|
||||
Screen::Input( input ); // default handler
|
||||
return Screen::Input( input ); // default handler
|
||||
}
|
||||
|
||||
void ScreenBookkeeping::MenuLeft( const InputEventPlus &input )
|
||||
bool ScreenBookkeeping::MenuLeft( const InputEventPlus &input )
|
||||
{
|
||||
m_iViewIndex--;
|
||||
CLAMP( m_iViewIndex, 0, m_vBookkeepingViews.size()-1 );
|
||||
|
||||
UpdateView();
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenBookkeeping::MenuRight( const InputEventPlus &input )
|
||||
bool ScreenBookkeeping::MenuRight( const InputEventPlus &input )
|
||||
{
|
||||
m_iViewIndex++;
|
||||
CLAMP( m_iViewIndex, 0, m_vBookkeepingViews.size()-1 );
|
||||
|
||||
UpdateView();
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenBookkeeping::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenBookkeeping::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
if( !IsTransitioning() )
|
||||
{
|
||||
SCREENMAN->PlayStartSound();
|
||||
StartTransitioningScreen( SM_GoToNextScreen );
|
||||
}
|
||||
if( IsTransitioning() )
|
||||
return false;
|
||||
|
||||
SCREENMAN->PlayStartSound();
|
||||
StartTransitioningScreen( SM_GoToNextScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenBookkeeping::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenBookkeeping::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
if( !IsTransitioning() )
|
||||
{
|
||||
SCREENMAN->PlayStartSound();
|
||||
StartTransitioningScreen( SM_GoToPrevScreen );
|
||||
}
|
||||
if( IsTransitioning() )
|
||||
return false;
|
||||
|
||||
SCREENMAN->PlayStartSound();
|
||||
StartTransitioningScreen( SM_GoToPrevScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenBookkeeping::MenuCoin( const InputEventPlus &input )
|
||||
bool ScreenBookkeeping::MenuCoin( const InputEventPlus &input )
|
||||
{
|
||||
UpdateView();
|
||||
|
||||
Screen::MenuCoin( input );
|
||||
return Screen::MenuCoin( input );
|
||||
}
|
||||
|
||||
static LocalizedString ALL_TIME ( "ScreenBookkeeping", "All-time Coin Total:" );
|
||||
|
||||
@@ -25,13 +25,13 @@ public:
|
||||
virtual void Init();
|
||||
|
||||
virtual void Update( float fDelta );
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
|
||||
virtual void MenuLeft( const InputEventPlus &input );
|
||||
virtual void MenuRight( const InputEventPlus &input );
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual void MenuCoin( const InputEventPlus &input );
|
||||
virtual bool MenuLeft( const InputEventPlus &input );
|
||||
virtual bool MenuRight( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuBack( const InputEventPlus &input );
|
||||
virtual bool MenuCoin( const InputEventPlus &input );
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -48,16 +48,16 @@ void ScreenContinue::BeginScreen()
|
||||
ScreenWithMenuElementsSimple::BeginScreen();
|
||||
}
|
||||
|
||||
void ScreenContinue::Input( const InputEventPlus &input )
|
||||
bool ScreenContinue::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( input.MenuI == GAME_BUTTON_COIN && input.type == IET_FIRST_PRESS )
|
||||
ResetTimer();
|
||||
|
||||
if( input.MenuI == GAME_BUTTON_START && input.type == IET_FIRST_PRESS && GAMESTATE->JoinInput(input.pn) )
|
||||
return; // handled
|
||||
return true; // handled
|
||||
|
||||
if( IsTransitioning() )
|
||||
return;
|
||||
return true;
|
||||
|
||||
if( input.type == IET_FIRST_PRESS && GAMESTATE->IsHumanPlayer(input.pn) && FORCE_TIMER_WAIT )
|
||||
{
|
||||
@@ -75,13 +75,13 @@ void ScreenContinue::Input( const InputEventPlus &input )
|
||||
Message msg("HurryTimer");
|
||||
msg.SetParam( "PlayerNumber", input.pn );
|
||||
this->HandleMessage( msg );
|
||||
return; // handled
|
||||
return true; // handled
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
ScreenWithMenuElementsSimple::Input( input );
|
||||
return ScreenWithMenuElementsSimple::Input( input );
|
||||
}
|
||||
|
||||
void ScreenContinue::HandleScreenMessage( const ScreenMessage SM )
|
||||
|
||||
@@ -11,7 +11,7 @@ public:
|
||||
virtual void Init();
|
||||
|
||||
virtual void BeginScreen();
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
virtual void HandleMessage( const Message &msg );
|
||||
virtual bool AllowLateJoin() const { return true; }
|
||||
|
||||
+118
-120
@@ -1714,17 +1714,17 @@ void ScreenEdit::DrawPrimitives()
|
||||
|
||||
}
|
||||
|
||||
void ScreenEdit::Input( const InputEventPlus &input )
|
||||
bool ScreenEdit::Input( const InputEventPlus &input )
|
||||
{
|
||||
// LOG->Trace( "ScreenEdit::Input()" );
|
||||
|
||||
// invalidate input if cmd/meta is being held.
|
||||
if( INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_LMETA)) ||
|
||||
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_RMETA)) )
|
||||
return;
|
||||
return false;
|
||||
|
||||
if( m_In.IsTransitioning() || m_Out.IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
EditButton EditB = DeviceToEdit( input.DeviceI );
|
||||
if( EditB == EditButton_Invalid )
|
||||
@@ -1743,18 +1743,14 @@ void ScreenEdit::Input( const InputEventPlus &input )
|
||||
{
|
||||
DEFAULT_FAIL( m_EditState );
|
||||
case STATE_EDITING:
|
||||
InputEdit( input, EditB );
|
||||
m_bTextInfoNeedsUpdate = true;
|
||||
break;
|
||||
return InputEdit( input, EditB );
|
||||
case STATE_RECORDING:
|
||||
InputRecord( input, EditB );
|
||||
break;
|
||||
return InputRecord( input, EditB );
|
||||
case STATE_RECORDING_PAUSED:
|
||||
InputRecordPaused( input, EditB );
|
||||
break;
|
||||
return InputRecordPaused( input, EditB );
|
||||
case STATE_PLAYING:
|
||||
InputPlay( input, EditB );
|
||||
break;
|
||||
return InputPlay( input, EditB );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1779,13 +1775,15 @@ static LocalizedString SWITCHED_TO ( "ScreenEdit", "Switched to" );
|
||||
static LocalizedString NO_BACKGROUNDS_AVAILABLE ( "ScreenEdit", "No backgrounds available" );
|
||||
static ThemeMetric<bool> INVERT_SCROLL_BUTTONS ( "ScreenEdit", "InvertScrollSpeedButtons" );
|
||||
|
||||
void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
{
|
||||
if( input.type == IET_RELEASE )
|
||||
{
|
||||
if( EditPressed( EDIT_BUTTON_SCROLL_SELECT, input.DeviceI ) )
|
||||
m_iShiftAnchor = -1;
|
||||
return;
|
||||
// XXX Key releases usually don't count as "handled," but what
|
||||
// does it mean in this case?
|
||||
return false;
|
||||
}
|
||||
TimingData &sTiming = GetAppropriateTiming();
|
||||
float playerBeat = GetAppropriatePosition().m_fSongBeat;
|
||||
@@ -1805,7 +1803,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
case EDIT_BUTTON_COLUMN_9:
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
break; // We only care about first presses
|
||||
return false; // We only care about first presses
|
||||
|
||||
int iCol = EditB - EDIT_BUTTON_COLUMN_0;
|
||||
|
||||
@@ -1815,7 +1813,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
ShiftToRightSide( iCol, m_NoteDataEdit.GetNumTracks() );
|
||||
|
||||
if( iCol >= m_NoteDataEdit.GetNumTracks() )
|
||||
break; // this button is not in the range of columns for this Style
|
||||
return false; // this button is not in the range of columns for this Style
|
||||
|
||||
const float fSongBeat = GetBeat();
|
||||
const int iSongIndex = BeatToNoteRow( fSongBeat );
|
||||
@@ -1854,7 +1852,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
CheckNumberOfNotesAndUndo();
|
||||
}
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
|
||||
case EDIT_BUTTON_CYCLE_TAP_LEFT:
|
||||
{
|
||||
@@ -1866,7 +1864,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
case TapNote::fake: m_selectedTap = TAP_ORIGINAL_LIFT; break;
|
||||
DEFAULT_FAIL( m_selectedTap.type );
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
}
|
||||
case EDIT_BUTTON_CYCLE_TAP_RIGHT:
|
||||
{
|
||||
@@ -1878,21 +1876,21 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
case TapNote::fake: m_selectedTap = TAP_ORIGINAL_TAP; break;
|
||||
DEFAULT_FAIL( m_selectedTap.type );
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
}
|
||||
case EDIT_BUTTON_CYCLE_SEGMENT_LEFT:
|
||||
{
|
||||
int tmp = enum_add2( this->currentCycleSegment, -1 );
|
||||
wrap( *ConvertValue<int>(&tmp), NUM_TimingSegmentType );
|
||||
currentCycleSegment = (TimingSegmentType)tmp;
|
||||
break;
|
||||
return true;
|
||||
}
|
||||
case EDIT_BUTTON_CYCLE_SEGMENT_RIGHT:
|
||||
{
|
||||
int tmp = enum_add2( this->currentCycleSegment, +1 );
|
||||
wrap( *ConvertValue<int>(&tmp), NUM_TimingSegmentType );
|
||||
currentCycleSegment = (TimingSegmentType)tmp;
|
||||
break;
|
||||
return true;
|
||||
}
|
||||
case EDIT_BUTTON_SCROLL_SPEED_UP:
|
||||
case EDIT_BUTTON_SCROLL_SPEED_DOWN:
|
||||
@@ -1930,16 +1928,15 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
}
|
||||
|
||||
PO_GROUP_ASSIGN( pPlayerState->m_PlayerOptions, ModsLevel_Song, m_fScrollSpeed, fScrollSpeed );
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_SCROLL_HOME:
|
||||
ScrollTo( 0 );
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_SCROLL_END:
|
||||
ScrollTo( m_NoteDataEdit.GetLastBeat() );
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_SCROLL_UP_LINE:
|
||||
case EDIT_BUTTON_SCROLL_UP_PAGE:
|
||||
case EDIT_BUTTON_SCROLL_UP_TS:
|
||||
@@ -1979,20 +1976,20 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
|
||||
ScrollTo( fDestinationBeat );
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_SCROLL_NEXT_MEASURE:
|
||||
{
|
||||
float fDestinationBeat = GetBeat() + beatsPerMeasure;
|
||||
fDestinationBeat = ftruncf( fDestinationBeat, (float)beatsPerMeasure );
|
||||
ScrollTo( fDestinationBeat );
|
||||
break;
|
||||
return true;
|
||||
}
|
||||
case EDIT_BUTTON_SCROLL_PREV_MEASURE:
|
||||
{
|
||||
float fDestinationBeat = QuantizeUp( GetBeat(), (float)beatsPerMeasure );
|
||||
fDestinationBeat -= (float)beatsPerMeasure;
|
||||
ScrollTo( fDestinationBeat );
|
||||
break;
|
||||
return true;
|
||||
}
|
||||
case EDIT_BUTTON_SCROLL_NEXT:
|
||||
{
|
||||
@@ -2000,38 +1997,38 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
NoteDataUtil::GetNextEditorPosition( m_NoteDataEdit, iRow );
|
||||
ScrollTo( NoteRowToBeat(iRow) );
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_SCROLL_PREV:
|
||||
{
|
||||
int iRow = BeatToNoteRow( GetBeat() );
|
||||
NoteDataUtil::GetPrevEditorPosition( m_NoteDataEdit, iRow );
|
||||
ScrollTo( NoteRowToBeat(iRow) );
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_SEGMENT_NEXT:
|
||||
{
|
||||
// TODO: Work around Stops and Delays. We MAY have to separate them.
|
||||
TimingData &timing = GetAppropriateTiming();
|
||||
ScrollTo(timing.GetNextSegmentBeatAtBeat(this->currentCycleSegment,
|
||||
GetBeat()));
|
||||
}
|
||||
break;
|
||||
case EDIT_BUTTON_SEGMENT_PREV:
|
||||
{
|
||||
// TODO: Work around Stops and Delays. We MAY have to separate them.
|
||||
TimingData &timing = GetAppropriateTiming();
|
||||
ScrollTo(timing.GetPreviousSegmentBeatAtBeat(this->currentCycleSegment,
|
||||
{
|
||||
// TODO: Work around Stops and Delays. We MAY have to separate them.
|
||||
TimingData &timing = GetAppropriateTiming();
|
||||
ScrollTo(timing.GetNextSegmentBeatAtBeat(this->currentCycleSegment,
|
||||
GetBeat()));
|
||||
}
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
case EDIT_BUTTON_SEGMENT_PREV:
|
||||
{
|
||||
// TODO: Work around Stops and Delays. We MAY have to separate them.
|
||||
TimingData &timing = GetAppropriateTiming();
|
||||
ScrollTo(timing.GetPreviousSegmentBeatAtBeat(this->currentCycleSegment,
|
||||
GetBeat()));
|
||||
}
|
||||
return true;
|
||||
case EDIT_BUTTON_SNAP_NEXT:
|
||||
if( m_SnapDisplay.PrevSnapMode() )
|
||||
OnSnapModeChange();
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_SNAP_PREV:
|
||||
if( m_SnapDisplay.NextSnapMode() )
|
||||
OnSnapModeChange();
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_LAY_SELECT:
|
||||
{
|
||||
const int iCurrentRow = BeatToNoteRow(GetAppropriatePosition().m_fSongBeat);
|
||||
@@ -2059,7 +2056,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
}
|
||||
m_soundMarker.Play();
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_OPEN_AREA_MENU:
|
||||
{
|
||||
// TODO: Improve behavior if timing changes are shifted down on beat 0.
|
||||
@@ -2069,7 +2066,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
g_AreaMenu.rows[undo].bEnabled = m_bHasUndo;
|
||||
EditMiniMenu( &g_AreaMenu, SM_BackFromAreaMenu );
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_OPEN_ALTER_MENU:
|
||||
{
|
||||
bool bAreaSelected = m_NoteFieldEdit.m_iBeginMarker!=-1 && m_NoteFieldEdit.m_iEndMarker!=-1;
|
||||
@@ -2089,19 +2086,19 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
g_AlterMenu.rows[routine_mirror_2_to_1].bEnabled = isRoutine;
|
||||
EditMiniMenu(&g_AlterMenu, SM_BackFromAlterMenu);
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
|
||||
}
|
||||
case EDIT_BUTTON_OPEN_EDIT_MENU:
|
||||
EditMiniMenu( &g_MainMenu, SM_BackFromMainMenu );
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_OPEN_INPUT_HELP:
|
||||
DoHelp();
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_OPEN_TIMING_MENU:
|
||||
{
|
||||
DisplayTimingMenu();
|
||||
break;
|
||||
return true;
|
||||
}
|
||||
case EDIT_BUTTON_OPEN_NEXT_STEPS:
|
||||
case EDIT_BUTTON_OPEN_PREV_STEPS:
|
||||
@@ -2136,7 +2133,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
if( it==vSteps.begin() )
|
||||
{
|
||||
SCREENMAN->PlayInvalidSound();
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
it--;
|
||||
break;
|
||||
@@ -2145,7 +2142,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
if( it==vSteps.end() )
|
||||
{
|
||||
SCREENMAN->PlayInvalidSound();
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2167,7 +2164,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
|
||||
ScrollTo( GetAppropriateTiming().GetBeatFromElapsedTime(curSecond) );
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_BPM_UP:
|
||||
case EDIT_BUTTON_BPM_DOWN:
|
||||
{
|
||||
@@ -2196,7 +2193,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
(fDelta>0 ? m_soundValueIncrease : m_soundValueDecrease).Play();
|
||||
SetDirty( true );
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_STOP_UP:
|
||||
case EDIT_BUTTON_STOP_DOWN:
|
||||
{
|
||||
@@ -2228,7 +2225,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
if( fDelta > 0 )
|
||||
timing.AddSegment( StopSegment(GetRow(), fDelta) );
|
||||
else
|
||||
break;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2241,7 +2238,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
(fDelta>0 ? m_soundValueIncrease : m_soundValueDecrease).Play();
|
||||
SetDirty( true );
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
// TODO: Combine the stop and delay call somehow?
|
||||
case EDIT_BUTTON_DELAY_UP:
|
||||
case EDIT_BUTTON_DELAY_DOWN:
|
||||
@@ -2274,7 +2271,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
if( fDelta > 0 )
|
||||
timing.AddSegment( DelaySegment(GetRow(), fDelta) );
|
||||
else
|
||||
break;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2287,7 +2284,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
(fDelta>0 ? m_soundValueIncrease : m_soundValueDecrease).Play();
|
||||
SetDirty( true );
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_OFFSET_UP:
|
||||
case EDIT_BUTTON_OFFSET_DOWN:
|
||||
{
|
||||
@@ -2322,7 +2319,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
}
|
||||
SetDirty( true );
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_SAMPLE_START_UP:
|
||||
case EDIT_BUTTON_SAMPLE_START_DOWN:
|
||||
case EDIT_BUTTON_SAMPLE_LENGTH_DOWN:
|
||||
@@ -2359,10 +2356,10 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
(fDelta>0 ? m_soundValueIncrease : m_soundValueDecrease).Play();
|
||||
SetDirty( true );
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_PLAY_SAMPLE_MUSIC:
|
||||
PlayPreviewMusic();
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_OPEN_BGCHANGE_LAYER1_MENU:
|
||||
case EDIT_BUTTON_OPEN_BGCHANGE_LAYER2_MENU:
|
||||
if( !GAMESTATE->m_bIsUsingStepTiming )
|
||||
@@ -2469,7 +2466,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
SCREENMAN->SystemMessage( BG_CHANGE_STEP_TIMING );
|
||||
SCREENMAN->PlayInvalidSound();
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
|
||||
case EDIT_BUTTON_OPEN_COURSE_MENU:
|
||||
{
|
||||
@@ -2501,18 +2498,18 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
|
||||
EditMiniMenu( &g_CourseMode, SM_BackFromCourseModeMenu );
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_OPEN_STEP_ATTACK_MENU:
|
||||
{
|
||||
this->DoStepAttackMenu();
|
||||
break;
|
||||
return true;
|
||||
}
|
||||
case EDIT_BUTTON_OPEN_COURSE_ATTACK_MENU:
|
||||
{
|
||||
// TODO: Give Song/Step Timing switches/functions here?
|
||||
Course *pCourse = GAMESTATE->m_pCurCourse;
|
||||
if( pCourse == NULL )
|
||||
break;
|
||||
return false;
|
||||
CourseEntry &ce = pCourse->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex];
|
||||
float fStartTime = m_pSteps->m_Timing.GetElapsedTimeFromBeat( GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat );
|
||||
int iAttack = FindAttackAtTime( ce.attacks, fStartTime );
|
||||
@@ -2537,7 +2534,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
|
||||
EditMiniMenu( &g_InsertCourseAttack, SM_BackFromInsertCourseAttack );
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_ADD_STEP_MODS:
|
||||
{
|
||||
float start = -1;
|
||||
@@ -2576,7 +2573,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
g_fLastInsertAttackDurationSeconds = end - start;
|
||||
toEdit.Assign( ModsLevel_Stage, po );
|
||||
SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertStepAttackPlayerOptions );
|
||||
break;
|
||||
return true;
|
||||
}
|
||||
case EDIT_BUTTON_ADD_COURSE_MODS:
|
||||
{
|
||||
@@ -2584,7 +2581,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
PlayerOptions po;
|
||||
const Course *pCourse = GAMESTATE->m_pCurCourse;
|
||||
if( pCourse == NULL )
|
||||
break;
|
||||
return false;
|
||||
const CourseEntry &ce = pCourse->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex];
|
||||
|
||||
if( m_NoteFieldEdit.m_iBeginMarker == -1 )
|
||||
@@ -2613,7 +2610,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertCourseAttackPlayerOptions );
|
||||
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_BAKE_RANDOM_FROM_SONG_GROUP:
|
||||
case EDIT_BUTTON_BAKE_RANDOM_FROM_SONG_GROUP_AND_GENRE:
|
||||
{
|
||||
@@ -2643,19 +2640,19 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
m_soundMarker.Play();
|
||||
}
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
|
||||
case EDIT_BUTTON_PLAY_FROM_START:
|
||||
HandleMainMenuChoice( play_whole_song );
|
||||
break;
|
||||
return true;
|
||||
|
||||
case EDIT_BUTTON_PLAY_FROM_CURSOR:
|
||||
HandleMainMenuChoice( play_current_beat_to_end );
|
||||
break;
|
||||
return true;
|
||||
|
||||
case EDIT_BUTTON_PLAY_SELECTION:
|
||||
HandleMainMenuChoice( play_selection );
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_RECORD_SELECTION:
|
||||
if( m_NoteFieldEdit.m_iBeginMarker!=-1 && m_NoteFieldEdit.m_iEndMarker!=-1 )
|
||||
{
|
||||
@@ -2680,80 +2677,80 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
if( m_iStartPlayingAt >= m_iStopPlayingAt )
|
||||
{
|
||||
SCREENMAN->PlayInvalidSound();
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
TransitionEditState( STATE_RECORDING );
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_RECORD_FROM_CURSOR:
|
||||
m_iStartPlayingAt = BeatToNoteRow(GetAppropriatePosition().m_fSongBeat);
|
||||
m_iStopPlayingAt = max( m_iStartPlayingAt, m_NoteDataEdit.GetLastRow() );
|
||||
TransitionEditState( STATE_RECORDING );
|
||||
break;
|
||||
return true;
|
||||
|
||||
case EDIT_BUTTON_INSERT:
|
||||
HandleAreaMenuChoice( insert_and_shift );
|
||||
SCREENMAN->PlayInvalidSound();
|
||||
break;
|
||||
return true;
|
||||
|
||||
case EDIT_BUTTON_INSERT_SHIFT_PAUSES:
|
||||
HandleAreaMenuChoice( shift_pauses_forward );
|
||||
SCREENMAN->PlayInvalidSound();
|
||||
break;
|
||||
return true;
|
||||
|
||||
case EDIT_BUTTON_DELETE:
|
||||
HandleAreaMenuChoice( delete_and_shift );
|
||||
SCREENMAN->PlayInvalidSound();
|
||||
break;
|
||||
return true;
|
||||
|
||||
case EDIT_BUTTON_DELETE_SHIFT_PAUSES:
|
||||
HandleAreaMenuChoice( shift_pauses_backward );
|
||||
SCREENMAN->PlayInvalidSound();
|
||||
break;
|
||||
return true;
|
||||
|
||||
case EDIT_BUTTON_SAVE:
|
||||
HandleMainMenuChoice( ScreenEdit::save );
|
||||
break;
|
||||
return true;
|
||||
|
||||
case EDIT_BUTTON_UNDO:
|
||||
Undo();
|
||||
break;
|
||||
return true;
|
||||
|
||||
case EDIT_BUTTON_SWITCH_PLAYERS:
|
||||
if( m_InputPlayerNumber != PLAYER_INVALID )
|
||||
{
|
||||
enum_add( m_InputPlayerNumber, 1 );
|
||||
if( m_InputPlayerNumber == NUM_PLAYERS )
|
||||
m_InputPlayerNumber = PLAYER_1;
|
||||
m_soundSwitchPlayer.Play();
|
||||
}
|
||||
break;
|
||||
if( m_InputPlayerNumber == PLAYER_INVALID )
|
||||
return false;
|
||||
enum_add( m_InputPlayerNumber, 1 );
|
||||
if( m_InputPlayerNumber == NUM_PLAYERS )
|
||||
m_InputPlayerNumber = PLAYER_1;
|
||||
m_soundSwitchPlayer.Play();
|
||||
return true;
|
||||
|
||||
case EDIT_BUTTON_SWITCH_TIMINGS:
|
||||
GAMESTATE->m_bIsUsingStepTiming = !GAMESTATE->m_bIsUsingStepTiming;
|
||||
m_soundSwitchTiming.Play();
|
||||
break;
|
||||
default: break;
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenEdit::InputRecord( const InputEventPlus &input, EditButton EditB )
|
||||
bool ScreenEdit::InputRecord( const InputEventPlus &input, EditButton EditB )
|
||||
{
|
||||
if( input.type == IET_FIRST_PRESS && EditB == EDIT_BUTTON_RETURN_TO_EDIT )
|
||||
{
|
||||
TransitionEditState( STATE_EDITING );
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
if( input.pn != PLAYER_1 )
|
||||
return; // ignore
|
||||
return false; // ignore
|
||||
|
||||
const int iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( input.GameI );
|
||||
|
||||
//Is this actually a column? If not, ignore the input.
|
||||
if( iCol == -1 )
|
||||
return;
|
||||
return false;
|
||||
|
||||
switch( input.type )
|
||||
{
|
||||
@@ -2763,7 +2760,7 @@ void ScreenEdit::InputRecord( const InputEventPlus &input, EditButton EditB )
|
||||
if( EditIsBeingPressed(EDIT_BUTTON_REMOVE_NOTE) )
|
||||
{
|
||||
// Remove notes in Update.
|
||||
break;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Add a tap
|
||||
@@ -2772,11 +2769,11 @@ void ScreenEdit::InputRecord( const InputEventPlus &input, EditButton EditB )
|
||||
|
||||
const int iRow = BeatToNoteRow( fBeat );
|
||||
if( iRow < 0 )
|
||||
break;
|
||||
return false;
|
||||
|
||||
// Don't add outside of the range.
|
||||
if( iRow < m_iStartPlayingAt || iRow >= m_iStopPlayingAt )
|
||||
return;
|
||||
return false;
|
||||
|
||||
// Remove hold if any so that we don't have taps inside of a hold.
|
||||
int iHeadRow;
|
||||
@@ -2788,18 +2785,18 @@ void ScreenEdit::InputRecord( const InputEventPlus &input, EditButton EditB )
|
||||
m_NoteDataRecord.SetTapNote( iCol, iRow, tn );
|
||||
m_NoteFieldRecord.Step( iCol, TNS_W1 );
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
case IET_REPEAT:
|
||||
case IET_RELEASE:
|
||||
// don't add or extend holds here; we do it in Update()
|
||||
break;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenEdit::InputRecordPaused( const InputEventPlus &input, EditButton EditB )
|
||||
bool ScreenEdit::InputRecordPaused( const InputEventPlus &input, EditButton EditB )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return; // don't care
|
||||
return false; // don't care
|
||||
|
||||
switch( EditB )
|
||||
{
|
||||
@@ -2808,15 +2805,15 @@ void ScreenEdit::InputRecordPaused( const InputEventPlus &input, EditButton Edit
|
||||
* to do to undo is Undo() as usual, and copy the note data back in. */
|
||||
Undo();
|
||||
m_NoteDataRecord.CopyAll( m_NoteDataEdit );
|
||||
break;
|
||||
return true;
|
||||
|
||||
case EDIT_BUTTON_PLAY_SELECTION:
|
||||
TransitionEditState( STATE_PLAYING );
|
||||
break;
|
||||
return true;
|
||||
|
||||
case EDIT_BUTTON_RECORD_SELECTION:
|
||||
TransitionEditState( STATE_RECORDING );
|
||||
break;
|
||||
return true;
|
||||
|
||||
case EDIT_BUTTON_RECORD_FROM_CURSOR:
|
||||
if( GAMESTATE->m_pCurSteps[0]->IsAnEdit() )
|
||||
@@ -2826,7 +2823,7 @@ void ScreenEdit::InputRecordPaused( const InputEventPlus &input, EditButton Edit
|
||||
{
|
||||
// We're already at the end.
|
||||
SCREENMAN->PlayInvalidSound();
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2841,16 +2838,17 @@ void ScreenEdit::InputRecordPaused( const InputEventPlus &input, EditButton Edit
|
||||
}
|
||||
|
||||
TransitionEditState( STATE_RECORDING );
|
||||
break;
|
||||
return true;
|
||||
|
||||
case EDIT_BUTTON_RETURN_TO_EDIT:
|
||||
TransitionEditState( STATE_EDITING );
|
||||
break;
|
||||
default: break;
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB )
|
||||
bool ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB )
|
||||
{
|
||||
switch( input.type )
|
||||
{
|
||||
@@ -2858,7 +2856,7 @@ void ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB )
|
||||
case IET_FIRST_PRESS:
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
GameButtonType gbt = GAMESTATE->m_pCurGame->GetPerButtonInfo(input.GameI.button)->m_gbt;
|
||||
@@ -2879,22 +2877,21 @@ void ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB )
|
||||
{
|
||||
switch( gbt )
|
||||
{
|
||||
case GameButtonType_INVALID:
|
||||
break;
|
||||
case GameButtonType_Step:
|
||||
if( iCol != -1 )
|
||||
m_Player->Step( iCol, -1, input.DeviceI.ts, false, bRelease );
|
||||
break;
|
||||
return true;
|
||||
case GameButtonType_Fret:
|
||||
if( iCol != -1 )
|
||||
m_Player->Fret( iCol, -1, input.DeviceI.ts, false, bRelease );
|
||||
break;
|
||||
return true;
|
||||
case GameButtonType_Strum:
|
||||
m_Player->Strum( iCol, -1, input.DeviceI.ts, false, bRelease );
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
@@ -2907,7 +2904,7 @@ void ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB )
|
||||
/* When exiting play mode manually, leave the cursor where it is. */
|
||||
m_fBeatToReturnTo = GetAppropriatePosition().m_fSongBeat;
|
||||
TransitionEditState( STATE_EDITING );
|
||||
break;
|
||||
return true;
|
||||
case EDIT_BUTTON_OFFSET_UP:
|
||||
case EDIT_BUTTON_OFFSET_DOWN:
|
||||
{
|
||||
@@ -2937,10 +2934,11 @@ void ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB )
|
||||
GAMESTATE->m_pCurSong->m_fMusicSampleStartSeconds += fOffsetDelta;
|
||||
}
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void ScreenEdit::TransitionEditState( EditState em )
|
||||
|
||||
+5
-5
@@ -202,11 +202,11 @@ public:
|
||||
virtual ~ScreenEdit();
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual void DrawPrimitives();
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
void InputEdit( const InputEventPlus &input, EditButton EditB );
|
||||
void InputRecord( const InputEventPlus &input, EditButton EditB );
|
||||
void InputRecordPaused( const InputEventPlus &input, EditButton EditB );
|
||||
void InputPlay( const InputEventPlus &input, EditButton EditB );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
bool InputEdit( const InputEventPlus &input, EditButton EditB );
|
||||
bool InputRecord( const InputEventPlus &input, EditButton EditB );
|
||||
bool InputRecordPaused( const InputEventPlus &input, EditButton EditB );
|
||||
bool InputPlay( const InputEventPlus &input, EditButton EditB );
|
||||
virtual void HandleMessage( const Message &msg );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
|
||||
|
||||
+18
-13
@@ -100,38 +100,42 @@ void ScreenEditMenu::HandleScreenMessage( const ScreenMessage SM )
|
||||
ScreenWithMenuElements::HandleScreenMessage( SM );
|
||||
}
|
||||
|
||||
void ScreenEditMenu::MenuUp( const InputEventPlus & )
|
||||
bool ScreenEditMenu::MenuUp( const InputEventPlus & )
|
||||
{
|
||||
if( m_Selector.CanGoUp() )
|
||||
{
|
||||
m_Selector.Up();
|
||||
RefreshExplanationText();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenEditMenu::MenuDown( const InputEventPlus & )
|
||||
bool ScreenEditMenu::MenuDown( const InputEventPlus & )
|
||||
{
|
||||
if( m_Selector.CanGoDown() )
|
||||
{
|
||||
m_Selector.Down();
|
||||
RefreshExplanationText();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenEditMenu::MenuLeft( const InputEventPlus & )
|
||||
bool ScreenEditMenu::MenuLeft( const InputEventPlus & )
|
||||
{
|
||||
if( m_Selector.CanGoLeft() )
|
||||
{
|
||||
m_Selector.Left();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenEditMenu::MenuRight( const InputEventPlus & )
|
||||
bool ScreenEditMenu::MenuRight( const InputEventPlus & )
|
||||
{
|
||||
if( m_Selector.CanGoRight() )
|
||||
{
|
||||
m_Selector.Right();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static RString GetCopyDescription( const Steps *pSourceSteps )
|
||||
@@ -158,16 +162,16 @@ static LocalizedString STEPS_WILL_BE_LOST ( "ScreenEditMenu", "These steps will
|
||||
static LocalizedString CONTINUE_WITH_DELETE ( "ScreenEditMenu", "Continue with delete?" );
|
||||
static LocalizedString ENTER_EDIT_DESCRIPTION ( "ScreenEditMenu", "Enter a description for this edit.");
|
||||
|
||||
void ScreenEditMenu::MenuStart( const InputEventPlus & )
|
||||
bool ScreenEditMenu::MenuStart( const InputEventPlus & )
|
||||
{
|
||||
if( IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
if( m_Selector.CanGoDown() )
|
||||
{
|
||||
m_Selector.Down();
|
||||
RefreshExplanationText();
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
Song* pSong = m_Selector.GetSelectedSong();
|
||||
@@ -188,7 +192,7 @@ void ScreenEditMenu::MenuStart( const InputEventPlus & )
|
||||
if( !pSong->HasMusic() )
|
||||
{
|
||||
ScreenPrompt::Prompt( SM_None, MISSING_MUSIC_FILE );
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
switch( m_Selector.EDIT_MODE )
|
||||
@@ -201,7 +205,7 @@ void ScreenEditMenu::MenuStart( const InputEventPlus & )
|
||||
if( !file.Open( sTempFile, RageFile::WRITE ) )
|
||||
{
|
||||
ScreenPrompt::Prompt( SM_None, SONG_DIR_READ_ONLY );
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
file.Close();
|
||||
@@ -221,7 +225,7 @@ void ScreenEditMenu::MenuStart( const InputEventPlus & )
|
||||
{
|
||||
SCREENMAN->PlayInvalidSound();
|
||||
SCREENMAN->SystemMessage( DELETED_AUTOGEN_STEPS.GetValue() );
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
default: break;
|
||||
@@ -314,17 +318,18 @@ void ScreenEditMenu::MenuStart( const InputEventPlus & )
|
||||
StartTransitioningScreen( SM_GoToNextScreen );
|
||||
}
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
case EditMenuAction_Delete:
|
||||
break;
|
||||
return true;
|
||||
default:
|
||||
FAIL_M(ssprintf("Invalid edit menu action: %i", action));
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenEditMenu::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenEditMenu::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
Cancel( SM_GoToPrevScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenEditMenu::RefreshExplanationText()
|
||||
|
||||
@@ -14,12 +14,12 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
void MenuUp( const InputEventPlus &input );
|
||||
void MenuDown( const InputEventPlus &input );
|
||||
void MenuLeft( const InputEventPlus &input );
|
||||
void MenuRight( const InputEventPlus &input );
|
||||
void MenuBack( const InputEventPlus &input );
|
||||
void MenuStart( const InputEventPlus &input );
|
||||
bool MenuUp( const InputEventPlus &input );
|
||||
bool MenuDown( const InputEventPlus &input );
|
||||
bool MenuLeft( const InputEventPlus &input );
|
||||
bool MenuRight( const InputEventPlus &input );
|
||||
bool MenuBack( const InputEventPlus &input );
|
||||
bool MenuStart( const InputEventPlus &input );
|
||||
|
||||
void RefreshExplanationText();
|
||||
void RefreshNumStepsLoadedFromProfile();
|
||||
|
||||
@@ -109,20 +109,22 @@ void ScreenEnding::Init()
|
||||
GAMESTATE->Reset();
|
||||
}
|
||||
|
||||
void ScreenEnding::Input( const InputEventPlus &input )
|
||||
bool ScreenEnding::Input( const InputEventPlus &input )
|
||||
{
|
||||
bool handled = false;
|
||||
if( !IsTransitioning() )
|
||||
{
|
||||
switch( input.MenuI )
|
||||
{
|
||||
case GAME_BUTTON_START:
|
||||
SCREENMAN->PostMessageToTopScreen( SM_BeginFadingOut, 0 );
|
||||
handled = true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ScreenAttract::Input( input );
|
||||
return ScreenAttract::Input( input ) || handled;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ class ScreenEnding : public ScreenAttract
|
||||
public:
|
||||
ScreenEnding();
|
||||
virtual void Init();
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
|
||||
private:
|
||||
Sprite m_sprRemoveMemoryCard[NUM_PLAYERS];
|
||||
|
||||
@@ -684,10 +684,10 @@ void ScreenEvaluation::Init()
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenEvaluation::Input( const InputEventPlus &input )
|
||||
bool ScreenEvaluation::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
if( input.GameI.IsValid() )
|
||||
{
|
||||
@@ -722,12 +722,12 @@ void ScreenEvaluation::Input( const InputEventPlus &input )
|
||||
MEMCARDMAN->UnmountCard( pn );
|
||||
|
||||
m_bSavedScreenshot[pn] = true;
|
||||
return; // handled
|
||||
return true; // handled
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ScreenWithMenuElements::Input( input );
|
||||
return ScreenWithMenuElements::Input( input );
|
||||
}
|
||||
|
||||
void ScreenEvaluation::HandleScreenMessage( const ScreenMessage SM )
|
||||
@@ -740,19 +740,20 @@ void ScreenEvaluation::HandleScreenMessage( const ScreenMessage SM )
|
||||
ScreenWithMenuElements::HandleScreenMessage( SM );
|
||||
}
|
||||
|
||||
void ScreenEvaluation::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenEvaluation::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
MenuStart( input );
|
||||
return MenuStart( input );
|
||||
}
|
||||
|
||||
void ScreenEvaluation::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenEvaluation::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
if( IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
m_soundStart.Play();
|
||||
|
||||
HandleMenuStart();
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenEvaluation::HandleMenuStart()
|
||||
|
||||
@@ -50,11 +50,11 @@ class ScreenEvaluation : public ScreenWithMenuElements
|
||||
{
|
||||
public:
|
||||
virtual void Init();
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuBack( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
virtual void PushSelf( lua_State *L );
|
||||
StageStats *GetStageStats() { return m_pStageStats; }
|
||||
|
||||
|
||||
+17
-11
@@ -2155,7 +2155,7 @@ void ScreenGameplay::AbortGiveUp( bool bShowText )
|
||||
}
|
||||
|
||||
|
||||
void ScreenGameplay::Input( const InputEventPlus &input )
|
||||
bool ScreenGameplay::Input( const InputEventPlus &input )
|
||||
{
|
||||
//LOG->Trace( "ScreenGameplay::Input()" );
|
||||
|
||||
@@ -2171,10 +2171,14 @@ void ScreenGameplay::Input( const InputEventPlus &input )
|
||||
if( m_PauseController == GameController_Invalid || m_PauseController == input.GameI.controller )
|
||||
{
|
||||
// IMO, it's better to have this configurable. -DaisuMaster
|
||||
if( UNPAUSE_WITH_START ) this->PauseGame( false );
|
||||
if( UNPAUSE_WITH_START )
|
||||
{
|
||||
this->PauseGame( false );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if( m_DancingState != STATE_OUTRO &&
|
||||
@@ -2206,7 +2210,7 @@ void ScreenGameplay::Input( const InputEventPlus &input )
|
||||
m_GiveUpTimer.Touch(); // start the timer
|
||||
}
|
||||
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Only handle GAME_BUTTON_BACK as a regular BACK button if BACK_GIVES_UP is
|
||||
@@ -2236,13 +2240,13 @@ void ScreenGameplay::Input( const InputEventPlus &input )
|
||||
m_textDebug.PlayCommand( "TweenOff" );
|
||||
}
|
||||
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool bRelease = input.type == IET_RELEASE;
|
||||
if( !input.GameI.IsValid() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
int iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( input.GameI );
|
||||
|
||||
@@ -2253,7 +2257,7 @@ void ScreenGameplay::Input( const InputEventPlus &input )
|
||||
case IET_RELEASE:
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if( GAMESTATE->m_bMultiplayer )
|
||||
@@ -2265,6 +2269,7 @@ void ScreenGameplay::Input( const InputEventPlus &input )
|
||||
if( input.mp == pi->m_mp )
|
||||
pi->m_pPlayer->Step( iCol, -1, input.DeviceI.ts, false, bRelease );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2284,22 +2289,23 @@ void ScreenGameplay::Input( const InputEventPlus &input )
|
||||
switch( gbt )
|
||||
{
|
||||
case GameButtonType_INVALID:
|
||||
break;
|
||||
return false;
|
||||
case GameButtonType_Step:
|
||||
if( iCol != -1 )
|
||||
pi.m_pPlayer->Step( iCol, -1, input.DeviceI.ts, false, bRelease );
|
||||
break;
|
||||
return true;
|
||||
case GameButtonType_Fret:
|
||||
if( iCol != -1 )
|
||||
pi.m_pPlayer->Fret( iCol, -1, input.DeviceI.ts, false, bRelease );
|
||||
break;
|
||||
return true;
|
||||
case GameButtonType_Strum:
|
||||
pi.m_pPlayer->Strum( iCol, -1, input.DeviceI.ts, false, bRelease );
|
||||
break;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ public:
|
||||
virtual void BeginScreen();
|
||||
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
virtual void HandleMessage( const Message &msg );
|
||||
virtual void Cancel( ScreenMessage smSendWhenDone );
|
||||
|
||||
@@ -63,19 +63,19 @@ void ScreenGameplayLesson::Init()
|
||||
pi->GetPlayerState()->m_PlayerController = PC_AUTOPLAY;
|
||||
}
|
||||
|
||||
void ScreenGameplayLesson::Input( const InputEventPlus &input )
|
||||
bool ScreenGameplayLesson::Input( const InputEventPlus &input )
|
||||
{
|
||||
//LOG->Trace( "ScreenGameplayLesson::Input()" );
|
||||
|
||||
if( m_iCurrentPageIndex != -1 )
|
||||
{
|
||||
// show a lesson page
|
||||
Screen::Input( input );
|
||||
return Screen::Input( input );
|
||||
}
|
||||
else
|
||||
{
|
||||
// in the "your turn" section"
|
||||
ScreenGameplay::Input( input );
|
||||
return ScreenGameplay::Input( input );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,25 +126,27 @@ void ScreenGameplayLesson::HandleScreenMessage( const ScreenMessage SM )
|
||||
ScreenGameplay::HandleScreenMessage( SM );
|
||||
}
|
||||
|
||||
void ScreenGameplayLesson::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenGameplayLesson::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
// XXX: Allow repeats?
|
||||
if( m_iCurrentPageIndex == -1 )
|
||||
return;
|
||||
return false;
|
||||
ChangeLessonPage( +1 );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenGameplayLesson::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenGameplayLesson::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
// XXX: Allow repeats?
|
||||
if( m_iCurrentPageIndex == 0 )
|
||||
{
|
||||
BeginBackingOutFromGameplay();
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
if( m_iCurrentPageIndex == -1 )
|
||||
return;
|
||||
return false;
|
||||
ChangeLessonPage( -1 );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenGameplayLesson::ChangeLessonPage( int iDir )
|
||||
|
||||
@@ -11,11 +11,11 @@ public:
|
||||
ScreenGameplayLesson();
|
||||
virtual void Init();
|
||||
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuBack( const InputEventPlus &input );
|
||||
|
||||
protected:
|
||||
void ChangeLessonPage( int iDir );
|
||||
|
||||
@@ -67,7 +67,7 @@ void ScreenGameplaySyncMachine::Update( float fDelta )
|
||||
RefreshText();
|
||||
}
|
||||
|
||||
void ScreenGameplaySyncMachine::Input( const InputEventPlus &input )
|
||||
bool ScreenGameplaySyncMachine::Input( const InputEventPlus &input )
|
||||
{
|
||||
// Hack to make this work from Player2's controls
|
||||
InputEventPlus _input = input;
|
||||
@@ -77,7 +77,7 @@ void ScreenGameplaySyncMachine::Input( const InputEventPlus &input )
|
||||
if( _input.pn != PLAYER_INVALID )
|
||||
_input.pn = PLAYER_1;
|
||||
|
||||
ScreenGameplay::Input( _input );
|
||||
return ScreenGameplay::Input( _input );
|
||||
}
|
||||
|
||||
void ScreenGameplaySyncMachine::HandleScreenMessage( const ScreenMessage SM )
|
||||
|
||||
@@ -10,7 +10,7 @@ public:
|
||||
virtual void Init();
|
||||
|
||||
virtual void Update( float fDelta );
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
|
||||
virtual ScreenType GetScreenType() const { return system_menu; }
|
||||
|
||||
|
||||
@@ -273,17 +273,17 @@ void ScreenHighScores::BeginScreen()
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenHighScores::Input( const InputEventPlus &input )
|
||||
bool ScreenHighScores::Input( const InputEventPlus &input )
|
||||
{
|
||||
//LOG->Trace( "ScreenRanking::Input()" );
|
||||
if( IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
// If manually scrolling, pass the input to Screen::Input so it will call Menu*
|
||||
if( (bool)MANUAL_SCROLLING )
|
||||
Screen::Input( input );
|
||||
return Screen::Input( input );
|
||||
else
|
||||
ScreenAttract::Input( input );
|
||||
return ScreenAttract::Input( input );
|
||||
}
|
||||
|
||||
void ScreenHighScores::HandleScreenMessage( const ScreenMessage SM )
|
||||
@@ -296,22 +296,24 @@ void ScreenHighScores::HandleScreenMessage( const ScreenMessage SM )
|
||||
ScreenAttract::HandleScreenMessage( SM );
|
||||
}
|
||||
|
||||
void ScreenHighScores::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenHighScores::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
if( !MANUAL_SCROLLING )
|
||||
return;
|
||||
return false;
|
||||
if( !IsTransitioning() )
|
||||
StartTransitioningScreen( SM_GoToNextScreen );
|
||||
SCREENMAN->PlayStartSound();
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenHighScores::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenHighScores::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
if( !MANUAL_SCROLLING )
|
||||
return;
|
||||
return false;
|
||||
if( !IsTransitioning() )
|
||||
StartTransitioningScreen( SM_GoToNextScreen );
|
||||
SCREENMAN->PlayStartSound();
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenHighScores::DoScroll( int iDir )
|
||||
|
||||
@@ -55,13 +55,13 @@ public:
|
||||
virtual void BeginScreen();
|
||||
|
||||
void HandleScreenMessage( const ScreenMessage SM );
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual void MenuLeft( const InputEventPlus &input ) { DoScroll(-1); }
|
||||
virtual void MenuRight( const InputEventPlus &input ) { DoScroll(+1); }
|
||||
virtual void MenuUp( const InputEventPlus &input ) { DoScroll(-1); }
|
||||
virtual void MenuDown( const InputEventPlus &input ) { DoScroll(+1); }
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuBack( const InputEventPlus &input );
|
||||
virtual bool MenuLeft( const InputEventPlus &input ) { DoScroll(-1); return true; }
|
||||
virtual bool MenuRight( const InputEventPlus &input ) { DoScroll(+1); return true; }
|
||||
virtual bool MenuUp( const InputEventPlus &input ) { DoScroll(-1); return true; }
|
||||
virtual bool MenuDown( const InputEventPlus &input ) { DoScroll(+1); return true; }
|
||||
|
||||
private:
|
||||
void DoScroll( int iDir );
|
||||
|
||||
@@ -4,23 +4,25 @@
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenInstructions );
|
||||
|
||||
void ScreenInstructions::Input( const InputEventPlus &input )
|
||||
bool ScreenInstructions::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
// default input handler
|
||||
Screen::Input( input );
|
||||
return Screen::Input( input );
|
||||
}
|
||||
|
||||
void ScreenInstructions::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenInstructions::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
Cancel( SM_GoToPrevScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenInstructions::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenInstructions::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
StartTransitioningScreen( SM_GoToNextScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
class ScreenInstructions : public ScreenWithMenuElements
|
||||
{
|
||||
public:
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuBack( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -239,24 +239,24 @@ void ScreenJukebox::Init()
|
||||
m_DancingState = STATE_DANCING;
|
||||
}
|
||||
|
||||
void ScreenJukebox::Input( const InputEventPlus &input )
|
||||
bool ScreenJukebox::Input( const InputEventPlus &input )
|
||||
{
|
||||
//LOG->Trace( "ScreenJukebox::Input()" );
|
||||
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return; // ignore
|
||||
return false; // ignore
|
||||
|
||||
switch( input.MenuI )
|
||||
{
|
||||
case GAME_BUTTON_LEFT:
|
||||
case GAME_BUTTON_RIGHT:
|
||||
SCREENMAN->PostMessageToTopScreen( SM_NotesEnded, 0 );
|
||||
return;
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
ScreenAttract::AttractInput( input, this );
|
||||
return ScreenAttract::AttractInput( input, this );
|
||||
}
|
||||
|
||||
void ScreenJukebox::HandleScreenMessage( const ScreenMessage SM )
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ public:
|
||||
ScreenJukebox();
|
||||
virtual void Init();
|
||||
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
|
||||
void SetSong();
|
||||
|
||||
@@ -228,20 +228,21 @@ static bool IsAxis( const DeviceInput& DeviceI )
|
||||
return false;
|
||||
}
|
||||
|
||||
void ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
bool ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( m_fLockInputSecs > 0 )
|
||||
return;
|
||||
return false;
|
||||
|
||||
if( input.type != IET_FIRST_PRESS && input.type != IET_REPEAT )
|
||||
return; // ignore
|
||||
return false; // ignore
|
||||
if( IsTransitioning() )
|
||||
return; // ignore
|
||||
return false; // ignore
|
||||
|
||||
LOG->Trace( "ScreenMapControllers::Input(): device: %d, button: %d",
|
||||
input.DeviceI.device, input.DeviceI.button );
|
||||
|
||||
int button = input.DeviceI.button;
|
||||
bool bHandled = false;
|
||||
|
||||
/* TRICKY: Some adapters map the PlayStation digital d-pad to both axes and
|
||||
* buttons. We want buttons to be used for any mappings where possible
|
||||
@@ -253,7 +254,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
if( !m_WaitingForPress.IsZero() )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return;
|
||||
return false;
|
||||
|
||||
// Don't allow function keys to be mapped.
|
||||
if( input.DeviceI.device == DEVICE_KEYBOARD && (input.DeviceI.button >= KEY_F1 && input.DeviceI.button <= KEY_F12) )
|
||||
@@ -268,7 +269,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
IsAxis(input.DeviceI) )
|
||||
{
|
||||
LOG->Trace("Ignored input; non-axis event already received");
|
||||
return; // ignore this press
|
||||
return false; // ignore this press
|
||||
}
|
||||
|
||||
m_DeviceIToMap = input.DeviceI;
|
||||
@@ -304,6 +305,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
|
||||
// commit to disk after each change
|
||||
INPUTMAPPER->SaveMappingsToDisk();
|
||||
bHandled = true;
|
||||
}
|
||||
break;
|
||||
case KEY_LEFT: // Move the selection left, wrapping up.
|
||||
@@ -320,6 +322,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
}
|
||||
AfterChangeFocus();
|
||||
m_soundChange.Play();
|
||||
bHandled = true;
|
||||
break;
|
||||
case KEY_RIGHT: // Move the selection right, wrapping down.
|
||||
if( m_iCurButton == (int) m_KeysToMap.size() )
|
||||
@@ -335,6 +338,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
}
|
||||
AfterChangeFocus();
|
||||
m_soundChange.Play();
|
||||
bHandled = true;
|
||||
break;
|
||||
case KEY_UP: // Move the selection up.
|
||||
if( m_iCurButton == 0 )
|
||||
@@ -343,6 +347,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
m_iCurButton--;
|
||||
AfterChangeFocus();
|
||||
m_soundChange.Play();
|
||||
bHandled = true;
|
||||
break;
|
||||
case KEY_DOWN: // Move the selection down.
|
||||
if( m_iCurButton == (int) m_KeysToMap.size() )
|
||||
@@ -351,10 +356,12 @@ void ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
m_iCurButton++;
|
||||
AfterChangeFocus();
|
||||
m_soundChange.Play();
|
||||
bHandled = true;
|
||||
break;
|
||||
case KEY_ESC: // Quit the screen.
|
||||
SCREENMAN->PlayStartSound();
|
||||
StartTransitioningScreen( SM_GoToNextScreen );
|
||||
bHandled = true;
|
||||
break;
|
||||
case KEY_ENTER: // Change the selection.
|
||||
case KEY_KP_ENTER:
|
||||
@@ -373,6 +380,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
m_WaitingForPress.Touch();
|
||||
m_DeviceIToMap.MakeInvalid();
|
||||
SCREENMAN->PlayStartSound();
|
||||
bHandled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -382,6 +390,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
LOG->Trace( "m_iCurSlot: %d m_iCurController: %d m_iCurButton: %d", m_iCurSlot, m_iCurController, m_iCurButton );
|
||||
|
||||
Refresh();
|
||||
return bHandled;
|
||||
}
|
||||
|
||||
Actor *ScreenMapControllers::GetActorWithFocus()
|
||||
|
||||
@@ -17,7 +17,7 @@ public:
|
||||
virtual void BeginScreen();
|
||||
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
|
||||
private:
|
||||
virtual void HandleMessage( const Message &msg );
|
||||
|
||||
@@ -37,11 +37,11 @@ public:
|
||||
//virtual void EndScreen();
|
||||
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
|
||||
virtual void MenuUp( const InputEventPlus &input );
|
||||
virtual void MenuDown( const InputEventPlus &input );
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuUp( const InputEventPlus &input );
|
||||
virtual bool MenuDown( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
virtual void TweenOnScreen();
|
||||
|
||||
MapControlsState GetMapControlsState(){ return m_MapControlsState; }
|
||||
|
||||
@@ -330,15 +330,16 @@ void ScreenNameEntry::Update( float fDelta )
|
||||
ScreenWithMenuElements::Update(fDelta);
|
||||
}
|
||||
|
||||
void ScreenNameEntry::Input( const InputEventPlus &input )
|
||||
bool ScreenNameEntry::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
if( input.type != IET_FIRST_PRESS || !input.GameI.IsValid() )
|
||||
return; // ignore
|
||||
return false; // ignore
|
||||
|
||||
const int iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( input.GameI );
|
||||
bool bHandled = false;
|
||||
if( iCol != Column_Invalid && m_bStillEnteringName[input.pn] )
|
||||
{
|
||||
int iStringIndex = m_ColToStringIndex[input.pn][iCol];
|
||||
@@ -350,9 +351,10 @@ void ScreenNameEntry::Input( const InputEventPlus &input )
|
||||
m_textSelectedChars[input.pn][iCol].SetText( RString(1, c) );
|
||||
m_sSelectedName[input.pn][iStringIndex] = c;
|
||||
}
|
||||
bHandled = true;
|
||||
}
|
||||
|
||||
ScreenWithMenuElements::Input( input );
|
||||
return ScreenWithMenuElements::Input( input ) || bHandled;
|
||||
}
|
||||
|
||||
void ScreenNameEntry::HandleScreenMessage( const ScreenMessage SM )
|
||||
@@ -374,12 +376,12 @@ void ScreenNameEntry::HandleScreenMessage( const ScreenMessage SM )
|
||||
}
|
||||
|
||||
|
||||
void ScreenNameEntry::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenNameEntry::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
PlayerNumber pn = input.pn;
|
||||
|
||||
if( !m_bStillEnteringName[pn] )
|
||||
return;
|
||||
return false;
|
||||
m_bStillEnteringName[pn] = false;
|
||||
m_Text[pn].SetDone();
|
||||
|
||||
@@ -395,6 +397,7 @@ void ScreenNameEntry::MenuStart( const InputEventPlus &input )
|
||||
|
||||
if( !AnyStillEntering() && !m_Out.IsTransitioning() )
|
||||
StartTransitioningScreen( SM_GoToNextScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -13,10 +13,10 @@ public:
|
||||
ScreenNameEntry();
|
||||
virtual void Init();
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
private:
|
||||
class ScrollingText : public Actor
|
||||
{
|
||||
|
||||
@@ -139,12 +139,12 @@ bool ScreenNameEntryTraditional::AnyEntering() const
|
||||
return false;
|
||||
}
|
||||
|
||||
void ScreenNameEntryTraditional::Input( const InputEventPlus &input )
|
||||
bool ScreenNameEntryTraditional::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
ScreenWithMenuElements::Input( input );
|
||||
return ScreenWithMenuElements::Input( input );
|
||||
}
|
||||
|
||||
bool ScreenNameEntryTraditional::Finish( PlayerNumber pn )
|
||||
|
||||
@@ -13,7 +13,7 @@ public:
|
||||
virtual void BeginScreen();
|
||||
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
|
||||
bool EnterKey( PlayerNumber pn, wchar_t sLetter );
|
||||
bool Backspace( PlayerNumber pn );
|
||||
|
||||
@@ -88,36 +88,38 @@ void ScreenNetEvaluation::RedoUserTexts()
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenNetEvaluation::MenuLeft( const InputEventPlus &input )
|
||||
bool ScreenNetEvaluation::MenuLeft( const InputEventPlus &input )
|
||||
{
|
||||
MenuUp( input );
|
||||
return MenuUp( input );
|
||||
}
|
||||
|
||||
void ScreenNetEvaluation::MenuUp( const InputEventPlus &input )
|
||||
bool ScreenNetEvaluation::MenuUp( const InputEventPlus &input )
|
||||
{
|
||||
if( m_iActivePlayers == 0 || !m_bHasStats )
|
||||
return;
|
||||
return false;
|
||||
|
||||
COMMAND( m_textUsers[m_iCurrentPlayer], "DeSel" );
|
||||
m_iCurrentPlayer = (m_iCurrentPlayer + m_iActivePlayers - 1) % m_iActivePlayers;
|
||||
COMMAND( m_textUsers[m_iCurrentPlayer], "Sel" );
|
||||
UpdateStats();
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenNetEvaluation::MenuRight( const InputEventPlus &input )
|
||||
bool ScreenNetEvaluation::MenuRight( const InputEventPlus &input )
|
||||
{
|
||||
MenuDown( input );
|
||||
return MenuDown( input );
|
||||
}
|
||||
|
||||
void ScreenNetEvaluation::MenuDown( const InputEventPlus &input )
|
||||
bool ScreenNetEvaluation::MenuDown( const InputEventPlus &input )
|
||||
{
|
||||
if ( m_iActivePlayers == 0 || !m_bHasStats )
|
||||
return;
|
||||
return false;
|
||||
|
||||
COMMAND( m_textUsers[m_iCurrentPlayer], "DeSel" );
|
||||
m_iCurrentPlayer = (m_iCurrentPlayer + 1) % m_iActivePlayers;
|
||||
COMMAND( m_textUsers[m_iCurrentPlayer], "Sel" );
|
||||
UpdateStats();
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenNetEvaluation::HandleScreenMessage( const ScreenMessage SM )
|
||||
|
||||
@@ -18,10 +18,10 @@ public:
|
||||
virtual void PushSelf( lua_State *L );
|
||||
|
||||
protected:
|
||||
virtual void MenuLeft( const InputEventPlus &input );
|
||||
virtual void MenuUp( const InputEventPlus &input );
|
||||
virtual void MenuRight( const InputEventPlus &input );
|
||||
virtual void MenuDown( const InputEventPlus &input );
|
||||
virtual bool MenuLeft( const InputEventPlus &input );
|
||||
virtual bool MenuUp( const InputEventPlus &input );
|
||||
virtual bool MenuRight( const InputEventPlus &input );
|
||||
virtual bool MenuDown( const InputEventPlus &input );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
virtual void TweenOffScreen( );
|
||||
|
||||
|
||||
+18
-8
@@ -52,12 +52,12 @@ void ScreenNetRoom::Init()
|
||||
NSMAN->ReportNSSOnOff( 7 );
|
||||
}
|
||||
|
||||
void ScreenNetRoom::Input( const InputEventPlus &input )
|
||||
bool ScreenNetRoom::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( (input.MenuI == GAME_BUTTON_LEFT || input.MenuI == GAME_BUTTON_RIGHT) && input.type == IET_RELEASE )
|
||||
m_RoomWheel.Move( 0 );
|
||||
|
||||
ScreenNetSelectBase::Input( input );
|
||||
return ScreenNetSelectBase::Input( input );
|
||||
}
|
||||
|
||||
void ScreenNetRoom::HandleScreenMessage( const ScreenMessage SM )
|
||||
@@ -191,7 +191,7 @@ void ScreenNetRoom::TweenOffScreen()
|
||||
NSMAN->ReportNSSOnOff( 6 );
|
||||
}
|
||||
|
||||
void ScreenNetRoom::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenNetRoom::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
m_RoomWheel.Select();
|
||||
RoomWheelItemData* rwd = dynamic_cast<RoomWheelItemData*>( m_RoomWheel.LastSelected() );
|
||||
@@ -212,31 +212,41 @@ void ScreenNetRoom::MenuStart( const InputEventPlus &input )
|
||||
}
|
||||
}
|
||||
ScreenNetSelectBase::MenuStart( input );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenNetRoom::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenNetRoom::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
TweenOffScreen();
|
||||
|
||||
Cancel( SM_GoToPrevScreen );
|
||||
|
||||
ScreenNetSelectBase::MenuBack( input );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenNetRoom::MenuLeft( const InputEventPlus &input )
|
||||
bool ScreenNetRoom::MenuLeft( const InputEventPlus &input )
|
||||
{
|
||||
bool bHandled = false;
|
||||
if( input.type == IET_FIRST_PRESS )
|
||||
{
|
||||
m_RoomWheel.Move( -1 );
|
||||
bHandled = true;
|
||||
}
|
||||
|
||||
ScreenNetSelectBase::MenuLeft( input );
|
||||
return ScreenNetSelectBase::MenuLeft( input ) || bHandled;
|
||||
}
|
||||
|
||||
void ScreenNetRoom::MenuRight( const InputEventPlus &input )
|
||||
bool ScreenNetRoom::MenuRight( const InputEventPlus &input )
|
||||
{
|
||||
bool bHandled = false;
|
||||
if( input.type == IET_FIRST_PRESS )
|
||||
{
|
||||
m_RoomWheel.Move( 1 );
|
||||
bHandled = true;
|
||||
}
|
||||
|
||||
ScreenNetSelectBase::MenuRight( input );
|
||||
return ScreenNetSelectBase::MenuRight( input ) || bHandled;
|
||||
}
|
||||
|
||||
void ScreenNetRoom::UpdateRoomsList()
|
||||
|
||||
+5
-5
@@ -30,19 +30,19 @@ class ScreenNetRoom : public ScreenNetSelectBase
|
||||
{
|
||||
public:
|
||||
virtual void Init();
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
|
||||
protected:
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuBack( const InputEventPlus &input );
|
||||
|
||||
virtual void TweenOffScreen( );
|
||||
|
||||
private:
|
||||
void UpdateRoomsList();
|
||||
void MenuLeft( const InputEventPlus &input );
|
||||
void MenuRight( const InputEventPlus &input );
|
||||
bool MenuLeft( const InputEventPlus &input );
|
||||
bool MenuRight( const InputEventPlus &input );
|
||||
void CreateNewRoom( const RString& rName, const RString& rDesc, const RString& rPass );
|
||||
|
||||
RageSound m_soundChangeSel;
|
||||
|
||||
@@ -68,13 +68,13 @@ void ScreenNetSelectBase::Init()
|
||||
return;
|
||||
}
|
||||
|
||||
void ScreenNetSelectBase::Input( const InputEventPlus &input )
|
||||
bool ScreenNetSelectBase::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( m_In.IsTransitioning() || m_Out.IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
if( input.type != IET_FIRST_PRESS && input.type != IET_REPEAT )
|
||||
return;
|
||||
return false;
|
||||
|
||||
bool bHoldingCtrl =
|
||||
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL)) ||
|
||||
@@ -91,7 +91,7 @@ void ScreenNetSelectBase::Input( const InputEventPlus &input )
|
||||
NSMAN->SendChat( m_sTextInput );
|
||||
m_sTextInput="";
|
||||
UpdateTextInput();
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case KEY_BACK:
|
||||
@@ -116,10 +116,10 @@ void ScreenNetSelectBase::Input( const InputEventPlus &input )
|
||||
break;
|
||||
|
||||
if( c >= ' ' )
|
||||
return;
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
Screen::Input( input );
|
||||
return Screen::Input( input );
|
||||
}
|
||||
|
||||
void ScreenNetSelectBase::HandleScreenMessage( const ScreenMessage SM )
|
||||
|
||||
@@ -33,7 +33,7 @@ class ScreenNetSelectBase : public ScreenWithMenuElements
|
||||
public:
|
||||
virtual void Init();
|
||||
|
||||
void Input( const InputEventPlus &input );
|
||||
bool Input( const InputEventPlus &input );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
virtual void TweenOffScreen();
|
||||
|
||||
|
||||
@@ -90,19 +90,19 @@ void ScreenNetSelectMusic::Init()
|
||||
m_bAllowInput = false;
|
||||
}
|
||||
|
||||
void ScreenNetSelectMusic::Input( const InputEventPlus &input )
|
||||
bool ScreenNetSelectMusic::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( !m_bAllowInput || IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
if( input.type == IET_RELEASE )
|
||||
{
|
||||
m_MusicWheel.Move(0);
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
if( input.type != IET_FIRST_PRESS && input.type != IET_REPEAT )
|
||||
return;
|
||||
return false;
|
||||
|
||||
bool bHoldingCtrl =
|
||||
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL)) ||
|
||||
@@ -113,6 +113,7 @@ void ScreenNetSelectMusic::Input( const InputEventPlus &input )
|
||||
MakeUpper( &c, 1 );
|
||||
|
||||
// Ctrl+[A-Z] to go to that letter of the alphabet
|
||||
bool handled = false;
|
||||
if( bHoldingCtrl && ( c >= 'A' ) && ( c <= 'Z' ) )
|
||||
{
|
||||
SortOrder so = GAMESTATE->m_SortOrder;
|
||||
@@ -130,9 +131,10 @@ void ScreenNetSelectMusic::Input( const InputEventPlus &input )
|
||||
m_MusicWheel.ChangeSort( so );
|
||||
m_MusicWheel.SetOpenSection( ssprintf("%c", c ) );
|
||||
m_MusicWheel.Move(+1);
|
||||
handled = true;
|
||||
}
|
||||
|
||||
ScreenNetSelectBase::Input( input );
|
||||
return ScreenNetSelectBase::Input( input ) || handled;
|
||||
}
|
||||
|
||||
void ScreenNetSelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
||||
@@ -301,7 +303,7 @@ bool ScreenNetSelectMusic::LeftAndRightPressed( const PlayerNumber pn )
|
||||
&& INPUTMAPPER->IsBeingPressed( GAME_BUTTON_RIGHT, pn );
|
||||
}
|
||||
|
||||
void ScreenNetSelectMusic::MenuLeft( const InputEventPlus &input )
|
||||
bool ScreenNetSelectMusic::MenuLeft( const InputEventPlus &input )
|
||||
{
|
||||
PlayerNumber pn = input.pn;
|
||||
|
||||
@@ -309,9 +311,10 @@ void ScreenNetSelectMusic::MenuLeft( const InputEventPlus &input )
|
||||
m_MusicWheel.ChangeSort( SORT_MODE_MENU );
|
||||
else
|
||||
m_MusicWheel.Move( -1 );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenNetSelectMusic::MenuRight( const InputEventPlus &input )
|
||||
bool ScreenNetSelectMusic::MenuRight( const InputEventPlus &input )
|
||||
{
|
||||
PlayerNumber pn = input.pn;
|
||||
|
||||
@@ -319,16 +322,18 @@ void ScreenNetSelectMusic::MenuRight( const InputEventPlus &input )
|
||||
m_MusicWheel.ChangeSort( SORT_MODE_MENU );
|
||||
else
|
||||
m_MusicWheel.Move( +1 );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenNetSelectMusic::MenuUp( const InputEventPlus &input )
|
||||
bool ScreenNetSelectMusic::MenuUp( const InputEventPlus &input )
|
||||
{
|
||||
NSMAN->ReportNSSOnOff(3);
|
||||
GAMESTATE->m_EditMode = EditMode_Full;
|
||||
SCREENMAN->AddNewScreenToTop( PLAYER_OPTIONS_SCREEN, SM_BackFromPlayerOptions );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenNetSelectMusic::MenuDown( const InputEventPlus &input )
|
||||
bool ScreenNetSelectMusic::MenuDown( const InputEventPlus &input )
|
||||
{
|
||||
/* Tricky: If we have a player on player 2, and there is only player 2,
|
||||
* allow them to use player 1's controls to change their difficulty. */
|
||||
@@ -341,7 +346,7 @@ void ScreenNetSelectMusic::MenuDown( const InputEventPlus &input )
|
||||
pn = PLAYER_2;
|
||||
|
||||
if( GAMESTATE->m_pCurSong == NULL )
|
||||
return;
|
||||
return false;
|
||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||
vector <Steps *> MultiSteps;
|
||||
MultiSteps = GAMESTATE->m_pCurSong->GetStepsByStepsType( st );
|
||||
@@ -383,22 +388,23 @@ void ScreenNetSelectMusic::MenuDown( const InputEventPlus &input )
|
||||
}
|
||||
UpdateDifficulties( pn );
|
||||
GAMESTATE->m_PreferredDifficulty[pn].Set( m_DC[pn] );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenNetSelectMusic::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenNetSelectMusic::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
bool bResult = m_MusicWheel.Select();
|
||||
|
||||
if( !bResult )
|
||||
return;
|
||||
return true;
|
||||
|
||||
if( m_MusicWheel.GetSelectedType() != WheelItemDataType_Song )
|
||||
return;
|
||||
return true;
|
||||
|
||||
Song * pSong = m_MusicWheel.GetSelectedSong();
|
||||
|
||||
if( pSong == NULL )
|
||||
return;
|
||||
return false;
|
||||
|
||||
GAMESTATE->m_pCurSong.Set( pSong );
|
||||
|
||||
@@ -412,14 +418,16 @@ void ScreenNetSelectMusic::MenuStart( const InputEventPlus &input )
|
||||
}
|
||||
else
|
||||
StartSelectedSong();
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenNetSelectMusic::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenNetSelectMusic::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
SOUND->StopMusic();
|
||||
TweenOffScreen();
|
||||
|
||||
Cancel( SM_GoToPrevScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenNetSelectMusic::TweenOffScreen()
|
||||
|
||||
@@ -18,18 +18,18 @@ class ScreenNetSelectMusic : public ScreenNetSelectBase
|
||||
public:
|
||||
virtual void Init();
|
||||
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
|
||||
void StartSelectedSong();
|
||||
|
||||
protected:
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual void MenuLeft( const InputEventPlus &input );
|
||||
virtual void MenuRight( const InputEventPlus &input );
|
||||
virtual void MenuUp( const InputEventPlus &input );
|
||||
virtual void MenuDown( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuBack( const InputEventPlus &input );
|
||||
virtual bool MenuLeft( const InputEventPlus &input );
|
||||
virtual bool MenuRight( const InputEventPlus &input );
|
||||
virtual bool MenuUp( const InputEventPlus &input );
|
||||
virtual bool MenuDown( const InputEventPlus &input );
|
||||
bool LeftAndRightPressed( const PlayerNumber pn );
|
||||
|
||||
virtual void Update( float fDeltaTime );
|
||||
|
||||
@@ -107,7 +107,7 @@ void ScreenNetworkOptions::HandleScreenMessage( const ScreenMessage SM )
|
||||
ScreenOptions::HandleScreenMessage( SM );
|
||||
}
|
||||
|
||||
void ScreenNetworkOptions::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenNetworkOptions::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
switch( GetCurrentRow() )
|
||||
{
|
||||
@@ -122,13 +122,13 @@ void ScreenNetworkOptions::MenuStart( const InputEventPlus &input )
|
||||
SCREENMAN->SystemMessage( DISCONNECTED );
|
||||
UpdateConnectStatus( );
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
case PO_SCOREBOARD:
|
||||
if (m_pRows[PO_SCOREBOARD]->GetOneSharedSelection() == NO_SCOREBOARD_ON)
|
||||
PREFSMAN->m_bEnableScoreboard.Set(true);
|
||||
else
|
||||
PREFSMAN->m_bEnableScoreboard.Set(false);
|
||||
break;
|
||||
return true;
|
||||
/*
|
||||
case NetworkOptionRow::PO_SERVERS:
|
||||
if ( !AllServers.empty() )
|
||||
@@ -143,10 +143,10 @@ void ScreenNetworkOptions::MenuStart( const InputEventPlus &input )
|
||||
//If the server list is empty, keep passing the message on so exit works
|
||||
ScreenOptions::MenuStart( input );
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
*/
|
||||
default:
|
||||
ScreenOptions::MenuStart( input );
|
||||
return ScreenOptions::MenuStart( input );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ public:
|
||||
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
|
||||
private:
|
||||
void ImportOptions( int iRow, const vector<PlayerNumber> &vpns );
|
||||
|
||||
+22
-16
@@ -492,7 +492,7 @@ void ScreenOptions::Update( float fDeltaTime )
|
||||
ScreenWithMenuElements::Update( fDeltaTime );
|
||||
}
|
||||
|
||||
void ScreenOptions::Input( const InputEventPlus &input )
|
||||
bool ScreenOptions::Input( const InputEventPlus &input )
|
||||
{
|
||||
// HACK: This screen eats mouse inputs if we don't check for them first.
|
||||
bool mouse_evt = false;
|
||||
@@ -503,17 +503,16 @@ void ScreenOptions::Input( const InputEventPlus &input )
|
||||
}
|
||||
if (mouse_evt)
|
||||
{
|
||||
ScreenWithMenuElements::Input(input);
|
||||
return;
|
||||
return ScreenWithMenuElements::Input(input);
|
||||
}
|
||||
|
||||
/* Allow input when transitioning in (m_In.IsTransitioning()), but ignore it
|
||||
* when we're transitioning out. */
|
||||
if( m_Cancel.IsTransitioning() || m_Out.IsTransitioning() || m_fLockInputSecs > 0 )
|
||||
return;
|
||||
return false;
|
||||
|
||||
if( !GAMESTATE->IsHumanPlayer(input.pn) )
|
||||
return;
|
||||
return false;
|
||||
|
||||
if( input.type == IET_RELEASE )
|
||||
{
|
||||
@@ -532,7 +531,7 @@ void ScreenOptions::Input( const InputEventPlus &input )
|
||||
}
|
||||
|
||||
// default input handler
|
||||
Screen::Input( input );
|
||||
return Screen::Input( input );
|
||||
}
|
||||
|
||||
void ScreenOptions::HandleScreenMessage( const ScreenMessage SM )
|
||||
@@ -766,9 +765,10 @@ void ScreenOptions::AfterChangeValueOrRow( PlayerNumber pn )
|
||||
}
|
||||
|
||||
|
||||
void ScreenOptions::MenuBack( const InputEventPlus & )
|
||||
bool ScreenOptions::MenuBack( const InputEventPlus & )
|
||||
{
|
||||
Cancel( SM_GoToPrevScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ScreenOptions::AllAreOnLastRow() const
|
||||
@@ -781,7 +781,7 @@ bool ScreenOptions::AllAreOnLastRow() const
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenOptions::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenOptions::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
PlayerNumber pn = input.pn;
|
||||
switch( input.type )
|
||||
@@ -790,10 +790,10 @@ void ScreenOptions::MenuStart( const InputEventPlus &input )
|
||||
m_bGotAtLeastOneStartPressed[pn] = true;
|
||||
break;
|
||||
case IET_RELEASE:
|
||||
return; // ignore
|
||||
return false; // ignore
|
||||
default: // repeat type
|
||||
if( !m_bGotAtLeastOneStartPressed[pn] )
|
||||
return; // don't allow repeat
|
||||
return false; // don't allow repeat
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -811,13 +811,14 @@ void ScreenOptions::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
if( MoveRowRelative(pn, -1, input.type != IET_FIRST_PRESS) )
|
||||
m_SoundPrevRow.Play();
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
|
||||
this->ProcessMenuStart( input );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenOptions::ProcessMenuStart( const InputEventPlus &input )
|
||||
@@ -1244,7 +1245,7 @@ bool ScreenOptions::MoveRowAbsolute( PlayerNumber pn, int iRow )
|
||||
return bChanged;
|
||||
}
|
||||
|
||||
void ScreenOptions::MenuLeft( const InputEventPlus &input )
|
||||
bool ScreenOptions::MenuLeft( const InputEventPlus &input )
|
||||
{
|
||||
if( m_OptionsNavigation == NAV_THREE_KEY_ALT )
|
||||
MenuUpDown( input, -1 );
|
||||
@@ -1253,9 +1254,10 @@ void ScreenOptions::MenuLeft( const InputEventPlus &input )
|
||||
|
||||
PlayerNumber pn = input.pn;
|
||||
MESSAGEMAN->Broadcast( (MessageID)(Message_MenuLeftP1+pn) );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenOptions::MenuRight( const InputEventPlus &input )
|
||||
bool ScreenOptions::MenuRight( const InputEventPlus &input )
|
||||
{
|
||||
if( m_OptionsNavigation == NAV_THREE_KEY_ALT )
|
||||
MenuUpDown( input, +1 );
|
||||
@@ -1264,25 +1266,29 @@ void ScreenOptions::MenuRight( const InputEventPlus &input )
|
||||
|
||||
PlayerNumber pn = input.pn;
|
||||
MESSAGEMAN->Broadcast( (MessageID)(Message_MenuRightP1+pn) );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenOptions::MenuUp( const InputEventPlus &input )
|
||||
bool ScreenOptions::MenuUp( const InputEventPlus &input )
|
||||
{
|
||||
MenuUpDown( input, -1 );
|
||||
PlayerNumber pn = input.pn;
|
||||
MESSAGEMAN->Broadcast( (MessageID)(Message_MenuUpP1+pn) );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenOptions::MenuDown( const InputEventPlus &input )
|
||||
bool ScreenOptions::MenuDown( const InputEventPlus &input )
|
||||
{
|
||||
MenuUpDown( input, +1 );
|
||||
PlayerNumber pn = input.pn;
|
||||
MESSAGEMAN->Broadcast( (MessageID)(Message_MenuDownP1+pn) );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenOptions::MenuSelect( const InputEventPlus &input )
|
||||
bool ScreenOptions::MenuSelect( const InputEventPlus &input )
|
||||
{
|
||||
MenuUpDown( input, -1 );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenOptions::MenuUpDown( const InputEventPlus &input, int iDir )
|
||||
|
||||
+8
-8
@@ -40,7 +40,7 @@ public:
|
||||
void InitMenu( const vector<OptionRowHandler*> &vHands );
|
||||
virtual ~ScreenOptions();
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
|
||||
virtual void TweenOnScreen();
|
||||
@@ -84,14 +84,14 @@ protected:
|
||||
virtual void AfterChangeRow( PlayerNumber pn );
|
||||
virtual void AfterChangeValueOrRow( PlayerNumber pn );
|
||||
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuBack( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
virtual void ProcessMenuStart( const InputEventPlus &input );
|
||||
virtual void MenuLeft( const InputEventPlus &input );
|
||||
virtual void MenuRight( const InputEventPlus &input );
|
||||
virtual void MenuUp( const InputEventPlus &input );
|
||||
virtual void MenuDown( const InputEventPlus &input );
|
||||
virtual void MenuSelect( const InputEventPlus &input );
|
||||
virtual bool MenuLeft( const InputEventPlus &input );
|
||||
virtual bool MenuRight( const InputEventPlus &input );
|
||||
virtual bool MenuUp( const InputEventPlus &input );
|
||||
virtual bool MenuDown( const InputEventPlus &input );
|
||||
virtual bool MenuSelect( const InputEventPlus &input );
|
||||
virtual void MenuUpDown( const InputEventPlus &input, int iDir ); // iDir == -1 or iDir == +1
|
||||
|
||||
int GetCurrentRow( PlayerNumber pn = PLAYER_1 ) const { return m_iCurrentRow[pn]; }
|
||||
|
||||
@@ -203,12 +203,13 @@ void ScreenOptionsManageCourses::AfterChangeRow( PlayerNumber pn )
|
||||
ScreenOptions::AfterChangeRow( pn );
|
||||
}
|
||||
|
||||
void ScreenOptionsManageCourses::MenuSelect( const InputEventPlus &input )
|
||||
bool ScreenOptionsManageCourses::MenuSelect( const InputEventPlus &input )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return;
|
||||
return false;
|
||||
SetNextCombination();
|
||||
m_soundDifficultyChanged.Play();
|
||||
return true;
|
||||
}
|
||||
|
||||
static LocalizedString YOU_HAVE_MAX( "ScreenOptionsManageCourses", "You have %d, the maximum number allowed." );
|
||||
|
||||
@@ -13,7 +13,7 @@ public:
|
||||
void Init();
|
||||
virtual void BeginScreen();
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
virtual void MenuSelect( const InputEventPlus &input );
|
||||
virtual bool MenuSelect( const InputEventPlus &input );
|
||||
|
||||
protected:
|
||||
virtual void ImportOptions( int iRow, const vector<PlayerNumber> &vpns );
|
||||
|
||||
+18
-12
@@ -159,7 +159,7 @@ void ScreenPackages::Update( float fDeltaTime )
|
||||
}
|
||||
|
||||
static LocalizedString ENTER_URL ("ScreenPackages","Enter URL");
|
||||
void ScreenPackages::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenPackages::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
if ( m_iDLorLST == 1 )
|
||||
{
|
||||
@@ -169,12 +169,13 @@ void ScreenPackages::MenuStart( const InputEventPlus &input )
|
||||
EnterURL( m_Links[m_iLinksPos] );
|
||||
}
|
||||
ScreenWithMenuElements::MenuStart( input );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenPackages::MenuUp( const InputEventPlus &input )
|
||||
bool ScreenPackages::MenuUp( const InputEventPlus &input )
|
||||
{
|
||||
if ( m_bIsDownloading )
|
||||
return;
|
||||
return false;
|
||||
if ( m_iDLorLST == 0)
|
||||
{
|
||||
if ( m_iPackagesPos > 0)
|
||||
@@ -192,12 +193,13 @@ void ScreenPackages::MenuUp( const InputEventPlus &input )
|
||||
}
|
||||
}
|
||||
ScreenWithMenuElements::MenuUp( input );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenPackages::MenuDown( const InputEventPlus &input )
|
||||
bool ScreenPackages::MenuDown( const InputEventPlus &input )
|
||||
{
|
||||
if ( m_bIsDownloading )
|
||||
return;
|
||||
return false;
|
||||
|
||||
if ( m_iDLorLST == 0)
|
||||
{
|
||||
@@ -216,14 +218,15 @@ void ScreenPackages::MenuDown( const InputEventPlus &input )
|
||||
}
|
||||
}
|
||||
ScreenWithMenuElements::MenuDown( input );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenPackages::MenuLeft( const InputEventPlus &input )
|
||||
bool ScreenPackages::MenuLeft( const InputEventPlus &input )
|
||||
{
|
||||
if ( m_bIsDownloading )
|
||||
return;
|
||||
return false;
|
||||
if ( !m_bCanDL )
|
||||
return;
|
||||
return false;
|
||||
|
||||
/*
|
||||
m_sprExistingBG.StopTweening();
|
||||
@@ -243,12 +246,13 @@ void ScreenPackages::MenuLeft( const InputEventPlus &input )
|
||||
COMMAND( m_sprWebBG, "Away" );
|
||||
}
|
||||
ScreenWithMenuElements::MenuLeft( input );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenPackages::MenuRight( const InputEventPlus &input )
|
||||
bool ScreenPackages::MenuRight( const InputEventPlus &input )
|
||||
{
|
||||
if ( m_bIsDownloading )
|
||||
return;
|
||||
return false;
|
||||
|
||||
// Huh?
|
||||
//MenuLeft( input );
|
||||
@@ -267,21 +271,23 @@ void ScreenPackages::MenuRight( const InputEventPlus &input )
|
||||
}
|
||||
|
||||
ScreenWithMenuElements::MenuRight( input );
|
||||
return true;
|
||||
}
|
||||
|
||||
static LocalizedString DOWNLOAD_CANCELLED( "ScreenPackages", "Download cancelled." );
|
||||
void ScreenPackages::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenPackages::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
if ( m_bIsDownloading )
|
||||
{
|
||||
SCREENMAN->SystemMessage( DOWNLOAD_CANCELLED );
|
||||
CancelDownload( );
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
TweenOffScreen();
|
||||
Cancel( SM_GoToPrevScreen );
|
||||
ScreenWithMenuElements::MenuBack( input );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenPackages::TweenOffScreen( )
|
||||
|
||||
@@ -18,12 +18,12 @@ public:
|
||||
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual void MenuUp( const InputEventPlus &input );
|
||||
virtual void MenuDown( const InputEventPlus &input );
|
||||
virtual void MenuLeft( const InputEventPlus &input );
|
||||
virtual void MenuRight( const InputEventPlus &input );
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuUp( const InputEventPlus &input );
|
||||
virtual bool MenuDown( const InputEventPlus &input );
|
||||
virtual bool MenuLeft( const InputEventPlus &input );
|
||||
virtual bool MenuRight( const InputEventPlus &input );
|
||||
virtual bool MenuBack( const InputEventPlus &input );
|
||||
|
||||
virtual void TweenOffScreen( );
|
||||
virtual void Update(float f);
|
||||
|
||||
@@ -24,16 +24,17 @@ void ScreenPackagesSSC::HandleScreenMessage( const ScreenMessage SM )
|
||||
ScreenWithMenuElements::HandleScreenMessage( SM );
|
||||
}
|
||||
|
||||
void ScreenPackagesSSC::Input( const InputEventPlus &input )
|
||||
bool ScreenPackagesSSC::Input( const InputEventPlus &input )
|
||||
{
|
||||
ScreenWithMenuElements::Input( input );
|
||||
return ScreenWithMenuElements::Input( input );
|
||||
}
|
||||
|
||||
void ScreenPackagesSSC::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenPackagesSSC::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
TweenOffScreen();
|
||||
Cancel( SM_GoToPrevScreen );
|
||||
ScreenWithMenuElements::MenuBack( input );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenPackagesSSC::Update( float fDeltaTime )
|
||||
|
||||
@@ -16,8 +16,8 @@ public:
|
||||
virtual void Init();
|
||||
|
||||
/* Input stuff */
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual bool MenuBack( const InputEventPlus &input );
|
||||
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
virtual void Update(float f);
|
||||
|
||||
@@ -57,8 +57,10 @@ void ScreenPlayerOptions::BeginScreen()
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenPlayerOptions::Input( const InputEventPlus &input )
|
||||
bool ScreenPlayerOptions::Input( const InputEventPlus &input )
|
||||
{
|
||||
bool bHandled = false;
|
||||
|
||||
if( m_bAskOptionsMessage &&
|
||||
input.type == IET_FIRST_PRESS &&
|
||||
!m_In.IsTransitioning() &&
|
||||
@@ -69,6 +71,7 @@ void ScreenPlayerOptions::Input( const InputEventPlus &input )
|
||||
m_bGoToOptions = true;
|
||||
this->PlayCommand( "GoToOptions" );
|
||||
SCREENMAN->PlayStartSound();
|
||||
bHandled = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,9 +93,10 @@ void ScreenPlayerOptions::Input( const InputEventPlus &input )
|
||||
this->UpdateDisqualified( r, pn );
|
||||
m_pRows[r]->SetChoiceInRowWithFocus( pn, iOldFocus );
|
||||
}
|
||||
bHandled = true;
|
||||
}
|
||||
|
||||
ScreenOptionsMaster::Input( input );
|
||||
bHandled = ScreenOptionsMaster::Input( input ) || bHandled;
|
||||
|
||||
// UGLY: Update m_Disqualified whenever Start is pressed
|
||||
if( GAMESTATE->IsHumanPlayer(pn) && input.MenuI == GAME_BUTTON_START )
|
||||
@@ -100,6 +104,7 @@ void ScreenPlayerOptions::Input( const InputEventPlus &input )
|
||||
int row = m_iCurrentRow[pn];
|
||||
UpdateDisqualified( row, pn );
|
||||
}
|
||||
return bHandled;
|
||||
}
|
||||
|
||||
void ScreenPlayerOptions::HandleScreenMessage( const ScreenMessage SM )
|
||||
|
||||
@@ -11,7 +11,7 @@ public:
|
||||
virtual void Init();
|
||||
virtual void BeginScreen();
|
||||
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
bool GetGoToOptions() const { return m_bGoToOptions; }
|
||||
|
||||
|
||||
@@ -19,8 +19,9 @@ void ScreenProfileLoad::BeginScreen()
|
||||
ScreenWithMenuElements::BeginScreen();
|
||||
}
|
||||
|
||||
void ScreenProfileLoad::Input( const InputEventPlus &input )
|
||||
bool ScreenProfileLoad::Input( const InputEventPlus &input )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void ScreenProfileLoad::Continue()
|
||||
|
||||
@@ -8,7 +8,7 @@ class ScreenProfileLoad: public ScreenWithMenuElements
|
||||
public:
|
||||
virtual void Init();
|
||||
virtual void BeginScreen();
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
void Continue();
|
||||
|
||||
virtual void PushSelf( lua_State *L );
|
||||
|
||||
@@ -10,8 +10,9 @@ void ScreenProfileSave::BeginScreen()
|
||||
ScreenWithMenuElements::BeginScreen();
|
||||
}
|
||||
|
||||
void ScreenProfileSave::Input( const InputEventPlus &input )
|
||||
bool ScreenProfileSave::Input( const InputEventPlus &input )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void ScreenProfileSave::Continue()
|
||||
|
||||
@@ -7,7 +7,7 @@ class ScreenProfileSave: public ScreenWithMenuElements
|
||||
{
|
||||
public:
|
||||
virtual void BeginScreen();
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
void Continue();
|
||||
|
||||
virtual void PushSelf( lua_State *L );
|
||||
|
||||
+23
-15
@@ -106,29 +106,27 @@ void ScreenPrompt::BeginScreen()
|
||||
PositionCursor();
|
||||
}
|
||||
|
||||
void ScreenPrompt::Input( const InputEventPlus &input )
|
||||
bool ScreenPrompt::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
if( input.type == IET_RELEASE )
|
||||
return;
|
||||
return false;
|
||||
|
||||
if( input.DeviceI.device==DEVICE_KEYBOARD )
|
||||
{
|
||||
switch( input.DeviceI.button )
|
||||
{
|
||||
case KEY_LEFT:
|
||||
this->MenuLeft( input );
|
||||
return;
|
||||
return this->MenuLeft( input );
|
||||
case KEY_RIGHT:
|
||||
this->MenuRight( input );
|
||||
return;
|
||||
return this->MenuRight( input );
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
ScreenWithMenuElements::Input( input );
|
||||
return ScreenWithMenuElements::Input( input );
|
||||
}
|
||||
|
||||
bool ScreenPrompt::CanGoRight()
|
||||
@@ -157,30 +155,39 @@ void ScreenPrompt::Change( int dir )
|
||||
m_sndChange.Play();
|
||||
}
|
||||
|
||||
void ScreenPrompt::MenuLeft( const InputEventPlus &input )
|
||||
bool ScreenPrompt::MenuLeft( const InputEventPlus &input )
|
||||
{
|
||||
if( CanGoLeft() )
|
||||
{
|
||||
Change( -1 );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void ScreenPrompt::MenuRight( const InputEventPlus &input )
|
||||
bool ScreenPrompt::MenuRight( const InputEventPlus &input )
|
||||
{
|
||||
if( CanGoRight() )
|
||||
{
|
||||
Change( +1 );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void ScreenPrompt::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenPrompt::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
if( m_Out.IsTransitioning() || m_Cancel.IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
End( false );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenPrompt::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenPrompt::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
if( m_Out.IsTransitioning() || m_Cancel.IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
switch( g_PromptType )
|
||||
{
|
||||
@@ -190,8 +197,9 @@ void ScreenPrompt::MenuBack( const InputEventPlus &input )
|
||||
break;
|
||||
case PROMPT_YES_NO_CANCEL:
|
||||
End( true );
|
||||
break;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void ScreenPrompt::End( bool bCancelled )
|
||||
|
||||
+5
-5
@@ -30,7 +30,7 @@ public:
|
||||
|
||||
virtual void Init();
|
||||
virtual void BeginScreen();
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
|
||||
static PromptAnswer s_LastAnswer;
|
||||
static bool s_bCancelledLast;
|
||||
@@ -42,10 +42,10 @@ protected:
|
||||
bool CanGoLeft() { return m_Answer > 0; }
|
||||
bool CanGoRight();
|
||||
void Change( int dir );
|
||||
void MenuLeft( const InputEventPlus &input );
|
||||
void MenuRight( const InputEventPlus &input );
|
||||
void MenuBack( const InputEventPlus &input );
|
||||
void MenuStart( const InputEventPlus &input );
|
||||
bool MenuLeft( const InputEventPlus &input );
|
||||
bool MenuRight( const InputEventPlus &input );
|
||||
bool MenuBack( const InputEventPlus &input );
|
||||
bool MenuStart( const InputEventPlus &input );
|
||||
|
||||
virtual void End( bool bCancelled );
|
||||
void PositionCursor();
|
||||
|
||||
@@ -185,9 +185,9 @@ void ScreenSMOnlineLogin::HandleScreenMessage(const ScreenMessage SM)
|
||||
ScreenOptions::HandleScreenMessage(SM);
|
||||
}
|
||||
|
||||
void ScreenSMOnlineLogin::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenSMOnlineLogin::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
ScreenOptions::MenuStart( input );
|
||||
return ScreenOptions::MenuStart( input );
|
||||
}
|
||||
|
||||
RString ScreenSMOnlineLogin::GetSelectedProfileID()
|
||||
|
||||
@@ -8,7 +8,7 @@ class ScreenSMOnlineLogin : public ScreenOptions
|
||||
public:
|
||||
virtual void Init();
|
||||
virtual void HandleScreenMessage(const ScreenMessage SM);
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
void SendLogin( RString sPassword );
|
||||
|
||||
private:
|
||||
|
||||
@@ -22,9 +22,9 @@ void ScreenSandbox::HandleScreenMessage( const ScreenMessage SM )
|
||||
Screen::HandleScreenMessage( SM );
|
||||
}
|
||||
|
||||
void ScreenSandbox::Input( const InputEventPlus &input )
|
||||
bool ScreenSandbox::Input( const InputEventPlus &input )
|
||||
{
|
||||
Screen::Input( input );
|
||||
return Screen::Input( input );
|
||||
}
|
||||
|
||||
void ScreenSandbox::Update( float fDeltaTime )
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
class ScreenSandbox : public Screen
|
||||
{
|
||||
public:
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
virtual void Update(float f);
|
||||
virtual void DrawPrimitives();
|
||||
|
||||
@@ -93,7 +93,7 @@ void ScreenSelect::Update( float fDelta )
|
||||
ScreenWithMenuElements::Update( fDelta );
|
||||
}
|
||||
|
||||
void ScreenSelect::Input( const InputEventPlus &input )
|
||||
bool ScreenSelect::Input( const InputEventPlus &input )
|
||||
{
|
||||
// LOG->Trace( "ScreenSelect::Input()" );
|
||||
|
||||
@@ -114,14 +114,14 @@ void ScreenSelect::Input( const InputEventPlus &input )
|
||||
SCREENMAN->PlayStartSound();
|
||||
|
||||
if( !ALLOW_DISABLED_PLAYER_INPUT )
|
||||
return; // don't let the screen handle the MENU_START press
|
||||
return false; // don't let the screen handle the MENU_START press
|
||||
}
|
||||
|
||||
if( !GAMESTATE->IsPlayerEnabled(input.pn) )
|
||||
{
|
||||
// block input of disabled players
|
||||
if( !ALLOW_DISABLED_PLAYER_INPUT )
|
||||
return;
|
||||
return false;
|
||||
|
||||
/* Never allow a START press by a player that's still not joined, even if
|
||||
* ALLOW_DISABLED_PLAYER_INPUT would allow other types of input. If we
|
||||
@@ -129,10 +129,10 @@ void ScreenSelect::Input( const InputEventPlus &input )
|
||||
* players joined (eg. if ScreenTitleJoin is started in pay with no
|
||||
* credits). */
|
||||
if( input.MenuI == GAME_BUTTON_START )
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
ScreenWithMenuElements::Input( input ); // default input handler
|
||||
return ScreenWithMenuElements::Input( input ); // default input handler
|
||||
}
|
||||
|
||||
void ScreenSelect::HandleScreenMessage( const ScreenMessage SM )
|
||||
@@ -195,9 +195,10 @@ void ScreenSelect::HandleMessage( const Message &msg )
|
||||
ScreenWithMenuElements::HandleMessage( msg );
|
||||
}
|
||||
|
||||
void ScreenSelect::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenSelect::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
Cancel( SM_GoToPrevScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+2
-2
@@ -13,11 +13,11 @@ public:
|
||||
virtual ~ScreenSelect();
|
||||
|
||||
virtual void Update( float fDelta );
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
virtual void HandleMessage( const Message &msg );
|
||||
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual bool MenuBack( const InputEventPlus &input );
|
||||
|
||||
protected:
|
||||
virtual int GetSelectionIndex( PlayerNumber pn ) = 0;
|
||||
|
||||
@@ -157,14 +157,14 @@ ScreenSelectCharacter::~ScreenSelectCharacter()
|
||||
}
|
||||
|
||||
|
||||
void ScreenSelectCharacter::Input( const InputEventPlus &input )
|
||||
bool ScreenSelectCharacter::Input( const InputEventPlus &input )
|
||||
{
|
||||
LOG->Trace( "ScreenSelectCharacter::Input()" );
|
||||
|
||||
if( IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
ScreenWithMenuElements::Input( input ); // default input handler
|
||||
return ScreenWithMenuElements::Input( input ); // default input handler
|
||||
}
|
||||
|
||||
void ScreenSelectCharacter::HandleScreenMessage( const ScreenMessage SM )
|
||||
@@ -273,25 +273,27 @@ void ScreenSelectCharacter::AfterValueChange( PlayerNumber pn )
|
||||
}
|
||||
|
||||
|
||||
void ScreenSelectCharacter::MenuLeft( const InputEventPlus &input )
|
||||
bool ScreenSelectCharacter::MenuLeft( const InputEventPlus &input )
|
||||
{
|
||||
MenuUp( input );
|
||||
return MenuUp( input );
|
||||
}
|
||||
|
||||
void ScreenSelectCharacter::MenuRight( const InputEventPlus &input )
|
||||
bool ScreenSelectCharacter::MenuRight( const InputEventPlus &input )
|
||||
{
|
||||
MenuDown( input );
|
||||
return MenuDown( input );
|
||||
}
|
||||
|
||||
void ScreenSelectCharacter::MenuUp( const InputEventPlus &input )
|
||||
bool ScreenSelectCharacter::MenuUp( const InputEventPlus &input )
|
||||
{
|
||||
Move( input.pn, -1 );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void ScreenSelectCharacter::MenuDown( const InputEventPlus &input )
|
||||
bool ScreenSelectCharacter::MenuDown( const InputEventPlus &input )
|
||||
{
|
||||
Move( input.pn, +1 );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenSelectCharacter::Move( PlayerNumber pn, int deltaValue )
|
||||
@@ -322,9 +324,10 @@ bool ScreenSelectCharacter::AllAreFinishedChoosing() const
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenSelectCharacter::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenSelectCharacter::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
MakeSelection( input.pn );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenSelectCharacter::MakeSelection( PlayerNumber pn )
|
||||
@@ -364,9 +367,10 @@ void ScreenSelectCharacter::MakeSelection( PlayerNumber pn )
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenSelectCharacter::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenSelectCharacter::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
Cancel( SM_GoToPrevScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenSelectCharacter::TweenOffScreen()
|
||||
|
||||
@@ -19,15 +19,15 @@ public:
|
||||
virtual void Init();
|
||||
virtual ~ScreenSelectCharacter();
|
||||
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
|
||||
void MenuLeft( const InputEventPlus &input );
|
||||
void MenuRight( const InputEventPlus &input );
|
||||
void MenuUp( const InputEventPlus &input );
|
||||
void MenuDown( const InputEventPlus &input );
|
||||
void MenuStart( const InputEventPlus &input );
|
||||
void MenuBack( const InputEventPlus &input );
|
||||
bool MenuLeft( const InputEventPlus &input );
|
||||
bool MenuRight( const InputEventPlus &input );
|
||||
bool MenuUp( const InputEventPlus &input );
|
||||
bool MenuDown( const InputEventPlus &input );
|
||||
bool MenuStart( const InputEventPlus &input );
|
||||
bool MenuBack( const InputEventPlus &input );
|
||||
|
||||
void TweenOffScreen();
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ void ScreenSelectLanguage::BeginScreen()
|
||||
ScreenSelectMaster::BeginScreen();
|
||||
}
|
||||
|
||||
void ScreenSelectLanguage::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenSelectLanguage::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
int iIndex = this->GetSelectionIndex( input.pn );
|
||||
RString sLangCode = m_aGameCommands[iIndex].m_sName;
|
||||
@@ -52,11 +52,12 @@ void ScreenSelectLanguage::MenuStart( const InputEventPlus &input )
|
||||
|
||||
m_soundStart.Play();
|
||||
this->PostScreenMessage( SM_BeginFadingOut, 0 );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenSelectLanguage::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenSelectLanguage::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
return; // ignore the press
|
||||
return false; // ignore the press
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -10,8 +10,8 @@ public:
|
||||
virtual void Init();
|
||||
virtual RString GetDefaultChoice();
|
||||
virtual void BeginScreen();
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuBack( const InputEventPlus &input );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+38
-29
@@ -408,19 +408,19 @@ try_again:
|
||||
return ChangeSelection( pn, dir, iSwitchToIndex );
|
||||
}
|
||||
|
||||
void ScreenSelectMaster::MenuLeft( const InputEventPlus &input )
|
||||
bool ScreenSelectMaster::MenuLeft( const InputEventPlus &input )
|
||||
{
|
||||
PlayerNumber pn = input.pn;
|
||||
if( m_fLockInputSecs > 0 || m_bChosen[pn] )
|
||||
return;
|
||||
return false;
|
||||
if( input.type == IET_RELEASE )
|
||||
return;
|
||||
return false;
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
{
|
||||
if( !ALLOW_REPEATING_INPUT )
|
||||
return;
|
||||
return false;
|
||||
if( m_TrackingRepeatingInput != input.MenuI )
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if( Move(pn, MenuDir_Left) )
|
||||
{
|
||||
@@ -434,22 +434,24 @@ void ScreenSelectMaster::MenuLeft( const InputEventPlus &input )
|
||||
{
|
||||
m_bDoubleChoice[pn] = false; // player has cancelled their selection
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void ScreenSelectMaster::MenuRight( const InputEventPlus &input )
|
||||
bool ScreenSelectMaster::MenuRight( const InputEventPlus &input )
|
||||
{
|
||||
PlayerNumber pn = input.pn;
|
||||
if( m_fLockInputSecs > 0 || m_bChosen[pn] )
|
||||
return;
|
||||
return false;
|
||||
if( input.type == IET_RELEASE )
|
||||
return;
|
||||
return false;
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
{
|
||||
if( !ALLOW_REPEATING_INPUT )
|
||||
return;
|
||||
return false;
|
||||
if( m_TrackingRepeatingInput != input.MenuI )
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if( Move(pn, MenuDir_Right) )
|
||||
{
|
||||
@@ -463,22 +465,24 @@ void ScreenSelectMaster::MenuRight( const InputEventPlus &input )
|
||||
{
|
||||
m_bDoubleChoice[pn] = false; // player has cancelled their selection
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void ScreenSelectMaster::MenuUp( const InputEventPlus &input )
|
||||
bool ScreenSelectMaster::MenuUp( const InputEventPlus &input )
|
||||
{
|
||||
PlayerNumber pn = input.pn;
|
||||
if( m_fLockInputSecs > 0 || m_bChosen[pn] )
|
||||
return;
|
||||
return false;
|
||||
if( input.type == IET_RELEASE )
|
||||
return;
|
||||
return false;
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
{
|
||||
if( !ALLOW_REPEATING_INPUT )
|
||||
return;
|
||||
return false;
|
||||
if( m_TrackingRepeatingInput != input.MenuI )
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if( Move(pn, MenuDir_Up) )
|
||||
{
|
||||
@@ -492,22 +496,24 @@ void ScreenSelectMaster::MenuUp( const InputEventPlus &input )
|
||||
{
|
||||
m_bDoubleChoice[pn] = false; // player has cancelled their selection
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void ScreenSelectMaster::MenuDown( const InputEventPlus &input )
|
||||
bool ScreenSelectMaster::MenuDown( const InputEventPlus &input )
|
||||
{
|
||||
PlayerNumber pn = input.pn;
|
||||
if( m_fLockInputSecs > 0 || m_bChosen[pn] )
|
||||
return;
|
||||
return false;
|
||||
if( input.type == IET_RELEASE )
|
||||
return;
|
||||
return false;
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
{
|
||||
if( !ALLOW_REPEATING_INPUT )
|
||||
return;
|
||||
return false;
|
||||
if( m_TrackingRepeatingInput != input.MenuI )
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if( Move(pn, MenuDir_Down) )
|
||||
{
|
||||
@@ -521,7 +527,9 @@ void ScreenSelectMaster::MenuDown( const InputEventPlus &input )
|
||||
{
|
||||
m_bDoubleChoice[pn] = false; // player has cancelled their selection
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ScreenSelectMaster::ChangePage( int iNewChoice )
|
||||
@@ -775,29 +783,29 @@ float ScreenSelectMaster::DoMenuStart( PlayerNumber pn )
|
||||
return fSecs;
|
||||
}
|
||||
|
||||
void ScreenSelectMaster::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenSelectMaster::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return;
|
||||
return false;
|
||||
PlayerNumber pn = input.pn;
|
||||
|
||||
if( m_fLockInputSecs > 0 )
|
||||
return;
|
||||
return false;
|
||||
if( SHARED_SELECTION || GetCurrentPage() == PAGE_2 )
|
||||
{
|
||||
// Return if any player has chosen
|
||||
FOREACH_EnabledPlayer( p )
|
||||
{
|
||||
if( m_bChosen[p] )
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if( m_bChosen[pn] )
|
||||
// Return if this player has already chosen
|
||||
return;
|
||||
return false;
|
||||
|
||||
if( !ProcessMenuStart( pn ) )
|
||||
return;
|
||||
return false;
|
||||
|
||||
// double press is enabled and the player hasn't made their first press
|
||||
if(DOUBLE_PRESS_TO_SELECT && !m_bDoubleChoice[pn])
|
||||
@@ -811,7 +819,7 @@ void ScreenSelectMaster::MenuStart( const InputEventPlus &input )
|
||||
vScroll[m_iChoice[pn]]->PlayCommand( "InitialSelection" );
|
||||
}
|
||||
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
const GameCommand &mc = m_aGameCommands[m_iChoice[pn]];
|
||||
@@ -819,7 +827,7 @@ void ScreenSelectMaster::MenuStart( const InputEventPlus &input )
|
||||
/* If no options are playable, then we're just waiting for one to become available.
|
||||
* If any options are playable, then the selection must be playable. */
|
||||
if( !AnyOptionsArePlayable() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo(ssprintf("%s comment %s",m_sName.c_str(), mc.m_sName.c_str())) );
|
||||
|
||||
@@ -835,7 +843,7 @@ void ScreenSelectMaster::MenuStart( const InputEventPlus &input )
|
||||
Message msg( MessageIDToString((MessageID)(Message_MenuStartP1+pn)) );
|
||||
msg.SetParam( "ScreenEmpty", true );
|
||||
MESSAGEMAN->Broadcast( msg );
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
float fSecs = 0;
|
||||
@@ -863,6 +871,7 @@ void ScreenSelectMaster::MenuStart( const InputEventPlus &input )
|
||||
MESSAGEMAN->Broadcast( (MessageID)(Message_MenuStartP1+pn) );
|
||||
this->PostScreenMessage( SM_BeginFadingOut, fSecs );// tell our owner it's time to move on
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* We want all items to always run OnCommand and either GainFocus or LoseFocus
|
||||
|
||||
@@ -30,11 +30,11 @@ public:
|
||||
virtual RString GetDefaultChoice();
|
||||
virtual void BeginScreen();
|
||||
|
||||
virtual void MenuLeft( const InputEventPlus &input );
|
||||
virtual void MenuRight( const InputEventPlus &input );
|
||||
virtual void MenuUp( const InputEventPlus &input );
|
||||
virtual void MenuDown( const InputEventPlus &input );
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuLeft( const InputEventPlus &input );
|
||||
virtual bool MenuRight( const InputEventPlus &input );
|
||||
virtual bool MenuUp( const InputEventPlus &input );
|
||||
virtual bool MenuDown( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
virtual void TweenOnScreen();
|
||||
virtual void TweenOffScreen();
|
||||
|
||||
|
||||
+34
-35
@@ -392,7 +392,7 @@ void ScreenSelectMusic::Update( float fDeltaTime )
|
||||
|
||||
CheckBackgroundRequests( false );
|
||||
}
|
||||
void ScreenSelectMusic::Input( const InputEventPlus &input )
|
||||
bool ScreenSelectMusic::Input( const InputEventPlus &input )
|
||||
{
|
||||
// HACK: This screen eats mouse inputs if we don't check for them first.
|
||||
bool mouse_evt = false;
|
||||
@@ -403,8 +403,7 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
|
||||
}
|
||||
if (mouse_evt)
|
||||
{
|
||||
ScreenWithMenuElements::Input(input);
|
||||
return;
|
||||
return ScreenWithMenuElements::Input(input);
|
||||
}
|
||||
// LOG->Trace( "ScreenSelectMusic::Input()" );
|
||||
|
||||
@@ -416,11 +415,11 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
|
||||
if( input.DeviceI.device == DEVICE_KEYBOARD && input.DeviceI.button == KEY_F9 )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return;
|
||||
return false;
|
||||
PREFSMAN->m_bShowNativeLanguage.Set( !PREFSMAN->m_bShowNativeLanguage );
|
||||
MESSAGEMAN->Broadcast( "DisplayLanguageChanged" );
|
||||
m_MusicWheel.RebuildWheelItems();
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
if( !IsTransitioning() && m_SelectionState != SelectionState_Finalized )
|
||||
@@ -454,20 +453,20 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
|
||||
m_MusicWheel.ChangeSort( so );
|
||||
m_MusicWheel.SetOpenSection( ssprintf("%c", c ) );
|
||||
AfterMusicChange();
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( !input.GameI.IsValid() )
|
||||
return; // don't care
|
||||
return false; // don't care
|
||||
|
||||
// Handle late joining
|
||||
if( m_SelectionState != SelectionState_Finalized && input.MenuI == GAME_BUTTON_START && input.type == IET_FIRST_PRESS && GAMESTATE->JoinInput(input.pn) )
|
||||
return; // don't handle this press again below
|
||||
return true; // don't handle this press again below
|
||||
|
||||
if( !GAMESTATE->IsHumanPlayer(input.pn) )
|
||||
return;
|
||||
return false;
|
||||
|
||||
// Check for "Press START again for options" button press
|
||||
if( m_SelectionState == SelectionState_Finalized &&
|
||||
@@ -476,13 +475,13 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
|
||||
OPTIONS_MENU_AVAILABLE.GetValue() )
|
||||
{
|
||||
if( m_bGoToOptions )
|
||||
return; // got it already
|
||||
return false; // got it already
|
||||
if( !m_bAllowOptionsMenu )
|
||||
return; // not allowed
|
||||
return false; // not allowed
|
||||
|
||||
if( !m_bAllowOptionsMenuRepeat && input.type == IET_REPEAT )
|
||||
{
|
||||
return; // not allowed yet
|
||||
return false; // not allowed yet
|
||||
}
|
||||
|
||||
m_bGoToOptions = true;
|
||||
@@ -495,11 +494,11 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
|
||||
this->ClearMessageQueue( SM_BeginFadingOut );
|
||||
this->PostScreenMessage( SM_BeginFadingOut, this->GetTweenTimeLeft() );
|
||||
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
if( IsTransitioning() )
|
||||
return; // ignore
|
||||
return false; // ignore
|
||||
|
||||
// Handle unselect steps
|
||||
// xxx: select button could conflict with OptionsList here -aj
|
||||
@@ -510,12 +509,12 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
|
||||
msg.SetParam( "Player", input.pn );
|
||||
MESSAGEMAN->Broadcast( msg );
|
||||
m_bStepsChosen[input.pn] = false;
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
if( m_SelectionState == SelectionState_Finalized ||
|
||||
m_bStepsChosen[input.pn] )
|
||||
return; // ignore
|
||||
return false; // ignore
|
||||
|
||||
if( USE_PLAYER_SELECT_MENU )
|
||||
{
|
||||
@@ -533,9 +532,7 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( m_OptionsList[pn].IsOpened() )
|
||||
{
|
||||
m_OptionsList[pn].Input( input );
|
||||
|
||||
return;
|
||||
return m_OptionsList[pn].Input( input );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -587,7 +584,7 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
|
||||
g_CanOpenOptionsList.Touch();
|
||||
if( g_CanOpenOptionsList.Ago() > OPTIONS_LIST_TIMEOUT )
|
||||
m_bAcceptSelectRelease[input.pn] = false;
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
if( m_SelectionState == SelectionState_SelectingSong &&
|
||||
@@ -596,7 +593,7 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
|
||||
{
|
||||
// If we're rouletting, hands off.
|
||||
if( m_MusicWheel.IsRouletting() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
bool bLeftIsDown = false;
|
||||
bool bRightIsDown = false;
|
||||
@@ -669,7 +666,7 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
|
||||
{
|
||||
// Avoid any event not being first press
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return;
|
||||
return false;
|
||||
|
||||
if( m_SelectionState == SelectionState_SelectingSong )
|
||||
{
|
||||
@@ -695,7 +692,7 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
|
||||
if( CHANGE_GROUPS_WITH_GAME_BUTTONS )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS)
|
||||
return;
|
||||
return false;
|
||||
|
||||
if( m_SelectionState == SelectionState_SelectingSong )
|
||||
{
|
||||
@@ -856,9 +853,9 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
|
||||
}
|
||||
|
||||
if( input.type == IET_FIRST_PRESS && DetectCodes(input) )
|
||||
return;
|
||||
return true;
|
||||
|
||||
ScreenWithMenuElements::Input( input );
|
||||
return ScreenWithMenuElements::Input( input );
|
||||
}
|
||||
|
||||
bool ScreenSelectMusic::DetectCodes( const InputEventPlus &input )
|
||||
@@ -1168,21 +1165,21 @@ void ScreenSelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
||||
ScreenWithMenuElements::HandleScreenMessage( SM );
|
||||
}
|
||||
|
||||
void ScreenSelectMusic::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenSelectMusic::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return;
|
||||
return false;
|
||||
|
||||
/* If select is being pressed at the same time, this is probably an attempt
|
||||
* to change the sort, not to pick a song or difficulty. If it gets here,
|
||||
* the actual select press was probably hit during a tween and ignored.
|
||||
* Ignore it. */
|
||||
if( input.pn != PLAYER_INVALID && INPUTMAPPER->IsBeingPressed(GAME_BUTTON_SELECT, input.pn) )
|
||||
return;
|
||||
return false;
|
||||
|
||||
// Honor locked input for start presses.
|
||||
if( m_fLockInputSecs > 0 )
|
||||
return;
|
||||
return false;
|
||||
|
||||
switch( m_SelectionState )
|
||||
{
|
||||
@@ -1190,7 +1187,7 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input )
|
||||
case SelectionState_SelectingSong:
|
||||
// If false, we don't have a selection just yet.
|
||||
if( !m_MusicWheel.Select() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
// a song was selected
|
||||
if( m_MusicWheel.GetSelectedSong() != NULL )
|
||||
@@ -1258,7 +1255,7 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input )
|
||||
else
|
||||
{
|
||||
// We haven't made a selection yet.
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
// I believe this is for those who like pump pro. -aj
|
||||
MESSAGEMAN->Broadcast("SongChosen");
|
||||
@@ -1355,7 +1352,7 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
/* They selected non-Routine steps, so we can't
|
||||
* select Routine steps. */
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1371,7 +1368,7 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input )
|
||||
Message msg("StepsChosen");
|
||||
msg.SetParam( "Player", pn );
|
||||
MESSAGEMAN->Broadcast( msg );
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1485,10 +1482,11 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input )
|
||||
m_MenuTimer->Start();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void ScreenSelectMusic::MenuBack( const InputEventPlus & /* input */ )
|
||||
bool ScreenSelectMusic::MenuBack( const InputEventPlus & /* input */ )
|
||||
{
|
||||
// Handle unselect song (ffff)
|
||||
// todo: this isn't right at all. -aj
|
||||
@@ -1506,13 +1504,14 @@ void ScreenSelectMusic::MenuBack( const InputEventPlus & /* input */ )
|
||||
msg.SetParam( "Player", input.pn );
|
||||
MESSAGEMAN->Broadcast( msg );
|
||||
m_SelectionState = SelectionState_SelectingSong;
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
|
||||
m_BackgroundLoader.Abort();
|
||||
|
||||
Cancel( SM_GoToPrevScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenSelectMusic::AfterStepsOrTrailChange( const vector<PlayerNumber> &vpns )
|
||||
|
||||
@@ -33,13 +33,13 @@ public:
|
||||
virtual void BeginScreen();
|
||||
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual void HandleMessage( const Message &msg );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
virtual bool AllowLateJoin() const { return true; }
|
||||
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuBack( const InputEventPlus &input );
|
||||
|
||||
// ScreenWithMenuElements override: never play music here; we do it ourself.
|
||||
virtual void StartPlayingMusic() { }
|
||||
|
||||
+27
-23
@@ -19,92 +19,96 @@ void ScreenSelectProfile::Init()
|
||||
ScreenWithMenuElements::Init();
|
||||
}
|
||||
|
||||
void ScreenSelectProfile::Input( const InputEventPlus &input )
|
||||
bool ScreenSelectProfile::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
ScreenWithMenuElements::Input( input );
|
||||
return ScreenWithMenuElements::Input( input );
|
||||
}
|
||||
|
||||
void ScreenSelectProfile::MenuLeft( const InputEventPlus &input )
|
||||
bool ScreenSelectProfile::MenuLeft( const InputEventPlus &input )
|
||||
{
|
||||
PlayerNumber pn = input.pn;
|
||||
if( m_fLockInputSecs > 0 )
|
||||
return;
|
||||
return false;
|
||||
if( input.type == IET_RELEASE )
|
||||
return;
|
||||
return false;
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
{
|
||||
/*
|
||||
if( !ALLOW_REPEATING_INPUT )
|
||||
return;
|
||||
return false;
|
||||
*/
|
||||
if( m_TrackingRepeatingInput != input.MenuI )
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
m_TrackingRepeatingInput = input.MenuI;
|
||||
MESSAGEMAN->Broadcast( (MessageID)(Message_MenuLeftP1+pn) );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenSelectProfile::MenuRight( const InputEventPlus &input )
|
||||
bool ScreenSelectProfile::MenuRight( const InputEventPlus &input )
|
||||
{
|
||||
PlayerNumber pn = input.pn;
|
||||
if( m_fLockInputSecs > 0 )
|
||||
return;
|
||||
return false;
|
||||
if( input.type == IET_RELEASE )
|
||||
return;
|
||||
return false;
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
{
|
||||
/*
|
||||
if( !ALLOW_REPEATING_INPUT )
|
||||
return;
|
||||
return false;
|
||||
*/
|
||||
if( m_TrackingRepeatingInput != input.MenuI )
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
m_TrackingRepeatingInput = input.MenuI;
|
||||
MESSAGEMAN->Broadcast( (MessageID)(Message_MenuRightP1+pn) );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenSelectProfile::MenuUp( const InputEventPlus &input )
|
||||
bool ScreenSelectProfile::MenuUp( const InputEventPlus &input )
|
||||
{
|
||||
PlayerNumber pn = input.pn;
|
||||
if( m_fLockInputSecs > 0 )
|
||||
return;
|
||||
return false;
|
||||
if( input.type == IET_RELEASE )
|
||||
return;
|
||||
return false;
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
{
|
||||
/*
|
||||
if( !ALLOW_REPEATING_INPUT )
|
||||
return;
|
||||
return false;
|
||||
*/
|
||||
if( m_TrackingRepeatingInput != input.MenuI )
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
m_TrackingRepeatingInput = input.MenuI;
|
||||
MESSAGEMAN->Broadcast( (MessageID)(Message_MenuUpP1+pn) );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenSelectProfile::MenuDown( const InputEventPlus &input )
|
||||
bool ScreenSelectProfile::MenuDown( const InputEventPlus &input )
|
||||
{
|
||||
PlayerNumber pn = input.pn;
|
||||
if( m_fLockInputSecs > 0 )
|
||||
return;
|
||||
return false;
|
||||
if( input.type == IET_RELEASE )
|
||||
return;
|
||||
return false;
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
{
|
||||
/*
|
||||
if( !ALLOW_REPEATING_INPUT )
|
||||
return;
|
||||
return false;
|
||||
*/
|
||||
if( m_TrackingRepeatingInput != input.MenuI )
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
m_TrackingRepeatingInput = input.MenuI;
|
||||
MESSAGEMAN->Broadcast( (MessageID)(Message_MenuDownP1+pn) );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ScreenSelectProfile::SetProfileIndex( PlayerNumber pn, int iProfileIndex )
|
||||
|
||||
@@ -9,11 +9,11 @@ class ScreenSelectProfile : public ScreenWithMenuElements
|
||||
{
|
||||
public:
|
||||
virtual void Init();
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual void MenuLeft( const InputEventPlus &input );
|
||||
virtual void MenuRight( const InputEventPlus &input );
|
||||
virtual void MenuUp( const InputEventPlus &input );
|
||||
virtual void MenuDown( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual bool MenuLeft( const InputEventPlus &input );
|
||||
virtual bool MenuRight( const InputEventPlus &input );
|
||||
virtual bool MenuUp( const InputEventPlus &input );
|
||||
virtual bool MenuDown( const InputEventPlus &input );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
|
||||
GameButton m_TrackingRepeatingInput;
|
||||
|
||||
+18
-11
@@ -100,15 +100,15 @@ void ScreenSetTime::Update( float fDelta )
|
||||
m_textValue[day] .SetText( ssprintf("%02d",now.tm_mday) );
|
||||
}
|
||||
|
||||
void ScreenSetTime::Input( const InputEventPlus &input )
|
||||
bool ScreenSetTime::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS && input.type != IET_REPEAT )
|
||||
return; // ignore
|
||||
return false; // ignore
|
||||
|
||||
if( IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
Screen::Input( input ); // default handler
|
||||
return Screen::Input( input ); // default handler
|
||||
}
|
||||
|
||||
void ScreenSetTime::ChangeValue( int iDirection )
|
||||
@@ -159,27 +159,31 @@ void ScreenSetTime::ChangeSelection( int iDirection )
|
||||
m_soundChangeSelection.Play();
|
||||
}
|
||||
|
||||
void ScreenSetTime::MenuUp( const InputEventPlus &input )
|
||||
bool ScreenSetTime::MenuUp( const InputEventPlus &input )
|
||||
{
|
||||
ChangeSelection( -1 );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenSetTime::MenuDown( const InputEventPlus &input )
|
||||
bool ScreenSetTime::MenuDown( const InputEventPlus &input )
|
||||
{
|
||||
ChangeSelection( +1 );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenSetTime::MenuLeft( const InputEventPlus &input )
|
||||
bool ScreenSetTime::MenuLeft( const InputEventPlus &input )
|
||||
{
|
||||
ChangeValue( -1 );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenSetTime::MenuRight( const InputEventPlus &input )
|
||||
bool ScreenSetTime::MenuRight( const InputEventPlus &input )
|
||||
{
|
||||
ChangeValue( +1 );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenSetTime::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenSetTime::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
bool bHoldingLeftAndRight =
|
||||
INPUTMAPPER->IsBeingPressed( GAME_BUTTON_RIGHT, input.pn ) &&
|
||||
@@ -218,16 +222,19 @@ void ScreenSetTime::MenuStart( const InputEventPlus &input )
|
||||
}
|
||||
else
|
||||
ChangeSelection( +1 );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenSetTime::MenuSelect( const InputEventPlus &input )
|
||||
bool ScreenSetTime::MenuSelect( const InputEventPlus &input )
|
||||
{
|
||||
ChangeSelection( -1 );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenSetTime::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenSetTime::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
StartTransitioningScreen( SM_GoToPrevScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+8
-8
@@ -23,15 +23,15 @@ public:
|
||||
virtual void Init();
|
||||
|
||||
virtual void Update( float fDelta );
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
|
||||
virtual void MenuUp( const InputEventPlus &input );
|
||||
virtual void MenuDown( const InputEventPlus &input );
|
||||
virtual void MenuLeft( const InputEventPlus &input );
|
||||
virtual void MenuRight( const InputEventPlus &input );
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual void MenuSelect( const InputEventPlus &input );
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual bool MenuUp( const InputEventPlus &input );
|
||||
virtual bool MenuDown( const InputEventPlus &input );
|
||||
virtual bool MenuLeft( const InputEventPlus &input );
|
||||
virtual bool MenuRight( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuSelect( const InputEventPlus &input );
|
||||
virtual bool MenuBack( const InputEventPlus &input );
|
||||
|
||||
private:
|
||||
SetTimeSelection m_Selection;
|
||||
|
||||
@@ -34,18 +34,20 @@ void ScreenSplash::HandleScreenMessage( const ScreenMessage SM )
|
||||
ScreenWithMenuElements::HandleScreenMessage( SM );
|
||||
}
|
||||
|
||||
void ScreenSplash::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenSplash::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
Cancel( SM_GoToPrevScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenSplash::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenSplash::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
if( IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
if( !ALLOW_START_TO_SKIP )
|
||||
return;
|
||||
return false;
|
||||
StartTransitioningScreen( SM_GoToNextScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+2
-2
@@ -13,8 +13,8 @@ public:
|
||||
virtual void BeginScreen();
|
||||
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuBack( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
|
||||
protected:
|
||||
ThemeMetric<bool> ALLOW_START_TO_SKIP;
|
||||
|
||||
+13
-11
@@ -90,9 +90,10 @@ REGISTER_ACTOR_CLASS( InputList );
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenTestInput );
|
||||
|
||||
void ScreenTestInput::Input( const InputEventPlus &input )
|
||||
bool ScreenTestInput::Input( const InputEventPlus &input )
|
||||
{
|
||||
RString sMessage = input.DeviceI.ToString();
|
||||
bool bHandled = false;
|
||||
switch( input.type )
|
||||
{
|
||||
case IET_FIRST_PRESS:
|
||||
@@ -105,29 +106,30 @@ void ScreenTestInput::Input( const InputEventPlus &input )
|
||||
default: break;
|
||||
}
|
||||
MESSAGEMAN->Broadcast( sMessage );
|
||||
bHandled = true;
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
|
||||
Screen::Input( input ); // default handler
|
||||
return Screen::Input( input ) || bHandled; // default handler
|
||||
}
|
||||
|
||||
void ScreenTestInput::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenTestInput::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
MenuBack( input );
|
||||
return MenuBack( input );
|
||||
}
|
||||
|
||||
void ScreenTestInput::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenTestInput::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
if( input.type != IET_REPEAT )
|
||||
return; // ignore
|
||||
return false; // ignore
|
||||
|
||||
if( !IsTransitioning() )
|
||||
{
|
||||
SCREENMAN->PlayStartSound();
|
||||
StartTransitioningScreen( SM_GoToPrevScreen );
|
||||
}
|
||||
if( IsTransitioning() )
|
||||
return false;
|
||||
SCREENMAN->PlayStartSound();
|
||||
StartTransitioningScreen( SM_GoToPrevScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
class ScreenTestInput : public ScreenWithMenuElements
|
||||
{
|
||||
public:
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuBack( const InputEventPlus &input );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+15
-13
@@ -88,15 +88,15 @@ void ScreenTestLights::Update( float fDeltaTime )
|
||||
}
|
||||
|
||||
|
||||
void ScreenTestLights::Input( const InputEventPlus &input )
|
||||
bool ScreenTestLights::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS && input.type != IET_REPEAT )
|
||||
return; // ignore
|
||||
return false; // ignore
|
||||
|
||||
ScreenWithMenuElements::Input( input ); // default handler
|
||||
return ScreenWithMenuElements::Input( input ); // default handler
|
||||
}
|
||||
|
||||
void ScreenTestLights::MenuLeft( const InputEventPlus &input )
|
||||
bool ScreenTestLights::MenuLeft( const InputEventPlus &input )
|
||||
{
|
||||
if( LIGHTSMAN->GetLightsMode() != LIGHTSMODE_TEST_MANUAL_CYCLE )
|
||||
LIGHTSMAN->SetLightsMode( LIGHTSMODE_TEST_MANUAL_CYCLE );
|
||||
@@ -105,9 +105,10 @@ void ScreenTestLights::MenuLeft( const InputEventPlus &input )
|
||||
else
|
||||
LIGHTSMAN->PrevTestGameButtonLight();
|
||||
m_timerBackToAutoCycle.Touch();
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenTestLights::MenuRight( const InputEventPlus &input )
|
||||
bool ScreenTestLights::MenuRight( const InputEventPlus &input )
|
||||
{
|
||||
if( LIGHTSMAN->GetLightsMode() != LIGHTSMODE_TEST_MANUAL_CYCLE )
|
||||
LIGHTSMAN->SetLightsMode( LIGHTSMODE_TEST_MANUAL_CYCLE );
|
||||
@@ -116,20 +117,21 @@ void ScreenTestLights::MenuRight( const InputEventPlus &input )
|
||||
else
|
||||
LIGHTSMAN->NextTestGameButtonLight();
|
||||
m_timerBackToAutoCycle.Touch();
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenTestLights::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenTestLights::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
MenuBack( input );
|
||||
return MenuBack( input );
|
||||
}
|
||||
|
||||
void ScreenTestLights::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenTestLights::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
if( !IsTransitioning() )
|
||||
{
|
||||
SCREENMAN->PlayStartSound();
|
||||
StartTransitioningScreen( SM_GoToPrevScreen );
|
||||
}
|
||||
if( IsTransitioning() )
|
||||
return false;
|
||||
SCREENMAN->PlayStartSound();
|
||||
StartTransitioningScreen( SM_GoToPrevScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -13,12 +13,12 @@ public:
|
||||
virtual void EndScreen();
|
||||
|
||||
virtual void Update( float fDelta );
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
|
||||
virtual void MenuLeft( const InputEventPlus &input );
|
||||
virtual void MenuRight( const InputEventPlus &input );
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual bool MenuLeft( const InputEventPlus &input );
|
||||
virtual bool MenuRight( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuBack( const InputEventPlus &input );
|
||||
|
||||
private:
|
||||
BitmapText m_textInputs;
|
||||
|
||||
@@ -127,10 +127,10 @@ void ScreenTestSound::Update(float f)
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenTestSound::Input( const InputEventPlus &input )
|
||||
bool ScreenTestSound::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return; // ignore
|
||||
return false; // ignore
|
||||
|
||||
switch( input.DeviceI.device )
|
||||
{
|
||||
@@ -197,11 +197,13 @@ void ScreenTestSound::Input( const InputEventPlus &input )
|
||||
obj.SetY(obj.GetY() + 10);
|
||||
break;
|
||||
*/
|
||||
default: break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
default: break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
virtual void Init();
|
||||
~ScreenTestSound();
|
||||
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
|
||||
void Update(float f);
|
||||
void UpdateText(int n);
|
||||
|
||||
+49
-10
@@ -191,11 +191,12 @@ void ScreenTextEntry::Update( float fDelta )
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenTextEntry::Input( const InputEventPlus &input )
|
||||
bool ScreenTextEntry::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
|
||||
bool bHandled = false;
|
||||
if( input.DeviceI == DeviceInput(DEVICE_KEYBOARD, KEY_BACK) )
|
||||
{
|
||||
switch( input.type )
|
||||
@@ -203,6 +204,7 @@ void ScreenTextEntry::Input( const InputEventPlus &input )
|
||||
case IET_FIRST_PRESS:
|
||||
case IET_REPEAT:
|
||||
BackspaceInAnswer();
|
||||
bHandled = true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -216,10 +218,11 @@ void ScreenTextEntry::Input( const InputEventPlus &input )
|
||||
TryAppendToAnswer( WStringToRString(wstring()+c) );
|
||||
|
||||
TextEnteredDirectly();
|
||||
bHandled = true;
|
||||
}
|
||||
}
|
||||
|
||||
ScreenWithMenuElements::Input( input );
|
||||
return ScreenWithMenuElements::Input( input ) || bHandled;
|
||||
}
|
||||
|
||||
void ScreenTextEntry::TryAppendToAnswer( RString s )
|
||||
@@ -257,11 +260,15 @@ void ScreenTextEntry::BackspaceInAnswer()
|
||||
UpdateAnswerText();
|
||||
}
|
||||
|
||||
void ScreenTextEntry::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenTextEntry::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
// HACK: Only allow the screen to end on the Enter key.-aj
|
||||
if( input.DeviceI == DeviceInput(DEVICE_KEYBOARD, KEY_ENTER) && input.type==IET_FIRST_PRESS )
|
||||
{
|
||||
End( false );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void ScreenTextEntry::End( bool bCancelled )
|
||||
@@ -303,10 +310,12 @@ void ScreenTextEntry::End( bool bCancelled )
|
||||
s_sLastAnswer = bCancelled ? RString("") : WStringToRString(m_sAnswer);
|
||||
}
|
||||
|
||||
void ScreenTextEntry::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenTextEntry::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
if( input.type == IET_FIRST_PRESS )
|
||||
End( true );
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return false;
|
||||
End( true );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenTextEntry::TextEntrySettings::FromStack( lua_State *L )
|
||||
@@ -698,10 +707,39 @@ void ScreenTextEntryVisual::MoveY( int iDir )
|
||||
PositionCursor();
|
||||
}
|
||||
|
||||
void ScreenTextEntryVisual::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenTextEntryVisual::MenuLeft( const InputEventPlus &input )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return;
|
||||
return false;
|
||||
MoveX(-1);
|
||||
return true;
|
||||
}
|
||||
bool ScreenTextEntryVisual::MenuRight( const InputEventPlus &input )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return false;
|
||||
MoveX(+1);
|
||||
return true;
|
||||
}
|
||||
bool ScreenTextEntryVisual::MenuUp( const InputEventPlus &input )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return false;
|
||||
MoveY(-1);
|
||||
return true;
|
||||
}
|
||||
bool ScreenTextEntryVisual::MenuDown( const InputEventPlus &input )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return false;
|
||||
MoveY(+1);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ScreenTextEntryVisual::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return false;
|
||||
if( m_iFocusY == KEYBOARD_ROW_SPECIAL )
|
||||
{
|
||||
switch( m_iFocusX )
|
||||
@@ -719,13 +757,14 @@ void ScreenTextEntryVisual::MenuStart( const InputEventPlus &input )
|
||||
End( false );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TryAppendToAnswer( g_szKeys[m_iFocusY][m_iFocusX] );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
virtual void BeginScreen();
|
||||
|
||||
virtual void Update( float fDelta );
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
|
||||
static RString s_sLastAnswer;
|
||||
static bool s_bCancelledLast;
|
||||
@@ -117,8 +117,8 @@ protected:
|
||||
|
||||
virtual void End( bool bCancelled );
|
||||
private:
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual void MenuBack( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuBack( const InputEventPlus &input );
|
||||
|
||||
void UpdateAnswerText();
|
||||
|
||||
@@ -151,12 +151,12 @@ protected:
|
||||
|
||||
virtual void TextEnteredDirectly();
|
||||
|
||||
virtual void MenuLeft( const InputEventPlus &input ) { if(input.type==IET_FIRST_PRESS) MoveX(-1); }
|
||||
virtual void MenuRight( const InputEventPlus &input ) { if(input.type==IET_FIRST_PRESS) MoveX(+1); }
|
||||
virtual void MenuUp( const InputEventPlus &input ) { if(input.type==IET_FIRST_PRESS) MoveY(-1); }
|
||||
virtual void MenuDown( const InputEventPlus &input ) { if(input.type==IET_FIRST_PRESS) MoveY(+1); }
|
||||
virtual bool MenuLeft( const InputEventPlus &input );
|
||||
virtual bool MenuRight( const InputEventPlus &input );
|
||||
virtual bool MenuUp( const InputEventPlus &input );
|
||||
virtual bool MenuDown( const InputEventPlus &input );
|
||||
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
|
||||
int m_iFocusX;
|
||||
KeyboardRow m_iFocusY;
|
||||
|
||||
@@ -41,15 +41,16 @@ void ScreenTitleMenu::Init()
|
||||
|
||||
static LocalizedString THEME_ ("ScreenTitleMenu","Theme");
|
||||
static LocalizedString ANNOUNCER_ ("ScreenTitleMenu","Announcer");
|
||||
void ScreenTitleMenu::Input( const InputEventPlus &input )
|
||||
bool ScreenTitleMenu::Input( const InputEventPlus &input )
|
||||
{
|
||||
#if defined(DEBUG)
|
||||
LOG->Trace( "ScreenTitleMenu::Input( %d-%d )", input.DeviceI.device, input.DeviceI.button ); // debugging gameport joystick problem
|
||||
#endif
|
||||
|
||||
if( m_In.IsTransitioning() || m_Cancel.IsTransitioning() ) /* not m_Out */
|
||||
return;
|
||||
return false;
|
||||
|
||||
bool bHandled = false;
|
||||
if( input.type == IET_FIRST_PRESS )
|
||||
{
|
||||
// detect codes
|
||||
@@ -57,6 +58,7 @@ void ScreenTitleMenu::Input( const InputEventPlus &input )
|
||||
CodeDetector::EnteredCode(input.GameI.controller,CODE_NEXT_THEME2) )
|
||||
{
|
||||
GameLoop::ChangeTheme( THEME->GetNextSelectableTheme(), m_sName );
|
||||
bHandled = true;
|
||||
}
|
||||
if( CodeDetector::EnteredCode(input.GameI.controller,CODE_NEXT_ANNOUNCER) ||
|
||||
CodeDetector::EnteredCode(input.GameI.controller,CODE_NEXT_ANNOUNCER2) )
|
||||
@@ -66,10 +68,11 @@ void ScreenTitleMenu::Input( const InputEventPlus &input )
|
||||
if( sName=="" ) sName = "(none)";
|
||||
SCREENMAN->SystemMessage( ANNOUNCER_.GetValue()+": "+sName );
|
||||
SCREENMAN->SetNewScreen( m_sName );
|
||||
bHandled = true;
|
||||
}
|
||||
}
|
||||
|
||||
ScreenSelectMaster::Input( input );
|
||||
return ScreenSelectMaster::Input( input ) || bHandled;
|
||||
}
|
||||
|
||||
void ScreenTitleMenu::HandleMessage( const Message &msg )
|
||||
|
||||
@@ -11,7 +11,7 @@ public:
|
||||
ScreenTitleMenu();
|
||||
virtual void Init();
|
||||
|
||||
virtual void Input( const InputEventPlus &input );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
|
||||
virtual void HandleMessage( const Message &msg );
|
||||
};
|
||||
|
||||
@@ -46,10 +46,11 @@ void ScreenUnlockBrowse::BeginScreen()
|
||||
HandleMessage( Message(MessageIDToString(Message_MenuSelectionChanged)) );
|
||||
}
|
||||
|
||||
void ScreenUnlockBrowse::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenUnlockBrowse::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
m_soundStart.Play();
|
||||
this->PostScreenMessage( SM_BeginFadingOut, 0 );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenUnlockBrowse::HandleMessage( const Message &msg )
|
||||
|
||||
@@ -9,7 +9,7 @@ class ScreenUnlockBrowse : public ScreenSelectMaster
|
||||
public:
|
||||
virtual void Init();
|
||||
virtual void BeginScreen();
|
||||
virtual void MenuStart( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
|
||||
virtual void HandleMessage( const Message &msg );
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@ class ScreenUnlockCelebrate : public ScreenUnlockBrowse
|
||||
{
|
||||
public:
|
||||
virtual void Init();
|
||||
virtual void MenuLeft( const InputEventPlus &input ) { }
|
||||
virtual void MenuRight( const InputEventPlus &input ) { }
|
||||
virtual void MenuUp( const InputEventPlus &input ) { }
|
||||
virtual void MenuDown( const InputEventPlus &input ) { }
|
||||
virtual void MenuBack( const InputEventPlus &input ) { MenuStart( input ); }
|
||||
virtual bool MenuLeft( const InputEventPlus &input ) { return false; }
|
||||
virtual bool MenuRight( const InputEventPlus &input ) { return false; }
|
||||
virtual bool MenuUp( const InputEventPlus &input ) { return false; }
|
||||
virtual bool MenuDown( const InputEventPlus &input ) { return false; }
|
||||
virtual bool MenuBack( const InputEventPlus &input ) { return MenuStart( input ); }
|
||||
protected:
|
||||
};
|
||||
|
||||
|
||||
@@ -347,24 +347,26 @@ void ScreenWithMenuElements::StopTimer()
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenWithMenuElementsSimple );
|
||||
|
||||
void ScreenWithMenuElementsSimple::MenuStart( const InputEventPlus &input )
|
||||
bool ScreenWithMenuElementsSimple::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
if( IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
if( m_fLockInputSecs > 0 )
|
||||
return;
|
||||
return false;
|
||||
|
||||
StartTransitioningScreen( SM_GoToNextScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenWithMenuElementsSimple::MenuBack( const InputEventPlus &input )
|
||||
bool ScreenWithMenuElementsSimple::MenuBack( const InputEventPlus &input )
|
||||
{
|
||||
if( IsTransitioning() )
|
||||
return;
|
||||
return false;
|
||||
if( m_fLockInputSecs > 0 )
|
||||
return;
|
||||
return false;
|
||||
|
||||
Cancel( SM_GoToPrevScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
// lua start
|
||||
|
||||
@@ -62,8 +62,8 @@ private:
|
||||
class ScreenWithMenuElementsSimple: public ScreenWithMenuElements
|
||||
{
|
||||
public:
|
||||
void MenuStart( const InputEventPlus &input );
|
||||
void MenuBack( const InputEventPlus &input );
|
||||
bool MenuStart( const InputEventPlus &input );
|
||||
bool MenuBack( const InputEventPlus &input );
|
||||
|
||||
// Lua
|
||||
virtual void PushSelf( lua_State *L );
|
||||
|
||||
Reference in New Issue
Block a user