Skip to content

Conversation

@epfly6
Copy link
Member

@epfly6 epfly6 commented Dec 1, 2025

Sub PR of #579 without localization option. These changes allows mods to load files from -repentogon folders, taking over priority over -dlc3/ folder

epfly6 added 27 commits October 27, 2024 23:24
Added:
- Isaac:
* GetStringByNum (returns translated string from set category based on num)
Modded assets can now be stored in (resources/content)-repentogon folders (with potential localization support too)

Added potential localization support for modded (resources/content)-dlc3 folders
@epfly6 epfly6 marked this pull request as ready for review December 2, 2025 09:13
@epfly6 epfly6 requested a review from ConnorForan December 2, 2025 09:14
struct ModManager depends (ModEntry) {
struct ModManager depends (ModEntry, RedirectedPath) {
vector_ModEntryPointer _mods : 0x0;
RedirectedPath* _redirectedPathsMap[32768] : 0xc;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wacky looking thing. So the game can "only" remember 32768 redirected paths?

Is there something we will need to access this directly for?

#include "ASMDefinition.h"

bool __stdcall TryToRedirectToLocalizedResources(std::string& resFileString, std::string& targetFile, ModEntry** modEntry, RedirectedPath* redirectPath) {
auto* manager = g_Manager->GetModManager();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nitpick but I would prefer to skip the autos in this file unless the type is something wacky

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gonna change it to Manager* then

resFileString = potentialPath;
redirectPath->_modEntry = *modEntry;
redirectPath->_filePath = resFileString;
std::cout << "[REPENTOGON] Patched " << resFileString << std::endl;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this end up in the same place as printf (ie, external console)?

I support logging the redirections, unless it's spammy (like if theres anything that would cause it to be written every frame).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe print should be disabled

return false;
}

void ASMPatchRedirectToLocalizedResources() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this trigger every time the file is accessed, or does the game do this once, cache the path in _redirectedPathsMap, and then it wont trigger redirection again?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly, once the game successfully finds resources file, it will cache it to redirected path and it won't look for other mods

}

auto buildAndCheckPath = [&](const std::string& postfix, bool useLangCode) -> bool {
std::string potentialPath = resFileString + postfix;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resFileString always ends in "/resources" at this stage?

}

auto buildAndCheckPath = [&](const std::string& postfix, bool useLangCode) -> bool {
auto copyOfContentDirectory = _contentDirectory.substr(0, _contentDirectory.length() - 1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this chopping a / off of .../content/ or something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, for suffixes...

@epfly6 epfly6 merged commit 3381cbb into main Dec 5, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants