-
Notifications
You must be signed in to change notification settings - Fork 38
Modded resources/content-repentogon support #766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
…eamREPENTOGON/REPENTOGON into feat-moddedLocalizationFolders
| struct ModManager depends (ModEntry) { | ||
| struct ModManager depends (ModEntry, RedirectedPath) { | ||
| vector_ModEntryPointer _mods : 0x0; | ||
| RedirectedPath* _redirectedPathsMap[32768] : 0xc; |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, for suffixes...
Sub PR of #579 without localization option. These changes allows mods to load files from -repentogon folders, taking over priority over -dlc3/ folder