diff --git a/etc/apps.db b/etc/apps.db index 6f9a637..bbf4144 100644 --- a/etc/apps.db +++ b/etc/apps.db @@ -20,4 +20,9 @@ category = "Inventory", run = "inventoryWebBridge.lua", }, + [ "im_dropper" ] = { + title = "Dropper Ctrl", + category = "Inventory", + run = "dropperController.lua", + }, } diff --git a/inventoryClient.lua b/inventoryClient.lua index 9375b58..bdcaf9d 100644 --- a/inventoryClient.lua +++ b/inventoryClient.lua @@ -27,6 +27,15 @@ local DROPPER_ANNOUNCE_INTERVAL = 30 -- seconds between dropper announcements local _baseDir = fs.getDir(shell.getRunningProgram()) local function _path(rel) return fs.combine(_baseDir, rel) end +-- Override dofile to load modules into our _ENV so they inherit +-- Opus's require/package (CC:Tweaked dofile uses _G instead). +local _ccDofile = dofile +local function dofile(path) -- luacheck: ignore + local fn, err = loadfile(path, nil, _ENV) + if fn then return fn() + else error(err, 2) end +end + local CLIENT_CONFIG_FILE = _path(".client_config") ------------------------------------------------- diff --git a/inventoryManager.lua b/inventoryManager.lua index 9e03920..f199da9 100644 --- a/inventoryManager.lua +++ b/inventoryManager.lua @@ -15,6 +15,15 @@ local _baseDir = fs.getDir(shell.getRunningProgram()) local function _path(rel) return fs.combine(_baseDir, rel) end +-- Override dofile to load modules into our _ENV so they inherit +-- Opus's require/package (CC:Tweaked dofile uses _G instead). +local _ccDofile = dofile +local function dofile(path) -- luacheck: ignore + local fn, err = loadfile(path, nil, _ENV) + if fn then return fn() + else error(err, 2) end +end + ------------------------------------------------- -- Structured logging & shared UI helpers -------------------------------------------------