In Autodrive, we have a "selection-tool" entity that is used to select either "car" entities in an area or to get the selected position (if the area is small enough, using the tool will be interpreted as "click on a position" instead of "area selected" ). This works in normal mode. In mapview, it works if the player has zoomed in:
request to enable selecting a position on the zoomed out map. I've already thought about reacting to on_chart_tag_added -- but I'd still need a way to add a chart tag on click, so players can still use the item in their cursor instead of another input. I guess for that approach to work I'd need to detect when map view is toggled.
So, is there any way I can get a clicked position in map view?
However, it doesn't work if the map is zoomed out to schematic view:
There was a Detect clicked position in map view
Detect clicked position in map view
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Re: Detect clicked position in map view
How about to set the tag when the player on the map with item clicks?Pi-C wrote: Wed May 20, 2020 7:54 am I've already thought about reacting to on_chart_tag_added -- but I'd still need a way to add a chart tag on click, so players can still use the item in their cursor instead of another input. I guess for that approach to work I'd need to detect when map view is toggled.
If the player have "train" in the cursor and clicks on the map, then here comes the tag without text, may be only for some short time. You can catch it and delete after click.
But viewforum.php?f=28
Re: Detect clicked position in map view
The remote control from Autodrive is not of type "item", but "selection-tool". I'd need to exchange these when map view is toggled, but I can't find an event for it.darkfrei wrote: Wed May 20, 2020 2:34 pmHow about to set the tag when the player on the map with item clicks?Pi-C wrote: Wed May 20, 2020 7:54 am I've already thought about reacting to on_chart_tag_added -- but I'd still need a way to add a chart tag on click, so players can still use the item in their cursor instead of another input. I guess for that approach to work I'd need to detect when map view is toggled.
Do you mean I should make an interface request?
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!