2.0 KiB
2.0 KiB
rust
- Hook by name where Horizon has stamped the hook: each injection names
hookandhook_versionfrom Horizon'snative-hooks.json, so a mod keeps building when Horizon moves (ADR 0068). A pending hook (a fork fragment) is targeted by function until it's stamped. A hook Horizon lacks goes into the fork (native_hooks.rsandnative-hooks.json), offered upstream; then bumphorizon.revision. - Never edit
work/horizonor carry patches to it: a change no mod can make is a commit to the fork and a pin bump. - It's the same client as the Java one (ADR 0069): a screen of Incari's is a port of the Java
screen, a mod a port of the Java module, with its README as the spec: same names, settings, text
and layout. Mod ids are
incari_<module>. - The client is
mods/incari:core/(incari_core) has no game types and is tested here;glue.rs(moduleincari_client) is its game side. Features read their settings withincari_client::settings(id, ...)and draw HUD elements withincari_client::element(...)(PORTING.md); every module, setting and HUD element is declared incore/src/modules.rswith the Java ids, so profiles read the same in both builds. runtime.rsuses no game types, sorust/lib.rstests it alone. Helpers are a line or two overincari_client, Horizon'snative_*helpers and the mod's runtime.- Hot paths don't allocate: the
hud,frameandtickhooks run every frame or tick. Cache in thread-locals, never in locks: in the browser the window's thread is the page's, where a lock that waits traps. - Write it, don't copy it. Horizon's own mods (horizon-rust/horizon-mods) are MIT; read them for the API, write Incari's own.
- Add a mod to
rust/lib.rs, the table inREADME.md, and its module's row infeatures/README.md; its module tocore/src/modules.rsif it's new. - Test:
cargo testandcargo clippy --all-targets -- -D warningsinrust/; the build with./incari build --only rust.