Skip to content

Commit

Permalink
feat(shader_graph): sockets are now highlighted when linked
Browse files Browse the repository at this point in the history
  • Loading branch information
Silverlan committed Dec 15, 2024
1 parent c9d9137 commit daeebbe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ function Element:OnInitialize()
inner:SetMaterial("gui/pfm/circle_filled")
inner:CenterToParent()
inner:SetColor(Color.Lime)
inner:SetVisible(false)
self.m_innerCircle = inner
end
function Element:SetLinked(linked)
self.m_innerCircle:SetVisible(linked)
end
function Element:SetSocket(node, socket, socketType)
self.m_node = node
self.m_socket = socket
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,14 @@ function Element:AddLink(elOutputSocket, elInputSocket)
l:SetAnchor(0, 0, 1, 1)
l:SetZPos(-1)
l:Setup(elOutputSocket, elInputSocket)
l:AddCallback("OnRemove", function()
if(elInputSocket:IsValid()) then elInputSocket:SetLinked(false) end
if(elOutputSocket:IsValid()) then elOutputSocket:SetLinked(false) end
end)
table.insert(self.m_linkElements, l)

elInputSocket:SetLinked(true)
elOutputSocket:SetLinked(true)
end
function Element:RemoveNode(name)
local t = self.m_nameToElementData[name]
Expand Down

0 comments on commit daeebbe

Please sign in to comment.