tibia-client/modules/game_bugreport/bugreport.lua

37 lines
815 B
Lua
Raw Normal View History

2012-08-26 11:10:48 +02:00
-- TODO: find another hotkey for this. Ctrl+Z will be reserved to undo on textedits.
HOTKEY = 'Ctrl+Z'
bugReportWindow = nil
bugTextEdit = nil
function init()
2012-06-26 00:13:30 +02:00
g_ui.importStyle('bugreport.otui')
2012-06-26 00:13:30 +02:00
bugReportWindow = g_ui.createWidget('BugReportWindow', rootWidget)
bugReportWindow:hide()
bugTextEdit = bugReportWindow:getChildById('bugTextEdit')
g_keyboard.bindKeyDown(HOTKEY, show)
end
function terminate()
2012-06-26 00:13:30 +02:00
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()
2012-08-26 11:10:48 +02:00
if g_game.isOnline() then
bugTextEdit:setText('')
bugReportWindow:show()
bugReportWindow:raise()
bugReportWindow:focus()
end
end