forked from mehah/otclient
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
1,252 additions
and
6 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,5 @@ Module | |
- client_options | ||
- client_entergame | ||
- client_terminal | ||
- client_debug_info | ||
- client_serverlist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
local debugInfoWindow = nil | ||
local debugInfoButton = nil | ||
|
||
local updateEvent = nil | ||
|
||
function init() | ||
debugInfoButton = modules.client_topmenu.addTopRightToggleButton('debugInfoButton', tr('Debug Info'), | ||
'/images/topbuttons/debug', toggle) | ||
debugInfoButton:setOn(false) | ||
|
||
debugInfoWindow = g_ui.displayUI('debug_info') | ||
debugInfoWindow:hide() | ||
|
||
g_keyboard.bindKeyDown('Ctrl+Alt+D', toggle) | ||
|
||
updateEvent = scheduleEvent(update, 2000) | ||
end | ||
|
||
function terminate() | ||
debugInfoWindow:destroy() | ||
debugInfoButton:destroy() | ||
|
||
g_keyboard.unbindKeyDown('Ctrl+Alt+D') | ||
|
||
removeEvent(updateEvent) | ||
end | ||
|
||
function onClose() | ||
debugInfoButton:setOn(false) | ||
end | ||
|
||
function toggle() | ||
if debugInfoButton:isOn() then | ||
debugInfoWindow:hide() | ||
debugInfoButton:setOn(false) | ||
else | ||
debugInfoWindow:show() | ||
debugInfoWindow:raise() | ||
debugInfoWindow:focus() | ||
debugInfoButton:setOn(true) | ||
end | ||
end | ||
|
||
function update() | ||
updateEvent = scheduleEvent(update, 20) | ||
|
||
if not debugInfoWindow:isVisible() then | ||
return | ||
end | ||
|
||
if g_proxy then | ||
local text = "" | ||
local proxiesDebug = g_proxy.getProxiesDebugInfo() | ||
for proxy_name, proxy_debug in pairs(proxiesDebug) do | ||
text = text .. proxy_name .. " - " .. proxy_debug .. "\n" | ||
end | ||
debugInfoWindow.debugPanel.proxies:setText(text) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Module | ||
name: client_debug_info | ||
description: Showing and sending debug/stats informations | ||
author: [email protected] | ||
sandboxed: true | ||
scripts: [ debug_info ] | ||
dependencies: [ client_topmenu ] | ||
@onLoad: init() | ||
@onUnload: terminate() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
DebugText < Label | ||
font: terminus-10px | ||
text-wrap: false | ||
text-auto-resize: true | ||
text-align: topleft | ||
anchors.right: parent.right | ||
anchors.left: parent.left | ||
anchors.top: prev.bottom | ||
|
||
DebugLabel < Label | ||
text-wrap: false | ||
text-auto-resize: false | ||
text-align: center | ||
anchors.right: parent.right | ||
anchors.left: parent.left | ||
anchors.top: prev.bottom | ||
|
||
MainWindow | ||
id: debugWindow | ||
size: 600 150 | ||
!text: tr('Debug Info') | ||
@onClose: modules.client_debug_info.onMiniWindowClose() | ||
&save: false | ||
margin: 0 0 0 0 | ||
padding: 25 3 3 3 | ||
opacity: 0.9 | ||
$mobile: | ||
size: 600 150 | ||
@onEnter: modules.client_debug_info.toggle() | ||
@onEscape: modules.client_debug_info.toggle() | ||
|
||
|
||
ScrollablePanel | ||
id: debugPanel | ||
anchors.fill: parent | ||
margin-bottom: 5 | ||
margin: 5 5 5 5 | ||
padding-left: 5 | ||
vertical-scrollbar: debugScroll | ||
|
||
DebugLabel | ||
!text: tr('Proxies') | ||
anchors.top: parent.top | ||
|
||
DebugText | ||
id: proxies | ||
text: - | ||
|
||
VerticalScrollBar | ||
id: debugScroll | ||
anchors.top: parent.top | ||
anchors.bottom: parent.bottom | ||
anchors.right: parent.right | ||
step: 48 | ||
pixels-scroll: true | ||
|
||
ResizeBorder | ||
anchors.bottom: parent.bottom | ||
anchors.left: parent.left | ||
anchors.right: parent.right | ||
|
||
ResizeBorder | ||
anchors.right: parent.right | ||
anchors.top: parent.top | ||
anchors.bottom: parent.bottom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.