We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b2b25f commit 9fc08b4Copy full SHA for 9fc08b4
gooey/gooey.lua
@@ -42,8 +42,17 @@ end
42
-- @return Instance for the node
43
local function instance(id, instances)
44
local key = to_key(id)
45
- instances[key] = instances[key] or {}
46
- return instances[key]
+ local instance = instances[key]
+ -- detect a reload (unload and load cycle) and start with an
47
+ -- empty instance
48
+ -- if the script instance has changed then we're certain that
49
+ -- it's reloaded
50
+ local script_instance = _G.__dm_script_instance__
51
+ if instance and instance.__script ~= script_instance then
52
+ instances[key] = nil
53
+ end
54
+ instances[key] = instances[key] or { __script = script_instance, data = {} }
55
+ return instances[key].data
56
end
57
58
--- Convenience function to acquire input focus
0 commit comments