补杠牌同步其他三个麻将
parent
c584fa8a47
commit
744531d942
|
|
@ -76,7 +76,7 @@ end
|
|||
function M:OnEventBuGang(evt_data)
|
||||
printlog("OnEventBuGang")
|
||||
pt(evt_data)
|
||||
DispatchEvent(self._dispatcher, TX_GameEvent.EventBuGang, evt_data["info"][1], evt_data["info"][2], true)
|
||||
DispatchEvent(self._dispatcher, TX_GameEvent.EventBuGang, evt_data["info"], true)
|
||||
end
|
||||
|
||||
-- 发送放子选择到服务器
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ end
|
|||
function M:OnEventBuGang(evt_data)
|
||||
printlog("OnEventBuGang")
|
||||
pt(evt_data)
|
||||
DispatchEvent(self._dispatcher,TX_GameEvent.EventBuGang,evt_data["info"][1],evt_data["info"][2],true )
|
||||
DispatchEvent(self._dispatcher, TX_GameEvent.EventBuGang, evt_data["info"], true)
|
||||
end
|
||||
|
||||
-- 发送放子选择到服务器
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ end
|
|||
function M:OnEventBuGang(evt_data)
|
||||
printlog("OnEventBuGang")
|
||||
pt(evt_data)
|
||||
DispatchEvent(self._dispatcher, TX_GameEvent.EventBuGang, evt_data["info"][1], evt_data["info"][2], true)
|
||||
DispatchEvent(self._dispatcher, TX_GameEvent.EventBuGang, evt_data["info"], true)
|
||||
end
|
||||
|
||||
-- 发送放子选择到服务器
|
||||
|
|
|
|||
|
|
@ -45,19 +45,20 @@ function M:InitView(url)
|
|||
end
|
||||
end
|
||||
|
||||
function M:__BuGang(card1, card2, callback)
|
||||
function M:__BuGang(cardInfo, callback)
|
||||
local _gang_tip_choice = UIPackage.CreateObject("Extend_MJ_LiChuan", "Gang_tip_choice")
|
||||
_gang_tip_choice.visible = true
|
||||
|
||||
local gangcard1 = _gang_tip_choice:GetChild("card1")
|
||||
local gangcard2 = _gang_tip_choice:GetChild("card2")
|
||||
|
||||
|
||||
gangcard1.icon = UIPackage.GetItemURL("Main_Majiang", self:GetPrefix() .. "202_" .. card1)
|
||||
gangcard2.icon = UIPackage.GetItemURL("Main_Majiang", self:GetPrefix() .. "202_" .. card2)
|
||||
|
||||
gangcard1.onClick:Add(function()
|
||||
callback(card1)
|
||||
local list_card = _gang_tip_choice:GetChild("list_card")
|
||||
list_card:SetVirtual()
|
||||
list_card.itemRenderer = function(index, obj)
|
||||
obj.icon = UIPackage.GetItemURL("Main_Majiang", self:GetPrefix() .. "202_" .. cardInfo[index + 1])
|
||||
end
|
||||
list_card.numItems = #cardInfo
|
||||
list_card.onClickItem:Set(function(context)
|
||||
local item = context.data
|
||||
local index = list:GetChildIndex(item)
|
||||
callback(cardInfo[index + 1])
|
||||
end)
|
||||
|
||||
gangcard2.onClick:Add(function()
|
||||
|
|
@ -141,7 +142,7 @@ function M:EventInit()
|
|||
|
||||
_gamectr:AddEventListener(TX_GameEvent.EventBuGang, function(...)
|
||||
local arg = { ... }
|
||||
self:__BuGang(arg[1], arg[2],
|
||||
self:__BuGang(arg[1],
|
||||
function(id)
|
||||
printlog(id)
|
||||
_gamectr:SendGangCard(id)
|
||||
|
|
|
|||
|
|
@ -385,6 +385,7 @@ function M:UpdateFzList(fz, index, show_card)
|
|||
end
|
||||
|
||||
local obj = UIPackage.CreateObjectFromURL('ui://Main_Majiang/' .. comp)
|
||||
print("============================================pengpengpeng", comp)
|
||||
|
||||
local _area_fz_list = self._area_fz_list
|
||||
local _area_outcard_list = self._area_outcard_list
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue