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 c2c39c3 commit d8f8040
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@ globals = {
"IsTestBuild",
"C_Engraving",

"C_AddOns",
"C_Spell",
"C_UnitAuras",
"AuraUtil",
"Settings",

-- Wrath spell haste
"GetCombatRatingBonus",
"GetActiveTalentGroup",
Expand Down
11 changes: 11 additions & 0 deletions NugRunning.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ if apiLevel == 3 then
UnitSpellHaste = function() return GetCombatRatingBonus(CR_HASTE_SPELL) end
end
local GetSpecialization = isClassic and function() return nil end or _G.GetSpecialization
local LoadAddOn = LoadAddOn or C_AddOns.LoadAddOn


local NRunDB = nil
local config = NugRunningConfig
Expand Down Expand Up @@ -1764,6 +1766,15 @@ local ParseOpts = function(str)
return t
end

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

NugRunning.Commands = {
["unlock"] = function()
for name, anchor in pairs(NugRunning.anchors) do
Expand Down
21 changes: 21 additions & 0 deletions Options/NugRunningOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ local COMBATLOG_OBJECT_AFFILIATION_PARTY_OR_RAID = COMBATLOG_OBJECT_AFFILIATION_
local LSM = LibStub("LibSharedMedia-3.0")

local newFeatureIcon = "|TInterface\\OptionsFrame\\UI-OptionsFrame-NewFeatureIcon:0:0:0:-1|t"
local GetSpellInfo = NugRunning.helpers.GetSpellInfo
local GetSpellTexture = NugRunning.helpers.GetSpellTexture

function NugRunningGUI.SlashCmd(msg)
NugRunningGUI.frame:Show()
Expand Down Expand Up @@ -1953,6 +1955,25 @@ 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

do
local f = CreateFrame('Frame', "NugRunningOptions", InterfaceOptionsFrame)
f.general = MakeGeneralOptions() -- makes the root category now
Expand Down

0 comments on commit d8f8040

Please sign in to comment.