LoneGazebo / Community-Patch-DLL

Community Patch for Civilization V - Brave New World
Other
285 stars 157 forks source link

Number of techs that other players have is sometimes colored #8468

Closed treacherousfiend closed 2 years ago

treacherousfiend commented 2 years ago

1. Mod version (X.Y.Z, e.g. 1.2.1): 1.2.1

2. Mod list (if using Vox Populi only, leave blank): image Not listed: EUI and RCI (Redesigned Colors and Icons) installed as DLC Mods

3. Error description: Sometimes when hovering over a city of another player, the amount of techs they have is colored green or red. This error happens on a city-by-city basis, and does not happen at all when hovering over the player's icon on the right side of the screen. My guess is maybe this has to do with resources that do or do not have an improvement on them, maybe it has something to do with resources that have not been revealed yet?

As a side note, the turn in which the city of Tonga's tech number became red was the same turn that their borders grew and grabbed a tile with whales on it, which were, of course, unimproved.

4. Steps to reproduce (optional):

  1. Hover over city of another player
  2. Marvel at the magic color-changing technology number, wow!

Supporting information: Please note that you can attach .zip files by dragging-and-dropping them. If possible, zip up all supporting data and post that way.

  1. Log files (always attach your Logs folder, located at My Documents/My Games/Sid Meier's Civilization 5. For instructions, go to the repository's main page, under "To enable logging for bug reports"): Logs.zip

  2. Save game (always attach a save that was made a turn before the error; located at My Documents/My Games/Sid Meier's Civilization 5/ModdedSaves; you can change autosave frequency in the game's Options menu): Colored Tech Number Bug Report.zip In this save, Tonga's tech number color is red, while Beijing and Guangzhao's tech number color was green. Shanghai has the normal white color.

  3. CvMiniDump.dmp file (attach if experiencing a game crash. Located at Program Files/Steam/steamapps/common/Sid Meier's Civilization V):

  4. Screenshots (optional): Normal white text: image Green text: image Green text on a different civ's city: image Red text: image

RecursiveVision commented 2 years ago

No idea how to fix this

psparky commented 2 years ago

In (6a)...LUA/EUI_tooltip_library.lua at line 2669 there is a use of [/COLOR]. I'm not entirely sure what this does but I don't think it's needed, as all the preceding txt_key entries either don't set a color or terminate it with an [ENDCOLOR].

I suspect the [/COLOR] is having some strange effect and should be removed (with the preceding catenation operator).

So or L"TXT_KEY_DIPLO_MAJOR_CIV_DIPLO_STATE_NEUTRAL" ) .. "[/COLOR]"

becomes

    or L"TXT_KEY_DIPLO_MAJOR_CIV_DIPLO_STATE_NEUTRAL" )
treacherousfiend commented 2 years ago

Can confirm that the removal of that .. "[/COLOR]" seems to have fixed the issue! I don't see any side effects, and the tooltips seem to be the same as before, just without the bug. Of course, it's possible that i missed something.

My guess is that maybe it was there so that the text of the major civ's mood was colored, just like the border of their icon on the scoreboard, image but it was placed in the wrong spot, so stuff like "FRIENDLY" or "GUARDED" always appeared as white, although it's possible that was intentional. (image for reference) image As a sidenote, I don't see [/COLOR] used anywhere else in this file, not sure if thats helpful info in anyway.

psparky commented 2 years ago

Thanks for trying it out and reporting back. Whilst I don't fully understand exactly what's happening here, I think it would be OK for the change to be made.

[/COLOR] is pretty rare, but it is used in a few files in vanilla Civ 5, so it's a proper thing. The strings for Friendly etc are mostly defined in vanilla files and most don't set any color - War does, and one other IIRC.

My guess is that it's something to do with the resources at the top of the city tooltip.

I made a thread on the forum about [/COLOR]: https://forums.civfanatics.com/threads/meaning-of-color-in-ui-strings.674738/

RecursiveVision commented 2 years ago

Thanks @psparky!