Skip to content
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

Fix play time column if no playtime, hide game column if single game #3570

Merged
merged 3 commits into from
Apr 22, 2022

Conversation

DasSkelett
Copy link
Member

@DasSkelett DasSkelett commented Apr 22, 2022

Problem

#3543 introduced play time tracking and tries to conditionally display it in the "Manage game instances" dialog only if any instance has a playtime > 0.

This is broken, because the 0,0 string for the playtime is added to the ListViewItem contents array all the time, and if the column is removed it shows under Path:
broken-game-time

Changes

Now the string array for the column contents is factored out into a separate function. It includes the play time string only if the column (header) will actually be present in the end.
The same is applied to the "Game" column now as well, for those that only have instances of a single type of game registered with CKAN (currently the case all the time for everyone as we don't support another game yet).
The auto-resizing needs to be done after removing columns as it applies it to the incorrect columns otherwise.

new-shiny-and-fixed
(Ignore the Factorio instance being present, it is detected as KSP as this current branch doesn't have Factorio support)

I've also added the German localization for the play time strings.

@DasSkelett DasSkelett added Bug GUI Issues affecting the interactive GUI labels Apr 22, 2022
Copy link
Member

@HebaruSan HebaruSan left a comment

Choose a reason for hiding this comment

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

Looks good, let's do this.

@DasSkelett DasSkelett merged commit 703c2e6 into KSP-CKAN:master Apr 22, 2022
@DasSkelett DasSkelett deleted the fix/playtime-column branch April 22, 2022 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Enhancement GUI Issues affecting the interactive GUI Pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants