Thread Tools Display Modes
08/14/20, 03:54 PM   #1
ExoY
 
ExoY's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2020
Posts: 87
event code not returned

Hello,

i think i found a bug with an event not returning its "eventCode", as it should according to: https://wiki.esoui.com/API.
If I am mistaken, feel free to just close or delete this thread.

Its about the Event: EVENT_GROUP_MEMBER_JOINT

Here my code:
Lua Code:
  1. function foo:DebugGroupJoinedEvent(event, name, displayName, isPlayerLocal)
  2.   d("DebugGroupJoinedEvent")
  3.   d("event: " .. event)
  4.   d("name: " .. name)
  5.   d(displayName)
  6.   d(isPlayerLocal)
  7.   d("-------------------------")
  8. end
  9.  
  10. EVENT_MANAGER:RegisterForEvent(self.name.."DebugGroupJoined", EVENT_GROUP_MEMBER_JOINED, self.DebugGroupJoinedEvent)

And here the debug result in chat:

Code:
DebugGroupJointEvent
event: Exoy^Mx
name: @Exoy94
true
nil
-------------------------
As you can see, the eventCode is missing. (I would have included screenshot, if i know how to do that
  Reply With Quote
08/14/20, 04:07 PM   #2
Knurps
Join Date: Oct 2019
Posts: 3
Code:
function foo:DebugGroupJoinedEvent(event, name, displayName, isPlayerLocal)
is short for
Code:
function foo.DebugGroupJoinedEvent(self, event, name, displayName, isPlayerLocal)
so now the event code will be stored in the variable self,
the name will be stored in the variable event,
the display name will be stored in the variable name etc.
That's also why your debug output prints "event: Exoy^Mx".

you want to use
Code:
function foo.DebugGroupJoinedEvent(event, name, displayName, isPlayerLocal)
  Reply With Quote
08/14/20, 04:15 PM   #3
ExoY
 
ExoY's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2020
Posts: 87
Thanks for the quick reply.
And what an embarrassing mistake on my side.

Just started to use objects in that form and completely forgot about it.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » event code not returned

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off