Skip to content

Commit

Permalink
System - Save/Load added IN BETA
Browse files Browse the repository at this point in the history
  • Loading branch information
kuukuukuatchu committed Apr 4, 2017
1 parent 33cc585 commit 5399f31
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
4 changes: 4 additions & 0 deletions System/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
50 changes: 50 additions & 0 deletions System/UI/Windows/Settings.lua
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5399f31

Please sign in to comment.