API ReferenceGE Extensionsui
UI Mods
Discovers Vue mod components and notifies UI when mod files change.
Discovers Vue mod components and notifies UI when mod files change.
Overview
ui_uiMods scans /ui/ui-vue/mods/ for Vue mod directories and monitors file changes to trigger UI hot-reloads. It also watches /ui/modModules/ and calls sendUIModules() when those change.
Extension path: lua/ge/extensions/ui/uiMods.lua
Exports (M)
| Function | Signature | Description |
|---|---|---|
getVueMods | () → table | Returns a map of mod name → {path, files}. |
onFilesChanged | (files) | Reacts to VFS file changes; notifies UI if mod files changed. |
Internals
getVueMods
Scans /ui/ui-vue/mods/ recursively for all files. Groups them by the first directory segment after mods/:
{
["myUiMod"] = {
path = "/ui/ui-vue/mods/myUiMod",
files = { "/component.vue", "/style.css", ... }
}
}onFilesChanged
Checks each changed file path:
- If it starts with
/ui/modModules/→ callssendUIModules()(global). - If it starts with
/ui/ui-vue/mods/→ triggersUiModsChangedguihook.
Both checks are performed at most once per call.
How It Works
- The UI calls
getVueMods()to discover available Vue mod overlays. - When the VFS reports file changes,
onFilesChangedfires. - If Vue mod files changed,
UiModsChangedtells the UI to re-scan/reload. - If module files changed,
sendUIModules()pushes updated module data.
Lua Examples
-- List available Vue UI mods
local mods = extensions.ui_uiMods.getVueMods()
for name, info in pairs(mods) do
print(name, info.path, #info.files .. " files")
endHooks Triggered
| Hook | When |
|---|---|
UiModsChanged (guihook) | Vue mod files changed on disk |
Additional Exports
The following exports are available but not yet documented in detail:
M.getVueModsM.onFilesChanged