Skip to content

Commit

Permalink
add ComboTween theme option
Browse files Browse the repository at this point in the history
disabled by default like judgement tween option
  • Loading branch information
Ulti-FD committed Jul 28, 2021
1 parent acfa6c7 commit e0c31f7
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 1 deletion.
13 changes: 13 additions & 0 deletions Themes/Til Death/Graphics/Player combo/default.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ local allowedCustomization = playerConfig:get_data(pn_to_profile_slot(PLAYER_1))
local c
local enabledCombo = playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).ComboText
local CenterCombo = CenteredComboEnabled()
local CTEnabled = ComboTweensEnabled()

local Pulse = THEME:GetMetric("Combo", "PulseCommand")
local NumberMinZoom = THEME:GetMetric("Combo", "NumberMinZoom")
local NumberMaxZoom = THEME:GetMetric("Combo", "NumberMaxZoom")
local NumberMaxZoomAt = THEME:GetMetric("Combo", "NumberMaxZoomAt")

local function arbitraryComboX(value)
c.Label:x(value)
Expand Down Expand Up @@ -119,6 +125,13 @@ local t =
c.Label:diffuse(Color("Red"))
c.Label:diffusebottomedge(color("0.5,0,0,1"))
end

--Animations
param.Zoom = scale(iCombo, 0, NumberMaxZoomAt, NumberMinZoom, NumberMaxZoom)
param.Zoom = clamp(param.Zoom, NumberMinZoom, NumberMaxZoom)
if CTEnabled then
Pulse(c.Number, param)
end
end,
MovableBorder(0, 0, 1, MovableValues.ComboX, MovableValues.ComboY),
}
Expand Down
2 changes: 2 additions & 0 deletions Themes/Til Death/Languages/en.ini
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ ShowVisualizer=Music Visualizer
InstantSearch=Instant Search
IgnoreTabInput=Ignore Tabs Input
JudgmentTween=Judgement Animations
ComboTween=Combo Animations
CenteredCombo=Centered Combo
[OptionExplanations]
Expand Down Expand Up @@ -232,6 +233,7 @@ ShowVisualizer=Toggle whether to display the audio visualizer while on the Song
InstantSearch=Turn this on to have the Song Wheel update for every letter you put into the song search. If you lag when searching, turn this off.
IgnoreTabInput=While on the song wheel, number inputs do not change tabs.
JudgmentTween=Toggle animated judgements.
ComboTween=Toggle combo text animations.
CenteredCombo=Sets the positioning of the combo number (also disables the combo label).

[OffsetPlot]
Expand Down
4 changes: 4 additions & 0 deletions Themes/Til Death/Scripts/01 theme_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ local defaultConfig = {
InstantSearch = true, -- true = search per press, false = search on enter button
IgnoreTabInput = 1, -- 1 = dont ignore, 2 = ignore only in search, 3 = always
JudgmentTween = false,
ComboTween = false,
CenteredCombo = false,
FadeNoteFieldInSyncMachine = true,
},
Expand All @@ -41,6 +42,9 @@ themeConfig:load()
function JudgementTweensEnabled()
return themeConfig:get_data().global.JudgmentTween
end
function ComboTweensEnabled()
return themeConfig:get_data().global.ComboTween
end
function CenteredComboEnabled()
return themeConfig:get_data().global.CenteredCombo
end
32 changes: 32 additions & 0 deletions Themes/Til Death/Scripts/02 ThemePrefs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,38 @@ function JudgmentTween()
return t
end

function ComboTween()
local t = {
Name = "ComboTween",
LayoutType = "ShowAllInRow",
SelectType = "SelectOne",
OneChoiceForAllPlayers = true,
ExportOnChange = true,
Choices = {THEME:GetString("OptionNames", "Off"), THEME:GetString("OptionNames", "On")},
LoadSelections = function(self, list, pn)
local pref = themeConfig:get_data().global.ComboTween
if pref then
list[2] = true
else
list[1] = true
end
end,
SaveSelections = function(self, list, pn)
local value
if list[1] then
value = false
else
value = true
end
themeConfig:get_data().global.ComboTween = value
themeConfig:set_dirty()
themeConfig:save()
end
}
setmetatable( t, t )
return t
end

function CenteredCombo()
local t = {
Name = "CenteredCombo",
Expand Down
5 changes: 4 additions & 1 deletion Themes/Til Death/metrics.ini
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ NumberMaxZoomAt=100
#
LabelMinZoom=0.75*0.75
LabelMaxZoom=0.75*0.75
# Things the combo does when you bang on it
PulseCommand=%function(self,param) self:stoptweening(); self:zoom(1.1*param.Zoom); self:linear(0.05); self:zoom(param.Zoom); end

[ScreenProfileLoad]
Class="ScreenProfileLoad"
Expand Down Expand Up @@ -491,7 +493,7 @@ LineInputOptions="gamecommand;screen,ScreenOptionsInputSub;name,InputOptions"
Fallback="ScreenOptionsServiceChild"
NextScreen="ScreenOptionsService"
PrevScreen="ScreenOptionsService"
LineNames="SongBGEnabled,RateSort,HelpMenu,NPSWindow,MeasureLines,Visualizer,InstantSearch,JudgmentTween,CenteredCombo,IgnoreTabInput,FNFnGSM"
LineNames="SongBGEnabled,RateSort,HelpMenu,NPSWindow,MeasureLines,Visualizer,InstantSearch,JudgmentTween,ComboTween,CenteredCombo,IgnoreTabInput,FNFnGSM"
#LineDefaultScore="lua,DefaultScoreType()"
LineTipType="lua,TipType()"
LineFNFnGSM="lua,FadeNoteFieldInSyncMachine()"
Expand All @@ -506,6 +508,7 @@ LineMeasureLines="lua,MeasureLines()"
LineVisualizer="lua,ShowVisualizer()"
LineInstantSearch="lua,InstantSearch()"
LineJudgmentTween="lua,JudgmentTween()"
LineComboTween="lua,ComboTween()"
LineCenteredCombo="lua,CenteredCombo()"
LineIgnoreTabInput="lua,IgnoreTabInput()"

Expand Down

0 comments on commit e0c31f7

Please sign in to comment.