I want to specify a localised string so that if one component of it produces an "Unknown key:" it uses something else instead.
Speculative example:
Code: Select all
tooltip = {'my.tooltip-preset',{item-description.wooden-chest,my.no-description-placeholder,mode='use-first'}}
(Disclaimer: I don't really care *how* this is technically solved. So above is only a wild idea. I'm totally fine with anything better. Like making it possible for mods to know if a localised string is valid or not :p)
The problem is that certain localised strings can not be used in good looking mod guis because they produce garbage 90% of the time (i.e. "Unknown key:"). A prime cause of this are item descriptions, because there's only very few that have them. And from the mod side it's impossible to know if any given loc_string is valid or not.
Code: Select all
/c
game.player.gui.center.clear()
game.player.gui.center.add{
type="label",
caption=game.item_prototypes['wooden-chest'].localised_description
}
This is mostly annoying on tooltips, but it'd be awesome if a generic solution for all localised texts existed.
A good example is also the mod on the portal (which i can't find right now...) that extends the tooltip of mod settings to include the default value. But because most settings don't have a description it looks like this most of the time:
From Arumbas Stream @17:33