It's an addon for The Elder Scroll Online which track Dragons status in Elsweyr.
I was inspired by the addon World Event Alert (aka Dragon Alert) created by Enodoc. Thanks to him.
And, you can install the addon World Event Alert in addition if you want because I not display an alert when a dragon's status change.
One library : LibWorldEvents
.
Into the addon folder (Elder Scrolls Online\live\AddOns
in your document folder), you need to have a folder WorldEventsTracker
and copy all files into it.
So you can :
- Clone the repository in the AddOns folder and name it
WorldEventsTracker
. - Or download the zip file started by
esoui-
of the last release in github, and extract it in the AddOns folder.
Go to Elsweyr, and you will see something appear with the status of each dragon.
You can move it where you want.
If you are not in Elsweyr zone (also in Elsweyr public dungeons), info will be hidden.
A dragon is a "World Event" in the API, so we use some event on WorldEvents.
Game Events triggered :
EVENT_ADD_ON_LOADED
: When the addon is loadedEVENT_PLAYER_ACTIVATED
: When a load screen displayedEVENT_GAME_CAMERA_UI_MODE_CHANGED
: A change in camera mode (free mouse, open inventory, etc). In released versions, this event is not triggered. I use it to dump some data when I dev or debug.
LibWorldEvents
events triggered :
LibWorldEvents.Events.callbackEvents.dragon.new
: When a new dragon instance is created.LibWorldEvents.Events.callbackEvents.dragonList.removeAll
: When all dragon are removed fromDragonList
.
Note : Dark anchor, world bosses, etc are not trigger WorldEvent events. So I cannot catch events on them.
When the interface is displayed, a timer is created. This timer call a function which updates the display info "since ..." every 1 second. If the interface is not loaded, the timer is destroyed.
The text "since..." cannot be displayed if you just arrived in the zone; the addon doesn't know since how many time a dragon has its status. The "since..." will be displayed only if you are in the zone when the status change.
To know if the timer is created, you can use the variable WorldEventsTracker.updateTimeEnabled
; true
if created, false
if not exist.
There are loaded in order :
- Initialise.lua
- Events.lua
- GUI.lua
- GUIItem.lua
- GUITimer.lua
- Run.lua
Declare all variables and the initialise function.
Declared variables :
WorldEventsTracker
: The global table for all addon's properties and methods.WorldEventsTracker.name
: The addon nameWorldEventsTracker.savedVariables
: TheZO_SavedVars
table which contains saved variable for this addon.WorldEventsTracker.ready
: If the addon is ready to be usedWorldEventsTracker.LAM
: The library LibAddonMenu2
Methods :
WorldEventsTracker:Initialise
: Module initialiser
Intiialise savedVariables, settings panel and GUIWorldEventsTracker:initSavedVars
: Initialise all savedVariable's default values
Table : WorldEventsTracker.Events
Contain all functions called when a listened event is triggered.
WorldEventsTracker.Events.onLoaded
: Called when the addon is loadedWorldEventsTracker.Events.onLoadScreen
: Called after each load screenWorldEventsTracker.Events.onNewDragon
: Called when a new dragon instance is createdWorldEventsTracker.Events.onCreateAllDragon
: Called when all dragon are created from DragonListWorldEventsTracker.Events.onRemoveAllFromDragonList
: Called when all dragon is removed from DragonListWorldEventsTracker.Events.onDragonChangeType
: Called when a dragon's type changeWorldEventsTracker.Events.onDragonKilled
: Called when a dragon is killedWorldEventsTracker.Events.onGuiMoveStop
: Called when GUI items have been moved by the userWorldEventsTracker.Events.onGuiChanged
: Called when something changes in the GUI (like open inventory).
Used to debug only, the line to add the listener on the event is commented.WorldEventsTracker.Events.keybindingsToggle
: Called when player use the keybind to show/hide the GUI
Table : WorldEventsTracker.GUI
Contains all functions to define the GUI container and save GUIItems instances.
Properties :
container
: The TopLevelControl in interfaceitems
: List of GUIItems associate to a dragonsavedVars
: A direct access toWorldEventsTracker.savedVariables.gui
which contain all saved variables used by the GUI.fragment
: The fragment used to define when the GUI is displayedtoDisplay
: To know if the GUI should be displayed (user config only)
It's not the current GUI display status because the user can accept to display it but not be in a dragon's zone (so the GUI will be hidden) !
Methods :
WorldEventsTracker.GUI:init
: Initialise the GUIWorldEventsTracker.GUI:obtainContainer
: Obtain the TopLevelControl's tableWorldEventsTracker.GUI:restorePosition
: Restore the GUI's position from savedVariablesWorldEventsTracker.GUI:savePosition
: Save the GUI's position from savedVariablesWorldEventsTracker.GUI:restoreLock
: Restore the GUI locked statusWorldEventsTracker.GUI:isLocked
: Return the status if the GUI should be locked or notWorldEventsTracker.GUI:defineLocked
: Define if the GUI should be locked or not, and update the GUI to lock it (or not)WorldEventsTracker.GUI:defineFragment
: Define GUI has a fragment linked to scenes.
With that, the GUI is hidden when we open a menu (like inventory or map)WorldEventsTracker.GUI:isDisplayWithWMap
: Return the status if the GUI should be display in the world map interfaceWorldEventsTracker.GUI:defineDisplayWithWMap
: Define the status which define if the GUI is displayed in the world map interface or not, and update the fragment to apply the new status.WorldEventsTracker.GUI:display
: Hide or show all GUIItems.WorldEventsTracker.GUI:toggleToDisplay
: Switch the status of toDisplay to be the invert of the previous status, and call self:display() to update the GUIWorldEventsTracker.GUI:createItem
: To create a GUIItem instance for a DragonWorldEventsTracker.GUI:resetAllItems
: To reset the list of GUIItemsWorldEventsTracker.GUI:labelUseName
: Define the label type to use on the location name.WorldEventsTracker.GUI:labelUseCardinalPoint
: Define the label type to use on the cardinal point.WorldEventsTracker.GUI:obtainLabelType
: Return the current labelFormat usedWorldEventsTracker.GUI:defineLabelType
: Define the label to use and call the method to move the value controler relative to the max width of labels
Table : WorldEventsTracker.GUIItem
Contain all info about a LabelControl in the gui. It's a POO like with one instance of GUIItem by LabelControl. Each GUIItem is linked to a Dragon instance. Else, the text value is empty and label is hidden.
Properties :
dragon
: The Dragon instance linked to the GUIItemcolorctr
: The Color square in the interfacelabelctr
: The label control in the interface used to display locationvaluectr
: The Label control in the interface used to display the status and the timertitle
: The prefix to use for the dragon (like "North")value
: The text displayed
Methods :
WorldEventsTracker.GUIItem:new
: To instanciate a new GUIItem instanceWorldEventsTracker.GUIItem:defineTooltips
: Define all tooltipWorldEventsTracker.GUIItem:obtainTypeTooltipText
: Return the text to use in color tooltipWorldEventsTracker.GUIItem:changeColor
: To change the color in the dragon color boxWorldEventsTracker.GUIItem:changeTitleType
: Change the title type to use and update label text.WorldEventsTracker.GUIItem:moveValueCtr
: Move the value controler relative to the label width.WorldEventsTracker.GUIItem:clear
: Define the text value as empty stringWorldEventsTracker.GUIItem:display
: Define the value of SetHidden to show or hide the labelWorldEventsTracker.GUIItem:show
: Show the labelWorldEventsTracker.GUIItem:hide
: Hide the labelWorldEventsTracker.GUIItem:update
: Update the text valueWorldEventsTracker.GUIItem:obtainSinceValue
: Obtain the text to display with a "[status] since..."WorldEventsTracker.GUIItem:obtainRepopInValue
: Obtain the text to display with a "repop in..."WorldEventsTracker.GUIItem:obtainStatusText
: Obtain the status to display from a dragon statusWorldEventsTracker.GUIItem:obtainSinceTimerInfo
: Obtain the timer text to display when message is "[status] since..." (so count from 0)WorldEventsTracker.GUIItem:obtainInTimerInfo
: Obtain the timer text to display when message is "repop in..." (so count to 0)WorldEventsTracker.GUIItem:formatTime
: Format the time to have it for second, minute, or hour
Table : WorldEventsTracker.GUITimer
Extends : LibWorldEvents.Timer
Contain all function to manage the timer used to display "since..."
Methods :
WorldEventsTracker.GUITimer.update
: Callback function on timer. Called each 1sec in dragons zone. Update the GUI for each dragon.
Table : WorldEventsTracker.Settings
Contain all function used to build the settings panel
Properties :
panelName
: The name of the settings panel
Methods :
WorldEventsTracker.Settings:init
: Initialise the settings panelWorldEventsTracker.Settings:build
: Build the settings panelWorldEventsTracker.Settings:buildGUILocked
: Build the "GUI Locked" part of the panelWorldEventsTracker.Settings:buildDisplayedWithWorldMap
: Build the "Displayed with the World Map" part of the panelWorldEventsTracker.Settings:buildPositionType
: Build the "Position type" part of the panel
Define a listener to all used events.