Merge pull request #380 from kyzentun/pref_hide_note

Preference and mod for hiding notes that are hit
This commit is contained in:
Kyzentun
2014-12-01 16:14:51 -07:00
12 changed files with 53 additions and 10 deletions
+10
View File
@@ -227,6 +227,16 @@ TapNoteScore StringToTapNoteScore( const RString &s )
return TapNoteScore_Invalid;
}
// This is necessary because the StringToX macro wasn't used, and Preference
// relies on there being a StringConversion entry for enums used in prefs. -Kyz
namespace StringConversion
{
template<> bool FromString<TapNoteScore>(const RString& value, TapNoteScore& out)
{
out= StringToTapNoteScore(value);
return out != TapNoteScore_Invalid;
}
}
XToLocalizedString( TapNoteScore );
LuaFunction( TapNoteScoreToLocalizedString, TapNoteScoreToLocalizedString(Enum::Check<TapNoteScore>(L, 1)) );
+2 -2
View File
@@ -2563,7 +2563,7 @@ void Player::StepStrumHopo( int col, int row, const RageTimer &tm, bool bHeld, b
const bool bBright = ( m_pPlayerStageStats && m_pPlayerStageStats->m_iCurCombo > int(BRIGHT_GHOST_COMBO_THRESHOLD) ) || bBlind;
if( m_pNoteField )
m_pNoteField->DidTapNote( col, bBlind? TNS_W1:score, bBright );
if( score >= TNS_W3 || bBlind )
if( score >= m_pPlayerState->m_PlayerOptions.GetCurrent().m_MinTNSToHideNotes || bBlind )
HideNote( col, iRowOfOverlappingNoteOrRow );
}
}
@@ -2909,7 +2909,7 @@ void Player::FlashGhostRow( int iRow )
continue;
if( m_pNoteField )
m_pNoteField->DidTapNote( iTrack, lastTNS, bBright );
if( lastTNS >= TNS_W3 || bBlind )
if( lastTNS >= m_pPlayerState->m_PlayerOptions.GetCurrent().m_MinTNSToHideNotes || bBlind )
HideNote( iTrack, iRow );
}
}
+6
View File
@@ -52,6 +52,7 @@ void PlayerOptions::Init()
m_LifeType = LifeType_Bar;
m_DrainType = DrainType_Normal;
m_BatteryLives = 4;
m_MinTNSToHideNotes= PREFSMAN->m_MinTNSToHideNotes;
m_bSetScrollSpeed = false;
m_fMaxScrollBPM = 0; m_SpeedfMaxScrollBPM = 1.0f;
m_fTimeSpacing = 0; m_SpeedfTimeSpacing = 1.0f;
@@ -117,6 +118,7 @@ void PlayerOptions::Approach( const PlayerOptions& other, float fDeltaSeconds )
DO_COPY( m_bTransforms[i] );
DO_COPY( m_bMuteOnError );
DO_COPY( m_FailType );
DO_COPY( m_MinTNSToHideNotes );
DO_COPY( m_sNoteSkin );
#undef APPROACH
#undef DO_COPY
@@ -755,6 +757,7 @@ bool PlayerOptions::operator==( const PlayerOptions &other ) const
COMPARE(m_fMaxScrollBPM);
COMPARE(m_fRandomSpeed);
COMPARE(m_FailType);
COMPARE(m_MinTNSToHideNotes);
COMPARE(m_bMuteOnError);
COMPARE(m_fDark);
COMPARE(m_fBlind);
@@ -953,6 +956,7 @@ void PlayerOptions::ResetPrefs( ResetPrefsType type )
CPY(m_LifeType);
CPY(m_DrainType);
CPY(m_BatteryLives);
CPY(m_MinTNSToHideNotes);
CPY( m_fPerspectiveTilt );
CPY( m_bTransforms[TRANSFORM_NOHOLDS] );
@@ -1077,6 +1081,7 @@ public:
BOOL_INTERFACE(NoStretch, Transforms[PlayerOptions::TRANSFORM_NOSTRETCH]);
BOOL_INTERFACE(MuteOnError, MuteOnError);
ENUM_INTERFACE(FailSetting, FailType, FailType);
ENUM_INTERFACE(MinTNSToHideNotes, MinTNSToHideNotes, TapNoteScore);
// NoteSkins
static int NoteSkin(T* p, lua_State* L)
@@ -1448,6 +1453,7 @@ public:
ADD_METHOD(NoteSkin);
ADD_METHOD(FailSetting);
ADD_METHOD(MinTNSToHideNotes);
// Speed
ADD_METHOD( CMod );
+3 -1
View File
@@ -61,7 +61,8 @@ public:
m_fSkew(0), m_SpeedfSkew(1.0f),
m_fPassmark(0), m_SpeedfPassmark(1.0f),
m_fRandomSpeed(0), m_SpeedfRandomSpeed(1.0f),
m_bMuteOnError(false), m_FailType(FailType_Immediate)
m_bMuteOnError(false), m_FailType(FailType_Immediate),
m_MinTNSToHideNotes(TNS_W3)
{
m_sNoteSkin = "";
ZERO( m_fAccels ); ONE( m_SpeedfAccels );
@@ -215,6 +216,7 @@ public:
bool m_bMuteOnError;
/** @brief The method for which a player can fail a song. */
FailType m_FailType;
TapNoteScore m_MinTNSToHideNotes;
/**
* @brief The Noteskin to use.
+1
View File
@@ -221,6 +221,7 @@ PrefsManager::PrefsManager() :
m_iSongsPerPlay ( "SongsPerPlay", 3, ValidateSongsPerPlay ),
m_bDelayedCreditsReconcile ( "DelayedCreditsReconcile", false ),
m_bComboContinuesBetweenSongs ( "ComboContinuesBetweenSongs", false ),
m_MinTNSToHideNotes("MinTNSToHideNotes", TNS_W3),
m_ShowSongOptions ( "ShowSongOptions", Maybe_NO ),
m_bDancePointsForOni ( "DancePointsForOni", true ),
m_bPercentageScoring ( "PercentageScoring", false ),
+1
View File
@@ -213,6 +213,7 @@ public:
Preference<int> m_iSongsPerPlay;
Preference<bool> m_bDelayedCreditsReconcile; // zuh?
Preference<bool> m_bComboContinuesBetweenSongs;
Preference<TapNoteScore> m_MinTNSToHideNotes;
Preference<Maybe> m_ShowSongOptions;
Preference<bool> m_bDancePointsForOni;
Preference<bool> m_bPercentageScoring;
+2
View File
@@ -767,6 +767,8 @@ static void InitializeConfOptions()
ADD( ConfOption( "ShowSongOptions", MovePref<Maybe>, "Ask", "Hide","Show" ) );
ADD( ConfOption( "PercentageScoring", MovePref<bool>, "Off","On" ) );
ADD( ConfOption( "GetRankingName", MovePref<GetRankingName>, "Off", "On", "Ranking Songs" ) );
ADD( ConfOption( "MinTNSToHideNotes", MovePref<TapNoteScore>, "TNS_None", "TNS_HitMine", "TNS_AvoidMine", "TNS_CheckpointMiss", "TNS_Miss", "TNS_W5", "TNS_W4", "TNS_W3", "TNS_W2", "TNS_W1", "TNS_CheckpointHit"));
// Graphic options
ADD( ConfOption( "Windowed", MovePref<bool>, "Full Screen", "Windowed" ) );