Skip to content

Enhancement - Science screen - show multiple shields in multiple lines to prevent string from being cut off #2648

@pfroud

Description

@pfroud

In the Science screen, for targets with multiple shields, the shields are concatenated into one long string, which can get cut off by the edge of the game window:

target with multiple shields viewed in the Science screen

The Game Master screen shows multiple shields in multiple rows, here is what the same target looks like in release EE-2024.12.08:

target with multiple shields viewed in the Game Master Screen

I propose the Science screen show each shield in its own row.

Notes for implementation:

In the current master branch, the Game Master screen has that code commented out:

//for(int n=0; n<shield_count; n++) {
// Note, translators: this is a compromise.
// Because of the deferred translation the variable parameter can't be forwarded, so it'll always be a suffix.
// ret[trMark("gm_info", "Shield") + string(n + 1)] = string(shield_level[n]) + "/" + string(shield_max[n]);
//}

link to the commit diff which commented it out in the Game Master screen

Code in Science Screen where the long string is made:

for(size_t n=0; n<shields->entries.size(); n++) {
if (n > 0)
str += ":";
str += string(int(shields->entries[n].level));

The Science screen has a single GuiKeyValueDisplay to show the shields, while the Game Master screen uses a std::unordered_map<string, string>. The unordered map means sometimes the shields are out of order in the Game Master screen:

target with four shields in Game Master screen, Shield4 is above Hull which is above the rest of the shields

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions