Possible to hook into mapper rightclick menu?
Re: Possible to hook into mapper rightclick menu?
I added user hooks in my latest repo update. If you can compile, you can toy around with custom merges/whatever your heart desires. It can't do things like detect rooms dropped on one another, but it'll let you select individual rooms or many rooms and do fun things with them. As for exit stubs, I explain how they work in my repository post as well.
Re: Possible to hook into mapper rightclick menu?
Works, nice stuff. You call addMapEvent("menu entry name", "event name to be raised"), and when the entry is clicked, it'll raise an event with the selected room / rooms highlighted as a list of arguments.
-
- Posts: 18
- Joined: Sat Sep 10, 2011 7:37 am
Re: Possible to hook into mapper rightclick menu?
I'll take a peek when I have time to compile (might not be for a few days).chris wrote:If you can compile, you can toy around with custom merges/whatever your heart desires. It can't do things like detect rooms dropped on one another, but it'll let you select individual rooms or many rooms and do fun things with them.
Can someone explain though how I would go about selecting the rooms in such a way that I know which is the "room to merge" vs the "room to merge into"? Is the selection order maintained in a list?
Re: Possible to hook into mapper rightclick menu?
You can only select by dragging a rectangle, so there is no set order. I'd recommend dragging rooms into a single location, then merging them.
Re: Possible to hook into mapper rightclick menu?
You can also select via the right click Vadi, it returns the single room you highlighted. Though this is useless for merging . However, a general drag and drop for merges I think is a bad idea since sometimes you want to stack rooms on top of eachother, at least I have.
Re: Possible to hook into mapper rightclick menu?
I meant for multiple selection, its via a rectangle
-
- Posts: 18
- Joined: Sat Sep 10, 2011 7:37 am
Re: Possible to hook into mapper rightclick menu?
I'm curious, but why would you want to stack rooms on top of each other? If they're occupying the same space, aren't they the same room? Otherwise, how do you:chris wrote:However, a general drag and drop for merges I think is a bad idea since sometimes you want to stack rooms on top of eachother, at least I have.
1. select the room
2. speedwalk to the room
If it's easy to do the drag and drop and the only resistance to making the change is to keep the old behaviour, why not add a switch that users can set via their mapping script? Something settable with setMapVar? Maybe setMapVar("allowRoomMerges", 1)? Set the default to 0 and everyone's happy?
Multiple selections for merging is not helpful unless it's obvious which room to keep and which room to delete. If drag and drop won't happen, then an alternative method could be done using the right click menu and 3 events:
addMapEvent("Merge into this room", "event1")
addMapEvent("Merge this room", "event2")
addMapEvent("Abort merge", "event3")
but then it would be nice to grey out the "Merge into this room" when a room has been selected. And make the "Merge this room" and "Abort merge" inactive until "Merge into this room" has been selected. Is it possible to set an active/inactive property for a menu item via script?
Re: Possible to hook into mapper rightclick menu?
Can't activate/deactivate them yet, it doesn't carry that status. I'm sure that could be added, that that would require scripts to check at runtime as to whenever it should be enabled/disabled?
Re: Possible to hook into mapper rightclick menu?
. I just need to add the remove map event and you can toggle it that way.
-
- Posts: 18
- Joined: Sat Sep 10, 2011 7:37 am
Re: Possible to hook into mapper rightclick menu?
I've hooked up an event and handler, but how do I access this list of arguments? I've got:Vadi wrote:Works, nice stuff. You call addMapEvent("menu entry name", "event name to be raised"), and when the entry is clicked, it'll raise an event with the selected room / rooms highlighted as a list of arguments.
but I only ever see one room (the lowest room id) while I'm expecting to see a table. Or perhaps I'm making a bad assumption. Is "list of arguments" more like:
function test(event, room1, room2, ... , roomN)
but then how to get all of the rooms?