Page 1 of 1

Additional properties for custom alert/nodification icons

Posted: Fri May 12, 2017 4:38 am
by jonatkins
I've been playing with the add_custom_alert method to show information right of the quickbar.

While I have no troluble showing an icon with a custom message, I'd like to have the behaviour of the "Combat robotics" status icon.
factorio-notification-icon.jpg
factorio-notification-icon.jpg (12.71 KiB) Viewed 1932 times
Specifically:
  • Choose if the icon should flash or not
  • Specify a number (or a short string?) to overlay on the corner of the icon
Also, it seems the message that appears when you hover over the icon always has "Alerts" as a first line, and "see the map for more details" added at the end - neither make much sense for the mod I'm making. Shouldn't the last one, at least, depend on the "show_on_map" parameter?

I've hunted through the API docs for a while and found no sign of either if these possibilities.

Also - related - several of the alert APIs reference defines.alert_type, but the defines documentation has no entries for this.

Re: Additional properties for custom alert/nodification icons

Posted: Sat May 13, 2017 5:52 am
by jonatkins
Also, I now see that these alerts added from a mod are merged with any messages created from in-game "programmable speakers" - hence the "alert" title. I'd rather have control over a dedicated icon from the mod for this.

Re: Additional properties for custom alert/nodification icons

Posted: Sat May 13, 2017 7:41 pm
by Rseding91
custom alerts were created for the programmable speaker and as such that's what they're setup to be useful for. The API is simply so you can generate them outside of speakers.

It was never designed to work independent like the combat robot system and if such a thing was to be created it would require a completely new GUI system and backing logic - not something that's likely to happen anytime soon.

Re: Additional properties for custom alert/nodification icons

Posted: Sat May 13, 2017 8:11 pm
by jonatkins
Fair enough.

I don't suppose the existing LuaGui interface could be used to do something similar myself? I've not explored it's capabilities yet, but I've not seen any other mods create anything in that area.