Skip to content

Commit

Permalink
More work
Browse files Browse the repository at this point in the history
  • Loading branch information
kbarber committed May 24, 2018
1 parent 0d86c7c commit 4c0468c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
Expand Up @@ -89,7 +89,7 @@ function ConfigurationWidget:PopulateConfiguration(f, btkScript)
"1",
UDim2.new(0,0,0,0),
UDim2.new(0,100,0,16),
"ColumnFrame"
propsFrame
)
local kLabel = UI:CreateStandardLabel(
"1",
Expand Down
23 changes: 7 additions & 16 deletions src/Models/Core/MainModule/ScriptHelper.lua
@@ -1,6 +1,10 @@
local BaseObject = require(script.Parent.BaseObject)
local Schema = require(script.Parent.Schema)
local scripts = script.Parent.scripts
local scriptsFolder = script.Parent.scripts
local scripts = {}
for _, val in ipairs(scriptsFolder:GetChildren()) do
scripts[val.Name] = require(val)
end

local ScriptHelper = BaseObject:subclass(script.Name)

Expand All @@ -22,7 +26,7 @@ function ScriptHelper.static:Get(s)
)
end

local scriptToCall = scripts:FindFirstChild(name, false)
local scriptToCall = scripts[name]
if scriptToCall == nil then
self:Error("Script does not exist",
{
Expand All @@ -31,21 +35,8 @@ function ScriptHelper.static:Get(s)
}
)
end
self:AssertSchema(
scriptToCall,
Schema:IsA("ModuleScript")
)

local scriptModule = require(scriptToCall)
if scriptModule == nil then
self:Error("Script require returned nil",
{
ScriptName = s.Name,
Script = name,
}
)
end
return scriptModule
return scriptToCall
end

return ScriptHelper
4 changes: 2 additions & 2 deletions src/Models/Core/MainModule/scripts/Tool.lua
@@ -1,5 +1,5 @@
local BaseScript = require(script.Parent.BaseScript)
local Schema = require(script.Parent.Schema)
local BaseScript = require(script.Parent.Parent.BaseScript)
local Schema = require(script.Parent.Parent.Schema)

--[[
ToolComponent represents a component that uses a Tool at its root.
Expand Down
3 changes: 2 additions & 1 deletion src/Plugins/BTK.server.lua
@@ -1,7 +1,8 @@
local btkDev = game.ReplicatedStorage:FindFirstChild("BTK", false)
local btk
if btkDev then
btk = require(btkDev.Models.Core.MainModule:Clone())
local core = btkDev.Models.Core:Clone()
btk = require(core.MainModule)
else
btk = require(1815138614)
end
Expand Down

0 comments on commit 4c0468c

Please sign in to comment.