Adding a Tab to the Journal Screen
I considered titling this thread "Adding an Element to an Existing UI Control" but then I realised that could be too general or just outright incorrect.
What I would like to do is create an add-on listing all completed quests under a new tab in the Journal. Getting completed quests is probably the easy bit (CaptainBlagbird is already helping with that) -- the hard bit is getting that list to display as part of the native UI format rather than as its own pop-up or in chat. I hope this should technically be possible, as I've seen add-ons already adding additional tabs to the World Map; here, we're just using the Journal instead of the Map. The new window would have a list on the left of categories, similar to the way the Active Quests list and Cadwell's Almanac tabs already work, and some of those categories would have sub-entries. And now rather than trying to explain it further, I'm just going to put in a couple of pictures, and ask "How do I do this?" List of things I think I need to know:
Thanks for any assistance you can provide, and if anyone would like to be a collaborator on this add-on, let me know! |
Adding a tab:
Lua Code:
/edit: self.control is your TopLevelControl |
Great, thanks! I'm not sure what some of those things actually mean, but I'm sure I'll work it out! Now I have the correct names for some of the elements I can search around for them :)
Edit: Oh dear, I need to write an XML to define my TopLevelControl, don't I? There's probably tutorials on that somewhere... |
http://wiki.esoui.com/Circonians_Stamina_Bar_Tutorial
Scroll down to "XML structure", there should be a pretty good explanation. Or read the other tutorials here, maybe they help as well: http://www.esoui.com/forums/showthread.php?t=6399 The wiki is your friend: http://wiki.esoui.com/Main_Page |
I managed to find out how to define the TopLevelControl using lua instead, which makes a lot more sense to me. So now I have an empty tab! Does anyone know if the definitions for the existing Quest Journal, Lore Library, and/or Achievements controls are available anywhere? They would probably be a good starting point for the interior contents, as they must have a number of child controls themselves.
|
Check the addon ESOUI source, which provides the total source code including the XML files.
http://www.esoui.com/downloads/info1...ourcecode.html Or on github: https://github.com/esoui/esoui -> Version 3.1.0 from the actual PTS The definitions should be somewhere in esoui/ingame/achiev* or quest* |
Quote:
Quote:
|
Basic functionality achieved!
http://www.esoui.com/downloads/info1...stLogbeta.html Priority things to do now are to work out how to add categories down the left, and how to get the thing to update when a quest is completed. Also ideally some way to only load the whole list when the window is open, and unload it when it isn't, to save memory. |
There's EVENT_QUEST_COMPLETE (number eventCode, string questName, number level, number previousExperience, number currentExperience, number championPoints, number questType, number instanceDisplayType) that you can add a handler to to update when a quest completes, if you're keeping an internal list of completed quests. Alternatively, you can just build the quest list each time it's opened, but that might lag the game for players with a lot of completed quests.
I believe the garbage collection is all automatic, but you might be able to clear it by setting all references of it to nil. |
Quote:
|
Votan's addon has no bearing on it. When the quest window is opened, there is a function that is called. So you can hook that to reload the quest list. The quest list will take around 2-3 KB of memory, probably, which isn't too much. I think.
|
The best way I can think of to populate the completed list is to declare a variable firstrun = 1 then run a function on
EVENT_PLAYER_ACTIVATED (or maybe EVENT_ADDON_LOADED): if firstrun == 1 then blabla loop over quests to populate table firstrun = 0 end Then you can easily add entries with EVENT_QUEST_COMPLETED. I guess you would want the table to be alphabetized? So might have to have a separate function that is called to realphabetize the list, but if you figure out how to break them into categories you could make an efficient function that only reorders the quests under that zone category on quest completion. |
Quote:
In the next version I'll try hooking it into opening the window, and get some feedback from people who've completed lots of quests to see if it lags them too much. |
All times are GMT -6. The time now is 03:57 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI