Skip to content

Commit

Permalink
TWW API Update
Browse files Browse the repository at this point in the history
  • Loading branch information
d87 committed Jul 23, 2024
1 parent 38f9440 commit 5527cec
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,6 @@ globals = {
"PowerBarColor",
"GetCVar",
"BackdropTemplateMixin",
"UnitReaction"
"UnitReaction",
"Settings",
}
29 changes: 29 additions & 0 deletions NugEnergy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,35 @@ local ParseOpts = function(str)
return fields
end

local function InterfaceOptions_AddCategory(frame, addOn, position)
-- cancel is no longer a default option. May add menu extension for this.
frame.OnCommit = frame.okay;
frame.OnDefault = frame.default;
frame.OnRefresh = frame.refresh;

if frame.parent then
local category = Settings.GetCategory(frame.parent);
local subcategory, layout = Settings.RegisterCanvasLayoutSubcategory(category, frame, frame.name, frame.name);
subcategory.ID = frame.name;
return subcategory, category;
else
local category, layout = Settings.RegisterCanvasLayoutCategory(frame, frame.name, frame.name);
category.ID = frame.name;
Settings.RegisterAddOnCategory(category);
return category;
end
end

-- Deprecated. Use Settings.OpenToCategory().
local function InterfaceOptionsFrame_OpenToCategory(categoryIDOrFrame)
if type(categoryIDOrFrame) == "table" then
local categoryID = categoryIDOrFrame.name;
return Settings.OpenToCategory(categoryID);
else
return Settings.OpenToCategory(categoryIDOrFrame);
end
end

NugEnergy.Commands = {
["gui"] = function(v)
if not NugEnergy.optionsPanel then
Expand Down

0 comments on commit 5527cec

Please sign in to comment.