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
Remove TKM string code #11906
Remove TKM string code #11906
Conversation
Previously it relied on some enum entries using the same integer value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks okay to me, barring some minor coding style nitpicks.
|
||
auto *wid = this->GetWidget<NWidgetCore>(WID_GRAPH_FOOTER); | ||
if (wid != nullptr && TimerGameEconomy::UsingWallclockUnits()) { | ||
wid->SetDataTip(STR_GRAPH_LAST_72_MINUTES_TIME_LABEL, STR_NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we, for consistency, also have a string when it's not using wall clock units?
This PR keeps it as is, but it feels weird only having a tooltip some of the times. Possibly not for this PR though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There technically is, but different:
- Calendar: show year numbers along the X axis.
- Wallclock: there are no labels on the X axis, only this general text "72 minutes in total".
Motivation / Problem
#11341 added a
{TKM "calendar" "wallclock"}
string control code:calendar
orwallclock
into the string depending on a game setting value.Description
This PR removes usage and support for TKM:
UsingWallclockUnits
is called from the individual GUI code to choose string variants.UsingWallclockUnits
must know, whether it should check the current-game or new-game settings. The invidual GUI code knows this better than the general string templating code.UsingWallclockUnits
is still called with the magic_game_mode == GM_MENU
in the settings GUI. I am not aware of any case, where this assumption is false.Limitations
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.