[Video Tutorial] LibAddonMenu and Saved Variables
Hi, everyone! I'm very proud to announce my second tutorial video, entitled "ESO Addon Development: Custom Options and SavedVariables | The Elder Scrolls Online"
Check out the tutorial: https://youtu.be/ndkjro3RUGA Missed the first tutorial? Check it out here: https://www.youtube.com/watch?v=ZYsr5pVqhso This tutorial focuses on the integration of LibAddonMenu-2.0 and SavedVariables to create a more-user friendly experience - and allows the options to be remembered when you log out (very important)! Special thanks to @baertram and @wookiefriseur for your feedback, last time. I took it to heart - hopefully this one does you guys justice. The code can be found here: https://github.com/moshulu/ESOUI-SimpleClock Hope to see you in-game! @moshulu |
Thanks for your next video tutorial, it's appreciated.
My 2 cents: LibAddonMenu-2.0 added the global variable LibAddonMenu2 with version 26 first. New created addons should thus use the >= tag behind the ## Optional or ## DependsOn entries so that the addons do not load with any "older" LAM version! Same for other libraries. Allthough most users will have the newest versions of libraries installed there exist A LOT users using old addons with bundled old libs and thus these old libs could make your addon not work properly. So better check for the newest / needed versions of these libs by using the >= version check tag ending! -> Read about the >= version checks here at the Wiki: https://wiki.esoui.com/Addon_manifes...ionalDependsOn https://wiki.esoui.com/Libraries#.23...ned_integer.3E And for SavedVariables you should always consider "multi server" gameplay from the beginning of your addon, as many ESO players play on NA and EU megaservers at the same time! In your SV, if you are using the ZO_SavedVars: wrapper, you can either use the profile parameter or somethign else, and pass in the server name (which the API function GetWorldName() returns as a String). Not all addons need multi server differences, but many do need (especially if they arerelated to chat, guilds, use date and time, etc.). Example usage: Lua Code:
You can either use the profile param liek I have done here, for the GetWorldName(), or you could also pass it in at the 3rd param (where I'm using "Settings" in the example). It just differs in the global SavedVariables table structure in the end. btw: In your video tut you define "savedvariables = ZO_SavedVars:NewAccountWide" which makes savedvariables a global leaking variable -> it's missing the local up in front ;-) and could be overwriting other addons variables that way. Be carefull with it, especially if these variable names are "non unique" or "common". |
All times are GMT -6. The time now is 04:55 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI