Skip to content

Commit

Permalink
misc bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Wutname1 committed Aug 14, 2024
1 parent b62c1f5 commit 8c3ee25
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,8 @@
"assign-type-mismatch",
"need-check-nil",
"inject-field",
"duplicate-set-field"
"duplicate-set-field",
"invisible"
],
"[lua]": {
"editor.defaultFormatter": "JohnnyMorganz.stylua"
Expand Down
2 changes: 1 addition & 1 deletion Core/Handlers/Font.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
73 changes: 73 additions & 0 deletions Framework.Definition.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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. <<same as adding a new item>>

local function SetMultiselect(self, flag) end -- Toggle multi-selecting. <<Dummy function to stay inline with the dropdown API>>

local function SetItemDisabled(self, key) end -- Disable one item in the list. <<Dummy function to stay inline with the dropdown API>>

---@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
9 changes: 5 additions & 4 deletions Modules/AutoTurnIn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Modules/Tooltips.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 8c3ee25

Please sign in to comment.