Download
(12 Kb)
Download
Updated: 03/08/24 06:11 PM
Pictures
File Info
Compatibility:
Endless Archive (9.2.5)
Updated:03/08/24 06:11 PM
Created:02/09/24 07:41 PM
Monthly downloads:4,098
Total downloads:12,701
Favorites:24
MD5:
LibChatMenuButton  Popular! (More than 5000 hits)
Version: 1.5
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, onPressed, onDisabled and onDisabledPressed (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", "imagePath", "tooltip", function() d("Hi") end)

local button2 = LibChatMenuButton.addChatButton("myButton2", "imagePath", nil, function() d("Hi") end)

local button3 = LibChatMenuButton.addChatButton("myButton3", {"imagePath", "imagePathHover", "imagePathPressed", "imagePathDisabled", "imagePathDisabledPressed"}, "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.5
- bugfix

1.4
- changed type of button from Texture to Button
- added PressedTexture & DisabledPressedTexture

1.3
- added functions to override existing chat buttons and add them with this lib

1.2
- added function to disable/enable a button
- added regex for the button name

1.1
- added description etc
Archived Files (5)
File Name
Version
Size
Uploader
Date
1.4
12kB
akamatsu02
03/08/24 03:53 PM
1.3
12kB
akamatsu02
03/08/24 01:45 PM
1.2
25kB
akamatsu02
02/19/24 02:49 AM
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 03/09/24, 05:09 AM  
@DeadSoon
AddOn Author - Click to view AddOns

Forum posts: 22
File comments: 352
Uploads: 3
BeamMeUp is in

Great idea to organize the chat buttons via a dedicated library!

BeamMeUp is now using this library as optional dependsOn with version 3.5.4
Report comment to moderator  
Reply With Quote
Unread 02/18/24, 12:27 PM  
akamatsu02
 
akamatsu02's Avatar
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: 706
Uploads: 20
Synced Account Settings now uses this lib
Report comment to moderator  
Reply With Quote
Unread 02/13/24, 01:54 PM  
akamatsu02
 
akamatsu02's Avatar
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: 4989
File comments: 6040
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: