mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-22 23:45:55 +02:00
Version 2.1 - imbuements, wrap/unwrap, 4 byte header, packet compression and other features
This commit is contained in:
30
modules/game_bot/functions/ui_windows.lua
Normal file
30
modules/game_bot/functions/ui_windows.lua
Normal file
@@ -0,0 +1,30 @@
|
||||
local context = G.botContext
|
||||
if type(context.UI) ~= "table" then
|
||||
context.UI = {}
|
||||
end
|
||||
local UI = context.UI
|
||||
|
||||
UI.SinglelineEditorWindow = function(text, callback)
|
||||
return modules.game_textedit.singlelineEditor(text, callback)
|
||||
end
|
||||
|
||||
UI.MultilineEditorWindow = function(description, test, callback)
|
||||
return modules.game_textedit.multilineEditor(description, test, callback)
|
||||
end
|
||||
|
||||
UI.ConfirmationWindow = function(title, question, callback)
|
||||
local window = nil
|
||||
local onConfirm = function()
|
||||
window:destroy()
|
||||
callback()
|
||||
end
|
||||
local closeWindow = function()
|
||||
window:destroy()
|
||||
end
|
||||
window = context.displayGeneralBox(title, question, {
|
||||
{ text=tr('Yes'), callback=onConfirm },
|
||||
{ text=tr('No'), callback=closeWindow },
|
||||
anchor=AnchorHorizontalCenter}, onConfirm, closeWindow)
|
||||
window.botWidget = true
|
||||
return window
|
||||
end
|
Reference in New Issue
Block a user