Download
(5 Kb)
Download
Updated: 05/22/20 09:18 PM
Pictures
File Info
Compatibility:
Greymoor (6.0.5)
Harrowstorm (5.3.5)
Dragonhold (5.2.5)
Scalebreaker (5.1.5)
Elsweyr (5.0.5)
Updated:05/22/20 09:18 PM
Created:05/27/18 12:46 PM
Monthly downloads:44
Total downloads:7,311
Favorites:14
MD5:
Categories:Developer Utilities, Utility Mods
New Addon Template  Popular! (More than 5000 hits)
Version: 1.29
by: Phuein [More]
Gift me @phuein in-game, if you have extra crowns and appreciate my addons. (Can even ask which DLC I missed.) Thank you!

This is not a game addon and it does nothing meaningful.

Requirements:
  • LibAddonMenu-2.0 >= 28

This is a template for new addons. I often use these features when making or upgrading an addon. It is intended to be a "blank slate" to work with quickly and efficiently. Easier to remove a few code blocks, than it is to write them from scratch.

Included in this template are the following:
  • Manifest.
  • Keybinding.
  • LibAddonMenu-2.0 with all the default menu options.
  • Multiple language support.
  • Chat output, an animated announcement (center), and an alert (top-right.)
  • A slash command: "/newaddon".
  • Colors.
  • XML UI elements.
  • Notification when loaded for the first time.
  • Events handled: EVENT_ADD_ON_LOADED, EVENT_PLAYER_ACTIVATED, zo_callLater() [which uses RegisterForUpdate().]
  • Toggle savedVars per character or account-wide.

More useful features can be added in time. I welcome all code input, improvements, and requests. I suggest opening all of the project's files together (except the external libraries,) to see how they interact; from language, to hotkeys, to menus.

Writing addons shouldn't be about hunting for code online, but rather focusing on functionality and aesthetics.
1.29
- Added the AddOnVersion identifier, for other addons to match against if needed.

1.28
- Removed included LibStub and LibAddonMenu. Those are now external requirements.

1.27
- Updated the slash commands autocomplete.

1.26
- Fix.

1.25
- Minor tweaks.
- Added support for character/account savedVariables, with a toggle in settings.

1.23
- Minor tweaks.

1.2
- Settings code is easier to modify and improved.

1.1
- Bugfixes.
- Separated Settings menu to its own file.
- Changed some code format for readability.

1.0
- Core functionality for most addons. Full list in the description page.
Optional Files (0)


Archived Files (10)
File Name
Version
Size
Uploader
Date
1.28
5kB
Phuein
05/21/20 07:33 PM
1.27
50kB
Phuein
02/24/20 08:35 PM
1.26
50kB
Phuein
07/15/19 11:57 AM
1.25
50kB
Phuein
06/15/19 09:22 PM
1.23
48kB
Phuein
03/28/19 04:00 AM
1.22
48kB
Phuein
03/26/19 02:58 PM
1.21
48kB
Phuein
03/25/19 09:54 PM
1.2
48kB
Phuein
08/16/18 12:42 PM
1.1
48kB
Phuein
06/09/18 01:08 AM
1.0
47kB
05/27/18 12:46 PM


Post A Reply Comment Options
Unread 12/27/23, 06:29 PM  
Phuein
 
Phuein's Avatar
AddOn Author - Click to view AddOns

Forum posts: 132
File comments: 268
Uploads: 16
Originally Posted by Baertram
hm I downloaded your template files and craeted a small new addon and it never showed up in the ingame addon manager.
Somehow your txt file (or whatever the reason is) got a wrong encoding or something that disturbs the ingame addon manager, as it seems?

If I copied the contents of the files to some files I had created (from a working addon) and just renamed my files all was shown and working well.
So it must have to do with encoding or similar.
Hey Baertram. That's odd. I just tried it, and it loads normally. Shows up in the in-game addon manager, and also in the Settings -> Addons menu.

Checking the NewAddon.txt file, Notepad reports the encoding as UTF-8, as expected and normal. I'd expect other addons to show the same issue, if there was a general issue with the text file.

Are you using ESO in English or another language? And did you modify the txt or any other files, before just trying to load the addon as-is? Maybe copied the addon to the wrong folder by mistake?
Report comment to moderator  
Reply With Quote
Unread 12/19/23, 08:38 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4903
File comments: 5974
Uploads: 78
hm I downloaded your template files and craeted a small new addon and it never showed up in the ingame addon manager.
Somehow your txt file (or whatever the reason is) got a wrong encoding or something that disturbs the ingame addon manager, as it seems?

If I copied the contents of the files to some files I had created (from a working addon) and just renamed my files all was shown and working well.
So it must have to do with encoding or similar.
Report comment to moderator  
Reply With Quote
Unread 07/19/21, 03:45 PM  
Phuein
 
Phuein's Avatar
AddOn Author - Click to view AddOns

Forum posts: 132
File comments: 268
Uploads: 16
Originally Posted by tim99
One thing i always wondered is about the phrase in the textfiles:
## This Add-on is not created by, affiliated with or sponsored by ZeniMax Media Inc. or its affiliates.
## The Elder Scrolls® and related logos are registered trademarks or trademarks of ZeniMax Media Inc. in the United States and/or other countries.
## All rights reserved
## You can read the full terms at https://account.elderscrollsonline.com/add-on-terms
Is there a reason behind it, like can you get in any kind of trouble if its missing or is it just for "fun" (dont know a better word, "own pleasure" sounds even more wrong) lol
Seeing that your template is not using it, so mabye it's not nessessary?



Anyway thx as well for this

I'm not a lawyer and see no reason to specify anything legal in my addons. The above are also all listed in their ToS agreements, which we all Accept when we play the game. Don't think anybody ever got into trouble over this. If a Zeni' representative contacted me, I would make the appropriate modifications they require - probably.

You're welcome!
Report comment to moderator  
Reply With Quote
Unread 07/18/21, 12:17 AM  
tim99
 
tim99's Avatar
AddOn Author - Click to view AddOns

Forum posts: 22
File comments: 159
Uploads: 12
One thing i always wondered is about the phrase in the textfiles:
## This Add-on is not created by, affiliated with or sponsored by ZeniMax Media Inc. or its affiliates.
## The Elder Scrolls® and related logos are registered trademarks or trademarks of ZeniMax Media Inc. in the United States and/or other countries.
## All rights reserved
## You can read the full terms at https://account.elderscrollsonline.com/add-on-terms
Is there a reason behind it, like can you get in any kind of trouble if its missing or is it just for "fun" (dont know a better word, "own pleasure" sounds even more wrong) lol
Seeing that your template is not using it, so mabye it's not nessessary?



Anyway thx as well for this
Report comment to moderator  
Reply With Quote
Unread 07/10/20, 07:41 PM  
Phuein
 
Phuein's Avatar
AddOn Author - Click to view AddOns

Forum posts: 132
File comments: 268
Uploads: 16
Originally Posted by DarkPhalanx
Thanks for the template I created my first addon with it, mentioned you in the description !

Congratulations
Report comment to moderator  
Reply With Quote
Unread 07/09/20, 05:13 AM  
DarkPhalanx
AddOn Author - Click to view AddOns

Forum posts: 6
File comments: 31
Uploads: 2
Thanks for the template I created my first addon with it, mentioned you in the description !
Report comment to moderator  
Reply With Quote
Unread 07/03/20, 08:54 AM  
Phuein
 
Phuein's Avatar
AddOn Author - Click to view AddOns

Forum posts: 132
File comments: 268
Uploads: 16
Post Re: Getting LibAddonMenu-2 Error when changing global variable name

Originally Posted by Soulbull
So I changed the global variable name NewAddon to mine for my Addon but after that, everything broke.
I only changed names and other changeable variables.

It's hard to say without seeing the whole project. You might want to already put it up on ESOUI for review and feedback. Or in a repository like Github. My first guess would be anything related to filenames and NewAddon.txt being renamed correctly. Anything more would require access to the code.
Report comment to moderator  
Reply With Quote
Unread 06/27/20, 06:45 AM  
Soulbull

Forum posts: 0
File comments: 1
Uploads: 0
Getting LibAddonMenu-2 Error when changing global variable name

So I changed the global variable name NewAddon to mine for my Addon but after that, everything broke.
I only changed names and other changeable variables.
Here is a Screenshot of the Error Code in LibDebuggerLog.lua


Settings.lua changed




I'm new to lua and Addon Programming with lua but I have programming experience. Already tried a lot of methods and different way to create the menu but everything failed. If you need more Information, let me know. Thanks in advance
Report comment to moderator  
Reply With Quote
Unread 05/23/20, 06:52 PM  
Phuein
 
Phuein's Avatar
AddOn Author - Click to view AddOns

Forum posts: 132
File comments: 268
Uploads: 16
Originally Posted by Baertram
Thanks.
I'll link it in the ESOUI Wiki if this is ok for you?

For sure, it's there to help others. Thanks.
Report comment to moderator  
Reply With Quote
Unread 05/23/20, 04:33 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4903
File comments: 5974
Uploads: 78
Thanks.
I'll link it in the ESOUI Wiki if this is ok for you?

Top right side:
https://wiki.esoui.com/Main_Page

https://wiki.esoui.com/AddOn_templates
Last edited by Baertram : 05/23/20 at 04:33 AM.
Report comment to moderator  
Reply With Quote
Unread 05/22/20, 09:18 PM  
Phuein
 
Phuein's Avatar
AddOn Author - Click to view AddOns

Forum posts: 132
File comments: 268
Uploads: 16
Originally Posted by Baertram
Looks good to me, thanks.

Hint:
I'd have added the ## AddOnVersion: tag to the txt file to show the new devs it exists but this is minor and most likely needed only if your addon would be a lib or another addon depends on a special version of it.

Excellent. And that's a good idea, added just now. Thanks.
Report comment to moderator  
Reply With Quote
Unread 05/22/20, 10:41 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4903
File comments: 5974
Uploads: 78
Looks good to me, thanks.

Hint:
I'd have added the ## AddOnVersion: tag to the txt file to show the new devs it exists but this is minor and most likely needed only if your addon would be a lib or another addon depends on a special version of it.
Report comment to moderator  
Reply With Quote
Unread 05/19/20, 10:11 PM  
Phuein
 
Phuein's Avatar
AddOn Author - Click to view AddOns

Forum posts: 132
File comments: 268
Uploads: 16
Originally Posted by Baertram
Hi,

please remove the LibStub dependency in your addon AND the embedded libraries!

Hey Baertram, thanks for the reminder. I'm glad to hear people are encouraged to make new addons using this template. I'll definitely review the dependencies for the next release.

EDIT: I went ahead and removed the old dependencies, instead using the new external dependency format. If it looks good to you, I can apply this to my other addons in the future.
Last edited by Phuein : 05/21/20 at 07:34 PM.
Report comment to moderator  
Reply With Quote
Unread 05/19/20, 02:39 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4903
File comments: 5974
Uploads: 78
Hi,

please remove the LibStub dependency in your addon AND the embedded libraries!
Ppl are using this template and create new addons based on wrong and outdated data.
If you include the libs include them with their txt files properly please and do not hardcode them from your example addon's txt file.
New devs cannot see that this is wrong and rely on your code here

LibStub is obsolete and IF it is used it is used within the libraries txt files, not your addon's manifest.

e.g.
wrong:
Code:
 ## DependsOn: LibStub LibAddonMenu-2.0
correct:
Lua Code:
  1. ## DependsOn: LibAddonMenu-2.0>=28
-> >=28 means it will need version 28 or higher of the library to assure the global variable of the lib exists, see below.

Read this please:
https://wiki.esoui.com/Libraries

And the calls to the libraries should not be done via LibStub anymore but the global variable of the libraries:
https://www.esoui.com/forums/showthr...hlight=LibStub

e.g.
wrong:
Code:
 local LAM = LibStub("LibAddonMenu-2.0")
correct:
Lua Code:
  1. local LAM = LibAddonMenu2

Many thanks
Last edited by Baertram : 05/20/20 at 04:25 AM.
Report comment to moderator  
Reply With Quote
Unread 07/15/19, 11:56 AM  
Phuein
 
Phuein's Avatar
AddOn Author - Click to view AddOns

Forum posts: 132
File comments: 268
Uploads: 16
Originally Posted by SkidBrain
Thanks for the template! It's quite helpful and has encouraged me to start poking at things.

I just needed to change "Junkee" on line 84 to "NewAddon" and was good to go.

Cheers.
Whoops! Thanks for informing me, updating now to fix that.

Enjoy!
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: