From 43f85068f7188aa06b3cb413125b007de721d908 Mon Sep 17 00:00:00 2001 From: Chev Date: Sat, 4 Nov 2023 14:06:16 -0700 Subject: [PATCH] SprayMesh Extended: Fix error with opening context menu --- addons/spraymesh_extended/lua/spraymesh/client/cl_init.lua | 6 +++--- .../lua/spraymesh/client/cl_sandbox_context_menu.lua | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/spraymesh_extended/lua/spraymesh/client/cl_init.lua b/addons/spraymesh_extended/lua/spraymesh/client/cl_init.lua index 76a1a8f..eea8221 100644 --- a/addons/spraymesh_extended/lua/spraymesh/client/cl_init.lua +++ b/addons/spraymesh_extended/lua/spraymesh/client/cl_init.lua @@ -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 diff --git a/addons/spraymesh_extended/lua/spraymesh/client/cl_sandbox_context_menu.lua b/addons/spraymesh_extended/lua/spraymesh/client/cl_sandbox_context_menu.lua index 675692b..c029b61 100644 --- a/addons/spraymesh_extended/lua/spraymesh/client/cl_sandbox_context_menu.lua +++ b/addons/spraymesh_extended/lua/spraymesh/client/cl_sandbox_context_menu.lua @@ -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