Skip to content

Commit 37e5be8

Browse files
author
Sabine Lim
committed
Add createObject()
1 parent 35113e2 commit 37e5be8

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

Basalt/main.lua

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,18 @@ local getVariable = function(name)
7070
return variables[name]
7171
end
7272

73+
local getObjects = function()
74+
return moddedObjects
75+
end
76+
77+
local getObject = function(id)
78+
return getObjects()[id]
79+
end
80+
81+
local createObject = function(objectName, id, basalt)
82+
return getObject(objectName)(id, basalt)
83+
end
84+
7385
local bInstance = {
7486
getDynamicValueEventSetting = function()
7587
return basalt.dynamicValueEvents
@@ -127,14 +139,12 @@ local bInstance = {
127139
stop = stop,
128140
debug = basalt.debug,
129141
log = basalt.log,
142+
143+
getObjects = getObjects,
130144

131-
getObjects = function()
132-
return moddedObjects
133-
end,
145+
getObject = getObject,
134146

135-
getObject = function(id)
136-
return moddedObjects[id]
137-
end,
147+
createObject = createObject,
138148

139149
getDirectory = function()
140150
return projectDirectory

0 commit comments

Comments
 (0)