mirror of
https://github.com/mleem97/gregWiki.git
synced 2026-04-11 03:29:19 +02:00
- Revised the `getting-started.md` and `documentation-layout.md` files to improve clarity and organization of content. - Enhanced descriptions and added tables for better readability in the `getting-started.md` file. - Updated the `greg-hooks-registry.md` to reflect changes in the hook mapping and clarify the role of `greg_hooks.json`. - Adjusted the `fmf-hook-naming.md` and `fmf-hooks-catalog.md` to emphasize the transition from legacy naming conventions to the new `greg.*` format. This commit aims to improve the overall clarity and usability of the documentation, ensuring users have a better understanding of the framework and its components.
3.0 KiB
3.0 KiB
id, title, slug, description
| id | title | slug | description |
|---|---|---|---|
| greg-hooks-registry | greg.* hooks registry (IL2CPP) | /reference/greg-hooks-registry | greg_hooks.json, Harmony-Quellen unter gregCore, Regeneration, Überschneidung mit Hand-Patches. |
greg.* hooks registry (IL2CPP)
Diese Seite beschreibt die kanonische MelonLoader-Hook-Oberfläche für Data Center (IL2CPP): stabile String-IDs, JSON-Registry, erzeugte Harmony-Stubs und das Zusammenspiel mit handgeschriebenen Patches (z. B. HarmonyPatches.cs).
Kanonische Hook-IDs
greg.<DOMAIN>.<Action>
greg— fester Präfix für neue APIs.<DOMAIN>— u. a. ausGregDomain(PLAYER,NETWORK,SYSTEM, …).<Action>—PascalCase.
In Mods vorzugsweise GregHookName.Create(GregDomain.*, "Action") oder Konstanten aus GregNativeEventHooks verwenden.
Registry-Datei greg_hooks.json
| Ort | Rolle |
|---|---|
Repo-Root greg_hooks.json |
Eincheckter Katalog (name, patchTarget, strategy, payloadSchema, optional legacy). |
Neben FrikaModdingFramework.dll |
Build-Kopie für GregCompatBridge. |
Code-Layout (gregFramework-Repo)
| Pfad | Zweck |
|---|---|
gregCore/framework/src/Sdk/ |
gregFramework.Core: GregEventDispatcher, GregHookName, GregDomain, GregPayload, GregCompatBridge, GregNativeEventHooks |
gregCore/framework/src/ModLoader/ |
EventDispatcher, HarmonyPatches, FFI, GregHookIntegration, Services |
gregCore/framework/harmony/ |
Optional: generierte Domain-Harmony-Klassen (Skript Generate-GregHooksFromIl2CppDump.ps1) |
Das Projekt gregCore/framework/FrikaMF.csproj fasst diese Quellen zusammen; Harmony erkennt alle [HarmonyPatch]-Typen in der Assembly.
Regeneration
pwsh -NoProfile -File gregCore/scripts/Generate-GregHooksFromIl2CppDump.ps1
Anschließend FrikaMF neu bauen.
Generator (Kurz)
- Emittiert Postfix-Stubs mit
GregEventDispatcher.Emit, filtert häufige Unity-Loops und Lärm. - Harmony-Ausschluss: Das Skript wertet
framework/src/ModLoader/HarmonyPatches.csaus, damit z. B.Player.UpdateCoinnicht doppelt generiert wird (Hand-Patch +InvokeCancelable/GregHookIntegration).
Mod-Autor:innen
- Greg hooks showcase — Beispielmod
mods/GregShowcaseMod - FMF hook naming —
FMF.*-Doku-Konvention - greg hooks catalog — EventId →
greg.*(GregNativeEventHooks) - FMF hooks catalog — Hinweis/Redirect auf die neue Quelle
Legacy
GregCompatBridge lädt legacy → name aus greg_hooks.json. Zusätzlich gibt es eingebaute Alias-Tabellen für ältere Schreibweisen — siehe Quellcode GregCompatBridge.