新四人同步
parent
1e614133bb
commit
0b4308616f
|
|
@ -160,7 +160,7 @@ function M:UpdateHandCard(getcard, mp)
|
||||||
if self._view_handCardList.numItems > 0 then
|
if self._view_handCardList.numItems > 0 then
|
||||||
self._view_handCardList:RemoveChildren()
|
self._view_handCardList:RemoveChildren()
|
||||||
end
|
end
|
||||||
if self._view_handCardList.numItems > 0 then
|
if self._view_getCard.numItems > 0 then
|
||||||
self._view_getCard:RemoveChildren()
|
self._view_getCard:RemoveChildren()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -183,7 +183,7 @@ function M:UpdateHandCard(getcard, mp)
|
||||||
btn_card.onTouchBegin:Set(handler(self, self.onTouchBegin))
|
btn_card.onTouchBegin:Set(handler(self, self.onTouchBegin))
|
||||||
btn_card.onTouchMove:Set(handler(self, self.onTouchMove))
|
btn_card.onTouchMove:Set(handler(self, self.onTouchMove))
|
||||||
btn_card.onTouchEnd:Set(handler(self, self.__OnDragEnd))
|
btn_card.onTouchEnd:Set(handler(self, self.__OnDragEnd))
|
||||||
btn_card.onClick:Set(handler(self, self.__OnClickHandCard))
|
-- btn_card.onClick:Set(handler(self, self.__OnClickHandCard))
|
||||||
end
|
end
|
||||||
|
|
||||||
if getcard then
|
if getcard then
|
||||||
|
|
|
||||||
|
|
@ -462,16 +462,16 @@ function M:EventInit()
|
||||||
local liuju = result.liuju
|
local liuju = result.liuju
|
||||||
local data = result.info_list
|
local data = result.info_list
|
||||||
local niao = result.niao
|
local niao = result.niao
|
||||||
if liuju then
|
-- if liuju then
|
||||||
local le = UIPackage.CreateObjectFromURL("ui://Main_Majiang/LiuJu")
|
-- local le = UIPackage.CreateObjectFromURL("ui://Main_Majiang/LiuJu")
|
||||||
self._view:AddChild(le)
|
-- self._view:AddChild(le)
|
||||||
le:Center()
|
-- le:Center()
|
||||||
le:GetTransition("t0"):Play()
|
-- le:GetTransition("t0"):Play()
|
||||||
coroutine.start(function()
|
-- coroutine.start(function()
|
||||||
coroutine.wait(1)
|
-- coroutine.wait(1)
|
||||||
le:Dispose()
|
-- le:Dispose()
|
||||||
end)
|
-- end)
|
||||||
end
|
-- end
|
||||||
self:RemoveCursor()
|
self:RemoveCursor()
|
||||||
if self._clearingView == nil then
|
if self._clearingView == nil then
|
||||||
self._clearingView = EXClearingView.new(self._root_view)
|
self._clearingView = EXClearingView.new(self._root_view)
|
||||||
|
|
@ -515,7 +515,7 @@ function M:EventInit()
|
||||||
self._clearingView = nil
|
self._clearingView = nil
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
self._player_card_info[1]:ShowHuTip()
|
-- self._player_card_info[1]:ShowHuTip()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.ZPResult2, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.ZPResult2, function(...)
|
||||||
|
|
|
||||||
|
|
@ -34,10 +34,9 @@ function M:init()
|
||||||
self._view_handCardList = self._view:GetChild('List_HandCard')
|
self._view_handCardList = self._view:GetChild('List_HandCard')
|
||||||
self._view_FZList = self._view:GetChild('List_FZ')
|
self._view_FZList = self._view:GetChild('List_FZ')
|
||||||
self._view_outCardList = self._view:GetChild('List_OutCard')
|
self._view_outCardList = self._view:GetChild('List_OutCard')
|
||||||
self._view_getCard = self._view:GetChild('Btn_HandCard')
|
self._view_getCard = self._view:GetChild('Comp_HandCard')
|
||||||
|
|
||||||
self._ctr_getCard = self._view:GetController('getCard')
|
self._ctr_getCard = self._view:GetController('getCard')
|
||||||
self._ctr_seletedGet = self._view:GetController('seletedGetCard')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:SetPlayer(p)
|
function M:SetPlayer(p)
|
||||||
|
|
@ -69,15 +68,7 @@ end
|
||||||
|
|
||||||
function M:Clear()
|
function M:Clear()
|
||||||
--self._ctr_state.selectedIndex = 0
|
--self._ctr_state.selectedIndex = 0
|
||||||
self._area_fz_list.x = self._src_fz_list.x
|
|
||||||
self._area_fz_list.y = self._src_fz_list.y
|
|
||||||
self._area_fz_list.width = self._src_fz_list.z
|
|
||||||
self._area_fz_list.height = self._src_fz_list.w
|
|
||||||
|
|
||||||
self._area_fz_list:RemoveChildren(0, -1, true)
|
|
||||||
self._area_handcard_list:RemoveChildren(0, -1, true)
|
|
||||||
self._area_outcard_list:RemoveChildren(0, -1, true)
|
|
||||||
self._mask_liangpai:RemoveChildren(0, -1, true)
|
|
||||||
self._view_handCardList:RemoveChildren(0, -1, true)
|
self._view_handCardList:RemoveChildren(0, -1, true)
|
||||||
self._view_outCardList:RemoveChildren(0, -1, true)
|
self._view_outCardList:RemoveChildren(0, -1, true)
|
||||||
self._view_FZList:RemoveChildren(0, -1, true)
|
self._view_FZList:RemoveChildren(0, -1, true)
|
||||||
|
|
@ -85,7 +76,6 @@ function M:Clear()
|
||||||
|
|
||||||
self._view_handCardList.selectedIndex = -1
|
self._view_handCardList.selectedIndex = -1
|
||||||
self._click_index = self._view_handCardList.selectedIndex
|
self._click_index = self._view_handCardList.selectedIndex
|
||||||
self._ctr_seletedGet.selectedIndex = 0
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取麻将资源前缀
|
-- 获取麻将资源前缀
|
||||||
|
|
@ -185,10 +175,11 @@ function M:UpdateOutCardList(outcard, card_item, cursor)
|
||||||
cursor = cursor or nil
|
cursor = cursor or nil
|
||||||
|
|
||||||
local outCardName = self._viewText_cardInfo['Out_Card']
|
local outCardName = self._viewText_cardInfo['Out_Card']
|
||||||
local outcard
|
|
||||||
|
|
||||||
local outlist = self._player.outcard_list
|
local outlist = self._player.outcard_list
|
||||||
|
|
||||||
|
self._view_outCardList:RemoveChildrenToPool()
|
||||||
|
|
||||||
for i = 0, #outlist - 1 do
|
for i = 0, #outlist - 1 do
|
||||||
local outcard = self._view_outCardList:AddItemFromPool()
|
local outcard = self._view_outCardList:AddItemFromPool()
|
||||||
self:fillCard2(outcard, outCardName, outlist[i + 1])
|
self:fillCard2(outcard, outCardName, outlist[i + 1])
|
||||||
|
|
@ -307,67 +298,67 @@ local function replace_card(obj, prefix)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:ResetCardType()
|
function M:ResetCardType()
|
||||||
local old_card_type = self._current_card_type
|
-- local old_card_type = self._current_card_type
|
||||||
self._current_card_type = DataManager.CurrenRoom.card_type
|
-- self._current_card_type = DataManager.CurrenRoom.card_type
|
||||||
|
|
||||||
--设置3d标志
|
-- --设置3d标志
|
||||||
if self._current_card_type == 2 then
|
-- if self._current_card_type == 2 then
|
||||||
local c3d = self._view:GetController('3d')
|
-- local c3d = self._view:GetController('3d')
|
||||||
if c3d ~= nil then
|
-- if c3d ~= nil then
|
||||||
c3d.selectedIndex = 1
|
-- c3d.selectedIndex = 1
|
||||||
|
|
||||||
self._area_fz_list.x = self._src_fz_list_3d.x
|
-- self._area_fz_list.x = self._src_fz_list_3d.x
|
||||||
self._area_fz_list.y = self._src_fz_list_3d.y
|
-- self._area_fz_list.y = self._src_fz_list_3d.y
|
||||||
self._area_fz_list.width = self._src_fz_list_3d.z
|
-- self._area_fz_list.width = self._src_fz_list_3d.z
|
||||||
self._area_fz_list.height = self._src_fz_list_3d.w
|
-- self._area_fz_list.height = self._src_fz_list_3d.w
|
||||||
end
|
-- end
|
||||||
else
|
-- else
|
||||||
local c3d = self._view:GetController('3d')
|
-- local c3d = self._view:GetController('3d')
|
||||||
if c3d ~= nil then
|
-- if c3d ~= nil then
|
||||||
c3d.selectedIndex = 0
|
-- c3d.selectedIndex = 0
|
||||||
self._area_fz_list.x = self._src_fz_list.x
|
-- self._area_fz_list.x = self._src_fz_list.x
|
||||||
self._area_fz_list.y = self._src_fz_list.y
|
-- self._area_fz_list.y = self._src_fz_list.y
|
||||||
self._area_fz_list.width = self._src_fz_list.z
|
-- self._area_fz_list.width = self._src_fz_list.z
|
||||||
self._area_fz_list.height = self._src_fz_list.w
|
-- self._area_fz_list.height = self._src_fz_list.w
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
|
|
||||||
local change2d = false
|
-- local change2d = false
|
||||||
if old_card_type == 2 and self._current_card_type ~= 2 then
|
-- if old_card_type == 2 and self._current_card_type ~= 2 then
|
||||||
change2d = true
|
-- change2d = true
|
||||||
end
|
-- end
|
||||||
|
|
||||||
local change3d = false
|
-- local change3d = false
|
||||||
if old_card_type ~= 2 and self._current_card_type == 2 then
|
-- if old_card_type ~= 2 and self._current_card_type == 2 then
|
||||||
change3d = true
|
-- change3d = true
|
||||||
end
|
-- end
|
||||||
|
|
||||||
if change2d == false and change3d == false and self._current_card_type ~= 2 then
|
-- if change2d == false and change3d == false and self._current_card_type ~= 2 then
|
||||||
local prefix = self:GetPrefix()
|
-- local prefix = self:GetPrefix()
|
||||||
|
|
||||||
--更新已出牌
|
-- --更新已出牌
|
||||||
for i = 1, self._area_outcard_list.numChildren do
|
-- for i = 1, self._area_outcard_list.numChildren do
|
||||||
local obj = self._area_outcard_list:GetChildAt(i - 1)
|
-- local obj = self._area_outcard_list:GetChildAt(i - 1)
|
||||||
replace_card(obj, prefix)
|
-- replace_card(obj, prefix)
|
||||||
end
|
-- end
|
||||||
|
|
||||||
--更新手牌
|
-- --更新手牌
|
||||||
for i = 1, self._area_handcard_list.numChildren do
|
-- for i = 1, self._area_handcard_list.numChildren do
|
||||||
local obj = self._area_handcard_list:GetChildAt(i - 1)
|
-- local obj = self._area_handcard_list:GetChildAt(i - 1)
|
||||||
replace_card(obj, prefix)
|
-- replace_card(obj, prefix)
|
||||||
end
|
-- end
|
||||||
|
|
||||||
--更新放子牌
|
-- --更新放子牌
|
||||||
for i = 1, self._area_fz_list.numChildren do
|
-- for i = 1, self._area_fz_list.numChildren do
|
||||||
local com = self._area_fz_list:GetChildAt(i - 1)
|
-- local com = self._area_fz_list:GetChildAt(i - 1)
|
||||||
for j = 1, 4 do
|
-- for j = 1, 4 do
|
||||||
local obj = com:GetChild('card_' .. j)
|
-- local obj = com:GetChild('card_' .. j)
|
||||||
if obj then
|
-- if obj then
|
||||||
replace_card(obj, prefix)
|
-- replace_card(obj, prefix)
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,26 @@ end
|
||||||
|
|
||||||
function M:init()
|
function M:init()
|
||||||
MJPlayerCardInfoView.init(self)
|
MJPlayerCardInfoView.init(self)
|
||||||
|
|
||||||
|
self._view_getCard = self._view:GetChild('Btn_HandCard')
|
||||||
|
self._ctr_seletedGet = self._view:GetController('seletedGetCard')
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:ShowHuTip(card_list)
|
||||||
|
printlog("ShowHuTip")
|
||||||
|
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui,
|
||||||
|
DataManager.CurrenRoom.room_config.Laizi)
|
||||||
|
pt(tingList)
|
||||||
|
if #tingList > 0 then
|
||||||
|
if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then
|
||||||
|
for i = 1, #DataManager.CurrenRoom.laiziInfo do
|
||||||
|
if IsHasDictionary(DataManager.CurrenRoom.laiziInfo[i], tingList) == false then
|
||||||
|
table.insert(tingList, DataManager.CurrenRoom.laiziInfo[i])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
self._mainView._hu_tip:FillData(tingList)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:UpdateHandCard(getcard, mp)
|
function M:UpdateHandCard(getcard, mp)
|
||||||
|
|
@ -73,7 +93,7 @@ function M:UpdateHandCard(getcard, mp)
|
||||||
btn_card.onTouchBegin:Set(handler(self, self.onTouchBegin))
|
btn_card.onTouchBegin:Set(handler(self, self.onTouchBegin))
|
||||||
btn_card.onTouchMove:Set(handler(self, self.onTouchMove))
|
btn_card.onTouchMove:Set(handler(self, self.onTouchMove))
|
||||||
btn_card.onTouchEnd:Set(handler(self, self.__OnDragEnd))
|
btn_card.onTouchEnd:Set(handler(self, self.__OnDragEnd))
|
||||||
btn_card.onClick:Set(handler(self, self.__OnClickHandCard))
|
-- btn_card.onClick:Set(handler(self, self.__OnClickHandCard))
|
||||||
end
|
end
|
||||||
|
|
||||||
if getcard then
|
if getcard then
|
||||||
|
|
@ -207,6 +227,8 @@ end
|
||||||
|
|
||||||
function M:Clear()
|
function M:Clear()
|
||||||
MJPlayerCardInfoView.Clear(self)
|
MJPlayerCardInfoView.Clear(self)
|
||||||
|
|
||||||
|
self._ctr_seletedGet.selectedIndex = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue