Skip to content

Commit

Permalink
Settings updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Serkan Yazıcıoğlu committed Jul 25, 2024
1 parent eddb862 commit 43e54bc
Show file tree
Hide file tree
Showing 7 changed files with 940 additions and 836 deletions.
3 changes: 2 additions & 1 deletion Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ GOW.consts = {
GOW.defaults = {
profile = {
version = 1,
minimap = { hide = false }
minimap = { hide = false },
warnNewEvents = true
}
}

Expand Down
20 changes: 17 additions & 3 deletions Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ local optionsTable = {
type = "toggle",
order = 1,
name = "Show minimap icon",
width = "full",
get = function(info) return not GOW.DB.profile.minimap.hide end,
set = function(info, value)
GOW.DB.profile.minimap.hide = not value;
Expand All @@ -27,16 +28,29 @@ local optionsTable = {
GOW.LDBIcon:Show("gowicon");
end
end,
},
DisplayNewEventWarning = {
type = "toggle",
order = 2,
name = "Warn when new events are found",
desc = "Display a warning new new events which are not formed on in-game calendar are found",
width = "full",
get = function(info) return GOW.DB.profile.warnNewEvents end,
set = function(info, value)
GOW.DB.profile.warnNewEvents = value;
end,
}
}
}
}
}
}

AceConfig:RegisterOptionsTable(addonName, optionsTable, nil);
AceConfigDialog:AddToBlizOptions(addonName, "Guilds of WoW");
local GetAddOnMetadataFunc = GetAddOnMetadata or C_AddOns.GetAddOnMetadata;
local OpenSettingsFunc = InterfaceOptionsFrame_OpenToCategory or Settings.OpenToCategory;

function GOW:OpenSettings()
local title = GetAddOnMetadata(addonName, "Title");
InterfaceOptionsFrame_OpenToCategory(title);
local title = GetAddOnMetadataFunc(addonName, "Title");
OpenSettingsFunc(title);
end
Loading

0 comments on commit 43e54bc

Please sign in to comment.