1-- TODO: find another hotkey for this. Ctrl+Z will be reserved to undo on textedits.
2--HOTKEY = 'Ctrl+Z'
3
4bugReportWindow = nil
5bugTextEdit = nil
6
7function init()
8 g_ui.importStyle('bugreport')
9
10 bugReportWindow = g_ui.createWidget('BugReportWindow', rootWidget)
11 bugReportWindow:hide()
12
13 bugTextEdit = bugReportWindow:getChildById('bugTextEdit')
14
15 --g_keyboard.bindKeyDown(HOTKEY, show, modules.game_interface.getRootPanel())
16end
17
18function terminate()
19 --g_keyboard.unbindKeyDown(HOTKEY, modules.game_interface.getRootPanel())
20 bugReportWindow:destroy()
21end
22
23function doReport()
24 g_game.reportBug(bugTextEdit:getText())
25 bugReportWindow:hide()
26 modules.game_textmessage.displayGameMessage(tr('Bug report sent.'))
27end
28
29function show()
30 if g_game.isOnline() then
31 bugTextEdit:setText('')
32 bugReportWindow:show()
33 bugReportWindow:raise()
34 bugReportWindow:focus()
35 end
36end
37
38function isBugEnabled()
39 return bugReportWindow:isVisible()
40end
41