tbl localization documentation + minor cpk sorting change - #51
Conversation
oceanstuck
commented
May 27, 2026
- Adds documentation for localizing TBLs, as well as clarifying behavior when a localized TBL is not available
- Separates list of base cpks in Mod_Merging.cs from list of Japanese cpks, as P5R uses a separate JP.CPK for Japanese files. This probably won't affect much, some files are duped across both though I doubt they have substantial differences, but this should prioritize JP.CPK anyway just to be sure
WalkthroughThis PR updates both documentation and code to improve TBL localization support. The documentation changes add a clarification note that certain language-dependent TBL files are ignored unless the game language matches, along with a new example section showing how to localize TBL changes by providing English TBLs in essentials and language-specific overrides. The code changes refactor base CPK naming by introducing a dedicated 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
p5rpc.modloader/Mod_Merging.cs (1)
68-68: 💤 Low valueMisleading comment.
The comment states "force a specific cpk to be first" but the code swaps with position 1, making it second.
📝 Suggested fix
- // Reorder array to force a specific cpk to be first + // Reorder array to force a specific cpk to be second🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@p5rpc.modloader/Mod_Merging.cs` at line 68, The comment "Reorder array to force a specific cpk to be first" is misleading because the code swaps the target element with position 1 (making it second); either update the comment to accurately state it forces the cpk to be second, or change the swap index from 1 to 0 so the target becomes first; locate the swap in Mod_Merging.cs where the code swaps the element with position 1 and either modify that index to 0 (to make it first) or rewrite the comment to reflect the actual behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@p5rpc.modloader/Mod_Merging.cs`:
- Line 68: The comment "Reorder array to force a specific cpk to be first" is
misleading because the code swaps the target element with position 1 (making it
second); either update the comment to accurately state it forces the cpk to be
second, or change the swap index from 1 to 0 so the target becomes first; locate
the swap in Mod_Merging.cs where the code swaps the element with position 1 and
either modify that index to 0 (to make it first) or rewrite the comment to
reflect the actual behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 41ad407e-4c1c-4421-b97d-9bab1849c6f6
⛔ Files ignored due to path filters (2)
docs/images/TblLocalizedExample1.pngis excluded by!**/*.pngdocs/images/TblLocalizedExample2.pngis excluded by!**/*.png
📒 Files selected for processing (2)
docs/usage.mdp5rpc.modloader/Mod_Merging.cs
📜 Review details
🧰 Additional context used
🪛 LanguageTool
docs/usage.md
[style] ~248-~248: Consider a more expressive alternative.
Context: ...ng in a language other than English. To do this you would first place an English-l...
(DO_ACHIEVE)
🔇 Additional comments (2)
docs/usage.md (1)
183-186: LGTM!Also applies to: 246-255
p5rpc.modloader/Mod_Merging.cs (1)
11-11: 🏗️ Heavy liftFix CPK prioritization + misleading comment in Mod_Merging.cs
ForceBaseCpkSecond’s comment says it forces a CPK “to be first”, but it swaps into index1(second).ForceCpkFirstuses a singleArray.FindIndexwith an OR acrossJP.CPK/DATA.CPK/data\\umd0.cpk, so ifDATA.CPKis earlier incpkFiles, it can get moved to index0ahead ofJP.CPK.- Because
MergeUtils.TryFindFileInAnyCpkiteratescpkFilesin order and returns on the first CPK containingfilePath, this can change which CPK’s data gets used when the same path exists in multiple CPKs.Use explicit priority ordering (e.g., pick
JP.CPKindex first, elseDATA.CPK, elsedata\\umd0.cpk) instead of OR-ing all candidates into oneFindIndex.
|
Looks good to me. |
AnimatedSwine37
left a comment
There was a problem hiding this comment.
Looks good to me too :)