Sorry to reheat that old thread, but it is the only place I've found in this forum mentioning "initial" parameter to a function handling EVENT_PLAYER_ACTIVATED. What is real meaning of this parameter?
https://wiki.esoui.com/EVENT_PLAYER_ACTIVATED says:
boolean initial - whether the user just logged on
|
but this does not seem to be correct; according to the example code in this thread, "initial" is true not just after logging in, but also after fast travel, and false only after reloadui. Is that right? Is there anything else worth knowing about this parameter?
Originally Posted by Calamath
There are many ways to detect warping between different zones using fast travel, but I use EVENT_PLAYER_ACTIVATED.
Here is a hint.
Lua Code:
local isFirstTimePlayerActivated = true local function OnPlayerActivated(eventCode, initial) if initial then if isFirstTimePlayerActivated == false then -- --------------------------------- after fast travel -- do something else -- --------------------------------- after login isFirstTimePlayerActivated = false end else -- ------------------------------------- after reloadui isFirstTimePlayerActivated = false end end EVENT_MANAGER:RegisterForEvent("yourAddonName", EVENT_PLAYER_ACTIVATED, OnPlayerActivated)
|