Download
(2 Kb)
Download
Updated: 02/05/23 12:28 PM
Pictures
File Info
Compatibility:
Scribes of Fate (8.3.5)
Firesong (8.2.5)
Lost Depths (8.1.5)
High Isle (8.0.0)
Ascending Tide (7.3.5)
Deadlands (7.2.5)
Waking Flame (7.1.5)
Blackwood (7.0.5)
Greymoor (6.0.5)
Updated:02/05/23 12:28 PM
Created:11/08/20 01:41 PM
Monthly downloads:73
Total downloads:6,750
Favorites:12
MD5:
Categories:Beta-version AddOns, Miscellaneous
Item Sets Summary Page Percentages  Popular! (More than 5000 hits)
Version: 0.4.2
by: tombaa [More]
This was originally a small addon to add a total progress bar to the item sets collection, but with the arrival of the summary page in the Deadlands patch, the addon was updated to just add percentages to the summary page on the progress bars

Find the code on Github at https://github.com/tpjham/CollectionSetBookTotal
v0.4.2:
Added string length check to prevent errors on transmute station reconstruction page

v0.4.1.1:
Fixed file names

v0.4.1:
Added missing files, whoops

v0.4:
Removed custom progress bar as it was unnecessary with the summary pages arrival
Added percentages to the summary page progress bars

v0.35.1:
Updated API version to Blackwood DLC

v0.35:
Updated addon to Flames of Ambition DLC
Changed control names to hopefully prevent UI errors with other addons that might have similar controls

v0.3:
Changed the code so there's no saved variables anymore and no dependencies

v0.25:
Fixed an issue where the found items wasn't loading correctly when running the addon for the first time

v0.2:
Fixed up the code a bit

v0.15:
Changed the anchor for the progress bar, hopefully fixing the bar moving on higher resolutions than 1080p
Optional Files (0)


Archived Files (10)
File Name
Version
Size
Uploader
Date
0.4.1.1
2kB
tombaa
01/20/22 09:25 AM
0.4.1.1
1kB
tombaa
01/20/22 05:10 AM
0.4
1kB
tombaa
11/01/21 06:39 PM
0.35.1
2kB
tombaa
06/01/21 08:09 AM
0.35
28kB
tombaa
03/10/21 12:37 AM
0.3
2kB
tombaa
11/11/20 09:45 AM
0.25
3kB
tombaa
11/11/20 03:02 AM
0.2
3kB
tombaa
11/10/20 12:48 PM
0.15
3kB
tombaa
11/10/20 01:23 AM
0.1
3kB
tombaa
11/08/20 01:41 PM


Post A Reply Comment Options
Unread 11/09/20, 06:18 AM  
Onigar
 
Onigar's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 361
Uploads: 4
Such a great idea, thanks and well done

For me, the overall progress bar is shifted left for some reason. Not too much of an issue but just thought to let you know. I guess it is fine for you. If you need more info to help debug then just ask

Thanks

Report comment to moderator  
Reply With Quote
Unread 11/09/20, 08:13 AM  
tombaa
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 12
Uploads: 2
Originally Posted by Onigar
Such a great idea, thanks and well done

For me, the overall progress bar is shifted left for some reason. Not too much of an issue but just thought to let you know. I guess it is fine for you. If you need more info to help debug then just ask

Thanks

Huh, that's odd, I did test it with resolutions lower than 1920x1080, and it seemed to work with those so I presume your resolution is higher than that?
Report comment to moderator  
Reply With Quote
Unread 11/09/20, 11:11 AM  
Onigar
 
Onigar's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 361
Uploads: 4
Originally Posted by tombaa
Originally Posted by Onigar
Such a great idea, thanks and well done

For me, the overall progress bar is shifted left for some reason. Not too much of an issue but just thought to let you know. I guess it is fine for you. If you need more info to help debug then just ask

Thanks

Huh, that's odd, I did test it with resolutions lower than 1920x1080, and it seemed to work with those so I presume your resolution is higher than that?
Hi, here is the image of my settings and if it matters monitor + game frame rate is 144.

Report comment to moderator  
Reply With Quote
Unread 11/10/20, 01:25 AM  
tombaa
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 12
Uploads: 2
Originally Posted by Onigar

Hi, here is the image of my settings and if it matters monitor + game frame rate is 144.

Thanks for these, seems like my ESO wasn't actually changing the ingame resolution through the settings after all.

I uploaded a fix for this that I tested by creating a virtual resolution with the same ratio as yours, should be working correctly now!
Report comment to moderator  
Reply With Quote
Unread 11/10/20, 05:43 AM  
CyberOnEso
 
CyberOnEso's Avatar
AddOn Author - Click to view AddOns

Forum posts: 18
File comments: 119
Uploads: 4
Hey'a, thanks for the great addon!
If I may suggest I would appreciate the % of the sticker book you have completed added to the label of the progress bar.
Many thanks
Report comment to moderator  
Reply With Quote
Unread 11/10/20, 07:46 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4912
File comments: 5988
Uploads: 78
Thanks for the addon.
Please check your code about variables leaking to the global namespace.
Means all functions and variables you do not define with local up in front will be polluting the global table _G and if you did not choose a very unique name they might overwrite or disturb other addons or the vanilla code.

Example:
Code:
function IncrementByOne
Should be local function IncrementByOne
It only seems to be used in your SlashCommand so far sop as long as you define it in the lua file above the slash command it's known and usable, even if local.
-> Lua interpretes the source code lines from top to bottom!

Same relates to:
OnFoundItemsMinMaxValueChanged -> Just move it in your file above the call within texture:SetHandler("OnMinMaxValueChanged", function (_, newMin, newMax) and it will be found.

function initialize() -> NO-GO AT ALL!
Initialize is not a unique name and this will overwrite a lot of other initialize functions, so pelase add a local up in front or add it to your addon's namespace via function CollectionSetBookTotal.initialize instead.

Please check the other functions not starting with local and not starting with CollectionSetBookTotal. as well and add the local or add your addon's namespace.

Thank you

Edit:
If you want to anchor your tlc (top level control) not to the center of the ZO_CollectionsBook_TopLevel you could also anchor it at the left to the
"Collections" text and at the right to the "Sets" text instead of using CENTER.
This should make it indepenendet from any screen resolutions or scalings and chaneg the size of the bar depending on the space given between these 2 anchor controls.
You'd have to use the anchor command like this then, twice, once for the left part and once for the right part:

Lua Code:
  1. --Anchor my left to the right of the "Collections" text, with an xAxis offset + 30 pixel
  2. tlw:SetAnchor(LEFT, labelControlHoldingTheCollectionsText, RIGHT, 30, 0)
  3. --Anchor my right to the left of the "Sets" text, with an xAxis offset - 30 pixel
  4. tlw:SetAnchor(RIGHT, labelControlHoldingTheSetsText, LEFT, -30, 0)

Examples for anchors:
https://wiki.esoui.com/Control:SetAnchor

You are able to find out the labelControlHoldingTheCollectionsText and labelControlHoldingTheSetsText via the addons merTorchbug or zgoo and moving the mouse over the labels, typing into the chat /tb mouse or /zgoo mouse, or via using the keybind of these addons to show the control below the mouse.
Last edited by Baertram : 11/10/20 at 07:55 AM.
Report comment to moderator  
Reply With Quote
Unread 11/10/20, 12:51 PM  
tombaa
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 12
Uploads: 2
Originally Posted by CyberOnEso
Hey'a, thanks for the great addon!
If I may suggest I would appreciate the % of the sticker book you have completed added to the label of the progress bar.
Many thanks
I added a percentage behind the number on the progress bar

Originally Posted by Baertram
Thanks for the addon.
Please check your code about variables leaking to the global namespace.
Means all functions and variables you do not define with local up in front will be polluting the global table _G and if you did not choose a very unique name they might overwrite or disturb other addons or the vanilla code.
Thanks for pointing that out, I uploaded a changed version now.
Report comment to moderator  
Reply With Quote
Unread 11/10/20, 05:28 PM  
CyberOnEso
 
CyberOnEso's Avatar
AddOn Author - Click to view AddOns

Forum posts: 18
File comments: 119
Uploads: 4
Originally Posted by tombaa
I added a percentage behind the number on the progress bar
Thank you very much! I really appreciate it! <3
Report comment to moderator  
Reply With Quote
Unread 11/11/20, 12:42 AM  
Onigar
 
Onigar's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 361
Uploads: 4
Hi, updated to the new version and thanks for fixing the total bar positioning

a little more feedback

after the first login from the launcher the total bar is at zero. Tried relogging at this point and it stays at zero.



if you learn an item at this point then it does get correctly counted but you only see the result "1"



/reloadui refreshes this bar and then the values can be seen. Note: changing zone had no effect.



Note: when the total bar is showing results and you relog the character then you still have results shown so this only happens as you login when the game is closed.
Note2: I tried logging in from a closed game 3 times and comfirm this is repeatable.
Last edited by Onigar : 11/11/20 at 12:51 AM.
Report comment to moderator  
Reply With Quote
Unread 11/11/20, 03:08 AM  
tombaa
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 12
Uploads: 2
Originally Posted by Onigar
Note: when the total bar is showing results and you relog the character then you still have results shown so this only happens as you login when the game is closed.
Note2: I tried logging in from a closed game 3 times and comfirm this is repeatable.
Thanks again for letting me know, from what I can tell this was due to the addon loading before your character data so the GetNumItemSetCollectionSlotsUnlocked function was always returning 0?

I added timer before the initializing function is called, which should hopefully fix that issue
Report comment to moderator  
Reply With Quote
Unread 11/11/20, 03:26 AM  
code65536
AddOn Author - Click to view AddOns

Forum posts: 21
File comments: 371
Uploads: 40
You're making things more complicated than it should be.

Code:
function GetCollectionStatus( )
	local collected = 0
	local total = 0
	local setId = GetNextItemSetCollectionId()
	while (setId) do
		local setSize = GetNumItemSetCollectionPieces(setId)
		if (setSize > 0) then
			collected = collected + GetNumItemSetCollectionSlotsUnlocked(setId)
			total = total + setSize
		end
		setId = GetNextItemSetCollectionId(setId)
	end
	return collected, total
end
I benchmarked this function; it takes less than 1ms to run. (159ms to run it 1000 times)

Run that when EVENT_PLAYER_ACTIVATED fires for the first time and whenever EVENT_ITEM_SET_COLLECTION_UPDATED fires. That's it. No need for saved variables or LibSets.
Last edited by code65536 : 11/11/20 at 03:29 AM.
Report comment to moderator  
Reply With Quote
Unread 11/11/20, 03:45 AM  
Onigar
 
Onigar's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 361
Uploads: 4
Originally Posted by tombaa
Originally Posted by Onigar
Note: when the total bar is showing results and you relog the character then you still have results shown so this only happens as you login when the game is closed.
Note2: I tried logging in from a closed game 3 times and comfirm this is repeatable.
Thanks again for letting me know, from what I can tell this was due to the addon loading before your character data so the GetNumItemSetCollectionSlotsUnlocked function was always returning 0?

I added timer before the initializing function is called, which should hopefully fix that issue
Updated addon but sadly no its still the same as before with 0 on initial login.

instead of just a timer how about something like,

if GetNumItemSetCollectionSlotsUnlocked = 0 then

wait 20 secs

GetNumItemSetCollectionSlotsUnlocked

end

alternatively you could look for some indicator that character data is loaded before calling this

Edit: I have a lot of active addons, not sure if something in one of them could have an influence on chardata loading time, Just thought to pass on the info.
Last edited by Onigar : 11/11/20 at 09:15 AM.
Report comment to moderator  
Reply With Quote
Unread 11/11/20, 09:36 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4912
File comments: 5988
Uploads: 78
Just use EVENT_PLAYER_ACTIVATED to initially do the counts once and update the progress bar, as code65536 already described.
And then update it each time as new item pieces get unlocked via the events. That should be enough.

Originally Posted by Onigar
Originally Posted by tombaa
Originally Posted by Onigar
Note: when the total bar is showing results and you relog the character then you still have results shown so this only happens as you login when the game is closed.
Note2: I tried logging in from a closed game 3 times and comfirm this is repeatable.
Thanks again for letting me know, from what I can tell this was due to the addon loading before your character data so the GetNumItemSetCollectionSlotsUnlocked function was always returning 0?

I added timer before the initializing function is called, which should hopefully fix that issue
Updated addon but sadly no its still the same as before with 0 on initial login.

instead of just a timer how about something like,

if GetNumItemSetCollectionSlotsUnlocked = 0 then

wait 20 secs

GetNumItemSetCollectionSlotsUnlocked

end

alternatively you could look for some indicator that character data is loaded before calling this

Edit: I have a lot of active addons, not sure if something in one of them could have an influence on chardata loading time, Just thought to pass on the info.
Last edited by Baertram : 11/11/20 at 09:37 AM.
Report comment to moderator  
Reply With Quote
Unread 11/11/20, 09:39 AM  
zelenin
AddOn Author - Click to view AddOns

Forum posts: 7
File comments: 192
Uploads: 12
I rewrote the addon a little. Made it cleaner, more compact, effective, without LibSets and saved variables.
https://pastebin.com/EnXi7JAD
Report comment to moderator  
Reply With Quote
Unread 11/12/20, 02:28 AM  
Onigar
 
Onigar's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 361
Uploads: 4
Originally Posted by Onigar

Updated addon but sadly no its still the same as before with 0 on initial login.
Updated today to the latest release 0.3 but still the same 0 on initial login.

Im not getting stressed at all, just giving feedback, /relaodui is not so hard to do
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: