bug report module

* change modules authors and website
* avoid anchors recursivity crash
* update README
This commit is contained in:
Eduardo Bart
2012-05-01 10:06:38 -03:00
parent 69614da8cb
commit 788a831f24
39 changed files with 204 additions and 68 deletions

View 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

View File

@@ -0,0 +1,15 @@
Module
name: game_bugreport
description: Bug report interface (Ctrl+Z)
author: edubart
website: www.otclient.info
dependencies:
- game
@onLoad: |
dofile 'bugreport'
BugReport.init()
@onUnload: |
BugReport.terminate()

View File

@@ -0,0 +1,40 @@
BugReportWindow < MainWindow
!text: tr('Report Bug')
size: 280 250
&onEnter: BugReport.doReport
@onEscape: self:hide()
Label
id: bugLabel
!text: tr('Please use this dialog to only report bugs. Do not report rule violations here!')
text-wrap: true
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
height: 32
MultilineTextEdit
id: bugTextEdit
anchors.top: bugLabel.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: sendButton.top
margin-top: 4
margin-bottom: 8
Button
id: sendButton
!text: tr('Send')
anchors.bottom: cancelButton.bottom
anchors.right: cancelButton.left
margin-right: 10
width: 80
&onClick: BugReport.doReport
Button
id: cancelButton
!text: tr('Cancel')
anchors.bottom: parent.bottom
anchors.right: parent.right
width: 80
@onClick: self:getParent():hide()