mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 03:24:55 +02:00
bug report module
* change modules authors and website * avoid anchors recursivity crash * update README
This commit is contained in:
@@ -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
|
||||
|
@@ -1,8 +1,8 @@
|
||||
Module
|
||||
name: game_playertrade
|
||||
description: Allow to trade items with players
|
||||
author: OTClient team
|
||||
website: https://github.com/edubart/otclient
|
||||
author: edubart
|
||||
website: www.otclient.info
|
||||
|
||||
dependencies:
|
||||
- game
|
||||
|
Reference in New Issue
Block a user