master
lingmeng 2025-12-19 19:58:45 +08:00
parent 231d217972
commit 0d80ad593d
15 changed files with 285 additions and 417 deletions

View File

@ -1,128 +1,25 @@
local CardCheck = {
cardList = {},
cardListSord = {},
cardNum = 0,
cardSize = 0,
long = false,
planeNoBelt = false,
threeNoBelt = false,
planelack = false,
threelack = false,
fourDaiThree = false,
fristCard = true,
haveRuleCard = false,
tipCardList = {},
touchCardSet = {},
touchCardMao = {}
}
local CardType = {
one = 1,
long = 2,
dui = 3,
duiLong = 10,
threeAndTwo = 4,
normolPlant = 5,
zha = 6,
onlyThree = 7,
onlyPlant = 8,
zhaAndThreee = 9,
lessThree = 11,
lessPlant = 12
}
local M = CardCheck
function M:InitFlag()
local config = DataManager.CurrenRoom.room_config.config
self.planeNoBelt = config.planeNoBelt == 1
self.threeNoBelt = config.threeNoBelt == 1
self.planelack = config.planelack == 1
self.threelack = config.threelack == 1
self.fourDaiThree = config.fourDaiThree
self.rule = config.rule
self._flag_fristCard = true
print("==============================lingmengcheckinitFlag")
pt(config)
pt(self)
return self
end
function M:InitLastCard(cardList, mustPutMaxCard)
function M:InitLastCard(cardList)
self._flag_fristCard = false
self:Clear()
self._flag_mustMax = mustPutMaxCard
self.type = 0
self.specilCard = {}
self.lastCardNum = #cardList
self._flag_allCards = false
self._flag_checkLst = true
if #cardList == 0 then
self._flag_fristCard = true
return
end
table.sort(cardList)
pt(cardList)
self.lastMinCard = math.floor(cardList[1] / 10)
local temp_long = 0
for i = 1, #cardList do
local number = math.floor(cardList[i] / 10)
if self.cardList[number] then
self.cardList[number] = self.cardList[number] + 1
else
self.cardList[number] = 1
self.cardSize = self.cardSize + 1
table.insert(self.cardListSord, number)
end
self.cardNum = self.cardNum + 1
if i == 1 then
temp_long = 1
elseif temp_long == i - 1 then
if math.abs(math.floor(cardList[i - 1] / 10) - number) == 1 then
temp_long = i
end
end
end
self.long = temp_long == self.cardNum and self.cardNum >= 5
print("lingmengCheckAloneOrLong2")
if self:CheckAloneOrLong() then
self.type = self:CheckAloneOrLong()
return
end
print("lingmengCheckDuiZi2")
if self:CheckDuiZi() then
self.type = self:CheckDuiZi()
return
end
print("lingmengCheckSanDai2")
if self:CheckSanDai() then
local a, b, c = self:CheckSanDai()
self.type = a
if b then
self.specilCard = b
end
if c then
self.lastMinCard = c
end
return
end
print("lingmengCheckZha2")
if self:CheckZha() then
local a, b, c = self:CheckZha()
self.type = a
if b then
self.specilCard = b
end
if c then
self.lastMinCard = c
end
return
end
if self.type == 0 then
-- ViewUtil.ErrorTip(-1, "上一份牌型判断错误")
end
end

View File

@ -241,17 +241,10 @@ function M:OnPlaySuccCheck(evt_data)
local remain = evt_data["remain"] -- 报单
self._cacheEvent:Enqueue(
function()
local otherList = self:GetOtherSeatList(seat)
local player = self._room:GetPlayerBySeat(seat)
local out_card_list = self:ChangeCodeByFrom(cards, true)
player.hand_count = remain
-- if remain ~= 0 then
self._cardCheck:InitLastCard(out_card_list)
-- end
local card_type, number, length, plan_three_count = self:GetCardListInfo(out_card_list)
player.out_card_list = self:GetSortOutCardList(out_card_list, card_type, number, plan_three_count)
DispatchEvent(self._dispatcher, EXGameEvent.OnPlaySucc, player, remain, card_type, number, otherList,
length, out_card_list)
player.out_card_list = cards
DispatchEvent(self._dispatcher, EXGameEvent.OnPlaySucc, player, remain)
end
)
end

View File

@ -600,13 +600,19 @@ function M:EventInit()
end)
if self._room.ming_card ~= nil then
self._view:GetTransition("t" .. index):Play()
self._room.ming_card = nil
if self.tween ~= nil then
TweenUtils.Kill(self.tween)
self.tween = nil
end
-- if self._room.ming_card ~= nil then
-- self._view:GetTransition("t" .. index):Play()
-- self._room.ming_card = nil
-- if self.tween ~= nil then
-- TweenUtils.Kill(self.tween)
-- self.tween = nil
-- end
-- end
--出牌权和前端出牌提示挪到转向协议
local lastCardList = self._gamectr:GetLastCardList(self._room.self_player.seat)
if index == 1 then
card_info:ShowOutCardOption2(lastCardList, 1)
end
end)
@ -628,11 +634,6 @@ function M:EventInit()
local arg = { ... }
local p = arg[1]
local card_number = arg[2]
local cardstype = arg[3]
local num = arg[4]
local otherList = arg[5]
local length = arg[6]
local lastCardList = arg[7]
self.ctr_time.selectedIndex = 0
local index = self:GetPos(p.seat)
if index == 1 then
@ -649,54 +650,12 @@ function M:EventInit()
head_info._view:GetChild("shengyu").text = card_number
end
end
head_info:SetBaoDan(card_number == 1)
local card_info = self._player_card_info[index]
card_info:SetOutCardInfo(p.out_card_list, false, true)
card_info._ctr_time_clock.selectedIndex = 0
for i = 1, #otherList do
local other_seat = otherList[i]
local other_card_info = self._player_card_info[self:GetPos(other_seat)]
other_card_info:SetOutCardBlack()
end
if index == 1 then
card_info:DeleteHandCards(p.out_card_list)
else
-- card_info:SetRemainCardNumber(card_number == 1)
--card_info:UpdateHandPoker(card_number,false,false) -- todo
end
-- if self._room.is_new_bout == true then
-- for i = 1, #self._room.player_list do
-- local player = self._room.player_list[i]
-- local card_info_i = self._player_card_info[self:GetPos(player.seat)]
-- if p.seat ~= player.seat then
-- card_info_i:SetOutCardInfo(nil, false)
-- end
-- end
-- self:_Effect(cardstype, p)
-- else
-- if cardstype == 11 and cardstype ~= 12 then
-- self:_Effect(cardstype, p)
-- end
-- end
self:_Effect(self._cardCheck.type, p)
print("lingmeng end _Effect", self._cardCheck.type)
self:PlaySound(p.self_user.sex,
self:GetSoundFileName(self._cardCheck.type, num, self._room.is_new_bout))
-- self:PlaySound(p.self_user.sex, self:GetSoundFileName(cardstype, num, self._room.is_new_bout))
if card_number == 1 then
--self:ChangeBgmMusic(2)
self:ChangeBgmMusic(1)
if self._cor_sound ~= nil then
coroutine.stop(self._cor_sound)
end
self._cor_sound = nil
self._cor_sound = coroutine.start(function()
self:PlaySound(p.self_user.sex, "card_1")
end)
end
end)
_gamectr:AddEventListener(EXGameEvent.OnCheckCard, function(...)
@ -791,7 +750,7 @@ function M:EventInit()
local arg = { ... }
local error_str = arg[1]
self._player_card_info[1]:ErrorTip(error_str)
-- self._player_card_info[1]:ResetPoker()
self._player_card_info[1]:UpdateHandCardsPos()
end)
_gamectr:AddEventListener(EXGameEvent.OnPiaoTips, function(...)
@ -844,36 +803,36 @@ function M:EventInit()
end)
_gamectr:AddEventListener(EXGameEvent.OnOptions, function(...)
local arg = { ... }
local play = arg[1]
local pass = arg[5]
local card_type = arg[2]
local card_number = arg[3]
local card_length = arg[4]
local lastCardList = arg[6]
local ctr_number = pass == nil and 2 or 1
self.caozuo = 1 --记录是否是自己出牌的阶段
self.pass = pass
local m = false
local next_seat = self._room.self_player.seat + 1
local card_info = self._player_card_info[1]
card_info:SetOutCardInfo(nil, false)
if self.MypokerList ~= nil then
-- body
card_info:Clear()
card_info:InitPoker(self.MypokerList, false)
self.MypokerList = nil
end
if next_seat > self._room.room_config.people_num then
next_seat = next_seat - self._room.room_config.people_num
end
if self._room:GetPlayerBySeat(next_seat).hand_count == 1 and self._room.room_config.WillBeOut == 1 then
m = true
end
local zdts = self._view:GetController("zidongtishi").selectedIndex
-- self._player_card_info[1]._cardCheck:InitLastCard(lastCardList)
-- self._player_card_info[1]:ShowOutCardOption(ctr_number, card_type, card_number, card_length, m, play, zdts)
card_info:ShowOutCardOption2(lastCardList, ctr_number, m)
-- local arg = { ... }
-- local play = arg[1]
-- local pass = arg[5]
-- local card_type = arg[2]
-- local card_number = arg[3]
-- local card_length = arg[4]
-- local lastCardList = arg[6]
-- local ctr_number = pass == nil and 2 or 1
-- self.caozuo = 1 --记录是否是自己出牌的阶段
-- self.pass = pass
-- local m = false
-- local next_seat = self._room.self_player.seat + 1
-- local card_info = self._player_card_info[1]
-- card_info:SetOutCardInfo(nil, false)
-- if self.MypokerList ~= nil then
-- -- body
-- card_info:Clear()
-- card_info:InitPoker(self.MypokerList, false)
-- self.MypokerList = nil
-- end
-- if next_seat > self._room.room_config.people_num then
-- next_seat = next_seat - self._room.room_config.people_num
-- end
-- if self._room:GetPlayerBySeat(next_seat).hand_count == 1 and self._room.room_config.WillBeOut == 1 then
-- m = true
-- end
-- local zdts = self._view:GetController("zidongtishi").selectedIndex
-- -- self._player_card_info[1]._cardCheck:InitLastCard(lastCardList)
-- -- self._player_card_info[1]:ShowOutCardOption(ctr_number, card_type, card_number, card_length, m, play, zdts)
-- card_info:ShowOutCardOption2(lastCardList, ctr_number, m)
end)
-- 托管
_gamectr:AddEventListener(EXGameEvent.Game_TuoGuan, function(...)
@ -1187,6 +1146,7 @@ function M:ReConnectForStart()
-- body
head_info._view:GetChild("shengyu").text = player.hand_count
end
if player.seat == self._room.self_player.seat then
if player.open ~= nil and player.open == 0 and self._room.room_config.people_num == 3 and self._room.room_config.fangzuobi == 1 then
-- body
@ -1195,10 +1155,16 @@ function M:ReConnectForStart()
else
player_card_info:InitPoker(player.hand_list, false)
end
if not player.out_card_list or #player.out_card_list == 0 or player.out_card_list[1] == 0 then
player_card_info:SetOutCardInfo(nil, false)
else
player_card_info:SetOutCardInfo(player.out_card_list, false)
end
else
-- player_card_info:SetRemainCardNumber(player.hand_count == 1)
if player.hand_count == 1 then
-- self.bgm_index = 2
if not player.out_card_list or #player.out_card_list == 0 or player.out_card_list[1] == 0 then
player_card_info:SetOutCardInfo(nil, true)
else
player_card_info:SetOutCardInfo(player.out_card_list, false)
end
end
if self._room.curren_turn_seat == player.seat then
@ -1206,11 +1172,11 @@ function M:ReConnectForStart()
player_card_info._ctr_time_clock.selectedIndex = 1
self._tex_leftTime = player_card_info._view_comp_clock
self._left_time = 15
-- if player.out_card_list[1] == 0 then
player_card_info:SetOutCardInfo(nil, false)
-- else
-- player_card_info:SetOutCardInfo(player.out_card_list, false)
-- end
if player.seat == self._room.self_player.seat then
local lastCardList = self._gamectr:GetLastCardList(self._room.self_player.seat)
player_card_info:ShowOutCardOption2(lastCardList, 1)
end
else
-- head_info:MarkBank(true)
end

View File

@ -159,30 +159,41 @@ function M:SetOutCardInfo(cardlist, isPass, isAnim)
end
else
self.ctr_outpoker.selectedIndex = 1
if isAnim then
if self.move_cor then
coroutine.stop(self.move_cor)
self.move_cor = nil
end
for i = 1, #cardlist do
-- if isAnim then
-- if self.move_cor then
-- coroutine.stop(self.move_cor)
-- self.move_cor = nil
-- end
-- for i = 1, #cardlist do
-- local poker_item = self._view_Out:AddItemFromPool()
-- local code = self:ChangeCodeByTo(cardlist[i])
-- self:FillPoker(poker_item, "", cardlist[i])
-- end
-- self.move_cor = coroutine.start(function()
-- coroutine.wait(0.1)
-- ViewUtil.PlaySound("DuoDuo_PK", "extend/poker/duoduo/sound/chupai.mp3")
-- end)
-- else
local showOneCard
for i = 1, #cardlist do
if cardlist[i] % 100 < 3 then
local poker_item = self._view_Out:AddItemFromPool()
local code = self:ChangeCodeByTo(cardlist[i])
self:FillPoker(poker_item, "", cardlist[i])
end
self.move_cor = coroutine.start(function()
coroutine.wait(0.1)
ViewUtil.PlaySound("DuoDuo_PK", "extend/poker/duoduo/sound/chupai.mp3")
end)
else
for i = 1, #cardlist do
local poker_item = self._view_Out:AddItemFromPool()
local code = self:ChangeCodeByTo(cardlist[i])
self:FillPoker(poker_item, "", cardlist[i])
self:FillPoker2(poker_item, cardlist[i])
else
showOneCard = cardlist[i]
end
end
if showOneCard then
local poker_item = self._view_Out:AddItemFromPool()
self:FillPoker2(poker_item, showOneCard)
self._view:GetChild('text_paiNum').text = string.format("X%s", #cardlist)
else
printlog("error 190", "除了鬼牌没有其他牌")
end
self._view_Out:ResizeToFit(self._view_Out.numItems)
-- end
end
end

View File

@ -179,58 +179,7 @@ function M:InitPoker(pokerList, isPlayAni, open)
self.newCard_list[pokerList[i] % 100][math.floor(pokerList[i] / 100)] = (self.newCard_list[pokerList[i] % 100][math.floor(pokerList[i] / 100)] or 0) +
1
end
local maxHeight = 0
for k, v in pairs(self.newCard_list) do
local btn_cardListFather = self._view_handCard:AddItemFromPool()
btn_cardListFather.width = self.scaleW
-- btn_cardListFather.height = scaleH*12
local btn_cardList = btn_cardListFather:GetChild('list')
self.linegap = btn_cardList.lineGap
local tmpHeight = 0
for k1, v1 in pairs(v) do
local card_number_code = k * 10 + k1
local card_flower_code = k1 * 100 + k
if v1 ~= 4 then
for i = 1, v1 do
local btn_card = btn_cardList:AddItemFromPool()
btn_card.height = self.scaleH
self:FillPoker2(btn_card, card_flower_code)
-- self.cards_view:AddChild(btn_card)
local card_view = NewCardView(btn_card, card_number_code, card_flower_code)
card_view.fatherList = btn_cardList
self.card_list[#self.card_list + 1] = card_view
btn_card.data = card_view
tmpHeight = tmpHeight + 1
end
else
local btn_card = btn_cardList:GetFromPool('')
btn_cardList:AddChildAt(btn_card, 0)
btn_card.height = self.scaleH
self:FillPoker2(btn_card, card_flower_code, "_z")
-- self.cards_view:AddChild(btn_card)
local card_view = NewCardView(btn_card, card_number_code, card_flower_code)
card_view.fatherList = btn_cardList
card_view.zha = true
self.card_list[#self.card_list + 1] = card_view
btn_card.data = card_view
tmpHeight = tmpHeight + 1
end
end
if tmpHeight > maxHeight then
maxHeight = tmpHeight
end
end
self._view:GetChild('n82').y = self._view_handCard.height -
(self.scaleH + (self.scaleH + self.linegap) * (maxHeight - 1) + 50)
table.sort(self.card_list, tableSortNumber)
self:AddTouchMoveEvent(self._view_handCard)
for i = 1, #self.card_list do
local card = self.card_list[i]
if open ~= 1 then
-- body
self:AddCardTouchEvent(card)
end
end
self:UpdateHandCardsPos()
end
end
@ -281,9 +230,7 @@ function M:AddCardTouchEvent(card)
table.insert(self._SendCards, oncard.data.card_code_flower)
end
end
pt("lingmeng SendCards", self._SendCards)
local xy = self.touchCard.fatherList:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y))
printlog("lingmeng card.btn_card.xy", card.btn_card.xy.x, card.btn_card.xy.y)
self.touchBegin = xy - card.btn_card.xy
Stage.inst.onTouchMove:Add(self.touchMoveFun)
Stage.inst.onTouchEnd:Add(self.touchMoveEndFun)
@ -358,30 +305,57 @@ function M:TouchMoving(context)
end
function M:TouchMoveEnd(context)
printlog("lingmeng chupai end")
local linexy = self._view_handCard:GlobalToLocal(Vector2.New(context.inputEvent.x,
context.inputEvent.y))
if linexy.y < self._view:GetChild('n82').y then
local allcards = {}
for i, v in ipairs(self.card_list) do
table.insert(allcards, v.card_code_flower)
end
self.gameCtr:SendCard(self._SendCards, allcards)
else
for i = self.touchIndex, 0, -1 do
local oncard = self.touchCard.fatherList:GetChildAt(i)
oncard.xy = Vector2.New(0, self.touchCard.fatherList.height)
local allcards = {}
for k, v in pairs(self.newCard_list) do
for k1, v1 in pairs(v) do
if v1 > 0 then
for i = 1, v1 do
local card_flower_code = k1 * 100 + k
table.insert(allcards, card_flower_code)
end
end
end
end
if linexy.y < self._view:GetChild('n82').y then
self.gameCtr:SendCard(self._SendCards, allcards)
else
if self.touchCard.card_code_flower % 100 < 3 then
for i = self._view_handCard.numItems - 1, 0, -1 do
local oneCardList = self._view_handCard:GetChildAt(i):GetChild('list')
local listxy = oneCardList:GlobalToLocal(Vector2.New(context.inputEvent.x,
context.inputEvent.y))
if listxy.x > 0 and oneCardList:GetChildAt(0).data.card_code_flower % 100 > 2 then
for i = 0, oneCardList.numItems - 1 do
local oncard = oneCardList:GetChildAt(i)
if oncard.data.zha then
for j = 1, 4 do
table.insert(self._SendCards, oncard.data.card_code_flower)
end
else
table.insert(self._SendCards, oncard.data.card_code_flower)
end
end
self.gameCtr:SendCard(self._SendCards, allcards)
break
end
end
end
end
for i = 0, self.touchIndex do
local oncard = self.touchCard.fatherList:GetChildAt(i)
self:SetBtnCardColor(oncard.data, 0)
oncard.xy = Vector2.New(0, (self.scaleH + self.linegap) * i)
end
-- local fristCard = self._view_handCard:GetChildAt(0)
-- local CardWidth = fristCard.width
-- local columnGap = self._view_handCard.columnGap
-- local oneCardWidth = CardWidth + columnGap
-- local xy = fristCard:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y))
-- local downCards = #self.card_list
-- Stage.inst.onTouchMove:Remove(self.touchMoveFun)
-- Stage.inst.onTouchEnd:Remove(self.touchMoveEndFun)
Stage.inst.onTouchMove:Remove(self.touchMoveFun)
Stage.inst.onTouchEnd:Remove(self.touchMoveEndFun)
-- local max_x
-- local min_x
@ -471,22 +445,22 @@ function M:HidePiao()
end
function M:ShowOutCardOption2(lastCardList, ctr_select, mustPutMaxCard)
self._cardCheck:InitLastCard(lastCardList, mustPutMaxCard)
self._cardCheck:CheckOutCard(self.card_list)
self.tips_card_list = self._cardCheck:GetTipsList()
self.touchCardSet = self._cardCheck:GetTouchSet()
self.touchCardMap = self._cardCheck:GetTouchCardMap()
self.tips_click_count = 0
-- self._cardCheck:InitLastCard(lastCardList, mustPutMaxCard)
-- self._cardCheck:CheckOutCard(self.card_list)
-- self.tips_card_list = self._cardCheck:GetTipsList()
-- self.touchCardSet = self._cardCheck:GetTouchSet()
-- self.touchCardMap = self._cardCheck:GetTouchCardMap()
-- self.tips_click_count = 0
print("lingmengShowOutCardOption2", #self.touchCardSet)
pt(self.touchCardSet)
pt(self.touchCardMap)
-- body --在这个方法里添加判断抬起牌是否符合出牌类型(少跑一次手牌循环)
self:UpdateHandCardsColor()
-- print("lingmengShowOutCardOption2", #self.touchCardSet)
-- pt(self.touchCardSet)
-- pt(self.touchCardMap)
-- -- body --在这个方法里添加判断抬起牌是否符合出牌类型(少跑一次手牌循环)
-- self:UpdateHandCardsColor()
if #self.tips_card_list == 1 then
self:ShowTipsCard(1)
end
-- if #self.tips_card_list == 1 then
-- self:ShowTipsCard(1)
-- end
self.ctr_put_card_option.selectedIndex = ctr_select
end
@ -549,31 +523,29 @@ function M:SetOutCardInfo(cardlist, isPass, isAnim)
end
else
self.ctr_outpoker.selectedIndex = 1
if isAnim then
if self.move_cor then
coroutine.stop(self.move_cor)
self.move_cor = nil
end
-- if isAnim then
-- if self.move_cor then
-- coroutine.stop(self.move_cor)
-- self.move_cor = nil
-- end
for i = 1, #cardlist do
local poker_item = self._view_Out:AddItemFromPool()
local code = self:ChangeCodeByTo(cardlist[i])
-- for i = 1, #cardlist do
-- local poker_item = self._view_Out:AddItemFromPool()
-- local code = self:ChangeCodeByTo(cardlist[i])
self:FillPoker(poker_item, "", cardlist[i])
end
self.move_cor = coroutine.start(function()
coroutine.wait(0.1)
ViewUtil.PlaySound("DuoDuo_PK", "extend/poker/duoduo/sound/chupai.mp3")
end)
else
for i = 1, #cardlist do
local poker_item = self._view_Out:AddItemFromPool()
-- self:FillPoker(poker_item, "", cardlist[i])
-- end
-- self.move_cor = coroutine.start(function()
-- coroutine.wait(0.1)
-- ViewUtil.PlaySound("DuoDuo_PK", "extend/poker/duoduo/sound/chupai.mp3")
-- end)
-- else
for i = 1, #cardlist do
local poker_item = self._view_Out:AddItemFromPool()
local code = self:ChangeCodeByTo(cardlist[i])
self:FillPoker(poker_item, "", cardlist[i])
end
self:FillPoker2(poker_item, cardlist[i])
end
-- end
end
end
@ -711,13 +683,23 @@ end
function M:DeleteHandCards(cardlist)
self.ctr_put_card_option.selectedIndex = 0
for i = 1, #cardlist do
local card_code_number = cardlist[i]
for j = 1, #self.card_list do
local card = self.card_list[j]
if card_code_number == card.card_code_number then
list_remove(self.card_list, card)
self._view_handCard:RemoveChild(card.btn_card, true)
break
local tmpNum = nil
if self.newCard_list[cardlist[i] % 100] then
tmpNum = self.newCard_list[cardlist[i] % 100][math.floor(cardlist[i] / 100)]
end
if tmpNum then
if tmpNum == 1 then
self.newCard_list[cardlist[i] % 100][math.floor(cardlist[i] / 100)] = nil
else
self.newCard_list[cardlist[i] % 100][math.floor(cardlist[i] / 100)] = tmpNum - 1
end
else
ViewUtil:ErrorTip("牌型出错,重新加载页面")
ViewManager.refreshGameView()
end
if i == #cardlist then
if #self.newCard_list[cardlist[i] % 100] == 0 then
self.newCard_list[cardlist[i] % 100] = nil
end
end
end
@ -725,13 +707,56 @@ function M:DeleteHandCards(cardlist)
end
function M:UpdateHandCardsPos()
for i = 1, #self.card_list do
local card_view = self.card_list[i]
card_view.index = i
card_view.btn_card.touchable = true
self:UpdateCardMove(card_view.btn_card, false, false)
self:SetBtnCardColor(card_view, 0)
local maxHeight = 0
self._view_handCard:RemoveChildrenToPool()
self._newCardSize = {}
for k, v in pairs(self.newCard_list) do
local btn_cardListFather = self._view_handCard:AddItemFromPool()
btn_cardListFather.width = self.scaleW
-- btn_cardListFather.height = scaleH*12
local btn_cardList = btn_cardListFather:GetChild('list')
btn_cardList:RemoveChildrenToPool()
self.linegap = btn_cardList.lineGap
local tmpHeight = 0
for k1, v1 in pairs(v) do
local card_number_code = k * 10 + k1
local card_flower_code = k1 * 100 + k
if v1 ~= 4 then
for i = 1, v1 do
local btn_card = btn_cardList:AddItemFromPool()
btn_card.height = self.scaleH
self:FillPoker2(btn_card, card_flower_code)
-- self.cards_view:AddChild(btn_card)
local card_view = NewCardView(btn_card, card_number_code, card_flower_code)
card_view.fatherList = btn_cardList
self.card_list[#self.card_list + 1] = card_view
btn_card.data = card_view
tmpHeight = tmpHeight + 1
self:AddCardTouchEvent(card_view)
end
else
local btn_card = btn_cardList:GetFromPool('')
btn_cardList:AddChildAt(btn_card, 0)
btn_card.height = self.scaleH
self:FillPoker2(btn_card, card_flower_code, "_z")
-- self.cards_view:AddChild(btn_card)
local card_view = NewCardView(btn_card, card_number_code, card_flower_code)
card_view.fatherList = btn_cardList
card_view.zha = true
self.card_list[#self.card_list + 1] = card_view
btn_card.data = card_view
tmpHeight = tmpHeight + 1
self:AddCardTouchEvent(card_view)
end
self._newCardSize[k1] = tmpHeight
end
if tmpHeight > maxHeight then
maxHeight = tmpHeight
end
end
self._view:GetChild('n82').y = self._view_handCard.height -
(self.scaleH + (self.scaleH + self.linegap) * (maxHeight - 1) + 50)
end
function M:ResetPoker()
@ -848,6 +873,7 @@ function M:BtnEvent()
-- 过
self.btn_not_put.onClick:Set(
function()
self.ctr_put_card_option.selectedIndex = 0
self.gameCtr:SendPass()
end
)

View File

@ -161,7 +161,7 @@ function M:FillRoomData(s2croom)
p.outCards = info_list[i]["outCards"]
local last_outcard = info_list[i]["last_outcard"]
if last_outcard ~= nil and last_outcard[1] ~= 0 then
local out_card_list = _ctr_game:ChangeCodeByFrom(last_outcard.card_list, true)
local out_card_list = last_outcard.card_list
local card_type, number, length, plan_three_count = _ctr_game:GetCardListInfo(out_card_list)
p.out_card_list = _ctr_game:GetSortOutCardList(out_card_list, card_type, number, plan_three_count)
else

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="2532,1170" designImageAlpha="100" designImageLayer="1">
<controller name="state" pages="0,准备状态,1,游戏状态,2,,3,回放,4,观战" selected="0"/>
<controller name="state" pages="0,准备状态,1,游戏状态,2,,3,回放,4,观战" selected="1"/>
<controller name="sdk" pages="0,,1," selected="0"/>
<controller name="action" pages="2,空,0,准备,1,开始" selected="0"/>
<controller name="time" pages="0,,1,,2,,3,,4," selected="0"/>
@ -34,41 +34,41 @@
<gearDisplay controller="state" pages="1"/>
</component>
<graph id="n102_t2e2" name="n109" xy="342,-1343" size="1670,834" visible="false" type="rect" lineSize="0" fillColor="#80000000"/>
<component id="n7" name="player_info1" src="g6uw74" fileName="Main_New/PlayerHead_1.xml" xy="18,772" size="157,131" group="n121_ckvb">
<component id="n7" name="player_info1" src="g6uw74" fileName="Main_New/PlayerHead_1.xml" xy="18,586" size="157,131" group="n121_ckvb">
<gearXY controller="state" pages="0,1,2,3" values="18,772|18,586|80,495|9,721" default="18,586"/>
<relation target="" sidePair="left-left,bottom-bottom"/>
</component>
<component id="n18" name="player_info2" src="g6uw7w" fileName="Main_New/PlayerHead_2.xml" xy="1789,63" size="156,126" group="n121_ckvb">
<gearXY controller="state" pages="0,1,2,3" values="1789,63|2359,17|2336,32|2372,4" default="2359,17"/>
<component id="n18" name="player_info2" src="g6uw7w" fileName="Main_New/PlayerHead_2.xml" xy="2029,137" size="156,126" group="n121_ckvb">
<gearXY controller="state" pages="0,1,2,3" values="1789,63|2029,137|2336,32|2372,4" default="2359,17"/>
<relation target="" sidePair="right-right,middle-middle"/>
</component>
<component id="n156_11k4t" name="player_info3" src="g6uw8q" fileName="Main_New/PlayerHead_3.xml" xy="898,22" size="156,126" group="n121_ckvb">
<gearXY controller="state" pages="0,1,2,3" values="898,22|18,17|2336,32|21,16" default="18,17"/>
<component id="n156_11k4t" name="player_info3" src="g6uw8q" fileName="Main_New/PlayerHead_3.xml" xy="1098,47" size="156,126" group="n121_ckvb">
<gearXY controller="state" pages="0,1,2,3" values="898,22|1098,47|2336,32|21,16" default="18,17"/>
<relation target="" sidePair="right-right,middle-middle"/>
</component>
<component id="n174_g6uw" name="player_info4" src="g6uw8q" fileName="Main_New/PlayerHead_3.xml" xy="92,55" size="156,126" group="n121_ckvb">
<gearXY controller="state" pages="0,1,2,3" values="92,55|18,17|2336,32|21,16" default="18,17"/>
<component id="n174_g6uw" name="player_info4" src="g6uw8q" fileName="Main_New/PlayerHead_3.xml" xy="58,97" size="156,126" group="n121_ckvb">
<gearXY controller="state" pages="0,1,2,3" values="92,55|58,97|2336,32|21,16" default="18,17"/>
<relation target="" sidePair="right-right,middle-middle"/>
</component>
<group id="n121_ckvb" name="playiinfo" xy="18,17" size="2497,700"/>
<group id="n121_ckvb" name="playiinfo" xy="18,47" size="2167,670"/>
<component id="n69_sdax" name="player_card_info_1" src="g6uw81" fileName="Main_New/Player_card_info_1.xml" xy="250,509" group="n122_ckvb">
<gearDisplay controller="state" pages="1,3,4"/>
<gearLook controller="state" pages="3" values="1,0,0,1" default="1,0,0,1"/>
<relation target="" sidePair="width-width,center-center,bottom-bottom"/>
</component>
<component id="n71_sdax" name="player_card_info_2" src="g6uw8k" fileName="Main_New/Player_card_info_2.xml" xy="85,281" group="n122_ckvb" scale="0.9,0.9" touchable="false">
<component id="n71_sdax" name="player_card_info_2" src="g6uw8k" fileName="Main_New/Player_card_info_2.xml" xy="2208,115" size="228,157" group="n122_ckvb" scale="0.9,0.9" touchable="false">
<gearDisplay controller="state" pages="1,3,4"/>
<relation target="n18" sidePair="right-left,middle-middle"/>
</component>
<component id="n157_11k4t" name="player_card_info_3" src="g6uw8r" fileName="Main_New/Player_card_info_3.xml" xy="-278,310" group="n122_ckvb" scale="0.9,0.9" touchable="false">
<component id="n157_11k4t" name="player_card_info_3" src="g6uw8r" fileName="Main_New/Player_card_info_3.xml" xy="1582,44" size="183,157" group="n122_ckvb" scale="0.9,0.9" touchable="false">
<gearDisplay controller="state" pages="1,3,4"/>
<relation target="n18" sidePair="right-left,middle-middle"/>
</component>
<component id="n175_g6uw" name="player_card_info_4" src="g6uw8r" fileName="Main_New/Player_card_info_3.xml" xy="-42,1221" group="n122_ckvb" scale="0.9,0.9" touchable="false">
<component id="n175_g6uw" name="player_card_info_4" src="g6uw8r" fileName="Main_New/Player_card_info_3.xml" xy="558,115" size="201,157" group="n122_ckvb" scale="0.9,0.9" touchable="false">
<gearDisplay controller="state" pages="1,3,4"/>
<relation target="n18" sidePair="right-left,middle-middle"/>
</component>
<group id="n122_ckvb" name="playCardInfo" xy="250,235" size="2165,1097"/>
<group id="n122_ckvb" name="playCardInfo" xy="250,44" size="2186,1265"/>
<component id="n152_n9qr" name="btn_inviteFamily" src="g6uw8y" fileName="Main_new/Main/Component/btn_normol.xml" xy="2404,264" size="129,243" visible="false">
<gearDisplay controller="state" pages="0"/>
<relation target="" sidePair="right-right"/>

View File

@ -9,13 +9,6 @@
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
</list>
</displayList>
<Button/>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="2031,800" opaque="false" initName="player_card_info">
<controller name="output" pages="0,,1,,2," selected="0"/>
<controller name="out_card_option" homePageType="specific" homePage="1" pages="0,,1,,2," selected="0"/>
<controller name="output" pages="0,,1,,2," selected="1"/>
<controller name="out_card_option" homePageType="specific" homePage="1" pages="0,,1,,2," selected="1"/>
<controller name="put_error" pages="0,,1," selected="0"/>
<controller name="piao" pages="0,,1,,2,,3," selected="0"/>
<controller name="piao_value" pages="0,0,1,1,2,2,3,3,4,5,5,8" selected="0"/>
@ -14,17 +14,13 @@
<list id="n46_sdax" name="out_card_list" xy="190,-748" size="874,256" visible="false" layout="row" colGap="-50" autoItemSize="false" align="center" vAlign="middle">
<gearDisplay controller="output" pages="1"/>
</list>
<component id="n49_g618" name="btn_put" src="g6uw83" fileName="component/Btn_Yellow.xml" xy="-573,398" group="n51_g618" scale="1.1,1.1">
<component id="n49_g618" name="btn_put" src="g6uw83" fileName="component/Btn_Yellow.xml" xy="-573,401" group="n51_g618" scale="1.1,1.1">
<Button icon="ui://kvku0fu4g6uw85"/>
</component>
<component id="n48_g618" name="btn_not_put" src="g6uw83" fileName="component/Btn_Yellow.xml" xy="-1422,395" group="n51_g618" scale="1.1,1.1">
<gearDisplay controller="out_card_option" pages="1"/>
<Button icon="ui://kvku0fu4g6uw86"/>
</component>
<component id="n50_g618" name="btn_tips" src="g6uw83" fileName="component/Btn_Yellow.xml" xy="-982,398" group="n51_g618" scale="1.1,1.1">
<component id="n50_g618" name="btn_tips" src="g6uw83" fileName="component/Btn_Yellow.xml" xy="-982,401" group="n51_g618" scale="1.1,1.1">
<Button icon="ui://kvku0fu4g6uw87"/>
</component>
<group id="n51_g618" name="btn_old" xy="-1422,395" size="1125,131" visible="false" advanced="true">
<group id="n51_g618" name="btn_old" xy="-982,401" size="685,128" visible="false" advanced="true">
<gearDisplay controller="out_card_option" pages="1,2"/>
<relation target="" sidePair="bottom-top,left-right"/>
</group>
@ -80,7 +76,7 @@
<item/>
<item/>
</list>
<list id="n70_ckvb" name="List_Out" xy="260,-311" pivot="0.5,0.5" size="1760,210" layout="row" selectionMode="none" colGap="-101" defaultItem="ui://kvku0fu4g6uw2f" align="center" vAlign="middle">
<list id="n70_ckvb" name="List_Out" xy="152,-181" pivot="0.5,0.5" size="1760,210" layout="row" selectionMode="none" colGap="-101" defaultItem="ui://kvku0fu4g6uw2f" align="center" vAlign="middle">
<gearDisplay controller="output" pages="1"/>
<item/>
<item/>
@ -114,16 +110,22 @@
<component id="n77_n9qr" name="Comp_Clock" src="g6uw1i" fileName="Main_New/Component/Comp_Clock.xml" xy="536,-205" size="174,143">
<gearDisplay controller="time_clock" pages="1"/>
</component>
<image id="n81_g6uw" name="n81" src="g6uwoz" fileName="image/滑动超过此行出牌.png" xy="949,-39"/>
<image id="n82_g6uw" name="n82" src="g6uwoy" fileName="image/Line 50.png" xy="-140,31"/>
<component id="n78_g6m8" name="Btn_SendCard_back" src="g6uw1k" fileName="Main_New/Component/Btn_SendCard.xml" xy="1170,-197" size="384,125" group="n80_g6m8">
<image id="n81_g6uw" name="n81" src="g6uwoz" fileName="image/滑动超过此行出牌.png" xy="824,73" group="n80_g6m8">
<relation target="n82_g6uw" sidePair="center-center,top-bottom"/>
</image>
<image id="n82_g6uw" name="n82" src="g6uwoy" fileName="image/Line 50.png" xy="-140,31" group="n80_g6m8"/>
<component id="n78_g6m8" name="Btn_SendCard_back" src="g6uw1k" fileName="Main_New/Component/Btn_SendCard.xml" xy="1170,-197" size="384,125" group="n80_g6m8" visible="false">
<Button sound=""/>
</component>
<component id="n79_g6m8" name="Btn_Tip_back" src="g6uw1n" fileName="Main_New/Component/Btn_Tip.xml" xy="740,-201" size="384,125" group="n80_g6m8">
<component id="n48_g618" name="btn_not_put" src="g6uw83" fileName="component/Btn_Yellow.xml" xy="877,-125" group="n80_g6m8" scale="1.1,1.1">
<relation target="n82_g6uw" sidePair="center-center,bottom-top"/>
<Button icon="ui://kvku0fu4g6uw86"/>
</component>
<component id="n79_g6m8" name="Btn_Tip_back" src="g6uw1n" fileName="Main_New/Component/Btn_Tip.xml" xy="740,-201" size="384,125" group="n80_g6m8" visible="false">
<Button sound=""/>
</component>
<group id="n80_g6m8" name="btn_back" xy="740,-201" size="814,129" advanced="true">
<gearDisplay controller="out_card_option2" pages="1"/>
<group id="n80_g6m8" name="btn_back" xy="-140,-201" size="2531,320" advanced="true">
<gearDisplay controller="out_card_option" pages="1"/>
</group>
</displayList>
<transition name="score">

View File

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1760,157" opaque="false" initName="player_card_info">
<controller name="output" homePageType="specific" homePage="0" pages="0,,1,,2," selected="0"/>
<controller name="output" homePageType="specific" homePage="0" pages="0,,1,,2," selected="1"/>
<controller name="one_card" pages="0,,1," selected="0"/>
<controller name="resultOut" homePageType="specific" homePage="0" pages="0,,1," selected="0"/>
<controller name="time_clock" pages="0,,1," selected="0"/>
<controller name="out_card_option2" pages="0,,1," selected="1"/>
<controller name="out_card_option2" pages="0,,1," selected="0"/>
<displayList>
<list id="n53_q9cc" name="hand_card_list" xy="-697,-634" size="445,78" visible="false" layout="row" selectionMode="none" overflow="scroll" lineGap="-15" colGap="-25" defaultItem="ui://kvku0fu4g6uw8l" align="right"/>
<component id="n59_8yp0" name="out_card_com" src="g6uw82" fileName="component/poker/hand_poker_con.xml" xy="-640,-632" size="390,179" visible="false"/>
<image id="n47_g618" name="n47" src="g6uw3s" fileName="Main_New/Image/要不起.png" xy="1595,35" size="213,62">
<image id="n47_g618" name="n47" src="g6uw3s" fileName="Main_New/Image/要不起.png" xy="15,35" size="213,62">
<gearDisplay controller="output" pages="2"/>
</image>
<component id="n54_jlqq" name="one_card_eff" src="g6uw8m" fileName="component/effect/one_card_eff/one_card_eff.xml" xy="192,-106">
@ -18,25 +18,15 @@
<text id="n56_8yp0" name="CardNumber" xy="-249,-482" size="114,37" visible="false" fontSize="26" color="#ffffff" align="center" vAlign="middle" autoSize="none" shadowColor="#000000" shadowOffset="1,1" text=""/>
<text id="n58_8yp0" name="area_mask" xy="-898,-1013" size="358,566" visible="false" fontSize="30" autoSize="none" text="{&#xA;&quot;outcard_list&quot;:{&#xA; &quot;parent&quot;:&quot;out_card_com&quot;,&#xA; &quot;obj&quot;:&quot;poker7&quot;,&#xA; &quot;maxcount_x&quot;:8,&#xA; &quot;start_x&quot;:400,&#xA; &quot;start_y&quot;:0&#xA; }&#xA;}"/>
<component id="n60_agiz" name="mask_liangpai" src="g6uw88" fileName="component/Component1.xml" xy="-640,-632" size="5,5" visible="false"/>
<list id="n61_ckvb" name="List_Out" xy="440,27" pivot="0.5,0.5" size="1760,210" layout="row" selectionMode="none" scroll="horizontal" colGap="-101" defaultItem="ui://kvku0fu4g6uw2f" align="center">
<list id="n61_ckvb" name="List_Out" xy="0,0" pivot="0.5,0.5" size="184,210" layout="row" selectionMode="none" scroll="horizontal" colGap="-101" defaultItem="ui://kvku0fu4g6uw2f">
<gearDisplay controller="output" pages="1"/>
<relation target="" sidePair="width-width,height-height"/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
</list>
<text id="n69_t63r" name="text_paiNum" xy="204,55" size="108,80" font="ui://27vd145bej1ib7jgl" fontSize="61" text="X77">
<gearDisplay controller="output" pages="1"/>
<relation target="n61_ckvb" sidePair="left-right"/>
</text>
<list id="n62_ckvb" name="n62" xy="570,-1020" size="200,300" overflow="scroll"/>
<list id="n63_ckvb" name="list_resultOut" xy="548,-26" pivot="0.5,0.5" size="1014,210" layout="flow_hz" lineGap="-90" colGap="-101" defaultItem="ui://kvku0fu4g6uw2f" align="right" autoClearItems="true">
<gearDisplay controller="resultOut" pages="1"/>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1760,157" opaque="false" initName="player_card_info">
<controller name="output" homePageType="specific" homePage="0" pages="0,,1,,2," selected="0"/>
<controller name="output" homePageType="specific" homePage="0" pages="0,,1,,2," selected="2"/>
<controller name="one_card" pages="0,,1," selected="0"/>
<controller name="resultOut" homePageType="specific" homePage="0" pages="0,,1," selected="0"/>
<controller name="time_clock" pages="0,,1," selected="0"/>
@ -8,7 +8,7 @@
<displayList>
<list id="n53_q9cc" name="hand_card_list" xy="-697,-634" size="445,78" visible="false" layout="row" selectionMode="none" overflow="scroll" lineGap="-15" colGap="-25" defaultItem="ui://kvku0fu4g6uw8l" align="right"/>
<component id="n59_8yp0" name="out_card_com" src="g6uw82" fileName="component/poker/hand_poker_con.xml" xy="-640,-632" size="390,179" visible="false"/>
<image id="n47_g618" name="n47" src="g6uw3s" fileName="Main_New/Image/要不起.png" xy="-55,35" size="213,62">
<image id="n47_g618" name="n47" src="g6uw3s" fileName="Main_New/Image/要不起.png" xy="15,35" size="213,62">
<gearDisplay controller="output" pages="2"/>
</image>
<component id="n54_jlqq" name="one_card_eff" src="g6uw8m" fileName="component/effect/one_card_eff/one_card_eff.xml" xy="192,-106">
@ -18,24 +18,10 @@
<text id="n56_8yp0" name="CardNumber" xy="-249,-482" size="114,37" visible="false" fontSize="26" color="#ffffff" align="center" vAlign="middle" autoSize="none" shadowColor="#000000" shadowOffset="1,1" text=""/>
<text id="n58_8yp0" name="area_mask" xy="-898,-1013" size="358,566" visible="false" fontSize="30" autoSize="none" text="{&#xA;&quot;outcard_list&quot;:{&#xA; &quot;parent&quot;:&quot;out_card_com&quot;,&#xA; &quot;obj&quot;:&quot;poker7&quot;,&#xA; &quot;maxcount_x&quot;:8,&#xA; &quot;start_x&quot;:400,&#xA; &quot;start_y&quot;:0&#xA; }&#xA;}"/>
<component id="n60_agiz" name="mask_liangpai" src="g6uw88" fileName="component/Component1.xml" xy="-640,-632" size="5,5" visible="false"/>
<list id="n61_ckvb" name="List_Out" xy="-440,27" pivot="0.5,0.5" size="1760,210" layout="row" selectionMode="none" scroll="horizontal" colGap="-101" defaultItem="ui://kvku0fu4g6uw2f" align="center" vAlign="middle">
<list id="n61_ckvb" name="List_Out" xy="0,0" pivot="0.5,0.5" size="242,210" layout="row" selectionMode="none" scroll="horizontal" colGap="-101" defaultItem="ui://kvku0fu4g6uw2f" vAlign="middle">
<gearDisplay controller="output" pages="1"/>
<relation target="" sidePair="width-width,height-height"/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
<item/>
</list>
<list id="n62_ckvb" name="n62" xy="570,-1020" size="200,300" overflow="scroll"/>
<list id="n63_ckvb" name="list_resultOut" xy="-62,-26" pivot="0.5,0.5" size="1014,210" layout="flow_hz" lineGap="-90" colGap="-101" defaultItem="ui://kvku0fu4g6uw2f" align="center" vAlign="middle">
@ -86,6 +72,10 @@
<group id="n68_g6m8" name="btn_back" xy="56,74" size="200,322" advanced="true">
<gearDisplay controller="out_card_option2" pages="1"/>
</group>
<text id="n69_t63r" name="text_paiNum" xy="262,62" size="108,80" font="ui://27vd145bej1ib7jgl" fontSize="61" text="X77">
<gearDisplay controller="output" pages="1"/>
<relation target="n61_ckvb" sidePair="left-right"/>
</text>
</displayList>
<transition name="score">
<item time="0" type="Alpha" target="n55_pgkj" tween="true" startValue="0" endValue="1" duration="18"/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 MiB

After

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 KiB

After

Width:  |  Height:  |  Size: 241 KiB

View File

@ -12,8 +12,8 @@ PlayerSettings:
targetDevice: 2
useOnDemandResources: 0
accelerometerFrequency: 60
companyName: quyou
productName: "\u8DA3\u53CB"
companyName: hunan
productName: hnqys
defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0}
m_SplashScreenBackgroundColor: {r: 1, g: 1, b: 1, a: 1}