Skip to content

Commit

Permalink
Update default theme to fit new function parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
rogeraabbccdd committed Aug 1, 2023
1 parent 59e4c1b commit 4c283bf
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions TECHMANIA/Assets/UI/Scripts/Panels/Options Panel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,6 @@ function InitializeThemeOptions()
InitializeOneOption("pauseButtonInteraction", "SingleTap")
end

function OnTracksFolderSelected(newFolder)
if (newFolder != nil) then
tm.options.tracksFolderLocation = newFolder;
tm.paths.ApplyCustomDataLocation()
selectTrackPanel.needsRefresh = true
optionsPanel.UpdateCustomDataLocationDisplay()
end
end

function OnSkinsFolderSelected(newFolder)
if (newFolder != nil) then
tm.options.skinsFolderLocation = newFolder;
tm.paths.ApplyCustomDataLocation()
optionsPanel.UpdateCustomDataLocationDisplay()
end
end

function OnThemeFolderSelected(newFolder)
if (newFolder != nil) then
tm.options.themesFolderLocation = newFolder;
tm.paths.ApplyCustomDataLocation()
optionsPanel.UpdateCustomDataLocationDisplay()
optionsPanel.UpdateThemeDropdown()
end
end

optionsPanel = {
panel = tm.root.Q("options-panel"),

Expand Down Expand Up @@ -384,17 +358,43 @@ optionsPanel.Initialize = function()
end)
end

function OnTracksFolderSelected(newFolder)
if (newFolder != nil) then
tm.options.tracksFolderLocation = newFolder;
tm.paths.ApplyCustomDataLocation()
selectTrackPanel.needsRefresh = true
optionsPanel.UpdateCustomDataLocationDisplay()
end
end
local tracksFolderButton = panel.Q("tracks-folder-location").Q("button")
tracksFolderButton.RegisterCallback(eventType.Click, function()
tm.OpenSelectFolderDialog("", tm.options.tracksFolderLocation, "OnTracksFolderSelected")
tm.OpenSelectFolderDialog("", tm.options.tracksFolderLocation, OnTracksFolderSelected)
end)


function OnSkinsFolderSelected(newFolder)
if (newFolder != nil) then
tm.options.skinsFolderLocation = newFolder;
tm.paths.ApplyCustomDataLocation()
optionsPanel.UpdateCustomDataLocationDisplay()
end
end
local skinsFolderButton = panel.Q("skins-folder-location").Q("button")
skinsFolderButton.RegisterCallback(eventType.Click, function()
tm.OpenSelectFolderDialog("", tm.options.skinsFolderLocation, "OnSkinsFolderSelected")
tm.OpenSelectFolderDialog("", tm.options.skinsFolderLocation, OnSkinsFolderSelected)
end)

function OnThemeFolderSelected(newFolder)
if (newFolder != nil) then
tm.options.themesFolderLocation = newFolder;
tm.paths.ApplyCustomDataLocation()
optionsPanel.UpdateCustomDataLocationDisplay()
optionsPanel.UpdateThemeDropdown()
end
end
local themesFolderButton = panel.Q("themes-folder-location").Q("button")
themesFolderButton.RegisterCallback(eventType.Click, function()
tm.OpenSelectFolderDialog("", tm.options.themesFolderLocation, "OnThemeFolderSelected")
tm.OpenSelectFolderDialog("", tm.options.themesFolderLocation, OnThemeFolderSelected)
end)
-- end

Expand Down

0 comments on commit 4c283bf

Please sign in to comment.