tibia-client/modules/game_bugreport/bugreport.lua

37 lines
791 B
Lua
Raw Normal View History

BugReport = {}
local bugReportWindow
local bugTextEdit
local HOTKEY = 'Ctrl+Z'
function BugReport.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')
2012-06-26 00:13:30 +02:00
g_keyboard.bindKeyDown(HOTKEY, BugReport.show)
end
function BugReport.terminate()
2012-06-26 00:13:30 +02:00
g_keyboard.unbindKeyDown(HOTKEY)
bugReportWindow:destroy()
bugReportWindow = nil
bugTextEdit = nil
end
function BugReport.doReport()
g_game.reportBug(bugTextEdit:getText())
bugReportWindow:hide()
TextMessage.displayEventAdvance(tr('Bug report sent.'))
end
function BugReport.show()
bugTextEdit:setText('')
bugReportWindow:show()
bugReportWindow:raise()
bugReportWindow:focus()
end