Allow access the 1.1 map tag editing gui
Posted: Thu Dec 10, 2020 11:26 pm
Long shot, as this is very much a personal request on something that is arguably a niche need.
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:
This would cover my use case perfectly fine, if someone wants to do more complicated stuff while editing a tag they would need a new ui. However if someone else would want to add tags programmatically but let the user edit them immediately, they could the same way.
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)
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)