Files
gregWiki/docs/reference/greg-hooks-registry.md
Marvin 9605741570 fix(docs): update documentation for clarity and structure
- 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.
2026-04-10 04:34:18 +02:00

3.0 KiB
Raw Blame History

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. aus GregDomain (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.cs aus, damit z.B. Player.UpdateCoin nicht doppelt generiert wird (Hand-Patch + InvokeCancelable / GregHookIntegration).

Mod-Autor:innen

Legacy

GregCompatBridge lädt legacyname aus greg_hooks.json. Zusätzlich gibt es eingebaute Alias-Tabellen für ältere Schreibweisen — siehe Quellcode GregCompatBridge.

Siehe auch