From 6544d31dd9fc69af339f7bd8597eb5f29244cc12 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Thu, 29 Dec 2011 12:49:45 -0600 Subject: [PATCH] theme prefs should NOT be in fallback. --- Themes/_fallback/Scripts/03 Gameplay.lua | 101 +++++++----------- Themes/_fallback/metrics.ini | 15 +-- .../{03 ThemePrefs.lua => 02 ThemePrefs.lua} | 0 Themes/default/Scripts/03 Gameplay.lua | 26 +++++ Themes/default/metrics.ini | 13 ++- 5 files changed, 81 insertions(+), 74 deletions(-) rename Themes/default/Scripts/{03 ThemePrefs.lua => 02 ThemePrefs.lua} (100%) create mode 100644 Themes/default/Scripts/03 Gameplay.lua diff --git a/Themes/_fallback/Scripts/03 Gameplay.lua b/Themes/_fallback/Scripts/03 Gameplay.lua index 19ca3de312..be15e61612 100644 --- a/Themes/_fallback/Scripts/03 Gameplay.lua +++ b/Themes/_fallback/Scripts/03 Gameplay.lua @@ -108,62 +108,60 @@ function EvalUsesCheckpointsWithJudgments() return (CurGameName() == "pump") and true or false end --- these need cleanup really. +local ComboThresholds = { + dance = { Hit = 2, Miss = 2, Fail = -1 }, + pump = { Hit = 4, Miss = 4, Fail = 51 }, + beat = { Hit = 1, Miss = 0, Fail = -1 }, + kb7 = { Hit = 1, Miss = 0, Fail = -1 }, + para = { Hit = 2, Miss = 0, Fail = -1 }, + ------------------------------------------- + default = { Hit = 2, Miss = 2, Fail = -1 } +} + function HitCombo() - local Combo = { - dance = 2, - pump = 4, - beat = 2, - kb7 = 2, - para = 2 - } - return Combo[CurGameName()] + if ComboThresholds[CurGameName()] then + return ComboThresholds[CurGameName()].Hit + end + return ComboThresholds["default"].Hit end function MissCombo() - local Combo = { - dance = 2, - pump = 4, - beat = 0, - kb7 = 0, - para = 0 - } - return Combo[CurGameName()] + if ComboThresholds[CurGameName()] then + return ComboThresholds[CurGameName()].Miss + end + return ComboThresholds["default"].Miss end -- FailCombo: -- [en] The combo that causes game failure. function FailCombo() - local Combo = { - dance = -1, -- ITG uses 30 - pump = 51, -- Pump Pro uses 30, real Pump uses 51 - beat = -1, - kb7 = -1, - para = -1 - } - return Combo[CurGameName()] + -- ITG (dance) uses 30. Pump Pro uses 30, real Pump uses 51 + if ComboThresholds[CurGameName()] then + return ComboThresholds[CurGameName()].Fail + end + return ComboThresholds["default"].Fail end +local RoutineSkins = { + dance = { P1 = "midi-routine-p1", P2 = "midi-routine-p1" }, + pump = { P1 = "cmd-routine-p1", P2 = "cmd-routine-p2" }, + kb7 = { P1 = "default", P2 = "retrobar" }, + ------------------------------------------------------------- + default = { P1 = "default", P2 = "default" } +} + function RoutineSkinP1() - local Combo = { - dance = "midi-routine-p1", - pump = "cmd-routine-p1", - beat = "default", - kb7 = "default", - para = "default" - } - return Combo[CurGameName()] + if RoutineSkins[CurGameName()] then + return RoutineSkins[CurGameName()].P1 + end + return RoutineSkins["Default"].P1 end function RoutineSkinP2() - local Combo = { - dance = "midi-routine-p2", - pump = "cmd-routine-p2", - beat = "default", - kb7 = "retrobar", - para = "default" - } - return Combo[CurGameName()] + if RoutineSkins[CurGameName()] then + return RoutineSkins[CurGameName()].P2 + end + return RoutineSkins["Default"].P2 end -- todo: use tables for some of these -aj @@ -175,27 +173,6 @@ function ShowHoldJudgments() return not IsGame("pump") end -local tNotePositions = { - -- StepMania 3.9/4.0 - Normal = { -144, 144, }, - -- ITG - Lower = { -125, 145, } -} - -function GetTapPosition( sType ) - bCategory = (sType == 'Standard') and 1 or 2 - -- true: Normal - -- false: Lower - bPreference = ThemePrefs.Get("NotePosition") and "Normal" or "Lower" - tNotePos = tNotePositions[bPreference] - return tNotePos[bCategory] -end - -function ComboUnderField() - --return ThemePrefs.Get("ComboUnderField") - return false -end - local CodeDetectorCodes = { -- steps PrevSteps1 = { diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index af930d9c74..1760cba4f1 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -24,7 +24,7 @@ ScreenHeight=480 # Allows you to pick all available game modes for your gametype: for example, # inserting enough coins for 1p would let you choose between solo, single # and double before each game -AutoSetStyle=ThemePrefs.Get("AutoSetStyle") +AutoSetStyle=false # Default modifiers and noteskin. DefaultModifiers="1x" @@ -1019,15 +1019,8 @@ GradeTier02IsFullCombo=false NumGradeTiersUsed=7 [Player] -# In The Groove -# ReceptorArrowsYStandard=-125 -# ReceptorArrowsYReverse=145 -# StepMania Alpha 4 -# ~ ReceptorArrowsYStandard=-144 -# ~ ReceptorArrowsYReverse=144 -# SM5 uses a UserPreference for this. -ReceptorArrowsYStandard=GetTapPosition('Standard') -ReceptorArrowsYReverse=GetTapPosition('Reverse') +ReceptorArrowsYStandard=-144 +ReceptorArrowsYReverse=144 ReceptorNoSinkScoreCutoff=4 JudgmentTransformCommand=%JudgmentTransformCommand JudgmentOnCommand= @@ -1044,7 +1037,7 @@ DrawDistanceBeforeTargetsPixels=SCREEN_HEIGHT DrawDistanceAfterTargetsPixels=-128 TapJudgmentsUnderField=false HoldJudgmentsUnderField=false -ComboUnderField=ComboUnderField() +ComboUnderField=false PenalizeTapScoreNone=false JudgeHoldNotesOnSameRowTogether=false HoldCheckpoints=IsGame("pump") diff --git a/Themes/default/Scripts/03 ThemePrefs.lua b/Themes/default/Scripts/02 ThemePrefs.lua similarity index 100% rename from Themes/default/Scripts/03 ThemePrefs.lua rename to Themes/default/Scripts/02 ThemePrefs.lua diff --git a/Themes/default/Scripts/03 Gameplay.lua b/Themes/default/Scripts/03 Gameplay.lua new file mode 100644 index 0000000000..1235c302b6 --- /dev/null +++ b/Themes/default/Scripts/03 Gameplay.lua @@ -0,0 +1,26 @@ +-- StepMania 5 default theme | script ring 03 | Gameplay.lua +-- someone thought it'd be a good idea to put theme preferences into the fallback +-- when they should've been in default instead. there is no emoticon for how i feel +-- at this moment right now -freem + +-- for example, not every theme wants to worry about custom receptor positions. +local tNotePositions = { + -- StepMania 3.9/4.0 + Normal = { -144, 144, }, + -- ITG + Lower = { -125, 145, } +} + +function GetTapPosition( sType ) + bCategory = (sType == 'Standard') and 1 or 2 + -- true: Normal + -- false: Lower + bPreference = ThemePrefs.Get("NotePosition") and "Normal" or "Lower" + tNotePos = tNotePositions[bPreference] + return tNotePos[bCategory] +end + +-- combo under field is another thing that doesn't always need to be custom +function ComboUnderField() + return ThemePrefs.Get("ComboUnderField") +end \ No newline at end of file diff --git a/Themes/default/metrics.ini b/Themes/default/metrics.ini index c97f6f241e..ac89f8e5e9 100644 --- a/Themes/default/metrics.ini +++ b/Themes/default/metrics.ini @@ -4,6 +4,7 @@ FallbackTheme=_fallback [Common] FirstAttractScreen="" +AutoSetStyle=ThemePrefs.Get("AutoSetStyle") # 02 # [LightsManager] @@ -296,6 +297,16 @@ ShowBoard=GAMESTATE:GetCurrentGame():GetName() == "kb7" [PlayerStageStats] [Player] +# In The Groove +# ReceptorArrowsYStandard=-125 +# ReceptorArrowsYReverse=145 +# StepMania Alpha 4 +# ~ ReceptorArrowsYStandard=-144 +# ~ ReceptorArrowsYReverse=144 +# SM5's default uses a UserPreference for this. +ReceptorArrowsYStandard=GetTapPosition('Standard') +ReceptorArrowsYReverse=GetTapPosition('Reverse') +ComboUnderField=ComboUnderField() [PlayerOptions] @@ -1251,7 +1262,7 @@ ItemsLongRowSharedX=SCREEN_CENTER_X [ScreenOptionsSystemDirection] LineNames="1,2,3,4,5,6,7,8,9,FlashyCombo,RollCombo,10,11,12,13,14,16,LF,17,18,19,20,21,22" -LineLF="lua,UserPrefLongFail()" +LineLF="lua,ThemePrefRow('LongFail')" LineRollCombo="lua,ThemePrefRow('ComboOnRolls')" LineFlashyCombo="lua,ThemePrefRow('FlashyCombo')"