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