From 040c0de5098b87f552fe67808a562f18a424efeb Mon Sep 17 00:00:00 2001 From: Kyzentun Date: Wed, 19 Nov 2014 15:59:21 -0700 Subject: [PATCH 1/3] Added MinTNSToHideNotes preference. --- Docs/Changelog_sm5.txt | 16 ++++++++++------ Themes/_fallback/Languages/en.ini | 13 +++++++++++++ Themes/_fallback/metrics.ini | 3 ++- src/GameConstantsAndTypes.cpp | 10 ++++++++++ src/Player.cpp | 4 ++-- src/PrefsManager.cpp | 1 + src/PrefsManager.h | 1 + src/ScreenOptionsMasterPrefs.cpp | 2 ++ 8 files changed, 41 insertions(+), 9 deletions(-) diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index a1c06e7e9f..edb697b213 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -4,28 +4,32 @@ The StepMania 5 Changelog covers all post-sm-ssc changes. For a list of changes from StepMania 4 alpha 5 to sm-ssc v1.2.5, see Changelog_sm-ssc.txt. ________________________________________________________________________________ +2014/11/19 +---------- +* [Preferences] MinTNSToHideNotes preference added. [kyzentun] + 2014/11/15 ---------- * [Preferences] Default Fail Type preference mechanism changed internally again. - Set your Default Fail Type preference again. + Set your Default Fail Type preference again. [kyzentun] 2014/11/05 ---------- -* [ScreenPrompt] Answer OnCommand metrics fixed to actually work. +* [ScreenPrompt] Answer OnCommand metrics fixed to actually work. [kyzentun] 2014/11/01 ---------- -* [RollingNumbers] Cropping and color during tweens fixed. +* [RollingNumbers] Cropping and color during tweens fixed. [kyzentun] 2014/10/23 ---------- -* [Global] approach, multiapproach, lerp, and lerp_color lua functions added. +* [Global] approach, multiapproach, lerp, and lerp_color lua functions added. [kyzentun] 2014/10/20 ---------- -* [StageStats] GetStepsSeconds function added. +* [StageStats] GetStepsSeconds function added. [kyzentun] * [Steps] If an unrecognized step type is saved, preserve that step instead of - deleting it. A warning will be placed in the log file during song load. + deleting it. A warning will be placed in the log file during song load. [kyzentun] ================================================================================ StepMania 5.0 beta 4a | 20141015 diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index c36778babb..599b732db2 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -414,6 +414,7 @@ HighResolutionTextures=Choose whether high resolution textures (if supported by MaxTextureResolution=Choose the maximum texture resolution. Setting this to anything below 1024 will cause some textures to appear blurry, but may increase your frame rate. MenuTimer=When &oq;ON&cq;, menus have a time limit. Mines=Mines +MinTNSToHideNotes=The judgment to achieve for a note to disappear after being hit. MoveRandomToEnd=Determines if courses with random songs should be placed at the end of the course select wheel. MovieColorDepth=Choose the color depth of movies. 32 bit textures use more memory, but look nicer. MusicWheelSwitchSpeed=Adjusts the speed of the music wheel. @@ -802,6 +803,17 @@ Three Key Menu=Three Key Tiny=Tiny Tipsy=Tipsy Title Only=Title Only +TNS_None=TNS_None +TNS_HitMine=TNS_HitMine +TNS_AvoidMine=TNS_AvoidMine +TNS_CheckpointMiss=TNS_CheckpointMiss +TNS_Miss=TNS_Miss +TNS_W5=TNS_W5 +TNS_W4=TNS_W4 +TNS_W3=TNS_W3 +TNS_W2=TNS_W2 +TNS_W1=TNS_W1 +TNS_CheckpointHit=TNS_CheckpointHit Tornado=Tornado Total Feet=Total Feet Twirl=Twirl @@ -1013,6 +1025,7 @@ MenuTimer=Menu Timer Meter=Meter Min BPM=Min Specified BPM Mines=Mines +MinTNSToHideNotes=HideNote Judgment Mirror Player 1 to 2=Mirror P1's notes to P2 (routine only) Mirror Player 2 to 1=Mirror P2's notes to P1 (routine only) Modify Keysounds at current beat=Modify keysounds at current beat diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 8f5acd8502..d4b36914c0 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -3001,13 +3001,14 @@ Line20="conf,VisualDelaySeconds" Fallback="ScreenOptionsServiceChild" NextScreen="ScreenOptionsService" PrevScreen="ScreenOptionsService" -LineNames="3,4,8,SI,SM,11,13,14,15,16,28,29,30,31" +LineNames="3,4,8,SI,SM,HN,11,13,14,15,16,28,29,30,31" #LineScore="lua,UserPrefScoringMode()" Line3="conf,TimingWindowScale" Line4="conf,LifeDifficulty" Line8="conf,DefaultFailType" LineSI="lua,SpeedModIncSize()" LineSM="lua,SpeedModIncLarge()" +LineHN="conf,MinTNSToHideNotes" Line11="conf,AllowW1" Line13="conf,HiddenSongs" Line14="conf,EasterEggs" diff --git a/src/GameConstantsAndTypes.cpp b/src/GameConstantsAndTypes.cpp index a6f6f7f2d1..8c406f82c9 100644 --- a/src/GameConstantsAndTypes.cpp +++ b/src/GameConstantsAndTypes.cpp @@ -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(const RString& value, TapNoteScore& out) + { + out= StringToTapNoteScore(value); + return out != TapNoteScore_Invalid; + } +} XToLocalizedString( TapNoteScore ); LuaFunction( TapNoteScoreToLocalizedString, TapNoteScoreToLocalizedString(Enum::Check(L, 1)) ); diff --git a/src/Player.cpp b/src/Player.cpp index ea07357e20..59503c2d13 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -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 >= PREFSMAN->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 >= PREFSMAN->m_MinTNSToHideNotes || bBlind ) HideNote( iTrack, iRow ); } } diff --git a/src/PrefsManager.cpp b/src/PrefsManager.cpp index d3d4702397..c22ba08d81 100644 --- a/src/PrefsManager.cpp +++ b/src/PrefsManager.cpp @@ -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 ), diff --git a/src/PrefsManager.h b/src/PrefsManager.h index 19f51e07e2..c95692a1e6 100644 --- a/src/PrefsManager.h +++ b/src/PrefsManager.h @@ -213,6 +213,7 @@ public: Preference m_iSongsPerPlay; Preference m_bDelayedCreditsReconcile; // zuh? Preference m_bComboContinuesBetweenSongs; + Preference m_MinTNSToHideNotes; Preference m_ShowSongOptions; Preference m_bDancePointsForOni; Preference m_bPercentageScoring; diff --git a/src/ScreenOptionsMasterPrefs.cpp b/src/ScreenOptionsMasterPrefs.cpp index 4b50face7d..3c9f6280e1 100644 --- a/src/ScreenOptionsMasterPrefs.cpp +++ b/src/ScreenOptionsMasterPrefs.cpp @@ -744,6 +744,8 @@ static void InitializeConfOptions() ADD( ConfOption( "ShowSongOptions", MovePref, "Ask", "Hide","Show" ) ); ADD( ConfOption( "PercentageScoring", MovePref, "Off","On" ) ); ADD( ConfOption( "GetRankingName", MovePref, "Off", "On", "Ranking Songs" ) ); + ADD( ConfOption( "MinTNSToHideNotes", MovePref, "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, "Full Screen", "Windowed" ) ); From 4e5a2ade73ccf930f34d1dec37ca47be6a6a7b46 Mon Sep 17 00:00:00 2001 From: Kyzentun Date: Sat, 22 Nov 2014 14:55:44 -0700 Subject: [PATCH 2/3] Added mod for MinTNSToHideNote so it can be set per-player. --- src/Player.cpp | 4 ++-- src/PlayerOptions.cpp | 6 ++++++ src/PlayerOptions.h | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Player.cpp b/src/Player.cpp index 59503c2d13..fc242c83f5 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -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 >= PREFSMAN->m_MinTNSToHideNotes || 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 >= PREFSMAN->m_MinTNSToHideNotes || bBlind ) + if( lastTNS >= m_pPlayerState->m_PlayerOptions.GetCurrent().m_MinTNSToHideNotes || bBlind ) HideNote( iTrack, iRow ); } } diff --git a/src/PlayerOptions.cpp b/src/PlayerOptions.cpp index 65d37800ce..fa6fb0bed1 100644 --- a/src/PlayerOptions.cpp +++ b/src/PlayerOptions.cpp @@ -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 ); diff --git a/src/PlayerOptions.h b/src/PlayerOptions.h index f4f56806d6..55deaec19d 100644 --- a/src/PlayerOptions.h +++ b/src/PlayerOptions.h @@ -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. From c96eec1ded668abbaa9d8b23112a8f359f340f19 Mon Sep 17 00:00:00 2001 From: Kyzentun Date: Sat, 22 Nov 2014 20:19:47 -0700 Subject: [PATCH 3/3] Updated changelog and docs for new mod. --- Docs/Changelog_sm5.txt | 3 ++- Docs/Luadoc/Lua.xml | 1 + Docs/Luadoc/LuaDocumentation.xml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index edb697b213..240277c0f6 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -4,9 +4,10 @@ The StepMania 5 Changelog covers all post-sm-ssc changes. For a list of changes from StepMania 4 alpha 5 to sm-ssc v1.2.5, see Changelog_sm-ssc.txt. ________________________________________________________________________________ -2014/11/19 +2014/11/22 ---------- * [Preferences] MinTNSToHideNotes preference added. [kyzentun] +* [PlayerOptions] MinTNSToHideNotes mod added. [kyzentun] 2014/11/15 ---------- diff --git a/Docs/Luadoc/Lua.xml b/Docs/Luadoc/Lua.xml index ab33c6e73d..d90c1215eb 100644 --- a/Docs/Luadoc/Lua.xml +++ b/Docs/Luadoc/Lua.xml @@ -1053,6 +1053,7 @@ + diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml index c6209eb1d4..2308132dd1 100644 --- a/Docs/Luadoc/LuaDocumentation.xml +++ b/Docs/Luadoc/LuaDocumentation.xml @@ -3097,6 +3097,7 @@ save yourself some time, copy this for undocumented things: + Sets the min TapNoteScore required for the notes to disappear after being hit. If the player has a MMod set, returns the value of that MMod and its associated approach speed. Returns nil otherwise.