Provide "currently hovered prototype" on a custom-input

Post Reply
User avatar
Raiguard
Filter Inserter
Filter Inserter
Posts: 354
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Provide "currently hovered prototype" on a custom-input

Post by Raiguard »

The prototype explorer GUI works by pressing a hotkey when hovering over something in the GUI or on the map - entities, items, recipes, technologies, etc. Would it be possible to provide this same functionality to a custom-input? For example, hovering over a recipe in the crafting menu, and pressing a custom input, will provide an object in the event providing that info (e.g. e.hovered_object = {type = "recipe", name = "iron-plate"}).

This would allow me to support opening Recipe Book when someone uses its hotkey while hovering an object. The advantage of this is that they wouldn't have to open the GUI and search for the same thing they were already looking at.

Thank you!
Don't forget, you're here forever.

blazespinnaker
Filter Inserter
Filter Inserter
Posts: 530
Joined: Wed Sep 16, 2020 12:45 pm
Contact:

Re: Provide "currently hovered prototype" on a custom-input

Post by blazespinnaker »

Supported in map mode and other views as well would be great. Very surprised there is no API already for this.
OptimaUPS Mod, pm for info.

Rseding91
Factorio Staff
Factorio Staff
Posts: 12150
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Provide "currently hovered prototype" on a custom-input

Post by Rseding91 »

Ok, I added include_selected_prototype as a new custom input property. When true and something is hovered that applies the following gets included in the event:

Code: Select all

selected_prototype = {base_type=, derived_type=, name=}
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Implemented mod requests”