Topic: Allow buildings to specify the icon used for “Purpose” in the Help
Kontorotsui
Topic Opener |
Posted at:
2026-08-25, 20:39 UTC+2.0
While working on a custom tribe, I noticed that the icon displayed next to the “Purpose” section in the building help text is always selected automatically in building_help.lua. For production sites, the code tries output_ware_types[1], then output_worker_types[1], and then has several other fallbacks. This works reasonably well in general, but it means that the building author cannot explicitly choose which object should represent the purpose of the building. For example, I have a building that produces meat, fish and wool, and also recruits a donkey. For this particular building the donkey is the important new feature, so I would like the Purpose icon to be the donkey. The current automatic selection instead uses one of the produced wares because they have priority in the choosing of the icon. I was thinking that an optional field such as purpose_icon in the building helptexts in units.lua could solve this: helptexts = { purpose = pgettext(...), purpose_icon = "carrier_donkey" } If purpose_icon is specified, the Help would use it; otherwise the current automatic selection would remain unchanged. I already checked the code and I can prepare the corresponding code change and submit it if this sounds like a useful addition. What do you think?
1
Top
Quote
|
hessenfarmer
|
Posted at:
2026-08-27, 20:59 UTC+2.0
+1 from my side as the icons in some of our legacy tribes, have similar problems. e.g. the frisian hunter
2
Top
Quote
|
Kontorotsui
Topic Opener |
Posted at:
2026-09-03, 18:20 UTC+2.0
Thanks, give me a few days and I will propose the code change, it is pretty small and straightforward.
Top
Quote
|
Kontorotsui
Topic Opener |
Posted at:
2026-09-17, 00:09 UTC+2.0
Ok, I made the change and tested it. It works perfectly, and if you mistype the purpose_icon you want, it simply shows no icon in the Purpose section of the encyclopedia, so you can tell that something is wrong. I don't know how to submit the change. It is just a few lines in building_help.lua, so here is the diff:
You only need to add the following to the appropriate building's helptexts section in units.lua:
This makes the encyclopedia show fur as the icon. It works with both wares and workers. If this approach is acceptable, I can prepare the proper code change. Otherwise, please let me know how you would prefer me to submit it officially.
Top
Quote
|


