Download
(8 Kb)
Download
Updated: 08/10/24 07:22 AM
Pictures
File Info
Compatibility:
Update 43 (10.1.0)
Gold Road (10.0.0)
Updated:08/10/24 07:22 AM
Created:08/10/24 06:54 AM
Monthly downloads:0
Total downloads:1
Favorites:1
MD5:
10.0.0
Volette  New Today!
Version: 0.0.2
by: FeynmanRules [More]
Depends on:
- LibAddonMenu-2.0

Adds an optional "Contacts" menu next to the Friends list with "Whisper", "Invite" and "Pin" buttons. It is mostly useful when we regularly invite people who are not in our Friends list.

Adds several slash commands:
- /v-craft: Ports to crafting HQ (@UserID must be added in the add-on settings)
- /v-parse: Ports to training HQ (@UserID must be added in the add-on settings)
- /v-wayshrine: Ports in front of a house close to a wayshrine (must be owned, limited list of houses available)
- /v-home: Ports to primary house
- /v-glead: Ports to the group leader
- Fixed LAM initialization order
- Removed event handler with nonexistent function
Post A Reply Comment Options
Unread Today, 08:46 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 5119
File comments: 6205
Uploads: 78
Hi and welcome to ESO addon development.

Your addon is in the ESO tools and utilitis category which is not shown within Minion addon manager,
was that on purpose?

Else we should move it to another category, please tell me which one and I can do so.


Other points and hints:
In your addons' event_add_on_loaded callback you should unregisetr your addon once it was loaded so the same func is not called for every other addon loaded again and again and again:

Code:
function Volette.OnAddonLoaded(event, addonName)
	if addonName == Volette.name then
		Volette.Initialize()
                EVENT_MANAGER:UnregisterForEvent(Volette.name, EVENT_ADD_ON_LOADED)
	end
end
Hint:
In your settings menu (LAM) you can use requiresReload = true to add a button for a reloadi once someone changed that setting.
The user is asked, if he tries to leave the addon settings, if changed values will be applied and reloadui is done, or else they will be switched back to old values automatically.
No need to manually add a warning there, that's all automatically there if you just add requiresReload = true to the widget.


Your code in slash.lua should be capsuled in a function which is 1st loaded from your EVENT_ADD_ON_LOADED callback or else you risk that the slash commands are added early where your functions are not present OR savedvariables are not present and lead to errors in the end!
So do something like:
Code:
function Volette.LoadSlashCommands()
    for shortcut, func in pairs(COMMANDS) do
        SLASH_COMMANDS["/v-" .. shortcut] = func
    end
end
And call that func Volette.LoadSlashCommands() from your Volette.OnAddonLoaded then

The notation using : in e.g. function VoletteContactsMenu:Initialize is kind of wrong as it is a control and not an object.
Using self in there works "by accident" but should not be done!
So change the function name to function VoletteContactsMenu.Initialize and instead of using self use VoletteContactsMenu then.

Using the function Volette.contacts.setPinButton(button, pinned) each time in the loop over your contacts is kind of wrong.
You only need to add the handlers for OnMouseEnter and Exit etc. once, and they stay there, so no need to re-do that overwriting them if they use fixed texts (and they do, as you use GetString(VOLETTE_CONTACTS_UNPIN_BUTTON_TOOLTIP)).

Better idea: Add the pinned state to the butonControl directly
button.pinned = pinned

And in the handlers just check
Code:
local textToShow = button.pinned and VOLETTE_CONTACTS_UNPIN_BUTTON_TOOLTIP or VOLETTE_CONTACTS_PIN_BUTTON_TOOLTIP
...
SetTooltipText(InformationTooltip, GetString(textToShow))
Something dnyamically like that is better in the end.

Hope it helps, if you got questions feel free to chat with us here:
https://app.gitter.im/#/room/#esoui_esoui:gitter.im
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: