Skip to content

Commit

Permalink
rebirth add measure lines toggle to settings
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Dec 13, 2021
1 parent 2127beb commit 09eaf6c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
9 changes: 9 additions & 0 deletions Themes/Rebirth/BGAnimations/playerInfoFrame/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2894,6 +2894,7 @@ local function rightFrame()
leaderboard = playeroption("leaderboardEnabled"),
displayMean = playeroption("DisplayMean"),
measureCounter = playeroption("MeasureCounter"),
measureLines = {get = getdataPLAYER("MeasureLines"), set = function(x) setdataPLAYER("MeasureLines", x) THEME:ReloadMetrics() end},
npsDisplay = playeroption("NPSDisplay"),
npsGraph = playeroption("NPSGraph"),
playerInfo = playeroption("PlayerInfo"),
Expand Down Expand Up @@ -4548,6 +4549,14 @@ local function rightFrame()
Directions = optionDataToggleDirectionsFUNC("measureCounter", true, false),
ChoiceIndexGetter = optionDataToggleIndexGetterFUNC("measureCounter", true),
},
{
Name = "Measure Lines",
Type = "SingleChoice",
Explanation = "Toggle showing a line on the NoteField for every measure.",
Choices = choiceSkeleton("On", "Off"),
Directions = optionDataToggleDirectionsFUNC("measureLines", true, false),
ChoiceIndexGetter = optionDataToggleIndexGetterFUNC("measureLines", true),
},
{
Name = "NPS Display",
Type = "SingleChoice",
Expand Down
1 change: 1 addition & 0 deletions Themes/Rebirth/Scripts/01 player_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ local defaultConfig = {
DisplayMean = true,
leaderboardEnabled = false,
MeasureCounter = false,
MeasureLines = false,
MiniProgressBar = true,
NPSDisplay = true,
NPSGraph = true,
Expand Down
9 changes: 4 additions & 5 deletions Themes/Rebirth/Scripts/02 ThemePrefs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ function MeasureLines()
ExportOnChange = true,
Choices = {THEME:GetString("OptionNames", "Off"), THEME:GetString("OptionNames", "On")},
LoadSelections = function(self, list, pn)
local pref = themeConfig:get_data().global.MeasureLines
local pref = playerConfig:get_data().MeasureLines
if pref then
list[2] = true
else
Expand All @@ -1024,10 +1024,9 @@ function MeasureLines()
else
value = true
end
themeConfig:get_data().global.MeasureLines = value
themeConfig:set_dirty()
themeConfig:save()
THEME:ReloadMetrics()
playerConfig:get_data().MeasureLines = value
playerConfig:set_dirty()
playerConfig:save()
end
}
setmetatable(t, t)
Expand Down
5 changes: 5 additions & 0 deletions Themes/Rebirth/metrics.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ NumWheelItems=-3

[NoteField]
ShowBoard=true
ShowBeatBars=playerConfig:get_data().MeasureLines
BarMeasureAlpha=0.4
Bar4thAlpha=0
Bar8thAlpha=0
Bar16thAlpha=0

[OptionRow]
FrameX=SCREEN_CENTER_X-convertForThemeHeight(222)
Expand Down

0 comments on commit 09eaf6c

Please sign in to comment.