Quantcast
Download
(4 Kb)
Download
Updated: 09/03/18 01:05 PM
Compatibility:
Wolfhunter (4.1)
Summerset (4.0)
Dragon Bones (3.3)
Updated:09/03/18 01:05 PM
Created:03/04/18 11:59 AM
Monthly downloads:3,422
Total downloads:13,155
Favorites:54
MD5:
LibDialog - Custom confirmation dialog with 2 buttons  Popular! (More than 5000 hits)
Version: 1.21
by: Baertram [More]
LibDialog
A library to create custom dialogs for your confirmation messages, containing customizable title and body text + 2 buttons (Accept, Decline) which can run your specified callback functions.

Usage
-Download, use as standalone library or strip the manifest txt file and just use the library file within your addon.
-Load the library within your addon code using the versioning library libStub (included):
Lua Code:
  1. local libDialog = LibStub('LibDialog')

-Specify a new dialog for your addon, giving it a unique dialog name, and using a unique addon name:
Lua Code:
  1. libDialog:RegisterDialog("YourAddonName", "DialogNameConfirmation1", "Title of the dialog", "Body text of the dialog.\n\nAre you sure?", callbackYes, callbackNo, callbackSetup)
Title of the dialog: Can be a string, an integer registered for function GetString(Integer) or a function which returns a string
Body text of the dialog: Can be a string, an integer registered for function GetString(Integer) or a function which returns a string
callbackYes: The function which will be executed as the dialog button "Accept" is pressed (Obligatory)
callbackNo: The function which will be executed as the dialog button "Decline" is pressed (Can be nil)
callbackSetup: The function which will be executed as the dialog is created (Can be nil)

-Show the dialog using the same unique addon and unique dialog name which you have used to register a dialog before:
Lua Code:
  1. libDialog:ShowDialog("YourAddonName", "DialogNameConfirmation1", data)
data: Data which can be passed to the dialog

Amount of dialogs per addon
You can define as much dialogs as you want to.


Where are the dialogs stored ingame?
The dialogs will be stored in the library variable which you have deifned via libStub, e.g. libDialog.
You can check your "libDialog" variable ingame (if you expose it to the globals) to see a list of addons which use the library, where a dialog was registered for the addon already.

You can also check the global ESO variable for dialogs
Code:
ESO_Dialogs[dialogName]
where "dialogName" is the concatenated string of uniqueAddonName and uniqueDialogName.
Version 1.21
Fixed: Archive contained a non-wanted subfolder LibDialog_1_2 which was removed.

Version 1.2
Changed: API
Fixed: Dependency to library LibStub

Version 1.1
Added: callBack function for dialog setup
Added: Support for "title" and "body" to be a normal String, a registered integer for the function GetString(integer) or a function which returns the string
Added: data can be passed to the dialog's data now (access it via dialog.data)
Optional Files (0)


Archived Files (3)
File Name
Version
Size
Uploader
Date
1.2
4kB
Baertram
08/30/18 11:24 AM
1.1
4kB
Baertram
07/26/18 05:18 AM
1.0
4kB
03/04/18 11:59 AM


Post A Reply Comment Options
Unread 09/06/18, 05:27 AM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1832
File comments: 2027
Uploads: 49
Originally Posted by Marazota
differences of version at esoui and in manifest
1.2.1
vs
1.21

its confusing Minion, because it want to update it every time after launch
Thanks, will fix ESOUI.
Report comment to moderator  
Reply With Quote
Unread 09/05/18, 09:46 AM  
Marazota

Forum posts: 89
File comments: 786
Uploads: 0
differences of version at esoui and in manifest
1.2.1
vs
1.21

its confusing Minion, because it want to update it every time after launch
Report comment to moderator  
Reply With Quote
Unread 07/26/18, 05:21 AM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1832
File comments: 2027
Uploads: 49
Version 1.1
Added: callBack function for dialog setup
Added: Support for "title" and "body" to be a normal String, a registered integer for the function GetString(integer) or a function which returns the string
Added: data can be passed to the dialog's data now (access it via dialog.data)

The callBackSetup function can be used to change some stuff within the dialog as it gets created/setup.

The data parameter can be used to pass custom variables to the dialog and use them inside the callbackYes or callbackNo functions via dialog.data then.

Te parameters title and bodyText can be a string like "Titel" or a registered integer for the function GetString(integer) like SI_MY_DIALOG_TITLE, or a function returning a string like
Lua Code:
  1. function() return "Titel" end
or
Lua Code:
  1. function() return GetString(SI_MY_DIALOG_TITEL) or "No titel specified" end
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: