Skip to content

Fix Load Game faction filter showing internal names instead of display names#22476

Merged
PunkPun merged 1 commit into
OpenRA:bleedfrom
xan2622:New-load-dialog-shows-faction's-internal-name-in-filter-dropdown
May 24, 2026
Merged

Fix Load Game faction filter showing internal names instead of display names#22476
PunkPun merged 1 commit into
OpenRA:bleedfrom
xan2622:New-load-dialog-shows-faction's-internal-name-in-filter-dropdown

Conversation

@xan2622
Copy link
Copy Markdown
Contributor

@xan2622 xan2622 commented May 5, 2026

Fix Load Game faction filter showing internal names instead of display names

Fixes #22472

image

Comment thread OpenRA.Mods.Common/Widgets/Logic/LoadGameBrowserLogic.cs Outdated
@xan2622 xan2622 force-pushed the New-load-dialog-shows-faction's-internal-name-in-filter-dropdown branch from 86b8142 to 7dcb92d Compare May 5, 2026 10:00
@ycamlad
Copy link
Copy Markdown

ycamlad commented May 6, 2026

Hey, I was looking at your fix for the faction dropdown issue and I tried to understand it on my own before reaching out.

From what I saw:

The save file stores faction IDs like "ukraine" / "russia"
The UI was passing those directly to Fluent, which didn’t match keys
I found the faction .ftl entries (faction-ukraine, etc.) and tried mapping them

I got pretty close, but I ran into a UI issue where the dropdown ended up showing the same faction multiple times.

If you have any tips for navigating this repo (especially around UI + traits), I’d really appreciate it.

Thanks!

@xan2622
Copy link
Copy Markdown
Contributor Author

xan2622 commented May 6, 2026

Hi @ycamlad

Your analysis is correct: the save file uses internal faction IDs, but Fluent expects message keys.

When looking into this, I found that FactionInfo traits from modData.DefaultRules.Actors[SystemActors.World] already link internal names to Fluent keys, so I reused that instead of mapping via .ftl.

For the duplicate issue, my guess is that it depends on when deduplication is applied. In this fix, Distinct() runs on the raw IDs (case-insensitive) before resolving display names, that might be the difference.

For the UI logic, you can look under OpenRA.Mods.Common/Widgets/Logic/, and if I am correct, traits are accessed via actor.TraitInfos<T>(), SystemActors.World is the actor key used to access global rules like factions.

@ycamlad
Copy link
Copy Markdown

ycamlad commented May 6, 2026

Thanks, that helped a lot!

Copy link
Copy Markdown
Member

@PunkPun PunkPun left a comment

Choose a reason for hiding this comment

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

Ok.

Unrelated, but I see filters don't get updated on save deletion.

@PunkPun PunkPun merged commit 8a1f0ad into OpenRA:bleed May 24, 2026
2 checks passed
@PunkPun
Copy link
Copy Markdown
Member

PunkPun commented May 24, 2026

@xan2622 xan2622 deleted the New-load-dialog-shows-faction's-internal-name-in-filter-dropdown branch May 24, 2026 16:43
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.

New load dialog shows faction's internal name in filter dropdown

4 participants