• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.
TCS Improved Mod Page

TCS UI Mods 6

It's based on v11 texts, I'd be glad to see it in the mod!
It's been added in Version 12, now up for download! Thanks again!! If I need to make any text changes in the future I'll ping you if that's ok to keep the Italian localization up to date.
 
[AI translate]
Hello! I really love your mod. I'd like to contribute by providing Chinese translations.

Also, I have a suggestion. Could you display the number of specialists in the column for resource harvest statistics (it doesn't need to be shown when there are no specialists).
I can't find an icon for specialists.

I hope this will be helpful. Thank you very much for creating such an amazing mod!
 

Attachments

  • Specialists专家.png
    Specialists专家.png
    224.6 KB · Views: 21
  • zh_Hans_CN-tcs-ui-improved-plot-tooltip.7z
    zh_Hans_CN-tcs-ui-improved-plot-tooltip.7z
    2 KB · Views: 4
Last edited:
I have to modify two places in the .js file every time I translate text: 1, 'Full Tile'; 2, 'Total Yields' — instead of just checking the text file for new entries.:sad:
 
I have to modify two places in the .js file every time I translate text: 1, 'Full Tile'; 2, 'Total Yields' — instead of just checking the text file for new entries.:sad:
That's exactly why I also created the account here - @thecrazyscot can we have Total Yields and Full Tile somehow defined and included in the InGameText.xml?

I have a polish translation ready to be shared, but you still see "Total Yields:" and "Full Tile" written in english, if you don't modify the .js file.

Screenshot 2025-02-19 193626.png
 
Hey all - really thrilled with the enthusiasm. I will push a release today that will fix those hard coded strings so that all the text can be updated in the localization files. For the Chinese translations, I've now had offers from 3 different people - again, I'm really grateful for the enthusiasm, but I don't know whose to put in - I will probably just have to pick one and I sincerely apologize to the others, no offense is intended.
 
Thank you for a fast response!

You're doing absolutely an amazing job. I can't even imagine playing without your mod anymore :)
as soon as the hotfix is out, i'll update and share my .xml file with polish translation. feel free to ping me for any future updates.

PS can I ask what the "LOC_PLOT_MOD_TCS_COORDINATES" and "LOC_PLOT_MOD_TCS_ROUTE_FERRY" are for? Can't see them anywhere in game and can't find them defined in the .js file.
 
Last edited:
‌‌You can post several Chinese texts here for us to discuss. I noticed that the friend above used AI translation, but the wording was not accurate. Many terms need to be consistent with the official game terminology, such as "urban", "quarter", and "unique quarter".
 
Thank you for a fast response!

You're doing absolutely an amazing job. I can't even imagine playing without your mod anymore :)
as soon as the hotfix is out, i'll update and share my .xml file with polish translation. feel free to ping me for any future updates.

PS can I ask what the "LOC_PLOT_MOD_TCS_COORDINATES" and "LOC_PLOT_MOD_TCS_ROUTE_FERRY" are for? Can't see them anywhere in game and can't find them defined in the .js file.
They are unused - I was going to use them for something but changed my mind :crazyeye:
 
1:The text "Not in the Trade Network" is not centered.

Stonecutter.png


2:The text of Golden Age building is too close to the icon of another building.In a Chinese environment, the right margin becomes too narrow.,but I'm not sure if it's a problem with my resolution.

Observatory.png
伊莎贝拉(你).png
 
Last edited:
PREMISE: this is a repost, my previous comment had a mistake so I took it down as soon as I noticed it. This one has been corrected.

Hey mate, while I was trying to fix a vanilla bug I discovered there is no way to implement the fix while also maintaining compatbility with tooltip mods such as yours. So I though of letting you know of the bug (and the fix) in case you want to include it in your mod. Here it is:

I think Fireaxis messed up the script execution order in a specific case: currently, the plot-tooltip script likely runs after the interface-mode-acquire-tile script, which is clearly not intended because interface-mode-acquire-tile includes its own cursor-icon-chaning logic (for valid or invalid hovered plots, like with the interface-mode-place-building, which works because it likely runs after plot-tooltip). This is causing the intended behavior from interface-mode-acquire-tile to be completely overridden by the cursor changes from the plot-tooltip script. I don't think we, as modders, can mess with script execution order, but I though of adding some code to check whether the aforementioned interface-mode is on, and in that case skip the cursor changes in the tooltip-plot.

The reason this can't be done without breaking compatbility with your mod (or any other tooltip mod), is that the cursor-changing-logic from plot-tooltip is not a distinct and well encapsulated function, and it is instead inside the generic update function, so I can't even monkey-patch this either. Of course such a tiny fix is not worth renouncing an awesome tooltip mod (like yours!) but...

if by any chance you want to include this fix in your mod, I'm glad to share code that fixes it according to my tests:

The original update function has the following piece of code:

JavaScript:
if (showHostileCursor) {
                    UI.setCursorByURL("fs://game/core/ui/cursors/enemy.ani");
                }
                else {
                    UI.setCursorByType(UIHTMLCursorTypes.Default);
                }



By simply wrapping it inside an additional check you can fix Fireaxis mistake:

JavaScript:
if (InterfaceMode.getCurrent() && InterfaceMode.getCurrent() === 'INTERFACEMODE_ACQUIRE_TILE') {
    // When in Acquire Tile mode, let that mode control the cursor..
}
else {
    if (showHostileCursor) {
       UI.setCursorByURL("fs://game/core/ui/cursors/enemy.ani");
    }
    else {
       UI.setCursorByType(UIHTMLCursorTypes.Default);
    }
}

This also requires adding the following import of course:
JavaScript:
import { InterfaceMode } from '/core/ui/interface-modes/interface-modes.js';

Feel free to do whatever you want with this information and this code!
 
1:The text "Not in the Trade Network" is not centered.

2:The text of Golden Age building is too close to the icon of another building.In a Chinese environment, the right margin becomes too narrow.,but I'm not sure if it's a problem with my resolution.
Thanks for the bug reports - I may have to revert to having the Buildings flow as a column instead of a row to smoothly handle longer names.
 
PREMISE: this is a repost, my previous comment had a mistake so I took it down as soon as I noticed it. This one has been corrected.

Hey mate, while I was trying to fix a vanilla bug I discovered there is no way to implement the fix while also maintaining compatbility with tooltip mods such as yours. So I though of letting you know of the bug (and the fix) in case you want to include it in your mod. Here it is:

I think Fireaxis messed up the script execution order in a specific case: currently, the plot-tooltip script likely runs after the interface-mode-acquire-tile script, which is clearly not intended because interface-mode-acquire-tile includes its own cursor-icon-chaning logic (for valid or invalid hovered plots, like with the interface-mode-place-building, which works because it likely runs after plot-tooltip). This is causing the intended behavior from interface-mode-acquire-tile to be completely overridden by the cursor changes from the plot-tooltip script. I don't think we, as modders, can mess with script execution order, but I though of adding some code to check whether the aforementioned interface-mode is on, and in that case skip the cursor changes in the tooltip-plot.

The reason this can't be done without breaking compatbility with your mod (or any other tooltip mod), is that the cursor-changing-logic from plot-tooltip is not a distinct and well encapsulated function, and it is instead inside the generic update function, so I can't even monkey-patch this either. Of course such a tiny fix is not worth renouncing an awesome tooltip mod (like yours!) but...

if by any chance you want to include this fix in your mod, I'm glad to share code that fixes it according to my tests:

The original update function has the following piece of code:

JavaScript:
if (showHostileCursor) {
                    UI.setCursorByURL("fs://game/core/ui/cursors/enemy.ani");
                }
                else {
                    UI.setCursorByType(UIHTMLCursorTypes.Default);
                }



By simply wrapping it inside an additional check you can fix Fireaxis mistake:

JavaScript:
if (InterfaceMode.getCurrent() && InterfaceMode.getCurrent() === 'INTERFACEMODE_ACQUIRE_TILE') {
    // When in Acquire Tile mode, let that mode control the cursor..
}
else {
    if (showHostileCursor) {
       UI.setCursorByURL("fs://game/core/ui/cursors/enemy.ani");
    }
    else {
       UI.setCursorByType(UIHTMLCursorTypes.Default);
    }
}

This also requires adding the following import of course:
JavaScript:
import { InterfaceMode } from '/core/ui/interface-modes/interface-modes.js';

Feel free to do whatever you want with this information and this code!
Thanks for the detailed breakdown! I'm happy to add this in.
 
Hi, thanks for the great mod.
Here is a Traditional Chinese translation based on version 13.
Some values related to mood do not change due to I found there is no using in script.
BTW, is it possible to add religion info in the tooltip?

Thanks again.
 

Attachments

Hey mate, while I was trying to fix a vanilla bug I discovered there is no way to implement the fix while also maintaining compatbility with tooltip mods such as yours. So I though of letting you know of the bug (and the fix) in case you want to include it in your mod. Here it is:
thanks for sharing this! i've made a note to fix this in Map Trix too.
 
Thanks for the detailed breakdown! I'm happy to add this in.
Would it would be possible for you to include, with your next release, a loadorder property with a very high value?
That's because I ended up including the fix an (upcoming) tiny mod of mine that includes a handful of similar "fixes".
If you end up including my suggested change as well as a high-value loadorder, I believe that a user could enable both my upcoming fixes mod as well as your tooltips with no issues.

EDIT: actually, it appears you're using <UIScripts> and I can't get it to entirely overwrite the file from my mod. It only works if I modify your modinfo to use <ImportFiles> instead, not sure why, I might be missing something about how the modloader works. Whatever, don't want to bother you further. I'll see what to do on my end if possible, after a bit of additional research. Have a good one!
 
Last edited:
LoadOrder is pretty finicky. you have to set it at exactly the same scope in both mods, and i don't think it affects <UIScripts>. i had so much trouble with it that i came up with an entirely different method to override the tooltip, haha. btw, what do you mean by "very high"? i usually set my mods to LoadOrder 1000, although occasionally i use a higher value if i need to override a specific mod.
 
Back
Top Bottom