-
Notifications
You must be signed in to change notification settings - Fork 69
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
Allow forcing 24h clock and leading zeroes on month and date strings #1401
Allow forcing 24h clock and leading zeroes on month and date strings #1401
Conversation
bc01e5c
to
e0dc32b
Compare
X2WOTCCommunityHighlander/Src/XComGame/Classes/X2StrategyGameRulesetDataStructures.uc
Outdated
Show resolved
Hide resolved
X2WOTCCommunityHighlander/Src/XComGame/Classes/X2StrategyGameRulesetDataStructures.uc
Outdated
Show resolved
Hide resolved
@@ -1621,6 +1629,26 @@ static function string GetDateString(TDateTime kDateTime, optional bool bShortFo | |||
kTag.IntValue1 = kDateTime.m_iYear; | |||
kTag.IntValue2 = kDateTime.m_iMonth; | |||
|
|||
// Issue #1400 - Add additional localization tags to allow mods to display days and months with leading zeroes |
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.
This seems like an opinionated change, it should be at least gated behind a separate config var.
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.
this isn't really a change at all - the default localization file uses this for the display of dates:
m_strMonthDayYearShort="<XGParam:IntValue2/><XGParam:StrValue1/!SeparatorString/><XGParam:IntValue0/><XGParam:StrValue1/!SeparatorString/><XGParam:IntValue1/>"
The default display would therefore not change at all with the code adjustment. A mod would have to specifically remove the original localization line and replace it with XGParam:StrValue2 or XGParam:StrValue3 explicitly in order for this to adjust base-game behaviour at all so I don't think a config gate is necessary.
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.
Does this have to be a Highlander change then? It this does nothing without mod-supplied localization lines, what's stopping the mod that is adding those lines from adding its own localized tags and using the tag expand handler to fill them with whatever date format it wants?
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.
Because the mod would need to MCO X2StrategyGameRulesetDataStrcutures just to create a couple of tags which is quite an invasive MCO for a very small change (plus there are already some mods existing MCOing other parts of this, creating conflicts. I thought this sort of thing is more or less exactly what CHL is for?)
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.
I don't understand why would MCO be necessary. You can create arbitrary tags and fill them with arbitrary content via the DLC Hook, no MCO required. Mods can always ship their own adjusted version of GetTimeStringSeparated()
to use in their tags.
39e24b7
to
c149fa1
Compare
After a bit of further investigation & for the purposes of clarity, the only place that the 'short' date is actually called for in the base game, is in the memorial screen. However, other mods (such as beat's mission history) also call for it. See below some examples of the display options: Clock example, base game: I should say that the save and load game screens do not use this function and have their own logic for parsing the save file headers to display the dates of the save games. This logic isn't great either in my view and in one of my own mods I MCO a few of the classes responsible in order to display those dates differently (https://steamcommunity.com/sharedfiles/filedetails/?id=3268722967). This is the output of that mod, for example: |
… hours, months and days
c149fa1
to
5c1871b
Compare
For context to the above discussion, I didn't understand that the following pipeline was in place:
So I didn't understand why changes to |
Fixes #1400