2012-07-24 07:30:08 +02:00
|
|
|
HOTKEY = 'Ctrl+Z'
|
2012-05-01 15:06:38 +02:00
|
|
|
|
2012-07-24 07:30:08 +02:00
|
|
|
bugReportWindow = nil
|
|
|
|
bugTextEdit = nil
|
2012-05-01 15:06:38 +02:00
|
|
|
|
2012-07-24 07:30:08 +02:00
|
|
|
function init()
|
2012-06-26 00:13:30 +02:00
|
|
|
g_ui.importStyle('bugreport.otui')
|
2012-05-01 15:06:38 +02:00
|
|
|
|
2012-06-26 00:13:30 +02:00
|
|
|
bugReportWindow = g_ui.createWidget('BugReportWindow', rootWidget)
|
2012-05-01 15:06:38 +02:00
|
|
|
bugReportWindow:hide()
|
|
|
|
|
|
|
|
bugTextEdit = bugReportWindow:getChildById('bugTextEdit')
|
|
|
|
|
2012-07-24 07:30:08 +02:00
|
|
|
g_keyboard.bindKeyDown(HOTKEY, show)
|
2012-05-01 15:06:38 +02:00
|
|
|
end
|
|
|
|
|
2012-07-24 07:30:08 +02:00
|
|
|
function terminate()
|
2012-06-26 00:13:30 +02:00
|
|
|
g_keyboard.unbindKeyDown(HOTKEY)
|
2012-05-01 15:06:38 +02:00
|
|
|
bugReportWindow:destroy()
|
|
|
|
end
|
|
|
|
|
2012-07-24 07:30:08 +02:00
|
|
|
function doReport()
|
2012-05-01 15:06:38 +02:00
|
|
|
g_game.reportBug(bugTextEdit:getText())
|
|
|
|
bugReportWindow:hide()
|
2012-07-24 07:30:08 +02:00
|
|
|
modules.game_textmessage.displayEventAdvance(tr('Bug report sent.'))
|
2012-05-01 15:06:38 +02:00
|
|
|
end
|
|
|
|
|
2012-07-24 07:30:08 +02:00
|
|
|
function show()
|
2012-05-01 15:06:38 +02:00
|
|
|
bugTextEdit:setText('')
|
|
|
|
bugReportWindow:show()
|
|
|
|
bugReportWindow:raise()
|
|
|
|
bugReportWindow:focus()
|
|
|
|
end
|