Permalink
Browse files

Do not allow editing of nodes that don't save

  • Loading branch information...
1 parent 5945cbc commit 661aa157d4cb2985b881311c56fcb1ca85f85b51 @robotboy655 robotboy655 committed May 3, 2016
@@ -47,16 +47,22 @@ function PANEL:Init()
if ( !IsValid( node ) || !IsValid( label ) || !IsValid( icons ) ) then return end
- label:SetText( node:GetText() )
- icons:SelectIcon( node:GetIcon() )
- icons:ScrollToSelected()
+ if ( node.CustomSpawnlist ) then
+ label:SetText( node:GetText() )
+ icons:SelectIcon( node:GetIcon() )
+ icons:ScrollToSelected()
+ else
+ label:SetText( "" )
+ end
label.OnChange = function()
+ if ( !node.CustomSpawnlist ) then return end
node:SetText( label:GetText() )
hook.Run( "SpawnlistContentChanged" )
end
icons.OnChange = function()
+ if ( !node.CustomSpawnlist ) then return end
node:SetIcon( icons:GetSelectedIcon() )
hook.Run( "SpawnlistContentChanged" )
end
@@ -129,9 +129,9 @@ function AddPropsOfParent( pnlContent, node, parentid )
if ( parentid != Info.parentid ) then continue end
-
local pnlnode = AddCustomizableNode( pnlContent, Info.name, Info.icon, node, Info.needsapp )
pnlnode:SetExpanded( true )
+ pnlnode.CustomSpawnlist = true -- Used to determine which nodes ContentSidebarToolBox can edit
pnlnode.DoPopulate = function( self )
if ( self.PropPanel ) then return end

0 comments on commit 661aa15

Please sign in to comment.