Download
(25 Kb)
Download
Updated: 02/19/24 02:49 AM
Pictures
File Info
Compatibility:
Endless Archive (9.2.5)
Updated:02/19/24 02:49 AM
Created:02/09/24 07:41 PM
Monthly downloads:1,484
Total downloads:1,512
Favorites:2
MD5:
9.2.5
LibChatMenuButton  Updated less than 3 days ago!
Version: 1.2
by: akamatsu02 [More]
This lib creates buttons in the top right of the chat window.


To create a new button, simply execute the following code:
Parameters:
  • name: the name for the button, it is only used for sorting the buttons. The name should follow this regex: !?!?!?[a-zA-Z]+[0-9]?
  • imagePath: the path for the icon that the button should have. By default the alpha of the icon is changed onHover, but you can also add another icon for the onHover and onDisabled (see examples below).
  • tooltip: the tooltip that should be shown next to the icon when hovering over it, this parameter is optional.
  • func: the function that should be executed when the button is clicked
Code:
LibChatMenuButton.addChatButton(<string>name, <string/table>imagePath, <string>tooltip, <function>func)

Examples:
Code:
local button1 = LibChatMenuButton.addChatButton("myButton1", "path/to/icon", "tooltip", function() d("Hi") end)

local button2 = LibChatMenuButton.addChatButton("myButton2", "path/to/icon", nil, function() d("Hi") end)

local button3 = LibChatMenuButton.addChatButton("myButton3", {"path/to/icon", "path/to/onHover-icon", "path/to/disabled-icon"}, "tooltip", function() d("Hi") end)

Edit a button:
Parameters:
  • values: a key - value list of the parameters that should be changed
Code:
local button1 = LibChatMenuButton.addChatButton("myButton1", "path/to/icon", "tooltip", function() d("Hi") end)

button1:edit({["tooltip"] = "newTooltip", ["imagePath"] = "path/to/new/icon"})

-- ! imagePath is a string here, if you want to edit the onHover - image you need to change the imagePathHover parameter
-- parameters that can be changed: name, imagePath, imagePathHover, tooltip, func

Hide a button:
Code:
local button1 = LibChatMenuButton.addChatButton("myButton1", "path/to/icon", "tooltip", function() d("Hi") end)

button1:hide()

Show a button:
Code:
local button1 = LibChatMenuButton.addChatButton("myButton1", "path/to/icon", "tooltip", function() d("Hi") end)

button1:show()

Enable a button:
Code:
local button1 = LibChatMenuButton.addChatButton("myButton1", "path/to/icon", "tooltip", function() d("Hi") end)

button1:enable()

Disable a button:
Code:
local button1 = LibChatMenuButton.addChatButton("myButton1", "path/to/icon", "tooltip", function() d("Hi") end)

button1:disable()
1.2
- added function to disable/enable a button
- added regex for the button name

1.1
- added description etc
Archived Files (2)
File Name
Version
Size
Uploader
Date
1.1
7kB
akamatsu02
02/13/24 11:06 PM
1.0
4kB
02/09/24 07:41 PM


Post A Reply Comment Options
Unread 02/18/24, 12:27 PM  
akamatsu02
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 18
Uploads: 10
Originally Posted by Masteroshi430
Synced Account Settings now uses this lib
Cool
Report comment to moderator  
Reply With Quote
Unread 02/18/24, 04:49 AM  
Masteroshi430
 
Masteroshi430's Avatar
AddOn Author - Click to view AddOns

Forum posts: 185
File comments: 640
Uploads: 18
Synced Account Settings now uses this lib
Report comment to moderator  
Reply With Quote
Unread 02/13/24, 01:54 PM  
akamatsu02
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 18
Uploads: 10
Originally Posted by Baertram
Please add a proper description what this library does and maybe a screenshot. Thank you
Sure, I'll add a description with the next update which comes soon.
Report comment to moderator  
Reply With Quote
Unread 02/12/24, 06:35 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4872
File comments: 5929
Uploads: 78
Please add a proper description what this library does and maybe a screenshot. Thank you
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: