SprayMesh Extended: Fix error with opening context menu

This commit is contained in:
Chev 2023-11-04 14:06:16 -07:00
parent 4d3c2bf17e
commit 43f85068f7
Signed by: chev2
GPG key ID: BE0CFBD5DCBB2511
2 changed files with 5 additions and 5 deletions

View file

@ -951,10 +951,10 @@ concommand.Add("spraymesh_reload", function()
spraymesh.ReloadSprays()
end)
local SETTINGS_PANEL = nil
spraymesh.SETTINGS_PANEL = nil
concommand.Add("spraymesh_settings", function()
if IsValid(SETTINGS_PANEL) then SETTINGS_PANEL:Close() end
SETTINGS_PANEL = vgui.Create("DSprayConfiguration")
if IsValid(spraymesh.SETTINGS_PANEL) then spraymesh.SETTINGS_PANEL:Remove() end
spraymesh.SETTINGS_PANEL = vgui.Create("DSprayConfiguration")
end)
local VIEWER_PANEL = nil

View file

@ -12,9 +12,9 @@ list.Set("DesktopWindows", "SprayMeshExtended", {
-- Remove basic frame and replace with our custom VGUI element
window:Remove()
if IsValid(screenshot_editor.PANEL) then screenshot_editor.PANEL:Remove() end
if IsValid(spraymesh.SETTINGS_PANEL) then spraymesh.SETTINGS_PANEL:Remove() end
local mainWindow = vgui.Create("DSprayConfiguration")
screenshot_editor.PANEL = mainWindow
spraymesh.SETTINGS_PANEL = mainWindow
icon.Window = mainWindow
end