X2CommunityCore / X2WOTCCommunityHighlander

https://steamcommunity.com/workshop/filedetails/?id=1134256495
MIT License
60 stars 69 forks source link

Allow forcing 24h clock and leading zeroes on month and date strings #1401

Closed BlackDog86 closed 1 week ago

BlackDog86 commented 3 weeks ago

Fixes #1400

BlackDog86 commented 1 week ago

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: Memorial before: image Memorial after, swapping the short date tags in localization: image

Clock example, base game: image Clock example with bforce24hclock and bforce24hclockleadingzero on: image Clock example with bforce24hclock and bforce24hclockleadingzero on and using tag swapping to swap the long dates as well (doing this can adjust the format for soldier birthdays, research reports, avenger facility construction dates in 'avenger report' and a couple other places. image

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: image. The base-game code is a bit janky in that area as well but making that better is out of scope for this, which is just making a few small changes for the sake of flexibility.

Iridar commented 1 week ago

For context to the above discussion, I didn't understand that the following pipeline was in place:

  1. Different parts of the code call the GetDateString() function
  2. Which takes one of the two existing strings that exist solely for the purpose of arranging date
  3. Expands its tags
  4. Returns the formatted date to whatever code caled the function

So I didn't understand why changes to GetDateString() were necessary.