Lort Krassbeter
Chieftain
Hi all,
I have some trouble getting events to work. I am trying to hide/show a UI element when the player opens/closes a city screen using the following code:
When calling the Hide()/Show() methods from Firetuner it works just fine.
So I am wondering if I made a mistake on setting up the events. I've seen some mods use "Events." others use use "GameEvents." or "LuaEvents.". Can you explain the difference between those, if there are any? Do I have to do something else besides registering the function I would like to get called when the event occurs?
Thanks in advance
I have some trouble getting events to work. I am trying to hide/show a UI element when the player opens/closes a city screen using the following code:
Code:
function Show()
Controls.MyLabel:SetHide(false)
end
function Hide()
Controls.MyLabel:SetHide(true)
end
function OnEnterCityScreen()
Hide()
end
Events.SerialEventEnterCityScreen.Add(OnEnterCityScreen);
function OnExitCityScreen()
Show()
end
Events.SerialEventExitCityScreen.Add(OnExitCityScreen);
So I am wondering if I made a mistake on setting up the events. I've seen some mods use "Events." others use use "GameEvents." or "LuaEvents.". Can you explain the difference between those, if there are any? Do I have to do something else besides registering the function I would like to get called when the event occurs?
Thanks in advance
