Go to Page... |
Compatibility: | Endless Archive (9.2.5) base-game patch (9.1.5) Necrom (9.0.0) Scribes of Fate (8.3.5) Firesong (8.2.5) Lost Depths (8.1.5) High Isle (8.0.0) |
Updated: | 10/26/23 03:34 PM |
Created: | 03/04/18 11:59 AM |
Monthly downloads: | 4,007 |
Total downloads: | 764,957 |
Favorites: | 499 |
MD5: |
local libDialog = LibDialog
libDialog:RegisterDialog("YourAddonName", "DialogNameConfirmation1", "Title of the dialog", "Body text of the dialog.\n\nAre you sure?", callbackYes, callbackNo, callbackSetup, forceUpdate, additionalOptions, textParams)
libDialog:ShowDialog("YourAddonName", "DialogNameConfirmation1", data)
--Add an editBox with parameters to a dialog --You can either pass in a table "editBoxParams" with the following contents (see below) --[[ Possible parameters in editBoxParams table could be: --->defaultText: number (will be used with function GetString(number)), or string. The default text shown at the edit box. Will be replaced upon typing in it --->textType: a textType constant (nil will be using TEXT_TYPE_ALL) ----> TEXT_TYPE_ALL = 0 ----> TEXT_TYPE_PASSWORD = 1 ----> TEXT_TYPE_NUMERIC = 2 ----> TEXT_TYPE_NUMERIC_UNSIGNED_INT = 3 ----> TEXT_TYPE_ALPHABETIC = 4 ----> TEXT_TYPE_ALPHABETIC_NO_FULLWIDTH_LATIN = 5 --->specialCharacters: a table with characters which can be entered into the input field. Table key is a number, value a character --->maxInputCharacters: number of maximum possible entered characters --->validatesText: boolean should the text in the editbox be validated --->validator: function for the text validation --->matchingString: string, Should the input into the editbox be compared to this matching string (e.g. used for DESTROY confirm dialog) --->autoComplete: table, containing info for a ZO_AutoComplete control attached to the editBox (will be created new if not existing). ---->subtable includeFlags: table with the include flags of the ZO_AutoComplete, e.g. { AUTO_COMPLETE_FLAG_GUILD, AUTO_COMPLETE_FLAG_RECENT, AUTO_COMPLETE_FLAG_RECENT_TARGET, AUTO_COMPLETE_FLAG_RECENT_CHAT }, ---->subtable excludeFlags: table with the exclude flags of the ZO_AutoComplete, e.g. {AUTO_COMPLETE_FLAG_FRIEND }, ---->boolean onlineOnly: boolean parameter online only, e.g. AUTO_COMPLETION_ONLINE_OR_OFFLINE ---->number maxResults: number parameter max results, e.g. MAX_AUTO_COMPLETION_RESULTS ]] --Or you can use the single parameters after that editBoxParams, starting with "textType". --->The single parameters are of the same type as described above in the "editBoxParams" table. function lib:AddEditBox(uniqueAddonName, uniqueDialogName, editBoxParams, defaultText, textType, specialCharacters, maxInputCharacters, matchingString, validatesText, validator, autoComplete)
--Remove an editBox from a dialog function lib:RemoveEditBox(uniqueAddonName, uniqueDialogName)
--Add radio buttons with parameters to a dialog --You can either pass in a table "radioButtonsParams" with the following contents (see below) --[[ -->Table specifiying radio buttons at the dialog. The table needs the radioButtonIndex as key and a subTable as value for each radio button. -->The following parameters can be added to the subTable of each radioButton: --->text: String --->data: Table with data of the radioButton --->clickedCallback: function called as the radio button was clicked. parameters of the function are: ---->radioButtonControl control ---->mouseButton MOUSE_BUTTON_INDEX_*, e.g. ----->MOUSE_BUTTON_INDEX_LEFT = 1 ----->MOUSE_BUTTON_INDEX_RIGHT = 2 ----->MOUSE_BUTTON_INDEX_MIDDLE = 3 ----->MOUSE_BUTTON_INDEX_4 = 4 ----->MOUSE_BUTTON_INDEX_5 = 5 ----->MOUSE_BUTTON_INDEX_LEFT_AND_RIGHT = 6 ---->upInside boolean, was the mouse released over the control ---->shift boolean: Was SHIFT key pressed ---->alt boolean: Was ALT key pressed ---->ctrl boolean: Was CTRL key pressed ---->command boolean: Was COMMAND (MAC only!) key pressed ]] --Or you can use the single parameters after that radioButtonsParams, starting with "rb<number>", e.g. rb1Text, rb1Data, rb1Callback and so on. --->The single parameters are of the same type as described above in the "radioButtonsParams" table. function lib:AddRadioButtons(uniqueAddonName, uniqueDialogName, radioButtonsParams, rb1Text, rb1Data, rb1ClickedCallback, rb2Text, rb2Data, rb2ClickedCallback, rb3Text, rb3Data, rb3ClickedCallback, rb4Text, rb4Data, rb4ClickedCallback, rb5Text, rb5Data, rb5ClickedCallback)
--Remove the radioButtons from a dialog --radioButtonNumbers table: key is the radioButtonNumber which should be removed, and value boolean true -> remove -->if table radioButtonNumbers is not given ALL radioButtons will be removed function lib:RemoveRadioButtons(uniqueAddonName, uniqueDialogName, radioButtonNumbers)
------------------------------------------------------------------------ -- ZO_Dialogs - possible parameters ------------------------------------------------------------------------ --> See example calls inside file LibDialog.lua, lines starting with (and below) --v-- TEST FUNCTION - BEGIN --Valid dialog additional options --Options like "editBox = { ... }, warning, or "customControl = {...}" --You can find all options here in the lines ff --https://github.com/esoui/esoui/blob/0569f38e70254b4e08a5eab088c4ce5e7e46be55/esoui/libraries/zo_dialog/zo_dialog.lua#L568 --Valid additional dialog parameters additionalOptions = { ["canQueue"] = { paramTypes = {"boolean", "function"} }, ["title"] = { paramTypes = {"table", } }, -- text: String or function returning a string (can contain placeholders <<1>> etc. for zo_strformat) -- align: TEXT_ALIGN_* member to set the alignment of the text (TEXT_ALIGN_LEFT, TEXT_ALIGN_RIGHT, or TEXT_ALIGN_CENTER....left is default). -- timer: index, which indicates that a certain parameter should be treated as seconds in a timer, and converted to time format -- (so if title contains "timer = 2", the 2nd parameter (<<2>>) in title.text is converted via zo_strformat to time format before being placed -- in the string). --Can this dialog be queued and called later, or not? ["mainText"] = { paramTypes = {"table", } }, -- text: String or function returning a string (can contain placeholders <<1>> etc. for zo_strformat) -- align: TEXT_ALIGN_* member to set the alignment of the text (TEXT_ALIGN_LEFT, TEXT_ALIGN_RIGHT, or TEXT_ALIGN_CENTER....left is default). -- timer: index, which indicates that a certain parameter should be treated as seconds in a timer, and converted to time format -- (so if mainText contains "timer = 2", the 2nd parameter (<<2>>) in mainText.text is converted via zo_strformat to time format before being placed -- in the string). --Can this dialog be queued and called later, or not? ["callback"] = { paramTypes = {"function"}, }, -- A callback function of the dialog, fired as the dialog is shown via ZO_Dialogs_ShowDialog -- 1 parameter in the callback function: number dialogID ["updateFn"] = { paramTypes = {"function"}, }, -- an update function called automatically as OnUpdate fires for the dialog ["gamepadInfo"] = { paramTypes = {"table"} }, --dialogType = any dialog of GAMEPAD_DIALOGS: --->GAMEPAD_DIALOGS.BASIC --->GAMEPAD_DIALOGS.CENTERED --->GAMEPAD_DIALOGS.COOLDOWN --->GAMEPAD_DIALOGS.CUSTOM --->GAMEPAD_DIALOGS.ITEM_SLIDER --->GAMEPAD_DIALOGS.PARAMETRIC --->GAMEPAD_DIALOGS.STATIC_LIST --text = number e.g. SI_DIALOG_CANCEL string constant, string text, or function returning a string --allowShowOnNextScene = boolean ["showLoadingIcon"] = { paramTypes = {"boolean"} }, --An option to show an animated loading icon near the main text. See parameter "loadingIcon" below ["customLoadingIcon"] = { paramTypes = {"string", "function"} }, --You can specify your own texture here which should be used as the loading icon. --dialog.loadingIcon = "string texture" (see https://github.com/esoui/esoui/blob/0569f38e70254b4e08a5eab088c4ce5e7e46be55/esoui/libraries/zo_dialog/zo_dialog.lua#L580) --As the "dialog" table will be created within function ZO_Dialogs_ShowDialog we need to apply our custom texture somehow to the control. --We will use the "callback" function of the dialog to achieve this! If a callback function was already defined we will "PreHook" this function to insert the texture first. ["modal"] = { paramTypes = {"boolean"} }, --Show the dialog modal or not ["warning"] = { paramTypes = {"table"} }, --Show a warning text at teh dialog. -- table with parameters --->string or function text, --->number timer, -----> You specify the timer index number here. -----> And inside the table "textParams" (see below) the warningParams the key must be the timer index, and the value the milliseconds left of that timer. -----> The attribute above (warning.text) should contain placeholders like <<1>> and <<2>> for a zo_strformat with the timer numbers! It will show a countdown then. --->boolean verboseTimer, ----> Show more details at the cooldown ["editBox"] = { paramTypes = {"table"} }, --Table specifiying an input edit control at the dialog. The following parameters can be added to the table: --->defaultText: number (will be used with function GetString(number)), or string. The default text shown at the edit box. Will be replaced upon typing in it --->textType: a textType constant (nil will be using TEXT_TYPE_ALL) ----> TEXT_TYPE_ALL = 0 ----> TEXT_TYPE_PASSWORD = 1 ----> TEXT_TYPE_NUMERIC = 2 ----> TEXT_TYPE_NUMERIC_UNSIGNED_INT = 3 ----> TEXT_TYPE_ALPHABETIC = 4 ----> TEXT_TYPE_ALPHABETIC_NO_FULLWIDTH_LATIN = 5 --->specialCharacters: a table with characters which can be entered into the input field. Table key is a number, value a character --->maxInputCharacters: number of maximum possible entered characters --->validatesText: boolean should the text in the editbox be validated --->validator: function for the text validation --->matchingString: string, Should the input into the editbox be compared to this matching string (e.g. used for DESTROY confirm dialog) --->autoComplete: table, containing info for a ZO_AutoComplete control attached to the editBox (will be created new if not existing). ---->subtable includeFlags: table with the include flags of the ZO_AutoComplete, e.g. { AUTO_COMPLETE_FLAG_GUILD, AUTO_COMPLETE_FLAG_RECENT, AUTO_COMPLETE_FLAG_RECENT_TARGET, AUTO_COMPLETE_FLAG_RECENT_CHAT }, ---->subtable excludeFlags: table with the exclude flags of the ZO_AutoComplete, e.g. {AUTO_COMPLETE_FLAG_FRIEND }, ---->boolean onlineOnly: boolean parameter online only, e.g. AUTO_COMPLETION_ONLINE_OR_OFFLINE ---->number maxResults: number parameter max results, e.g. MAX_AUTO_COMPLETION_RESULTS ["radioButtons"] = { paramTypes = {"table"} }, -->Table specifiying radio buttons at the dialog. The table needs the radioButtonIndex as key and a subTable as value for each radio button. -->The following parameters can be added to the subTable of each radioButton: --->text: String --->data: Table with data of the radioButton ["customControl"] = { paramTypes = {"userdata", "function"} }, --An own created control you would like to anchor and show in the dialog ["buttonData"] = { paramTypes = {"table"} }, -- needs to be a table with key = buttonIndex (1 or 2). Subdata can be visible (boolean or function returning a boolean) -->Table with key = buttonIndex (1 or 2) and a table as value. This table can contain the following entries: --->text: number (read via GetString(number), function returning a string, or string --->callback: function --->visible: function returning boolean, or boolean --->keybind: function returning a keybind, or keybind (if nil DIALOG_PRIMARY will be used for buttonIndex1 and DIALOG_NEGATIVE for buttonIndex2) --->noReleaseOnClick: boolean --->enabled: function returning boolean, or boolean --->clickSound: SOUNDS.SOUND_NAME --->requiresTextInput: boolean } --Valid text parameters (3rd parameter of function ZO_Dialogs_ShowDialog) textParams = { ["titleParams"] = { paramTypes = {"table"} }, --table containing key = number 1 to n and value = string or function returning a string. --Used to change the placeholders <<1>>, <<2>> etc. in the dialog's title.text string ["mainTextParams"] = { paramTypes = {"table"} }, --table containing key = number 1 to n and value = string text or function returning string. --Used to change the placeholders <<1>>, <<2>> etc. in the dialog's mainText.text string --Example: -- If the main text in the dialog has 2 parameters (e.g "Hello <<1>> <<2>>"), then the 3rd parameter of ZO_Dialogs_ShowDialog should contain a subtable called -- "mainTextParams" which itself contains 2 members, the first will go into the <<1>> and the second will go into the <<2>>. The 3rd parameter -- in ZO_Dialogs_ShowDialog can also contain a titleParams subtable which is used to fill in the parameters in the title, if needed. -- -- So as an example, let's say you had defined a dialog in InGameDialogs called "TEST_DIALOG" with -- title = { text = "Dialog <<1>>" } and mainText = { text = "Main <<1>> Text <<2>>" } -- And you called -- ZO_Dialogs_ShowDialog("TEST_DIALOG", {5}, {titleParams={"Test1"}, mainTextParams={"Test2", "Test3"}}) -- The resulting dialog would have a title that read "Dialog Test1" and a main text field that read "Main Test2 Text Test3". -- The 5 passed in the second parameter could be used by the callback functions to perform various tasks based on this value. ["warningParams"] = { paramTypes = {"table"} }, --table with parameters: Like the mainTextparams table is acting for maintext, this table is acrting for the warning table. --{ number timer } --The table here needs as key the parameter which should be replaced in the warning.text field placeholder <<[table key]>> ["buttonTextOverrides"] = { paramTypes = {"table"} }, --needs to be a table with key = buttonIndex (1 or 2) and will then overwrite the text of the buttons ["initialEditText"] = { paramTypes = {"string"} }, --used for additionalOptions.editBox as initial edit box text shown }
ESO_Dialogs[dialogName]
File Name |
Version |
Size |
Uploader |
Date |
1.26 |
6kB |
Baertram |
06/10/20 11:41 AM |
|
1.25 |
13kB |
Baertram |
06/10/20 04:02 AM |
|
1.24 |
3kB |
Baertram |
05/24/20 06:20 PM |
|
1.23 |
3kB |
Baertram |
05/31/19 06:55 AM |
|
1.22 |
3kB |
Baertram |
05/19/19 04:49 PM |
|
1.21 |
4kB |
Baertram |
09/03/18 01:05 PM |
|
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 |
Comment Options |
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |
AzraelDrakePhoenix |
View Public Profile |
Send a private message to AzraelDrakePhoenix |
Find More Posts by AzraelDrakePhoenix |
Add AzraelDrakePhoenix to Your Buddy List |
07/20/20, 05:57 AM | ||
|
Nope it's not this lib but maybe any of your active addons that depend on this lib as they will automatically be switched off if you unload LibDialog!
So check your addons which use this libs. Oh and btw: I heard the same problem from other addon devs in the past days, but related to no special addon. Maybe it's just a ZOs error or problem, or one of your addon creates SavedVariable files that are TOO big (too many lines/characters) to be handled by the game. Check your SV folder for big files, and check if disabling the addons creating these files (the names should be similar/equal to the addon!) fixes this. Maybe also backup/delete the file LibDebugLogger and update the library as it was a known probem of this lib a few months ago. But you should be using a newer versin meanwhile (I hope ).
|
|
|
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |
07/20/20, 01:34 AM | |
Forum posts: 0
File comments: 15
Uploads: 0
|
Hi Baertram,
I'm not convinced this is an issue with the library itself, but I have been having issues for the past 24 hours or so where the game will close to desktop instead of logging out to character select when choosing the log out option. I discovered just a few minutes ago that if I disable libdialog, this no longer happens. Since neither the game nor the library have been updated in the last 24 hours it seems odd, and I don't see how an addon or library could alter the log out behavior in such a way, but I thought you should at least be aware of it, just in case there is something odd going on with the library's code. Thanks. |
|
AzraelDrakePhoenix |
View Public Profile |
Send a private message to AzraelDrakePhoenix |
Find More Posts by AzraelDrakePhoenix |
Add AzraelDrakePhoenix to Your Buddy List |
05/27/20, 09:17 AM | ||
|
Edit: Found the editBox in dialog source here: https://github.com/esoui/esoui/blob/...ialog.lua#L593 Seems one could add it to each dialog so we could add it to LibDialog :-) Would look like this then Lua Code:
Going to test it a bit.
Last edited by Baertram : 05/27/20 at 09:37 AM.
|
|
|
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |
05/27/20, 08:41 AM | |
|
Hi, Baertram! Have you known a similar library, but with a edit string dialog?
|
|
Crunatus |
View Public Profile |
Send a private message to Crunatus |
Find More Posts by Crunatus |
Add Crunatus to Your Buddy List |
04/25/20, 03:06 PM | |
|
LibDialog has remove LibStub support with the Greymoor API10031 update.
Please use the global variable "LibDialog" in your addons instead! In your code change lines like this: Code:
local ld = LibStub("LibDialog") Lua Code:
In your addon's txt manifest file: Use the same ## OptionaDependsOn: LibDialog or ## DependsOn: LibDialog You should remove any OptionalDependsOn or DependsOn: LibStub though if none of the libraries in your addon need it anymore.
Last edited by Baertram : 05/24/20 at 06:20 PM.
|
|
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |
05/27/19, 04:07 AM | |||
|
tested with only Skyshards+Addon Selector active first and then without it Ah looks like its Addon Selector then.... reported to that addon page
Last edited by Marazota : 05/27/19 at 11:15 AM.
|
||
|
Marazota |
View Public Profile |
Send a private message to Marazota |
Find More Posts by Marazota |
Add Marazota to Your Buddy List |
05/27/19, 03:48 AM | ||
|
|
|
|
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |
05/27/19, 03:26 AM | |
|
this lib prevents Skyshard addon from counting skyshards in Skill UI
numbers always the same no matter how many skyshards you gathererd only after reloadui numbers will change |
|
Marazota |
View Public Profile |
Send a private message to Marazota |
Find More Posts by Marazota |
Add Marazota to Your Buddy List |
09/06/18, 05:27 AM | ||
|
|
|
|
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |
09/05/18, 09:46 AM | |
|
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 |
|
Marazota |
View Public Profile |
Send a private message to Marazota |
Find More Posts by Marazota |
Add Marazota to Your Buddy List |
07/26/18, 05:21 AM | |
|
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:
Lua Code:
|
|
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |