mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-12-18 18:07:12 +01:00
Version 1.3 - auto reconnect, better bot (with sound), animated mounts, bug fixes
This commit is contained in:
@@ -269,7 +269,7 @@ Panel
|
||||
ui.config:addOption(name)
|
||||
end
|
||||
|
||||
if not context.storage.cavebot.activeConfig and #context.storage.cavebot.configs > 0 then
|
||||
if (not context.storage.cavebot.activeConfig or context.storage.cavebot.activeConfig == 0) and #context.storage.cavebot.configs > 0 then
|
||||
context.storage.cavebot.activeConfig = 1
|
||||
end
|
||||
|
||||
@@ -331,10 +331,24 @@ Panel
|
||||
if not context.storage.cavebot.activeConfig or not context.storage.cavebot.configs[context.storage.cavebot.activeConfig] then
|
||||
return
|
||||
end
|
||||
context.storage.cavebot.enabled = false
|
||||
table.remove(context.storage.cavebot.configs, context.storage.cavebot.activeConfig)
|
||||
context.storage.cavebot.activeConfig = 0
|
||||
refreshConfig()
|
||||
local questionWindow = nil
|
||||
local closeWindow = function()
|
||||
questionWindow:destroy()
|
||||
end
|
||||
local removeConfig = function()
|
||||
closeWindow()
|
||||
if not context.storage.cavebot.activeConfig or not context.storage.cavebot.configs[context.storage.cavebot.activeConfig] then
|
||||
return
|
||||
end
|
||||
context.storage.cavebot.enabled = false
|
||||
table.remove(context.storage.cavebot.configs, context.storage.cavebot.activeConfig)
|
||||
context.storage.cavebot.activeConfig = 0
|
||||
refreshConfig()
|
||||
end
|
||||
questionWindow = context.displayGeneralBox(tr('Remove config'), tr('Do you want to remove current waypoints config?'), {
|
||||
{ text=tr('Yes'), callback=removeConfig },
|
||||
{ text=tr('No'), callback=closeWindow },
|
||||
anchor=AnchorHorizontalCenter}, removeConfig, closeWindow)
|
||||
end
|
||||
|
||||
-- waypoint editor
|
||||
@@ -733,7 +747,7 @@ Panel
|
||||
ui.list:focusChild(nextChild)
|
||||
commandExecutionNo = 0
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
return functions
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user