同步梭哈修改

master
罗家炜 2025-05-15 16:49:18 +08:00
parent 6fe74e62e6
commit 9d72403c7b
5 changed files with 83 additions and 33 deletions

View File

@ -82,6 +82,7 @@ end
--绑定协议为事件
function M:OnSendCard(evt_data)
print("lingmengsuohaOnSendCard")
self._cacheEvent:Enqueue(
function()
DispatchEvent(self._dispatcher, EXGameEvent.OnSendCard, evt_data)

View File

@ -304,6 +304,24 @@ function M:EventInit()
_gamectr:AddEventListener(EXGameEvent.OnSendCard, function(...)
local arg = { ... }
local data = arg[1]
local round = data.round
local bank_seat = data.bank_seat
self:UpdateRound(round)
self._state.selectedIndex = 1
local maxPeopleNum = _room.room_config.people_num
for i = 1, maxPeopleNum do
local cardList = data[string.format("seat_%d", i)]
pt(cardList)
local cardInfo = _player_card_info[self:GetPos(i)]
if cardList then
cardInfo:UpdateHandPoker(cardList)
if self:GetPos(bank_seat) == 1 and bank_seat == i then
cardInfo:ShowTips(1)
end
end
end
end)
_gamectr:AddEventListener(EXGameEvent.OnTipAction, function(...)
@ -371,30 +389,33 @@ function M:ReConnectForStart()
-- body
head_info._view:GetChild("shengyu"):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
self.MypokerList = player.hand_list
player_card_info:InitPoker(player.hand_list, false, 1)
else
player_card_info:InitPoker(player.hand_list, false)
end
else
player_card_info:SetRemainCardNumber(player.hand_count == 1)
if player.hand_count == 1 then
self.bgm_index = 2
end
end
if self._room.curren_turn_seat ~= player.seat then
-- head_info:MarkBank(false)
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
else
-- head_info:MarkBank(true)
end
print("lingmengReConnectForStart")
pt(player)
-- 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
-- self.MypokerList = player.hand_list
-- player_card_info:InitPoker(player.hand_list, false, 1)
-- else
-- player_card_info:InitPoker(player.hand_list, false)
-- end
-- else
-- player_card_info:SetRemainCardNumber(player.hand_count == 1)
-- if player.hand_count == 1 then
-- self.bgm_index = 2
-- end
-- end
player_card_info:UpdateHandPoker(player.hand_list)
-- if self._room.curren_turn_seat ~= player.seat then
-- -- head_info:MarkBank(false)
-- 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
-- else
-- -- head_info:MarkBank(true)
-- end
end
end

View File

@ -27,18 +27,21 @@ function M:init()
end
function M:UpdateHandPoker(cardList)
print("lingmengUpdateHandPoker", #cardList)
self._view_handCardList:RemoveChildren()
for i = 1, #cardList do
local obj = self._view_handCardList:AddItemFromPool()
print("lingmengUpdateHandPoker2", obj, cardList[i], string.format("ui://Main_Poker/%s", cardList[i]))
self:FillPoker(obj, cardList[i])
end
end
function M:FillPoker(poker2, prefix, num, code)
if num ~= nil then
code = self:ChangeCodeByTo(num)
end
code = code == 1 and "00" or code
function M:FillPoker(poker2, code)
code = code == 0 and "00" or code
if not poker2.icon then
poker2:GetChild('icon').url = string.format("ui://Extend_Poker_SuoHa/%s%s", prefix, code)
poker2:GetChild('icon').url = string.format("ui://Main_Poker/%s", code)
else
poker2.icon = string.format("ui://Extend_Poker_SuoHa/%s%s", prefix, code)
poker2.icon = string.format("ui://Main_Poker/%s", code)
end
end

View File

@ -2,6 +2,13 @@
--- Created by 谌建军.
--- DateTime: 2017/12/13 17:04
---
local TipType = {
guo = 0,
qi = 1,
xia = 4
}
local EXPlayerPokerInfoView = import('.EXPlayerPokerInfoView')
local EXCardType = import('.EXCardType')
local EXCardCheck = import(".CardCheck")
@ -25,11 +32,29 @@ function M.new(view, mainView)
end
function M:init()
local view = self._view
EXPlayerPokerInfoView.init(self)
self._view_tipsList = view:GetChild('list_tips')
self._ctr_out = view:GetController('out')
end
function M:InitPoker(pokerList, isPlayAni, open)
function M:ShowTips(type)
self._ctr_out.selectedIndex = 1
if type == 1 then
self._view_tipsList:RemoveChildren()
local obj = self._view_tipsList:AddItemFromPool()
self.SetTipData(obj, TipType.qi)
local obj = self._view_tipsList:AddItemFromPool()
self.SetTipData(obj, TipType.xia)
end
end
function M.SetTipData(obj, type)
obj.data = {}
obj.data.type = type
obj:GetController('type').selectedIndex = type
end
function M:Clear()