diff --git a/.vscode/settings.json b/.vscode/settings.json index dd6e0959..79a1fd3a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -633,7 +633,8 @@ "assign-type-mismatch", "need-check-nil", "inject-field", - "duplicate-set-field" + "duplicate-set-field", + "invisible" ], "[lua]": { "editor.defaultFormatter": "JohnnyMorganz.stylua" diff --git a/Core/Handlers/Font.lua b/Core/Handlers/Font.lua index 1f1de44b..87947421 100644 --- a/Core/Handlers/Font.lua +++ b/Core/Handlers/Font.lua @@ -225,7 +225,7 @@ local function FontSetupWizard() --Create Dropdown for other fonts using AceGUI and LSM30_Font position at the end of the Sample buttons local AceGUI = LibStub('AceGUI-3.0') - local dropdown = AceGUI:Create('LSM30_Font') + local dropdown = AceGUI:Create('LSM30_Font') ---@type AceGUIWidgetLSM30_Font dropdown:SetLabel('Other Fonts') dropdown:SetList(SUI.Lib.LSM:HashTable('font')) dropdown:SetValue('Roboto Bold') diff --git a/Framework.Definition.lua b/Framework.Definition.lua index 7da2ccfb..07cb24cd 100644 --- a/Framework.Definition.lua +++ b/Framework.Definition.lua @@ -16,3 +16,76 @@ local b = {} ---@class AceConfig.OptionsTable ---@field args? table local c = {} + +local function ContentOnClick(this, button) end + +--- Set the value to an item in the List. +--- @param value any +local function SetValue(self, value) end + +--- Set the list of values for the dropdown (key => value pairs) +--- @param list table +local function SetList(self, list) end + +--- Set the text displayed in the box. +---@param text string +local function SetText(self, text) end + +--- Set the text for the label. +---@param text string +local function SetLabel(self, text) end + +--- Add an item to the list. +---@param key any +---@param value any +local function AddItem(key, value) end +local SetItemValue = AddItem -- Set the value of a item in the list. <> + +local function SetMultiselect(self, flag) end -- Toggle multi-selecting. <> + +local function SetItemDisabled(self, key) end -- Disable one item in the list. <> + +---@param disabled boolean +local function SetDisabled(self, disabled) end + +local function ToggleDrop(self) end + +local function ClearFocus(self) end + +---return string +local function GetValue(self) end + +---@return AceGUIWidgetLSM30_Font +local function Constructor() + ---@class AceGUIWidgetLSM30_Font : AceGUIWidget + ---@field dropButton Button + local frame = {} + ---@class AceGUIWidgetLSM30_Font : AceGUIWidget + ---@field GetMultiselect function + ---@field GetValue function + ---@field OnAcquire function + ---@field OnRelease function + local self = {} + + self.type = 'LSM30_Font' + self.frame = frame + frame.obj = self + frame.dropButton.obj = self + + self.alignoffset = 31 + + self.ClearFocus = ClearFocus + self.SetText = SetText + self.SetValue = SetValue + self.GetValue = GetValue + self.SetList = SetList + self.SetLabel = SetLabel + self.SetDisabled = SetDisabled + self.AddItem = AddItem + self.SetMultiselect = SetMultiselect + self.SetItemValue = SetItemValue + self.SetItemDisabled = SetItemDisabled + self.ToggleDrop = ToggleDrop + + return self +end diff --git a/Modules/AutoTurnIn.lua b/Modules/AutoTurnIn.lua index b1d7e028..69bdb648 100644 --- a/Modules/AutoTurnIn.lua +++ b/Modules/AutoTurnIn.lua @@ -486,7 +486,8 @@ function module.QUEST_COMPLETE() end function module:GetItemAmount(isCurrency, item) - local amount = isCurrency and select(2, GetCurrencyInfo(item)) or C_Item.GetItemCount(item, nil, true) + local currency = C_CurrencyInfo.GetCurrencyInfo(item) + local amount = isCurrency and (currency.quantity or C_Item.GetItemCount(item, nil, true)) return amount and amount or 0 end @@ -722,7 +723,7 @@ function module.QUEST_GREETING() debug(numAvailableQuests) for i = 1, numActiveQuests do local isComplete = select(2, GetActiveTitle(i)) - if isComplete then SelectActiveQuest(i) end + if isComplete then C_GossipInfo.SelectActiveQuest(i) end end for i = 1, numAvailableQuests do @@ -735,11 +736,11 @@ function module.QUEST_GREETING() if (trivialORAllowed and isRepeatableORAllowed) and (not module.Blacklist.isBlacklisted(questID)) and questID ~= 0 then debug('selecting ' .. i .. ' questId ' .. questID) ---@diagnostic disable-next-line: redundant-parameter - SelectAvailableQuest(i) + C_GossipInfo.SelectAvailableQuest(i) end else ---@diagnostic disable-next-line: redundant-parameter - SelectAvailableQuest(i) + C_GossipInfo.SelectAvailableQuest(i) end end end diff --git a/Modules/Tooltips.lua b/Modules/Tooltips.lua index d3583ca3..08774891 100644 --- a/Modules/Tooltips.lua +++ b/Modules/Tooltips.lua @@ -183,7 +183,7 @@ local function ApplySkin(tooltip) if tooltip.SetBackdrop then tooltip:SetBackdrop(nil) end tooltip:HookScript('OnShow', onShow) tooltip:HookScript('OnHide', onHide) - _G.tremove(tooltips, i) + _G.tremove(tooltips, tooltip) end local style = {