From 090b236cc765c772db6de2facc2c1581c6a10ccb Mon Sep 17 00:00:00 2001 From: Barinade Date: Mon, 16 Sep 2019 20:19:22 -0500 Subject: [PATCH] Change Practice Mode toggle from PlayerOption to sketchy Lua --- Themes/_fallback/Scripts/02 ThemePrefs.lua | 27 ++++++++++++++++++++++ Themes/_fallback/metrics.ini | 7 +----- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/Themes/_fallback/Scripts/02 ThemePrefs.lua b/Themes/_fallback/Scripts/02 ThemePrefs.lua index 5fb6a3778c..409451712f 100644 --- a/Themes/_fallback/Scripts/02 ThemePrefs.lua +++ b/Themes/_fallback/Scripts/02 ThemePrefs.lua @@ -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 \ No newline at end of file diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index c1113b36b9..97acb5b800 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -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" @@ -2504,7 +2499,7 @@ Line13="list,Hide" Line14="list,Persp" Line16="list,Steps" Line17="list,Characters" -LinePRAC="list,PracticeMode" +LinePRAC="lua,PracticeMode()" #