Thread Tools Display Modes
10/09/19, 03:42 PM   #1
Weaselkit
Join Date: Nov 2015
Posts: 3
reload SavedVars

It's my understanding that savedvars only get saved when you do certain things like logout/reloadui but is it possible to check if savedvars have changed without doing one of those actions? If not, is it possible to force a reloadui?

I'm pondering how feasible it would be to create a Trials Finder similar to the Dungeon Finder. Getting data in and out of the game in a timely manner seems to be the biggest roadblock. I was thinking about the guild store pricing addons but I suspect they are only partially 'live'. Am I right in that Tamrial Trade Center and the like just edit the saved variables and wait for a zone change to display updates to the player?
  Reply With Quote
10/09/19, 05:06 PM   #2
Rhyono
AddOn Author - Click to view addons
Join Date: Sep 2016
Posts: 659
That is my understanding as well.
  Reply With Quote
10/10/19, 05:02 AM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,913
Yes. You normally update the prices table from their website's database, usign the included exe file clients.
They download a file and include the data into teh SavedVariables of the addon.

After reloadui they are in then.
Normally you do this before playing and not "during".

Same with the guild data upload.
During palying your listed items will be saved to the SV.
And the client might track the change date & time of the SV, chekc the contents of a decent table like e.g. "guild_postings" and upload the data then if something changed (or always, not sure).

You are able to use e.G. ZOs table functions (https://github.com/esoui/esoui/blob/...tableutils.lua) like

function ZO_ShallowTableCopy(source, dest)
function ZO_DeepTableCopy(source, dest)

to copy your SV table to a non-connected table data.
After some time (use the EVENT_MANAGER:RegisterForUpdate to register an update check function each e.g. 5 seconds and/or use GetTimeStamp() or other GetTimeSinceLogin() or similar, dunno which exist all) check if some content of the table changed, compared to your current global SV variable.
And if so you can call Reloadui() to reload the UI.

But be sure these copy functions and checks might get CPU hungry and if you do not take care it might even crash the client if the SVs get updated at teh time you do the deeptabelcopy e.g. -> endless loops or whateever might happen.

Last edited by Baertram : 10/10/19 at 05:07 AM.
  Reply With Quote

ESOUI » AddOns » AddOn Help/Support » reload SavedVars

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