X2CommunityCore/X2CommunityPromotionScreen

CPS seems to be ignoring `AbilityTreeTitles` config

pledbrook opened this issue · 13 comments

I have this config for SPARKs:

+AbilityTreeTitles[0]="Future Combat"
+AbilityTreeTitles[1]=""
+AbilityTreeTitles[2]="War Machine"
+AbilityTreeTitles[3]="XCOM"

and yet the blank row seems to be ignored:

image

The current GetLocalizedAbilityTreeTitle() function is a bit noodly, but I don't see why it would result in that behavior. I'm a bit confused you would call AbilityTreeTitles a "config"; it's a localized array, so to be crystal clear, you are in fact using localization files to set that array?

Yes, that's from the localisation.

Hm, weird. I'd suggest adding some logging to GetLocalizedAbilityTreeTitle() in CPS to see where this goes wrong.

X2CharacterTemplate.AbilityTreeTitles itself seems to be mangled. I'll need to compare with normal LWOTC.

LWOTC with integrated promotion screen:

image

I'll try to look further into it at some point.

This is because CPS provides its own localisation for SPARKs and mod config load order comes into play as to which mod wins.

I see. You can use the event I added for the purpose of overriding these localized row names.

I can't say I like CPS placing the burden onto other mods to work around this. Would it be possible for CPS to set these values if they're all empty? Perhaps in OPTC?

I can't say I like CPS placing the burden onto other mods to work around this. Would it be possible for CPS to set these values if they're all empty? Perhaps in OPTC?

The only reason CPS provides localization for SPARK per rows (NPSBD did that too btw) is because the base game doesn't, so SPARKs would be left without localization on the new promotion screen.

SPARKs don't even get training center perks in base WOTC, so it's not a problem there. This is basically just to ensure consistency.

Conditionally changing localization for perk rows of a specific unit is very much the intended use for the event.

To answer your question directly, yes we can set up CPS to OPTC patch localization for SPARK perk rows if another mod has not done so, if you don't like the event for some reason, though setting that up is probably gonna take slightly longer than just setting up the event listener.

The only reason CPS provides localization for SPARK per rows (NPSBD did that too btw) is because the base game doesn't, so SPARKs would be left without localization on the new promotion screen.

I understand that, but CPS potentially overrides any other mod that provides entries for SPARKs in their l10n files. "Community" mods should work a little harder compared to other mods to not get in the way. Ideally NPSBD wouldn't have done this.

I suggested OPTC because I was initially worried about CPS again overriding other mods, but the event listener approach is better if CPS has a high priority for its one. Then a normal default-priority listener from another mod will take precedence without the mod author having to worry about it.

Okay, let's do it that way.

Is this what it should look like?

image

Yep