From 658e3db2a4947686c86797d53eef2e8b843c561f Mon Sep 17 00:00:00 2001 From: Marvin <52848568+mleem97@users.noreply.github.com> Date: Fri, 10 Apr 2026 16:41:30 +0200 Subject: [PATCH] docs(repo-inventory): expand language bridges section with detailed descriptions Added a comprehensive overview of the language bridges in the repository, including the bridge host, Lua VM, Lua API modules, module interface, Rust adapter, and FFI bridge. This update aims to enhance understanding of the code structure and facilitate contributions related to language integration. --- docs/contributors/repo-inventory.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/contributors/repo-inventory.md b/docs/contributors/repo-inventory.md index 13ee2f4..45ad0b3 100644 --- a/docs/contributors/repo-inventory.md +++ b/docs/contributors/repo-inventory.md @@ -69,6 +69,20 @@ Documentation is maintained in this repository under `docs/`; historical GitHub - **Landing**: `/` → [`src/pages/index.tsx`](https://github.com/mleem97/gregWiki/blob/main/src/pages/index.tsx) - **Static catalog page**: `/mods` +## Language bridges (code) + +- **Bridge host:** `gregCore/framework/ModLoader/LanguageBridges/GregLanguageBridgeHost.cs` — creates and orchestrates all bridges. +- **Lua VM:** `gregCore/framework/ModLoader/LanguageBridges/LuaLanguageBridge.cs` — MoonSharp integration, script discovery, lifecycle dispatch (`on_update`, `on_scene`, `on_gui`). +- **Lua API modules:** `gregCore/framework/ModLoader/LanguageBridges/LuaModules/` + - `GregHooksLuaModule.cs` — `greg.on()`, `greg.hook.before/after()` (connects to `GregEventDispatcher` and `HookBinder`) + - `GregUnityLuaModule.cs` — `greg.unity.*` (handle-based Unity object manipulation, TMPro, TextMesh, physics, materials, transforms) + - `GregIoLuaModule.cs` — `greg.io.*` (file read/write, directory listing) + - `GregInputLuaModule.cs` — `greg.input.*` (keyboard via InputSystem) + - `LuaObjectHandleRegistry.cs` — thread-safe int→object handle registry for Il2Cpp objects +- **Module interface:** `gregCore/framework/ModLoader/LanguageBridges/IGregLuaModule.cs` +- **Rust adapter:** `gregCore/framework/ModLoader/LanguageBridges/RustLanguageBridgeAdapter.cs` (delegates to `FFIBridge`) +- **FFI bridge:** `gregCore/framework/ModLoader/FfiBridge.cs` — native DLL loading, C ABI lifecycle + ## Hook / event sources of truth (code) - **Native pipeline (`EventIds` → `greg.*`):** [`gregCore/framework/src/Sdk/GregNativeEventHooks.cs`](https://github.com/mleem97/gregFramework/blob/main/gregCore/framework/src/Sdk/GregNativeEventHooks.cs) with numeric ids in [`EventDispatcher.cs` (`EventIds`)](https://github.com/mleem97/gregFramework/blob/main/gregCore/framework/src/ModLoader/EventDispatcher.cs) — wiki table: [greg hooks catalog](../reference/greg-hooks-catalog.md); generator [`gregCore/tools/Generate-GregHookCatalog.ps1`](https://github.com/mleem97/gregFramework/blob/main/gregCore/tools/Generate-GregHookCatalog.ps1).