Resolve "Merge the best from 7.40 branch"

This commit is contained in:
Erikas Kontenis
2022-04-06 14:58:52 +00:00
parent 3bd1a6f07e
commit 155da3573c
928 changed files with 43723 additions and 1221 deletions

View File

@@ -0,0 +1,36 @@
-- TODO: find another hotkey for this. Ctrl+Z will be reserved to undo on textedits.
HOTKEY = 'Ctrl+Z'
bugReportWindow = nil
bugTextEdit = nil
function init()
g_ui.importStyle('bugreport')
bugReportWindow = g_ui.createWidget('BugReportWindow', rootWidget)
bugReportWindow:hide()
bugTextEdit = bugReportWindow:getChildById('bugTextEdit')
g_keyboard.bindKeyDown(HOTKEY, show, modules.game_interface.getRootPanel())
end
function terminate()
g_keyboard.unbindKeyDown(HOTKEY, modules.game_interface.getRootPanel())
bugReportWindow:destroy()
end
function doReport()
g_game.reportBug(bugTextEdit:getText())
bugReportWindow:hide()
modules.game_textmessage.displayGameMessage(tr('Bug report sent.'))
end
function show()
if g_game.isOnline() then
bugTextEdit:setText('')
bugReportWindow:show()
bugReportWindow:raise()
bugReportWindow:focus()
end
end