From 82e3444f3857ad8f3c28b476a765c9552f790f0d Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Wed, 21 Jul 2010 22:40:14 -0500 Subject: [PATCH] flashy combo userpref (default = off) --- .../Graphics/Combo 100milestone/default.lua | 5 ++- .../default/Graphics/Player combo/default.lua | 18 +++++++-- Themes/default/Languages/en.ini | 2 + Themes/default/Scripts/03 ThemePrefs.lua | 39 +++++++++++++++++++ Themes/default/metrics.ini | 3 +- 5 files changed, 60 insertions(+), 7 deletions(-) diff --git a/Themes/default/Graphics/Combo 100milestone/default.lua b/Themes/default/Graphics/Combo 100milestone/default.lua index 377c7d897e..0d7279c583 100644 --- a/Themes/default/Graphics/Combo 100milestone/default.lua +++ b/Themes/default/Graphics/Combo 100milestone/default.lua @@ -1,10 +1,11 @@ +local ShowFlashyCombo = GetUserPrefB("UserPrefFlashyCombo") return Def.ActorFrame { LoadActor("explosion") .. { - InitCommand=cmd(diffusealpha,0;blend,'BlendMode_Add'); + InitCommand=cmd(diffusealpha,0;blend,'BlendMode_Add';hide_if,not ShowFlashyCombo); MilestoneCommand=cmd(rotationz,0;zoom,2;diffusealpha,0.5;linear,0.5;rotationz,90;zoom,1.75;diffusealpha,0); }; LoadActor("explosion") .. { - InitCommand=cmd(diffusealpha,0;blend,'BlendMode_Add'); + InitCommand=cmd(diffusealpha,0;blend,'BlendMode_Add';hide_if,not ShowFlashyCombo); MilestoneCommand=cmd(rotationz,0;zoom,2;diffusealpha,0.5;linear,0.5;rotationz,-90;zoom,2.5;diffusealpha,0); }; }; \ No newline at end of file diff --git a/Themes/default/Graphics/Player combo/default.lua b/Themes/default/Graphics/Player combo/default.lua index 24526dd9c0..3013a37b6a 100644 --- a/Themes/default/Graphics/Player combo/default.lua +++ b/Themes/default/Graphics/Player combo/default.lua @@ -12,16 +12,22 @@ local NumberMaxZoomAt = THEME:GetMetric("Combo", "NumberMaxZoomAt"); local LabelMinZoom = THEME:GetMetric("Combo", "LabelMinZoom"); local LabelMaxZoom = THEME:GetMetric("Combo", "LabelMaxZoom"); +local ShowFlashyCombo = GetUserPrefB("UserPrefFlashyCombo") + local t = Def.ActorFrame { InitCommand=cmd(vertalign,bottom); ---[[ LoadActor(THEME:GetPathG("Combo","100Milestone")) .. { + -- flashy combo elements: + LoadActor(THEME:GetPathG("Combo","100Milestone")) .. { Name="OneHundredMilestone"; + InitCommand=cmd(visible,ShowFlashyCombo); FiftyMilestoneCommand=cmd(playcommand,"Milestone"); }; LoadActor(THEME:GetPathG("Combo","1000Milestone")) .. { Name="OneThousandMilestone"; + InitCommand=cmd(visible,ShowFlashyCombo); ToastyAchievedMessageCommand=cmd(playcommand,"Milestone"); - }; --]] + }; + -- normal combo elements: Def.ActorFrame { Name="ComboFrame"; LoadFont( "Combo", "numbers" ) .. { @@ -50,9 +56,13 @@ local t = Def.ActorFrame { else return end; --]] ---[[ TwentyFiveMilestoneCommand=function(self,parent) - (cmd(skewy,-0.125;decelerate,0.325;skewy,0))(self); + TwentyFiveMilestoneCommand=function(self,parent) + if ShowFlashyCombo then + (cmd(skewy,-0.125;decelerate,0.325;skewy,0))(self); + end; end; + --]] + --[[ ToastyAchievedMessageCommand=function(self,params) if params.PlayerNumber == player then (cmd(thump,2;effectclock,'beat'))(c.ComboFrame); diff --git a/Themes/default/Languages/en.ini b/Themes/default/Languages/en.ini index 12611207d2..d34c52c2b3 100644 --- a/Themes/default/Languages/en.ini +++ b/Themes/default/Languages/en.ini @@ -63,6 +63,7 @@ UserPrefShowLotsaOptions=Options Density UserPrefAutoSetStyle=Auto Set Style UserPrefLongFail=Fail Length UserPrefComboOnRolls=Rolls Increment Combo +UserPrefFlashyCombo=Flashy Combo [OptionExplanations] UserPrefNotePosition=Determines where the arrow receptors are placed in gameplay. UserPrefGameplayShowScore=Show or Hide the score display in gameplay. @@ -71,6 +72,7 @@ UserPrefShowLotsaOptions=Choose how many lines/rows of options to choose from. & UserPrefAutoSetStyle=Allow the game to list all one player and two player modes at once instead of one style only. This might require a restart of StepMania\n( or alternatively hit F2! ) UserPrefLongFail=Choose between the original sm-ssc fail (Long) or the new sm-ssc fail (Short). UserPrefComboOnRolls=Choose if rolls should increment the combo or not. +UserPrefFlashyCombo=Determine if combo flashes should be shown or not. [StepsListDisplayRow StepsType] Dance_Single=4 Dance_Double=8 diff --git a/Themes/default/Scripts/03 ThemePrefs.lua b/Themes/default/Scripts/03 ThemePrefs.lua index e97a80c1b1..a1955526b9 100644 --- a/Themes/default/Scripts/03 ThemePrefs.lua +++ b/Themes/default/Scripts/03 ThemePrefs.lua @@ -22,6 +22,9 @@ function InitUserPrefs() if GetUserPrefB("UserPrefComboOnRolls") == nil then SetUserPref("UserPrefComboOnRolls", false); end; + if GetUserPrefB("FlashyCombos") == nil then + SetUserPref("FlashyCombos", false); + end; --[[ if GetUserPref("ProTimingP1") == nil then SetUserPref("ProTimingP1", false); end; @@ -350,4 +353,40 @@ function UserPrefComboOnRolls() setmetatable( t, t ); return t; end + +function UserPrefFlashyCombo() + local t = { + Name = "UserPrefFlashyCombo"; + LayoutType = "ShowAllInRow"; + SelectType = "SelectOne"; + OneChoiceForAllPlayers = true; + ExportOnChange = false; + Choices = { 'Off','On' }; + LoadSelections = function(self, list, pn) + if ReadPrefFromFile("UserPrefFlashyCombo") ~= nil then + if GetUserPrefB("UserPrefFlashyCombo") then + list[2] = true; + else + list[1] = true; + end; + else + WritePrefToFile("UserPrefFlashyCombo",false); + list[1] = true; + end; + end; + SaveSelections = function(self, list, pn) + local val; + if list[2] then + val = true; + else + val = false; + end; + WritePrefToFile("UserPrefFlashyCombo",val); + MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); + THEME:ReloadMetrics(); + end; + }; + setmetatable( t, t ); + return t; +end --[[ end option rows ]] \ No newline at end of file diff --git a/Themes/default/metrics.ini b/Themes/default/metrics.ini index 185b9b0c8b..3abaa610dc 100644 --- a/Themes/default/metrics.ini +++ b/Themes/default/metrics.ini @@ -773,9 +773,10 @@ LinegAuto="lua,UserPrefAutoSetStyle()" LinegLongFail="lua,UserPrefLongFail()" [ScreenOptionsSystemDirection] -LineNames="1,2,3,4,5,6,7,8,9,RollCombo,10,11,12,13,14,15,16,LF,17,18,19,20,21,22" +LineNames="1,2,3,4,5,6,7,8,9,FlashyCombo,RollCombo,10,11,12,13,14,15,16,LF,17,18,19,20,21,22" LineLF="lua,UserPrefLongFail()" LineRollCombo="lua,UserPrefComboOnRolls()" +LineFlashyCombo="lua,UserPrefFlashyCombo()" [ScreenOptionsService] ShowHeader=false