Mods folder: optional victory_mod_* exports a mod may be called at #2846
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2846"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ifBars on 2026-11-29T18:02:18Z.
[pr-feature]
Related: #1892, #2113
What it changes
#1892 added a mods folder: every DLL in
%LOCALAPPDATA%\victory\modsis loaded before the title runs. Nothing calls those DLLs again afterwards. A mod that needs to patch title code, draw over the picture or keep keys from the title still has to rebuildvictory.exeor hook the process from outside.This adds four optional C exports a mod DLL may provide. Each is looked up once with
GetProcAddresswhen the mod loads. A mod that has none of them is only loaded, as before. Without any mod that asks, a present or an input read costs one atomic load.victory_mod_title_ready(const VictoryTitle *)write_sites::apply_askedinrun.rs.victory_mod_title_exited(uint32_t code)victory_mod_present(const VictoryPresent *)victory_mod_captured(VictoryCaptured *)gameinput.rsand in mouse-and-keyboard mode (mnk.rs).Every struct starts with its
size, so fields can be added later. The console names the exports each mod has, for exampleMod palmhook_victory loaded (...): called at title_ready, present, captured.The folder's DLLs now load through a plain
LoadLibraryWinvictory_gpu::mods, not throughstreamline::load_mod. That function is MFG Unlocker's loader and marks MFG Unlocker as present. #2113 fixes the same flag inside that loader. The two changes do not depend on each other, but they touch neighbouring lines inplay.rs.What uses it: Palmhook, a mod host for this title. Today Palmhook is installed as a patched
victory.exeper release. With these exports it can ship as one DLL in the mods folder that works with stock releases. A prototype of that DLL is on theprototype/victory-mods-folderbranch (crates/palmhook-victory). It installs its script hook intitle_ready, draws its overlay inpresentand reports its captured input incaptured. The same four points are what Palmhook's patch for v2026.11.28.03 wires into the runtime, and that patch runs in game.How it was tested
victory_gpu::mods::tests::captured_input_is_every_mods_togethercovers combining the input that several mods take.cargo clippyreports nothing new in the touched code (-p victory-gpu -p victory-hle -p victory --all-targets; the warnings it does print are in lines this change does not touch).cargo testpassed for the crates it touches: yes forcargo test -p victory-gpu --lib mods::,cargo test -p victory-hle --lib gameinput(84 passed, 2 ignored) andcargo test -p victory(78 + 1 + 2 passed). These ran before rebasing onto55d06914. After the rebase, themods::test passes again and clippy reports nothing in the touched files.cargo xtask policyreports one violation, incrates/victory-loader/src/heap_sites/frame_users.rs, which this change does not touch; the same check fails onmaintoo.Checked for overlap
load_mod).🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.