mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
Use new coding style in game modules
Lots of refactoring and changes Remove docs folder
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
BugReport = {}
|
||||
HOTKEY = 'Ctrl+Z'
|
||||
|
||||
local bugReportWindow
|
||||
local bugTextEdit
|
||||
local HOTKEY = 'Ctrl+Z'
|
||||
bugReportWindow = nil
|
||||
bugTextEdit = nil
|
||||
|
||||
function BugReport.init()
|
||||
function init()
|
||||
g_ui.importStyle('bugreport.otui')
|
||||
|
||||
bugReportWindow = g_ui.createWidget('BugReportWindow', rootWidget)
|
||||
@@ -12,23 +11,21 @@ function BugReport.init()
|
||||
|
||||
bugTextEdit = bugReportWindow:getChildById('bugTextEdit')
|
||||
|
||||
g_keyboard.bindKeyDown(HOTKEY, BugReport.show)
|
||||
g_keyboard.bindKeyDown(HOTKEY, show)
|
||||
end
|
||||
|
||||
function BugReport.terminate()
|
||||
function terminate()
|
||||
g_keyboard.unbindKeyDown(HOTKEY)
|
||||
bugReportWindow:destroy()
|
||||
bugReportWindow = nil
|
||||
bugTextEdit = nil
|
||||
end
|
||||
|
||||
function BugReport.doReport()
|
||||
function doReport()
|
||||
g_game.reportBug(bugTextEdit:getText())
|
||||
bugReportWindow:hide()
|
||||
TextMessage.displayEventAdvance(tr('Bug report sent.'))
|
||||
modules.game_textmessage.displayEventAdvance(tr('Bug report sent.'))
|
||||
end
|
||||
|
||||
function BugReport.show()
|
||||
function show()
|
||||
bugTextEdit:setText('')
|
||||
bugReportWindow:show()
|
||||
bugReportWindow:raise()
|
||||
|
@@ -3,13 +3,7 @@ Module
|
||||
description: Bug report interface (Ctrl+Z)
|
||||
author: edubart
|
||||
website: www.otclient.info
|
||||
|
||||
dependencies:
|
||||
- game_interface
|
||||
|
||||
@onLoad: |
|
||||
dofile 'bugreport'
|
||||
BugReport.init()
|
||||
|
||||
@onUnload: |
|
||||
BugReport.terminate()
|
||||
scripts: [ bugreport.lua ]
|
||||
sandboxed: true
|
||||
@onLoad: init()
|
||||
@onUnload: terminate()
|
||||
|
@@ -28,7 +28,7 @@ BugReportWindow < MainWindow
|
||||
anchors.right: cancelButton.left
|
||||
margin-right: 10
|
||||
width: 80
|
||||
&onClick: BugReport.doReport
|
||||
&onClick: doReport
|
||||
|
||||
Button
|
||||
id: cancelButton
|
||||
|
Reference in New Issue
Block a user