mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 12:04:55 +02:00
bug report module
* change modules authors and website * avoid anchors recursivity crash * update README
This commit is contained in:
36
modules/game_bugreport/bugreport.lua
Normal file
36
modules/game_bugreport/bugreport.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
BugReport = {}
|
||||
|
||||
local bugReportWindow
|
||||
local bugTextEdit
|
||||
local HOTKEY = 'Ctrl+Z'
|
||||
|
||||
function BugReport.init()
|
||||
importStyle 'bugreport.otui'
|
||||
|
||||
bugReportWindow = createWidget('BugReportWindow', rootWidget)
|
||||
bugReportWindow:hide()
|
||||
|
||||
bugTextEdit = bugReportWindow:getChildById('bugTextEdit')
|
||||
|
||||
Keyboard.bindKeyDown(HOTKEY, BugReport.show)
|
||||
end
|
||||
|
||||
function BugReport.terminate()
|
||||
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
|
Reference in New Issue
Block a user