Alternative Column Input Metrics -- Mainly a requirement for Ez2dancer gametype. Allows for a themer to make game inputs that aren't usually used to trigger a column press do so in addition to the usual buttons. (In the case of ez2dancer, the lower hand sensors are used as well as upper hand sensors, except for real mode where they are defined seperately).
This commit is contained in:
@@ -635,6 +635,7 @@ PrevScreen=SongSelectionScreen()
|
|||||||
NextScreen=GetGameplayNextScreen()
|
NextScreen=GetGameplayNextScreen()
|
||||||
LightsMode="LightsMode_Gameplay"
|
LightsMode="LightsMode_Gameplay"
|
||||||
TimerSeconds=-1
|
TimerSeconds=-1
|
||||||
|
UseAlternativeInput=false
|
||||||
PlayerType="Player"
|
PlayerType="Player"
|
||||||
PlayerInitCommand=y,SCREEN_CENTER_Y
|
PlayerInitCommand=y,SCREEN_CENTER_Y
|
||||||
StartGivesUp=true
|
StartGivesUp=true
|
||||||
|
|||||||
@@ -59,6 +59,8 @@
|
|||||||
#include "Song.h"
|
#include "Song.h"
|
||||||
#include "XmlFileUtil.h"
|
#include "XmlFileUtil.h"
|
||||||
|
|
||||||
|
#include "arch/Dialog/Dialog.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
// Defines
|
// Defines
|
||||||
//
|
//
|
||||||
@@ -353,6 +355,8 @@ void ScreenGameplay::Init()
|
|||||||
FAIL_ON_MISS_COMBO.Load( m_sName, "FailOnMissCombo" );
|
FAIL_ON_MISS_COMBO.Load( m_sName, "FailOnMissCombo" );
|
||||||
ALLOW_CENTER_1_PLAYER.Load( m_sName, "AllowCenter1Player" );
|
ALLOW_CENTER_1_PLAYER.Load( m_sName, "AllowCenter1Player" );
|
||||||
|
|
||||||
|
USE_ALTERNATIVE_INPUT.Load( m_sName,"UseAlternativeInput");
|
||||||
|
|
||||||
if( UseSongBackgroundAndForeground() )
|
if( UseSongBackgroundAndForeground() )
|
||||||
{
|
{
|
||||||
m_pSongBackground = new Background;
|
m_pSongBackground = new Background;
|
||||||
@@ -754,6 +758,37 @@ void ScreenGameplay::Init()
|
|||||||
LoadNextSong();
|
LoadNextSong();
|
||||||
|
|
||||||
m_GiveUpTimer.SetZero();
|
m_GiveUpTimer.SetZero();
|
||||||
|
|
||||||
|
// friez
|
||||||
|
|
||||||
|
if(USE_ALTERNATIVE_INPUT) // using alternative input
|
||||||
|
{
|
||||||
|
int iNumCols = GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer;
|
||||||
|
FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi )
|
||||||
|
{
|
||||||
|
for( int col=0; col < iNumCols; ++col )
|
||||||
|
{
|
||||||
|
|
||||||
|
// TODO: Remove use of PlayerNumber.
|
||||||
|
GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( col, pi->m_pn );
|
||||||
|
// Dialog::OK(GameI.ToString(INPUTMAPPER->GetInputScheme()),"DEBUG");
|
||||||
|
|
||||||
|
ThemeMetric<RString> tmpMetric;
|
||||||
|
tmpMetric.Load(m_sName,ssprintf("AltInp%s%s",GAMESTATE->GetCurrentStyle()->m_szName,GameI.ToString( INPUTMAPPER->GetInputScheme() ).c_str() ) );
|
||||||
|
|
||||||
|
if(tmpMetric.GetValue() != "")
|
||||||
|
{
|
||||||
|
GameInput GameIAlt;
|
||||||
|
GameIAlt.FromString(INPUTMAPPER->GetInputScheme(),tmpMetric.GetValue());
|
||||||
|
|
||||||
|
AlternateMapping tmpMap;
|
||||||
|
tmpMap.inpMain = GameI;
|
||||||
|
tmpMap.inpAlt = GameIAlt;
|
||||||
|
m_vAlterMap.push_back(tmpMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScreenGameplay::Center1Player() const
|
bool ScreenGameplay::Center1Player() const
|
||||||
@@ -2211,7 +2246,19 @@ void ScreenGameplay::Input( const InputEventPlus &input )
|
|||||||
if( !input.GameI.IsValid() )
|
if( !input.GameI.IsValid() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const int iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( input.GameI );
|
int iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( input.GameI );
|
||||||
|
|
||||||
|
if(USE_ALTERNATIVE_INPUT) // using alternative input
|
||||||
|
{
|
||||||
|
for( unsigned int i=0; i < m_vAlterMap.size(); ++i )
|
||||||
|
{
|
||||||
|
if(m_vAlterMap[i].inpAlt == input.GameI)
|
||||||
|
{
|
||||||
|
iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( m_vAlterMap[i].inpMain );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Don't pass on any inputs to Player that aren't a press or a release.
|
// Don't pass on any inputs to Player that aren't a press or a release.
|
||||||
switch( input.type )
|
switch( input.type )
|
||||||
|
|||||||
@@ -153,6 +153,18 @@ protected:
|
|||||||
ThemeMetric<int> FAIL_ON_MISS_COMBO;
|
ThemeMetric<int> FAIL_ON_MISS_COMBO;
|
||||||
ThemeMetric<bool> ALLOW_CENTER_1_PLAYER;
|
ThemeMetric<bool> ALLOW_CENTER_1_PLAYER;
|
||||||
|
|
||||||
|
|
||||||
|
ThemeMetric<bool> USE_ALTERNATIVE_INPUT;
|
||||||
|
|
||||||
|
struct AlternateMapping
|
||||||
|
{
|
||||||
|
GameInput inpMain;
|
||||||
|
GameInput inpAlt;
|
||||||
|
};
|
||||||
|
|
||||||
|
vector<AlternateMapping> m_vAlterMap;
|
||||||
|
|
||||||
|
|
||||||
bool IsLastSong();
|
bool IsLastSong();
|
||||||
void SetupSong( int iSongIndex );
|
void SetupSong( int iSongIndex );
|
||||||
void ReloadCurrentSong();
|
void ReloadCurrentSong();
|
||||||
|
|||||||
Reference in New Issue
Block a user