From 5399f3155a71360114ad4e1d101c4eba2c221f36 Mon Sep 17 00:00:00 2001 From: kuukuukuatchu Date: Tue, 4 Apr 2017 02:45:05 -0400 Subject: [PATCH] System - Save/Load added IN BETA --- System/Core.lua | 4 +++ System/UI/Windows/Settings.lua | 50 ++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 System/UI/Windows/Settings.lua diff --git a/System/Core.lua b/System/Core.lua index 7842e3cfa..393e60c30 100644 --- a/System/Core.lua +++ b/System/Core.lua @@ -257,6 +257,10 @@ function BadRotationsUpdate(self) br.ui:closeWindow("debug") end + if isChecked("Save/Load Settings") then + br.ui:createSettingsWindow() + end + -- FPS Intensive Functions -- Healing Engine if isChecked("HE Active") then diff --git a/System/UI/Windows/Settings.lua b/System/UI/Windows/Settings.lua new file mode 100644 index 000000000..2a64fdb96 --- /dev/null +++ b/System/UI/Windows/Settings.lua @@ -0,0 +1,50 @@ +br.ui.window.settings = {} +function br.ui:createSettingsWindow() + if not br.ui.window['settings']['parent'] then + br.ui.window.settings = br.ui:createWindow("Save/Load Settings", 200, 125, "Save/Load Settings") + local section + section = br.ui:createSection(br.ui.window.settings, "Save/Load") + br.ui:createCheckbox(section, "Dungeons", "Save/Load Dungeon Data") + br.ui:createCheckbox(section, "Raids", "Save/Load Raid Data") + br.ui:createSettingsButton(section, "Save", 0, -40) + br.ui:createSettingsButton(section, "Load", 100, -40) + br.ui:checkSectionState(section) + br.ui.window.settings.parent.closeButton:SetScript("OnClick", function() + if br.data.settings[br.selectedSpec][br.selectedProfile] ~= nil then + br.data.settings[br.selectedSpec][br.selectedProfile]["Save/Load SettingsCheck"] = false + end + if slsettings ~= nil then slsettings:SetChecked(false) end + br.data.settings[br.selectedSpec].settings["active"] = false + br.ui.window.settings.parent:Hide() + end) + br.ui:checkWindowStatus("settings") + br.ui:closeWindow("settings") + end + if isChecked("Save/Load Settings") then + if not br.ui.window['settings']['parent'] then + br.ui.window.settings = br.ui:createWindow("Save/Load Settings", 200, 125, "Save/Load Settings") + local section + section = br.ui:createSection(br.ui.window.settings, "Save/Load") + br.ui:createCheckbox(section, "Dungeons", "Save/Load Dungeon Data") + br.ui:createCheckbox(section, "Raids", "Save/Load Raid Data") + br.ui:createSettingsButton(section, "Save", 0, -40) + br.ui:createSettingsButton(section, "Load", 100, -40) + br.ui:checkSectionState(section) + br.ui.window.settings.parent.closeButton:SetScript("OnClick", function() + if br.data.settings[br.selectedSpec][br.selectedProfile] ~= nil then + br.data.settings[br.selectedSpec][br.selectedProfile]["Save/Load SettingsCheck"] = false + end + if slsettings ~= nil then slsettings:SetChecked(false) end + br.data.settings[br.selectedSpec].settings["active"] = false + br.ui.window.settings.parent:Hide() + end) + br.ui:checkWindowStatus("settings") + end + br.ui:showWindow("settings") + elseif br.data.settings[br.selectedSpec]["settings"] == nil then + br.data.settings[br.selectedSpec]["settings"] = {} + br.data.settings[br.selectedSpec]["settings"].active = false + elseif br.data.settings[br.selectedSpec]["settings"].active == true then + br.ui:closeWindow("settings") + end + end \ No newline at end of file