Forums Gallery Downloads LOGIN |REGISTER

UI Event listener and Functions creation

Please use this forum for questions on C++, Lua, XML, and any other languages used in CryENGINE development.


 

User avatar
Alex626
Producer
Producer
 
Posts: 2321
Member since: 15.04.2008, 19:40
Location: London, UK
Likes: 1

UI Event listener and Functions creation

Postby Alex626 » 09.03.2012, 16:54

I've just copy&pasted the code from here:
http://freesdk.crydev.net/display/SDKDO ... ctionnodes

and followed instructions of implementation. But I have a compile error:

Code: Select all
1>  UIFunctions.cpp
1>UIFunctions.cpp(13): error C2660: 'IUIEventSystem::RegisterListener' : function does not take 1 arguments


It says that the function RegisterListener needs more arguments:

Code: Select all
m_pGameEvents = gEnv->pFlashUI->CreateEventSystem( "Game", IUIEventSystem::eEST_UI_TO_SYSTEM );
m_pGameEvents->RegisterListener(this);



Another problem!

How to make a node, which will send the values as Event? I've tried the standard UI Events, like UISettings, and it worked. After I made Events and Functions in the separate files, like it said in docs, I can't activate the SendEvent function!!!



I need a help. Thank you!
Last edited by Alex626 on 11.03.2012, 20:23, edited 3 times in total.
User avatar
Alex626
Producer
Producer
 
Posts: 2321
Member since: 15.04.2008, 19:40
Location: London, UK
Likes: 1

Re: UIFunctions.cpp - compile error

Postby Alex626 » 09.03.2012, 17:56

First problem is solved.

You should register the listener with a name.

Change this:

Code: Select all
m_pGameEvents->RegisterListener(this);


to this:

Code: Select all
m_pGameEvents->RegisterListener(this,"CUIFunctions");


It should be sticked, and documentation needs to be fixed.
User avatar
Alex626
Producer
Producer
 
Posts: 2321
Member since: 15.04.2008, 19:40
Location: London, UK
Likes: 1

Re: UIFunctions.cpp - compile error

Postby Alex626 » 10.03.2012, 13:36

up^

How to make a node, which will send the values as Event? I've tried the standard UI Events, like UISettings, and it worked. After I made Events and Functions in the separate files, like it said in docs, I can't activate the SendEvent function!!!
User avatar
Alex626
Producer
Producer
 
Posts: 2321
Member since: 15.04.2008, 19:40
Location: London, UK
Likes: 1

Re: UI Event listener and Functions creation

Postby Alex626 » 12.03.2012, 18:55

UP!!


 
Connect and collaborate with CRYENGINE developers in the official Forums.
Visit the Gallery to share what you have created and be inspired by what others are creating with CRYENGINE.
Community