diff --git a/install.lua b/install.lua index d1f94ec..47aa213 100644 --- a/install.lua +++ b/install.lua @@ -133,7 +133,7 @@ versionDropdown:onSelect(function(self, index, value) end end) -instalScreen:addLabel(coloring) +installScreen:addLabel(coloring) :setText("Path:") :setPosition(2, "{versionDesc.y + versionDesc.height + 1}") diff --git a/src/elements/TextBox.lua b/src/elements/TextBox.lua index 422189e..fe19502 100644 --- a/src/elements/TextBox.lua +++ b/src/elements/TextBox.lua @@ -1,5 +1,7 @@ local VisualElement = require("elements/VisualElement") local tHex = require("libraries/colorHex") +---@configDescription A multi-line text editor component with cursor support and text manipulation features +---@configDefault false ---A multi-line text editor component with cursor support and text manipulation features ---@class TextBox : VisualElement diff --git a/tools/generate-config.lua b/tools/generate-config.lua index e5405c2..a96c3e6 100644 --- a/tools/generate-config.lua +++ b/tools/generate-config.lua @@ -74,34 +74,36 @@ local function categorizeFile(path) end end -local function scanDirectory(baseDir, relativePath) +local function scanDirectory(baseDir) local files = {} + -- Liste aller zu scannenden Ordner + local dirs = { + baseDir .. "/elements", + baseDir .. "/plugins", + baseDir .. "/libraries", + baseDir -- für Core-Files + } - -- Nutze direkt io.popen für das Directory Listing - local cmd = 'dir "' .. baseDir .. '/' .. relativePath .. '" /b /s' - local pipe = io.popen(cmd) - if not pipe then - error("Failed to execute directory scan command") - return files - end - - for path in pipe:lines() do - if path:match("%.lua$") then - local config = parseFile(path) - if config then - config.name = path:match("([^/\\]+)%.lua$") - config.path = path:gsub(baseDir .. "/", "") - files[path] = config + for _, dir in ipairs(dirs) do + for entry in io.popen('ls -1 "' .. dir .. '"'):lines() do + if entry:match("%.lua$") then + local fullPath = dir .. "/" .. entry + local config = parseFile(fullPath) + if config then + config.name = entry:gsub("%.lua$", "") + -- Relativen Pfad erstellen + config.path = fullPath:gsub("^" .. baseDir .. "/", "") + files[fullPath] = config + end end end end - pipe:close() return files end local function generateConfig(srcPath) - local files = scanDirectory(srcPath, "") + local files = scanDirectory(srcPath) local categories = {} -- Files in Kategorien einordnen