Archive incari-client (client, 26.3, clean)

This commit is contained in:
2026-11-28 00:54:38 -06:00
parent 7a6174687f
commit 12838e838c
2383 changed files with 280266 additions and 0 deletions
@@ -0,0 +1,27 @@
# Incari's Short Items (features/shortitems) for the Rust build (ADR 0068, 0069).
# Hooks by name where Horizon has stamped the hook point (native-hooks.json), by function where
# it's still pending. Its settings are the client's (rust/mods/incari): the module menu shows them.
[mod]
id = "incari_shortitems"
version = "0.1.0"
priority = 100
[[module]]
id = "runtime"
file = "crates/horizon-client/src/game.rs"
name = "incari_shortitems"
source = "runtime.rs"
[[injection]]
id = "pose"
# Horizon's hand_pose hook point is still a pending fragment
# (tools/native-hook-fragments/incari_client_hooks.json), so this targets its function. Make it
# `hook = "hand_pose"` and `hook_version = 1` once Horizon stamps it.
target = "horizon_client::game::native_hooks::Game<'_>::native_hand_pose"
kind = "HEAD"
helper = "pose.rs"
bindings = [
{ name = "game", ty = "&crate::game::Game<'_>", value = "self" },
{ name = "using", ty = "bool", value = "using" },
{ name = "pose", ty = "&mut glam::Mat4", value = "&mut *pose" },
]
@@ -0,0 +1,13 @@
// The held item scaled in its own space, toward the hand.
fn incari_shortitems_pose(game: &crate::game::Game<'_>, using: bool, pose: &mut glam::Mat4) {
use crate::game::{incari_client as c, incari_shortitems as m};
let _ = game;
let Some(scale) = c::settings(m::ID, |s| {
m::scale(s.int("size"), using, s.bool("while-blocking"))
}) else {
return;
};
if scale != 1.0 {
*pose *= glam::Mat4::from_scale(glam::Vec3::splat(scale));
}
}
@@ -0,0 +1,28 @@
// Incari's Short Items for the Rust build (ADR 0068, 0069), as features/shortitems does it: held
// items drawn smaller in first person, in either hand, as 1.8 PvP packs drew swords; reach and hits
// are unchanged. Its id and settings are the module's in `incari_core::modules`: still Short
// Swords' `shortswords`, so profiles keep it. No game types: rust/lib.rs tests it.
/// The module's id, as the Java client's profiles name it.
pub const ID: &str = "shortswords";
/// The scale to draw an item at for the `size` (a percent) and `while-blocking` settings; 1
/// leaves it be.
pub fn scale(size: i32, using: bool, while_using: bool) -> f32 {
if using && !while_using {
return 1.0;
}
size.clamp(40, 100) as f32 / 100.0
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn draws_at_the_size() {
assert_eq!(scale(70, false, true), 0.7);
assert_eq!(scale(70, true, true), 0.7);
assert_eq!(scale(70, true, false), 1.0);
}
}