Download
(2 Kb)
Download
Updated: 12/01/22 06:06 AM
Pictures
File Info
Compatibility:
Firesong (8.2.5)
Updated:12/01/22 06:06 AM
Created:12/01/22 03:10 AM
Monthly downloads:69
Total downloads:1,775
Favorites:2
MD5:
Categories:Bags, Bank, Inventory, Miscellaneous, Utility Mods
Rengaru's Oakensoul Swap
Version: 1.1
by: Rengaru [More]
A quick way to swap weapons even with the Oakensoul Ring equipped.

-----------------------------------------------------------------------------------------------------------------------

This addon will let you bind a key that un-equips the Oakensoul Ring, and automatically re-equips it after you have performed a weapon swap. Press both buttons in quick succession to perform a seamless weapon swap.

Of course this only works out of combat.
1.1
- Some extra polish
Optional Files (0)


Archived Files (1)
File Name
Version
Size
Uploader
Date
1
2kB
12/01/22 03:10 AM


Post A Reply Comment Options
Unread 12/01/22, 01:38 PM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4913
File comments: 5990
Uploads: 78
If you skip the event your code loads before other addons and runs early maybe because ZOs is not preventing all events to fire before event_add_on_loaded. So XML code and other controls of your addons might create and try to use the UI where it's not ready yet -> weird errors occur.
Better safe that via the event_add_on_loaded so the code only initiates after all of your addon files have been loaded properly too!

Originally Posted by Rengaru
Originally Posted by Baertram
Hi there, thanks for your addon but pelase fix the globally leaking variables with non unique names AS FAST AS POSSIBLE!


Code:
swaping = false
slot = 0
link = 0
Dang, I knew I forgot something. Fixed it, thanks.


Originally Posted by Baertram
And:
You should add a proper EVENT_ADD_ON_LOADED callback for your addon's name, else your code is run too early and you might get errors!
Check the WIKI tutorials (https://wiki.esoui.com/SimpleNotebookTutorial/part3) for EVENT_ADD_ON_LOADED examples, how to check that YOUR addon was loaded, and how to unload your event callback after your addon was loaded.
Thought I could save some time by skipping that part, didn't know that could cause issues. Also fixed, thanks.
Report comment to moderator  
Reply With Quote
Unread 12/01/22, 06:05 AM  
Rengaru
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 27
Uploads: 3
Originally Posted by Baertram
Hi there, thanks for your addon but pelase fix the globally leaking variables with non unique names AS FAST AS POSSIBLE!


Code:
swaping = false
slot = 0
link = 0
Dang, I knew I forgot something. Fixed it, thanks.


Originally Posted by Baertram
And:
You should add a proper EVENT_ADD_ON_LOADED callback for your addon's name, else your code is run too early and you might get errors!
Check the WIKI tutorials (https://wiki.esoui.com/SimpleNotebookTutorial/part3) for EVENT_ADD_ON_LOADED examples, how to check that YOUR addon was loaded, and how to unload your event callback after your addon was loaded.
Thought I could save some time by skipping that part, didn't know that could cause issues. Also fixed, thanks.
Report comment to moderator  
Reply With Quote
Unread 12/01/22, 03:38 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4913
File comments: 5990
Uploads: 78
Hi there, thanks for your addon but pelase fix the globally leaking variables with non unique names AS FAST AS POSSIBLE!


Code:
swaping = false
slot = 0
link = 0
Add a local in front of them OR even better add them to your global table RengarusOakensoulSwap instead
Else they are polluting the global table_G and overwrite ALL variables of vanilla ZOs ESO code and addons, making them fail to properly work!!!
Variables not defined as local are always global and thus will be accessible by other addons AND overwrite other addons or ESO code variables with the same name.
So either make the global variables very unqiue in their name, like MYADDONNAME_GLOBAL1, or add 1 global table (you did already: RengarusOakensoulSwap) and add all variables of your addon to that table so they do not flow around, overwriting other addons and ESO variables.

So change them to e.g.
Lua Code:
  1. RengarusOakensoulSwap.swaping = false
  2. RengarusOakensoulSwap.slot = 0
  3. RengarusOakensoulSwap.link = 0

and in yur code use the proper RengarusOakensoulSwap.<variablename> then instead.
This makes it easy to see they belong to your addon AND you can inspect them ingame with tools like ZGOO and merTorchbug to debug them!
win win

btw: your apiversion is outdated too in your txt file.
The current APIversion can be read via /script d(GetAPIVersion()) ingame and teh WIKI also tlls you the API version history + current on live/or PTS:
https://wiki.esoui.com/APIVersion


And:
You should add a proper EVENT_ADD_ON_LOADED callback for your addon's name, else your code is run too early and you might get errors!
Check the WIKI tutorials (https://wiki.esoui.com/SimpleNotebookTutorial/part3) for EVENT_ADD_ON_LOADED examples, how to check that YOUR addon was loaded, and how to unload your event callback after your addon was loaded.

Thank you for the fixes and checking your addon's (all of your other addons too please!!!) code for leaking globals before releasing it! It really breaks other addons or even vanilla ZOs game code.
Last edited by Baertram : 12/01/22 at 03:44 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: