A mods folder: load every DLL in %LOCALAPPDATA%\victory\mods before the title runs #1523

Open
leonidarider wants to merge 1 commit from upstream-pr/1523 into main
leonidarider commented 2026-11-29 02:47:46 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by leonidarider on 2026-11-29T02:47:46Z.


What it changes

A mod DLL has no clean way into victory today: it has to pose as a system DLL beside the program or inject itself from outside.

This adds a mods folder. Every .dll in %LOCALAPPDATA%\victory\mods is loaded by name order with LoadLibraryW just before the title runs. Each one is named on the console whether it loaded or not, and a DLL that fails to load costs the run nothing. An empty or missing folder changes nothing, and off Windows the function is empty.

One self-contained function, load_mods, in apps/victory/src/main.rs, and a call before run::run. No new dependency.

What uses it

We wrote it for OpenRage's mod loader: a DLL that serves loose files from a mods folder beside the game in place of the archives' own, with no archive rewritten. Nothing in this change is specific to it: any mod DLL dropped in the folder loads the same way.

How it was tested

Honestly: not on this tree. The same behaviour is open and in daily use on the NVIDIA fork as trustno1-coder/VIctory-NVIDIA#1892, where it goes through that fork's own DLL-loading call. This version is rewritten to stand alone because this tree has no such call. The function compiles and passes rustfmt on its own under edition 2024 with warnings denied, but I have not built this repository with it, so please treat it as a proposal to check rather than a tested change.

<!-- greyfinch-sync:fxceless/victory-fork:issue:5546937383 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1523). Originally posted by [leonidarider](https://github.com/leonidarider) on 2026-11-29T02:47:46Z. --- ## What it changes A mod DLL has no clean way into victory today: it has to pose as a system DLL beside the program or inject itself from outside. This adds a mods folder. Every `.dll` in `%LOCALAPPDATA%\victory\mods` is loaded by name order with `LoadLibraryW` just before the title runs. Each one is named on the console whether it loaded or not, and a DLL that fails to load costs the run nothing. An empty or missing folder changes nothing, and off Windows the function is empty. One self-contained function, `load_mods`, in `apps/victory/src/main.rs`, and a call before `run::run`. No new dependency. ## What uses it We wrote it for [OpenRage](https://github.com/openragee/openrage)'s mod loader: a DLL that serves loose files from a `mods` folder beside the game in place of the archives' own, with no archive rewritten. Nothing in this change is specific to it: any mod DLL dropped in the folder loads the same way. ## How it was tested Honestly: not on this tree. The same behaviour is open and in daily use on the NVIDIA fork as trustno1-coder/VIctory-NVIDIA#1892, where it goes through that fork's own DLL-loading call. This version is rewritten to stand alone because this tree has no such call. The function compiles and passes `rustfmt` on its own under edition 2024 with warnings denied, but I have not built this repository with it, so please treat it as a proposal to check rather than a tested change.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1523:upstream-pr/1523'
git switch 'upstream-pr/1523'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/1523'
git switch 'upstream-pr/1523'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1523'
git switch 'upstream-pr/1523'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1523'
git switch 'main'
git merge --squash 'upstream-pr/1523'
git switch 'main'
git merge --ff-only 'upstream-pr/1523'
git switch 'main'
git merge 'upstream-pr/1523'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!1523
No description provided.