I am working on this mod that reintroduces the ability to add tags by right-clicking. After my custom input event adds the tag, I'd like to show the edit dialog like vanilla used to do.
Rather than write an interface that does the exact same thing as the already existing one, I'd rather be able to call some function or raise some event to inject into the regular tag editing flow. I was thinking something like this:
Code: Select all
local tag = player.force.add_chart_tag(player.surface, {...})
if (tag ~= nil) then
player.open_edit_tag_gui(tag)
end
A couple examples out of the top of my head:
- a mod that allows adding tags from outside the map view;
- a mod that adds a beacon or signpost entity that can be built and placed by the player, and generates a map marker at the same time (though this would require something to prevent the player from deleting the marker)