fixing a small bug with autoload and button events (#1276)

Bug: Button events didn't work properly in autoload pacs, before opening the pac editor (using a pac without opening the editor is indeed autoload's main purpose, or one of them at least)
Explanation: Because of this single boolean, the statement at line 1189 of the event part's code resolves to true regardless of whether it's actually true, and the statement skips the necessary lines that update the active buttons. Uninverted button events "worked" because they show stuff when the button is not pressed, so indeed, if no button is recognized then that event will detect the absence and not hide the stuff.

if ply == pac.LocalPlayer and (pace and pace.IsFocused() or gui.IsConsoleVisible()) then return end

Before we open it, the editor is not focused, so it can't be initialized to true. It should be false.
This commit is contained in:
pingu7867 2023-01-23 04:01:24 -05:00 committed by GitHub
parent 61932e96e8
commit e0e684f4ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -311,7 +311,7 @@ function PANEL:SetBottom(pnl)
self.div:SetBottom(pnl)
end
pace.Focused = true
pace.Focused = false
function pace.IsFocused()
return pace.Focused
@ -481,4 +481,4 @@ function PANEL:Paint(w,h)
--DFrame.Paint(self, w,h)
end
pace.RegisterPanel(PANEL)
pace.RegisterPanel(PANEL)