Skip to content

Commit

Permalink
Change Practice Mode toggle from PlayerOption to sketchy Lua
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Sep 17, 2019
1 parent 71e921b commit 090b236
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
27 changes: 27 additions & 0 deletions Themes/_fallback/Scripts/02 ThemePrefs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,30 @@ function InitUserPrefs()
SetUserPref("UserPrefScoringMode", "DDR Extreme")
end
end

-- Practice Mode Lua version because I don't know what else to do
function PracticeMode()
local t = {
Name = "PracticeMode",
LayoutType = "ShowAllInRow",
SelectType = "SelectOne",
OneChoiceForAllPlayers = false,
ExportOnChange = true,
Choices = {THEME:GetString("OptionNames", "Off"), THEME:GetString("OptionNames", "On")},
LoadSelections = function(self, list, pn)
local pref = GAMESTATE:IsPracticeMode()
if pref then
list[2] = true
else
list[1] = true
end
end,
SaveSelections = function(self, list, pn)
local value
value = list[2]
GAMESTATE:SetPracticeMode(value)
end
}
setmetatable(t, t)
return t
end
7 changes: 1 addition & 6 deletions Themes/_fallback/metrics.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1869,11 +1869,6 @@ PlayerAutoPlayDefault="mod,no playerautoplay"
PlayerAutoPlay,1="name,Off"
PlayerAutoPlay,2="mod,playerautoplay;name,On"

PracticeMode="2"
PracticeModeDefault="mod,no practicemode"
PracticeMode,1="name,Off"
PracticeMode,2="mod,practicemode;name,On"

Hide="3;selectmultiple"
HideDefault="mod,no dark,no blind,no cover"
Hide,1="mod,dark;name,Dark"
Expand Down Expand Up @@ -2504,7 +2499,7 @@ Line13="list,Hide"
Line14="list,Persp"
Line16="list,Steps"
Line17="list,Characters"
LinePRAC="list,PracticeMode"
LinePRAC="lua,PracticeMode()"
#


Expand Down

0 comments on commit 090b236

Please sign in to comment.