There is no way AFAIK for us modders to do the same. Matching vanilla behavior as closely as possible is something I strive to do with my mods, and being able to create "error" texts like this would be very nice.
The simplest way to do this that I can think of would be to add an argument to player.create_local_flying_text to create it at the cursor position instead of on the map. Something like this:
Code: Select all
player.create_local_flying_text{
text = {'fe-gui-search.no-recipes-as-ingredient-error'},
create_at_cursor = true
}
Is this something that can be done?