mirror of
https://github.com/chev2/gmod-addons.git
synced 2025-10-30 06:31:35 +00:00
SprayMesh Extended: Recreate panel if spray name is changed
If there is already a valid spray entry in the saved spray list, recreate it
This commit is contained in:
parent
45da650a08
commit
995e20125a
1 changed files with 4 additions and 3 deletions
|
|
@ -361,9 +361,10 @@ local MAT_FAKE_TRANSPARENT = Material("spraymesh/fake_transparent.png", "noclamp
|
|||
|
||||
function PANEL:AddSpray(url, name)
|
||||
-- If the spray already exists
|
||||
if self.Sprays[url] then
|
||||
self.IconLayout:Layout()
|
||||
return
|
||||
local existingSpray = self.Sprays[url]
|
||||
if existingSpray and IsValid(existingSpray) and IsValid(existingSpray:GetParent()) then
|
||||
existingSpray:GetParent():Remove()
|
||||
self.Sprays[url] = nil
|
||||
end
|
||||
|
||||
-- A transparency grid background, to indicate which sprays are transparent
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue