Page 1 of 1

Request: Prototype/ResourceEntity custom_map_tooltip property

Posted: Tue Jun 28, 2022 2:50 am
by ShadowGlass
Please add a new property for the 'resource' prototype:

name: custom_map_tooltip
type: LocalisedString
default: nil

If this is specified, then it should be displayed on the map view when hovering over the resource, instead of the default generated tooltip which shows the product names / amounts.

We have some special resources, which are modified by control scripts and the initial products/amounts are just meaningless placeholders. To avoid confusing the players, it'd be nice if the map tooltip could display a custom text instead of the meaningless placeholder item when hovering over the resource.

Optional: Maybe pass in the original generated tooltip as the __1__ parameter of the LocalisedString. We won't use this, but it would make this a bit more flexible.

You might also want to make this available as a read-only field at runtime on the LuaEntityPrototype.

Re: Request: Prototype/ResourceEntity custom_map_tooltip property

Posted: Fri Jul 07, 2023 12:17 pm
by micromario
+1 this would be extremely helpful for custom resource patches.

Re: Request: Prototype/ResourceEntity custom_map_tooltip property

Posted: Sat Jul 08, 2023 4:15 am
by SWeini
+1, this would make my favorite mod more beginner-friendly

regarding parameter passing to LocalisedString:

passing the originally generated tooltip as __1__ allows mod authors to add extra information
passing the resource amount as __2__ allows to have totally custom tooltips which incorporate the resource amount

these are for different purposes, so if you add parameters it might make sense to just add both