From 54ec935ec3d1cb374afcaa64f190f24294279654 Mon Sep 17 00:00:00 2001 From: Ryan Ward Date: Tue, 10 Jan 2023 00:07:28 -0500 Subject: [PATCH] Working on cloning --- gui/init.lua | 11 +++++++---- multi | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gui/init.lua b/gui/init.lua index 078ae5a..835cd9c 100644 --- a/gui/init.lua +++ b/gui/init.lua @@ -378,7 +378,6 @@ function gui:clone(opt) elseif self.type == image + button then temp = gui:newImageButton(u.DO[2], self:getDualDim()) elseif self.type == image then - print(u.DO[2]) temp = gui:newImageLabel(u.DO[2], self:getDualDim()) else -- We are dealing with a complex object temp = processDo(u) @@ -387,7 +386,7 @@ function gui:clone(opt) for i, v in pairs(u) do temp[i] = v end - + local conn if opt then temp:setParent(opt.copyTo or gui.virtual) @@ -395,8 +394,12 @@ function gui:clone(opt) conn = true for i, v in pairs(self) do if v.Type == "connector" then - -- Add the 2 connections together, inheret the old connections while allowing new ones to not link - temp[i] = temp[i] + v + -- We want to copy the connection functions from the original object and bind them to the new one + if not temp[i] then + -- Incase we are dealing with a custom object, create a connection if the custom objects unique declearation didn't + temp[i] = multi:newConnection() + end + temp[i]:Bind(v:getConnections()) end end end diff --git a/multi b/multi index 0bccc0d..7114b87 160000 --- a/multi +++ b/multi @@ -1 +1 @@ -Subproject commit 0bccc0dd877baaeaa0e9769e6db2571c0f49fee3 +Subproject commit 7114b87bdd05eb9e4d01f0c639175f6d2dda1d52