Gladdy-TBC/Modules/XiconProfiles.lua

156 lines
5.2 KiB
Lua
Raw Normal View History

2021-05-17 16:49:54 +02:00
local Gladdy = LibStub("Gladdy")
local L = Gladdy.L
local XiconProfiles = Gladdy:NewModule("XiconProfiles", nil, {
})
2022-01-11 00:29:30 +01:00
local function applyProfile(profileString)
local deserialized = Gladdy.modules["Export Import"]:Decode(profileString)
2021-09-14 23:53:12 +02:00
if deserialized then
Gladdy.modules["Export Import"]:ApplyImport(deserialized, Gladdy.db)
end
Gladdy:Reset()
Gladdy:HideFrame()
Gladdy:ToggleFrame(3)
2022-01-11 00:29:30 +01:00
Gladdy.options.args.lock.name = Gladdy.db.locked and L["Unlock frame"] or L["Lock frame"]
Gladdy.options.args.showMover.name = Gladdy.db.showMover and L["Hide Mover"] or L["Show Mover"]
LibStub("AceConfigRegistry-3.0"):NotifyChange("Gladdy")
2021-09-14 23:53:12 +02:00
end
2021-05-17 16:49:54 +02:00
function XiconProfiles:GetOptions()
return {
headerProfileBlizzard = {
type = "header",
2021-05-24 12:41:21 +02:00
name = "Blizzard " .. L["Profile"],
order = 2,
},
blizzardProfile = {
type = "execute",
func = function()
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
2022-01-11 00:29:30 +01:00
applyProfile(Gladdy:GetBlizzardProfile())
end,
name = " ",
2021-05-24 12:41:21 +02:00
desc = "Blizzard " .. L["Profile"],
image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Blizz1.blp",
imageWidth = 350,
imageHeight = 175,
width = "full",
order = 3,
},
2021-05-17 16:49:54 +02:00
headerProfileClassic = {
type = "header",
2021-05-24 12:41:21 +02:00
name = "Classic " .. L["Profile"],
order = 4,
2021-05-17 16:49:54 +02:00
},
classicProfile = {
type = "execute",
func = function()
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
2022-01-11 00:29:30 +01:00
applyProfile(Gladdy:GetClassicProfile())
2021-05-17 16:49:54 +02:00
end,
name = " ",
2021-05-24 12:41:21 +02:00
desc = "Classic " .. L["Profile"],
2021-05-17 16:49:54 +02:00
image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Classic1.blp",
2021-05-20 01:23:55 +02:00
imageWidth = 350,
imageHeight = 175,
2021-05-17 16:49:54 +02:00
width = "full",
order = 5,
2021-05-17 16:49:54 +02:00
},
2021-06-17 16:39:40 +02:00
headerProfileClassicNoPet = {
type = "header",
2021-09-14 23:53:12 +02:00
name = "Classic " .. L["Profile"] .. L[" No Pet"],
2021-06-17 16:39:40 +02:00
order = 6,
},
classicProfileNoPet = {
type = "execute",
func = function()
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
2022-01-11 00:29:30 +01:00
applyProfile(Gladdy:GetClassicProfileNoPet())
2021-06-17 16:39:40 +02:00
end,
name = " ",
2021-09-14 23:53:12 +02:00
desc = "Classic " .. L["Profile"] .. L[" No Pet"],
2021-06-17 16:39:40 +02:00
image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Classic2.blp",
imageWidth = 350,
imageHeight = 175,
width = "full",
order = 7,
},
2021-05-17 16:49:54 +02:00
headerProfileKnall = {
type = "header",
2021-05-24 12:41:21 +02:00
name = "Knall's " .. L["Profile"],
2021-06-17 16:39:40 +02:00
order = 8,
2021-05-17 16:49:54 +02:00
},
knallProfile = {
type = "execute",
func = function()
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
2022-01-11 00:29:30 +01:00
applyProfile(Gladdy:GetKnallProfile())
2021-05-17 16:49:54 +02:00
end,
name = " ",
2021-05-24 12:41:21 +02:00
desc = "Knall's " .. L["Profile"],
2021-05-17 16:49:54 +02:00
image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Knall1.blp",
2021-05-20 01:23:55 +02:00
imageWidth = 350,
imageHeight = 175,
2021-05-17 16:49:54 +02:00
width = "full",
2021-06-17 16:39:40 +02:00
order = 9,
2021-05-17 16:49:54 +02:00
},
headerProfileKlimp = {
type = "header",
2021-05-24 12:41:21 +02:00
name = "Klimp's " .. L["Profile"],
2021-06-17 16:39:40 +02:00
order = 10,
2021-05-17 16:49:54 +02:00
},
klimpProfiles = {
type = "execute",
func = function()
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
2022-01-11 00:29:30 +01:00
applyProfile(Gladdy:GetKlimpProfile())
2021-05-17 16:49:54 +02:00
end,
image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Klimp1.blp",
2021-05-20 01:23:55 +02:00
imageWidth = 350,
imageHeight = 175,
2021-05-17 16:49:54 +02:00
name = " ",
2021-05-24 12:41:21 +02:00
desc = "Klimp's " .. L["Profile"],
2021-05-17 16:49:54 +02:00
width = "full",
2021-06-17 16:39:40 +02:00
order = 11,
2021-05-17 16:49:54 +02:00
},
2021-07-26 14:35:37 +02:00
headerProfileRukk = {
type = "header",
name = "Rukk1's " .. L["Profile"],
order = 12,
},
rukkProfile = {
type = "execute",
func = function()
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
2022-01-11 00:29:30 +01:00
applyProfile(Gladdy:GetRukkProfile())
2021-07-26 14:35:37 +02:00
end,
name = " ",
desc = "Rukk1's " .. L["Profile"],
image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Rukk1.blp",
imageWidth = 350,
imageHeight = 175,
width = "full",
order = 13,
},
2021-09-14 23:53:12 +02:00
headerProfileMir = {
type = "header",
name = "Mir's " .. L["Profile"],
order = 14,
},
mirProfile = {
type = "execute",
func = function()
Gladdy.dbi:ResetProfile(Gladdy.dbi:GetCurrentProfile())
2022-01-11 00:29:30 +01:00
applyProfile(Gladdy:GetMirProfile())
2021-09-14 23:53:12 +02:00
end,
name = " ",
desc = "Mir's " .. L["Profile"],
image = "Interface\\AddOns\\Gladdy\\Images\\BasicProfiles\\Mir1.blp",
imageWidth = 350,
imageHeight = 175,
width = "full",
order = 15,
},
2021-05-17 16:49:54 +02:00
}
end