mirror of
https://github.com/edubart/otclient.git
synced 2025-04-30 01:29:21 +02:00

* All modules are sandboxed now * All images,sounds,fonts,translations and styles were moved to "data" folder * Reorganize image files folders * Remove unmaintained modules: client_particles, client_shaders * Implement new automatic way to load styles and fonts * Add hide/show offline option in VipList * Add invite/exclude to/from private channel in players menus * Many other minor changes
37 lines
810 B
Lua
37 lines
810 B
Lua
-- TODO: find another hotkey for this. Ctrl+Z will be reserved to undo on textedits.
|
|
HOTKEY = 'Ctrl+Z'
|
|
|
|
bugReportWindow = nil
|
|
bugTextEdit = nil
|
|
|
|
function init()
|
|
g_ui.importStyle('bugreport')
|
|
|
|
bugReportWindow = g_ui.createWidget('BugReportWindow', rootWidget)
|
|
bugReportWindow:hide()
|
|
|
|
bugTextEdit = bugReportWindow:getChildById('bugTextEdit')
|
|
|
|
g_keyboard.bindKeyDown(HOTKEY, show)
|
|
end
|
|
|
|
function terminate()
|
|
g_keyboard.unbindKeyDown(HOTKEY)
|
|
bugReportWindow:destroy()
|
|
end
|
|
|
|
function doReport()
|
|
g_game.reportBug(bugTextEdit:getText())
|
|
bugReportWindow:hide()
|
|
modules.game_textmessage.displayGameMessage(tr('Bug report sent.'))
|
|
end
|
|
|
|
function show()
|
|
if g_game.isOnline() then
|
|
bugTextEdit:setText('')
|
|
bugReportWindow:show()
|
|
bugReportWindow:raise()
|
|
bugReportWindow:focus()
|
|
end
|
|
end
|