Skip to content

Commit

Permalink
Bug Window fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Wutname1 committed Oct 23, 2024
1 parent eaff08c commit ac68d61
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
12 changes: 11 additions & 1 deletion Core/Handlers/Bugs/BugWindow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ local window, currentErrorIndex, currentErrorList, currentSession
local countLabel, sessionLabel, textArea
local ActiveButton = nil
local categoryButtons = {}
addon.BugWindow.window = window

local function updateDisplay(forceRefresh)
if not window then addon.BugWindow.Create() end
Expand Down Expand Up @@ -177,7 +178,7 @@ function addon.BugWindow.Create()
innerFrame.bg:SetAllPoints()
innerFrame.bg:SetAtlas('weeklyrewards-background-reward-locked')
innerFrame.bg:SetTexCoord(0.05, 0.95, 0.05, 0.95)
innerFrame.bg:SetVertexColor(0.6, 0.6, 0.6, 0.7)
innerFrame.bg:SetVertexColor(0.6, 0.6, 0.6, 1)

textArea = CreateFrame('EditBox', 'SUI_ErrorTextArea', scrollFrame)
textArea:SetTextColor(0.5, 0.5, 0.5, 1)
Expand Down Expand Up @@ -236,6 +237,15 @@ function addon.BugWindow.Create()
clearAllBtn:SetPoint('BOTTOMRIGHT', search, 'TOPRIGHT', 0, 5)
clearAllBtn:SetScript('OnClick', function()
BugGrabber:Reset()
-- Reset the UI
currentErrorList = {}
currentErrorIndex = nil
updateDisplay(true)

-- Reset the MiniMap Icon
if addon.MiniMapIcon then
addon.MiniMapIcon:Reset() -- Assuming there's a Reset method for the MiniMap Icon
end
end)
window.Buttons.ClearAll = clearAllBtn

Expand Down
2 changes: 2 additions & 0 deletions Core/Handlers/Bugs/ErrorHandler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ end

function addon.ErrorHandler:OnBugGrabbed(callback, errorObject)
self:ProcessError(errorObject)
-- Check if the error window is shown and update the display
if addon.BugWindow.window and addon.BugWindow.window:IsShown() then addon.BugWindow:updateDisplay(true) end
end

function addon.ErrorHandler:ProcessError(errorObject)
Expand Down
19 changes: 0 additions & 19 deletions Core/Handlers/Bugs/Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,6 @@ local function InitializeMinimapButton()
tt:AddLine(' ')
tt:AddLine(hint, 0.2, 1, 0.2, 1)
end,
-- type = 'launcher',
-- icon = 'Interface\\AddOns\\' .. addonName .. '\\Media\\Icon',
-- OnClick = function(self, button)
-- if button == 'LeftButton' then
-- addon.BugWindow:OpenErrorWindow()
-- elseif button == 'RightButton' then
-- if InterfaceOptionsFrame_OpenToCategory then
-- InterfaceOptionsFrame_OpenToCategory(addonName)
-- InterfaceOptionsFrame_OpenToCategory(addonName)
-- else
-- Settings.OpenToCategory(addon.settingsCategory.ID)
-- end
-- end
-- end,
-- OnTooltipShow = function(tooltip)
-- tooltip:AddLine(L['SpartanUI Error Display'])
-- tooltip:AddLine(L['Left-click to open error window'])
-- tooltip:AddLine(L['Right-click to open options'])
-- end,
})

icon:Register(MinimapIconName, SUIErrorLauncher, addon.Config.db.minimapIcon)
Expand Down

0 comments on commit ac68d61

Please sign in to comment.