* change modules authors and website * avoid anchors recursivity crash * update READMEmaster
コミット
788a831f24
@ -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
|
@ -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()
|
@ -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()
|
@ -1,7 +1,46 @@
|
||||
PlayerTrade = {}
|
||||
|
||||
-- g_game.inspectTrade(counterOffer, index)
|
||||
-- g_game.acceptTrade()
|
||||
-- g_game.rejectTrade()
|
||||
|
||||
local tradeWindow
|
||||
|
||||
local function createTrade()
|
||||
if tradeWindow then
|
||||
tradeWindow:destroy()
|
||||
tradeWindow = nil
|
||||
end
|
||||
|
||||
tradeWindow = createWidget('TradeWindow', rootWidget)
|
||||
end
|
||||
|
||||
local function onOwnTrade(name, items)
|
||||
local firstItem = items[1]
|
||||
|
||||
local tradeItemWidget = tradeWindow:getChildById('tradeItem')
|
||||
tradeItemWidget:setItem(firstItem)
|
||||
end
|
||||
|
||||
local function onCounterTrade(name, items)
|
||||
|
||||
end
|
||||
|
||||
local function onCloseTrade()
|
||||
tradeWindow:destroy()
|
||||
tradeWindow = nil
|
||||
end
|
||||
|
||||
function PlayerTrade.init()
|
||||
importStyle 'tradewindow.otui'
|
||||
|
||||
connect(g_game, { onOwnTrade = onGameOwnTrade,
|
||||
onCounterTrade = onGameCounterTrade,
|
||||
onCloseTrade = onGameCloseTrade })
|
||||
end
|
||||
|
||||
function PlayerTrade.terminate()
|
||||
disconnect(g_game, { onOwnTrade = onGameOwnTrade,
|
||||
onCounterTrade = onGameCounterTrade,
|
||||
onCloseTrade = onGameCloseTrade })
|
||||
end
|
||||
|
読み込み中…
新しいイシューから参照