SKIN_CLICK does not work after Edit Mode

Post here your questions about the OpenSpace 2.x or notify bugs and suggestions.

Moderators: Lapo, Bax

ohanyan
Posts: 8
Joined: 10 Nov 2009, 23:13

SKIN_CLICK does not work after Edit Mode

Postby ohanyan » 15 Oct 2011, 03:16

I have defined a trigger for a skin (the tile is not walkable).

When I add the item in edit mode, the MapInteractionEvent.SKIN_CLICK event is not dispatched. But if I reload the app with the item now in the map, it all works beautifully.

How can I work around this?
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 17 Oct 2011, 08:51

In edit mode the triggers are disabled. They only work in play mode.
Paolo Bax
The SmartFoxServer Team
ohanyan
Posts: 8
Joined: 10 Nov 2009, 23:13

Postby ohanyan » 17 Oct 2011, 14:50

bax wrote:In edit mode the triggers are disabled. They only work in play mode.


I wasn't clear. The SKIN_CLICK triggers aren't firing after leaving Edit Mode. I enter edit mode, move things around, leave edit mode (map is updated successfully) but then the triggers aren't fired in play mode any more.
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 18 Oct 2011, 08:10

Not sure what you are doing wrong, but I just tested this using our live demo here, and it works as expected.
Try it yourself: enter one of the maps, go to edit mode, load the inventory and drag the rocking chair item on the map. It has a skin click trigger attached to it. When you leave the edit mode and click the chair, you will see it rock without the need to reload the map.
Paolo Bax
The SmartFoxServer Team
ohanyan
Posts: 8
Joined: 10 Nov 2009, 23:13

Postby ohanyan » 19 Oct 2011, 18:07

Yes, I do see that. So I checked everything against the sample project and there is no difference. Can you tell me what else may cause this issue? Also, we have a custom extension that handles map saving. Can the problem come from that?

Thanks
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 20 Oct 2011, 06:55

No idea at all. And I don't think the way map data is saved has anything to do with this issue. Would you be able to send the map and assets to us, for a local test?
Paolo Bax
The SmartFoxServer Team
ohanyan
Posts: 8
Joined: 10 Nov 2009, 23:13

Postby ohanyan » 27 Oct 2011, 20:46

I was able to get this working by setting

Code: Select all

openSpace.userInteractionEnabled = true
every time the user leaves edit mode.

Code: Select all

OpenSpaceEvent.EDIT_MODE_LEFT


:D
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 29 Oct 2011, 04:48

Great.
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 36 guests