Use new coding style in game modules

Lots of refactoring and changes
Remove docs folder
This commit is contained in:
Eduardo Bart
2012-07-24 02:30:08 -03:00
parent 1c3e630237
commit c54cd1fdf1
69 changed files with 1629 additions and 2634 deletions

View File

@@ -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()

View File

@@ -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()

View File

@@ -28,7 +28,7 @@ BugReportWindow < MainWindow
anchors.right: cancelButton.left
margin-right: 10
width: 80
&onClick: BugReport.doReport
&onClick: doReport
Button
id: cancelButton