Fix a problem with alternative input that made hold notes 'let go' when held using the alternative button.
This commit is contained in:
@@ -24,6 +24,11 @@ public:
|
|||||||
DeviceInputList InputList;
|
DeviceInputList InputList;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct AlternateMapping
|
||||||
|
{
|
||||||
|
GameInput inpMain;
|
||||||
|
GameInput inpAlt;
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -733,10 +733,25 @@ void Player::Update( float fDeltaTime )
|
|||||||
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( col, m_pPlayerState->m_PlayerNumber );
|
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( col, m_pPlayerState->m_PlayerNumber );
|
||||||
|
|
||||||
bool bIsHoldingButton = INPUTMAPPER->IsBeingPressed( GameI );
|
bool bIsHoldingButton = INPUTMAPPER->IsBeingPressed( GameI );
|
||||||
|
|
||||||
|
if( m_vAlterMap.size() > 0 ) // alternate input is being used
|
||||||
|
{
|
||||||
|
for( unsigned int i=0; i < m_vAlterMap.size(); ++i )
|
||||||
|
{
|
||||||
|
if( m_vAlterMap[i].inpMain == GameI )
|
||||||
|
{
|
||||||
|
bIsHoldingButton = bIsHoldingButton | INPUTMAPPER->IsBeingPressed( m_vAlterMap[i].inpAlt );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Make this work for non-human-controlled players
|
// TODO: Make this work for non-human-controlled players
|
||||||
if( bIsHoldingButton && !GAMESTATE->m_bDemonstrationOrJukebox && m_pPlayerState->m_PlayerController==PC_HUMAN )
|
if( bIsHoldingButton && !GAMESTATE->m_bDemonstrationOrJukebox && m_pPlayerState->m_PlayerController==PC_HUMAN )
|
||||||
if( m_pNoteField )
|
if( m_pNoteField )
|
||||||
m_pNoteField->SetPressed( col );
|
m_pNoteField->SetPressed( col );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -959,7 +974,23 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector<TrackRowTap
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( iTrack, pn );
|
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( iTrack, pn );
|
||||||
bIsHoldingButton &= INPUTMAPPER->IsBeingPressed( GameI, m_pPlayerState->m_mp );
|
|
||||||
|
// this previously read as bIsHoldingButton &=
|
||||||
|
// was there a specific reason for this? - Friez
|
||||||
|
bIsHoldingButton = INPUTMAPPER->IsBeingPressed( GameI, m_pPlayerState->m_mp );
|
||||||
|
|
||||||
|
if( m_vAlterMap.size() > 0 ) // alternate input is being used
|
||||||
|
{
|
||||||
|
for( unsigned int i=0; i < m_vAlterMap.size(); ++i )
|
||||||
|
{
|
||||||
|
if( m_vAlterMap[i].inpMain == GameI )
|
||||||
|
{
|
||||||
|
bIsHoldingButton = bIsHoldingButton | INPUTMAPPER->IsBeingPressed( m_vAlterMap[i].inpAlt );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2440,16 +2471,47 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now )
|
|||||||
{
|
{
|
||||||
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
||||||
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( iTrack, pn );
|
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( iTrack, pn );
|
||||||
|
|
||||||
if( PREFSMAN->m_fPadStickSeconds > 0.f )
|
if( PREFSMAN->m_fPadStickSeconds > 0.f )
|
||||||
{
|
{
|
||||||
float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameI, m_pPlayerState->m_mp );
|
float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameI, m_pPlayerState->m_mp );
|
||||||
if( fSecsHeld >= PREFSMAN->m_fPadStickSeconds )
|
if( fSecsHeld >= PREFSMAN->m_fPadStickSeconds )
|
||||||
Step( iTrack, -1, now - PREFSMAN->m_fPadStickSeconds, true, false );
|
Step( iTrack, -1, now - PREFSMAN->m_fPadStickSeconds, true, false );
|
||||||
|
|
||||||
|
if( m_vAlterMap.size() > 0 ) // alternate input is being used
|
||||||
|
{
|
||||||
|
for( unsigned int i=0; i < m_vAlterMap.size(); ++i )
|
||||||
|
{
|
||||||
|
if( m_vAlterMap[i].inpMain == GameI )
|
||||||
|
{
|
||||||
|
GameInput GameIB = m_vAlterMap[i].inpAlt;
|
||||||
|
float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameIB, m_pPlayerState->m_mp );
|
||||||
|
if( fSecsHeld >= PREFSMAN->m_fPadStickSeconds )
|
||||||
|
Step( iTrack, -1, now - PREFSMAN->m_fPadStickSeconds, true, false );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if( INPUTMAPPER->IsBeingPressed(GameI, m_pPlayerState->m_mp) )
|
else if( INPUTMAPPER->IsBeingPressed(GameI, m_pPlayerState->m_mp) )
|
||||||
{
|
{
|
||||||
Step( iTrack, -1, now, true, false );
|
Step( iTrack, -1, now, true, false );
|
||||||
}
|
}
|
||||||
|
else if( m_vAlterMap.size() > 0 ) // alternate input being used
|
||||||
|
{
|
||||||
|
for( unsigned int i=0; i < m_vAlterMap.size(); ++i )
|
||||||
|
{
|
||||||
|
if( m_vAlterMap[i].inpMain == GameI )
|
||||||
|
{
|
||||||
|
GameInput GameIB = m_vAlterMap[i].inpAlt;
|
||||||
|
if( INPUTMAPPER->IsBeingPressed(GameIB, m_pPlayerState->m_mp) )
|
||||||
|
{
|
||||||
|
Step( iTrack, -1, now, true, false );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TapNote::mine:
|
case TapNote::mine:
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "NoteData.h"
|
#include "NoteData.h"
|
||||||
#include "ScreenMessage.h"
|
#include "ScreenMessage.h"
|
||||||
#include "ThemeMetric.h"
|
#include "ThemeMetric.h"
|
||||||
|
#include "InputEventPlus.h"
|
||||||
|
|
||||||
class ScoreDisplay;
|
class ScoreDisplay;
|
||||||
class LifeMeter;
|
class LifeMeter;
|
||||||
@@ -106,6 +107,7 @@ public:
|
|||||||
//
|
//
|
||||||
virtual void PushSelf( lua_State *L );
|
virtual void PushSelf( lua_State *L );
|
||||||
|
|
||||||
|
vector<AlternateMapping> m_vAlterMap;
|
||||||
protected:
|
protected:
|
||||||
void UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat );
|
void UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat );
|
||||||
void UpdateJudgedRows();
|
void UpdateJudgedRows();
|
||||||
|
|||||||
@@ -783,6 +783,11 @@ void ScreenGameplay::Init()
|
|||||||
tmpMap.inpMain = GameI;
|
tmpMap.inpMain = GameI;
|
||||||
tmpMap.inpAlt = GameIAlt;
|
tmpMap.inpAlt = GameIAlt;
|
||||||
m_vAlterMap.push_back( tmpMap );
|
m_vAlterMap.push_back( tmpMap );
|
||||||
|
|
||||||
|
FOREACH( PlayerInfo, m_vPlayerInfo, pi )
|
||||||
|
{
|
||||||
|
pi->m_pPlayer->m_vAlterMap.push_back( tmpMap );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,12 +156,6 @@ protected:
|
|||||||
|
|
||||||
ThemeMetric<bool> USE_ALTERNATIVE_INPUT;
|
ThemeMetric<bool> USE_ALTERNATIVE_INPUT;
|
||||||
|
|
||||||
struct AlternateMapping
|
|
||||||
{
|
|
||||||
GameInput inpMain;
|
|
||||||
GameInput inpAlt;
|
|
||||||
};
|
|
||||||
|
|
||||||
vector<AlternateMapping> m_vAlterMap;
|
vector<AlternateMapping> m_vAlterMap;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user