This is a library which allows Addon Authors to easily add a feedback window to their addon. The feedback options are pretty open ended. You can do a simple 'Send Note', for if the user wants to just send you a note, a gold amount, a Paypal URL/personal website/charity donation page. If you'd like to have more options, let me know. (Or be like Baertram and code them yourself )
Usage:
local LibFeedback = LibStub:GetLibrary('LibFeedback')
-- The button is returned so you can modify the button if needed
-- ExampleAddonNameSpace.feedbackButton = LibFeedback:initializeFeedbackWindow(
ExampleAddonNameSpace, -- namespace of the addon
"Example Addon", -- The title string for the feedback window and the mails it sends
parentControl, -- The parent control to anchor the feedback button(s) + label(s) to
"@AddonAuthor", -- If this parameter is no table: [1st parameter] like desribed below:
-- The destination for feedback (0 gold attachment) and donation mails, valid for all servers
-- If this parameter is a table:
-- Example: { addonVars.addonAuthorDisplayNameEU, addonVars.addonAuthorDisplayNameNA, addonVars.addonAuthorDisplayNamePTS },
-- [1st parameter]Addon author name or character name at the EU Megaserver
-- [2nd parameter]Addon author name or character name at the NA Megaserver
-- [3rd parameter]Addon author name or character name at the PTS (Testserver)
{TOPLEFT, owningWindow, TOPLEFT, x, y}, -- The position of the mail button icon. owningWindow: Parent control for the button. x and y: Integer values for the offsets
{0,5000,50000, "https://www.genericexampleurl.com/somemoregenericiness"} -- The button info:
-- Can theoretically do any number of options, it *should* handle them
-- If this parameter is no table: [1st parameter] like desribed below:
-- If 0: Will not attach any gold, and will say 'Send Note'
-- If non zero: Will auto attach that amount of gold
-- If URL: Will show a dialog box and ask the user if they want to go to the URL.
-- If this parameter is a table:
-- Example: [index]= {[1st parameter] [2nd parameter] [3rd parameter] },
-- [1] = { 0, localization.feedbackSendNote, false }, -- Send ingame mail
-- [2] = { 10000, localization.feedbackSendGold, true }, -- Send 10000 gold
-- [3] = { addonVars.authorPortal, localization.feedbackOpenAddonAuthorWebsite, false }, -- Open URL
-- [4] = { addonVars.FAQwebsite, localization.feedbackOpenAddonFAQ, false } -- Open URL
-- [1st parameter]Integer. When >0: Gold value to send/Integer. Gold will only be send if 3rd parameter is true. / When Integer==0: Show the 2nd parameter string as button text and send ingame mail. / When String <> "": Show the 2nd parameter string as button text and open the URL from 1st parameter in Webbrowser
-- [2nd parameter]String to show as button text.
-- [3rd parameter]Boolean send gold. True: Send mail with attached gold value from 1st parameter/False: Send normal mail without gold attached
"If you found a bug, have a request or a suggestion, or simply wish to donate, send a mail.", -- Will be displayed as a message below the title.
600, -- The default width of the feedback window. If more than 4 buttons this should be increased.
150 -- The default height of the feedback window
150, -- The default width of the feedback window's buttons
28 -- The default height of the feedback window's buttons
)
Addons currently using the library:
Dolgubon's Lazy Writ Crafter
Dolgubon's Lazy Set Crafter
This Library is based on code from Master Merchant.
Version 1.32:
Removed the dependency on LibStub
Version 1.31:
Fixed a slight bug with the function button type. The text will now properly show up, and clicking on it will run the function.
Version 1.3:
API bump
Added the ability for buttons to run a function
Will play nicer when it's as a standalone addon.
Version 1.21:
Fixed a bug with setting the window height
Changed the anchor of the buttons to use BOTTOMLEFT, and a small spacer value, so different button widths don't mess up the placement
Version 1.2:
Fixed the button spacing formula
Auto resizing of the window based on # of buttons now uses the button width and not the height of the window
Window resizing properly affects button and message placement
Version 1.1: (reupload)
Added a text file so that minion will recognize it
Version 1.1:
Contributions from Baetram: (Thanks!)
- Support for different destinations for mail on different servers
- Default values and error messages added
- More options available for the buttons and windows, but still backwards compatible
- Support for translations
- Debug messages added
- Detailed description of parameters
Contributions from me
- Closes itself if the user chooses to send a mail
The usage of the latest version is little bit tricky for addon authors that got rid of libstub.
Older addons which work perfectly fine and are loved and used, may have bundled older (libstub) versions of LibFeedback.
If the latest version of LibFeedback(1.32) is not installed, but older versions (which depend on libStub) are,
ESO will show LibFeedback as properly installed.
This will cause addons depending on the new (non-libstub) version to fail and authors and users being puzzled.
This can be avoided by doing two things:
1) The "## AddOnVersion:" clause needs to be added to LibFeedback's manifest. E.g:
Code:
## AddOnVersion: 132
2) Addon authors using the latest non-libstub version need to be specific in the their addon manifest (.txt):
Code:
## DependsOn: … LibFeedback>=132
This will notify the user when a never version of LibFeedback is needed and prevent the addon from loading.
You may want to do this change and point it out in the Usage section.
Sometimes I get dependency on libfeedback addon. It's not listed in addons or libs sections of UI, but I have it in my folder.
No one but me has this bug. My guess it's related to my system language is not being English.
Makes the Addon window ingame a little more cleaned up. Tnx a lot.
I was just going to comment on this and also have now learnt what is needed to identify a library correctly.
I agree it would make the list cleaner in game, with the many addons I have atm there are 2 or 3 libs mixed in with them rather than separately listed with the Libs.
LibFeedback won't be found on Minion. Please add the txt file!
Just wanted to provide you the contents of a LibFeedback.txt file for the dependency to LibStub:
Code:
## Title: LibFeedback
## Author: Dolgubon
## APIVersion: 100024 100025
## Version: 1.1
## Description: This is a library which allows Addon Authors to easily add a feedback window to their addon
## DependsOn: LibStub
## 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.
libs/LibStub.lua
feedback.lua
I've build a package zip for version 1.1 too including libstub so one can add this lib as standalone too: LibFeedback v1.1 with LibStub
Thanks Dolgubon, looks promising.
Will try to add it to an addon and check what nonsense ppl will use it for
Edit:
The description is missing the 3rd parameter "parentControl" for the function
LibFeedback:initializeFeedbackWindow(parentAddonNameSpace, parentAddonName, parentControl, mailDestination, mailButtonPosition, buttonInfo, messageText)
Ideas/Questions:
Are we somehow able to specify different @names for the mail attachments, depending on the server name?
And I got some more ideas, will work on them some time I guess and send you an example then.
e.g.
-Change the texture + size + color of the mail icon from function parameters/via a library function (as addition to returning the button as a variable and chaning it afterwards)
-Change the text shown on the buttons
-Preset the text shown in the mail body
...
Edit2:
Added a pull request to github with my changes.
You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.
*Clicking the donate button above will take you to PayPal.com
*Clicking the donate button above will take you to Pledgie.com