mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 04:24:54 +02:00
a lot of changes in modules
This commit is contained in:
55
modules/client_terminal/commands.lua
Normal file
55
modules/client_terminal/commands.lua
Normal file
@@ -0,0 +1,55 @@
|
||||
function dumpWidgets(widget, level)
|
||||
widget = widget or rootWidget
|
||||
level = level or 0
|
||||
for i=1,widget:getChildCount() do
|
||||
local child = widget:getChildByIndex(i)
|
||||
if child:isVisible() then
|
||||
local name = child:getId()
|
||||
if name:match('widget%d+') == nil then
|
||||
print(string.rep(' ', level) .. name)
|
||||
end
|
||||
if child:getId() ~= 'terminalBuffer' then
|
||||
dumpWidgets(child, level+1)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function drawDebugBoxes(enable)
|
||||
if enable == nil then enable = true end
|
||||
g_ui.setDebugBoxesDrawing(enable)
|
||||
end
|
||||
|
||||
function hideMap()
|
||||
local map = rootWidget:recursiveGetChildById('gameMapPanel')
|
||||
if map then map:hide() end
|
||||
end
|
||||
|
||||
function showMap()
|
||||
local map = rootWidget:recursiveGetChildById('gameMapPanel')
|
||||
if map then map:show() end
|
||||
end
|
||||
|
||||
function debugContainersItems()
|
||||
function UIItem:onHoverChange(hovered)
|
||||
if hovered then
|
||||
local item = self:getItem()
|
||||
if item then ToolTip.display(item:getId()) end
|
||||
else
|
||||
ToolTip.hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function quit()
|
||||
exit()
|
||||
end
|
||||
|
||||
function autoReloadModule(name)
|
||||
local function reloadEvent()
|
||||
reloadModule(name)
|
||||
scheduleEvent(reloadEvent, 1000)
|
||||
end
|
||||
reloadEvent()
|
||||
end
|
||||
|
Reference in New Issue
Block a user