提交6.20
parent
f976b9db20
commit
d7daa0c666
|
|
@ -22,8 +22,8 @@ local Fix_Msg_Chat = {
|
|||
|
||||
--- Create a new ZZ_MainView
|
||||
function M.new()
|
||||
setmetatable(M, {__index = ZPMainView})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
setmetatable(M, { __index = ZPMainView })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
self.class = 'FanPaoFa_MainView'
|
||||
self._full = true
|
||||
self:init()
|
||||
|
|
@ -31,13 +31,13 @@ function M.new()
|
|||
end
|
||||
|
||||
function M:getCardItem(card_1, card_2)
|
||||
|
||||
if self._room.change_card_display ~= nil then
|
||||
return card_1 .. self._room.change_card_display .. card_2
|
||||
else
|
||||
return card_1 .. '6_' .. card_2
|
||||
end
|
||||
end
|
||||
|
||||
function M:InitView(url)
|
||||
local _room = self._room
|
||||
self.Fix_Msg_Chat = Fix_Msg_Chat
|
||||
|
|
@ -80,11 +80,11 @@ function M:InitView(url)
|
|||
end
|
||||
|
||||
function M:InitPlayerInfoView()
|
||||
self._player_info = {}
|
||||
self._player_info = {}
|
||||
local _player_info = self._player_info
|
||||
for i = 1, self._room.room_config.people_num do
|
||||
local tem = self._view:GetChild("player_info" .. i)
|
||||
_player_info[i] = PlayerInfoView.new(tem,self)
|
||||
_player_info[i] = PlayerInfoView.new(tem, self)
|
||||
tem.visible = false
|
||||
end
|
||||
end
|
||||
|
|
@ -153,85 +153,83 @@ function M:NewPlayerCardInfoView(view, index)
|
|||
end
|
||||
return PlayerCardInfoView.new(view, self)
|
||||
end
|
||||
|
||||
function M:closeTipOnTuoguan()
|
||||
if self._clearingView ~= nil then
|
||||
self._clearingView:Close()
|
||||
end
|
||||
self:__CloseTip()
|
||||
end
|
||||
|
||||
function M:EventInit()
|
||||
MainView.EventInit(self)
|
||||
local _room = self._room
|
||||
local _view = self._view
|
||||
local _player_info = self._player_info
|
||||
local _gamectr = self._gamectr
|
||||
_gamectr:AddEventListener(GameEvent.EventXiPai,function( ... )
|
||||
local arg = {...}
|
||||
local currentPlayer1=arg[1]
|
||||
local currentPlayer2=arg[2]
|
||||
self._popEvent = false
|
||||
_gamectr:AddEventListener(GameEvent.EventXiPai, function(...)
|
||||
local arg = { ... }
|
||||
local currentPlayer1 = arg[1]
|
||||
local currentPlayer2 = arg[2]
|
||||
self._popEvent = false
|
||||
self._player_card_info[1]:HideDaNiao(0)
|
||||
if ( currentPlayer1 ) then
|
||||
|
||||
local xipaiCB=function ()
|
||||
self._popEvent = true
|
||||
end
|
||||
self:PlayXiPai(xipaiCB)
|
||||
|
||||
end
|
||||
if ( currentPlayer2 ) then
|
||||
local xipaiCB2=function ()
|
||||
self._popEvent = true
|
||||
end
|
||||
self:PlayXiPai1(xipaiCB2)
|
||||
end
|
||||
end)
|
||||
if (currentPlayer1) then
|
||||
local xipaiCB = function()
|
||||
self._popEvent = true
|
||||
end
|
||||
self:PlayXiPai(xipaiCB)
|
||||
end
|
||||
if (currentPlayer2) then
|
||||
local xipaiCB2 = function()
|
||||
self._popEvent = true
|
||||
end
|
||||
self:PlayXiPai1(xipaiCB2)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
_gamectr:AddEventListener(GameEvent.OnDaNiaoTips, function(...)
|
||||
local arg = {...}
|
||||
_gamectr:AddEventListener(GameEvent.OnDaNiaoTips, function(...)
|
||||
local arg = { ... }
|
||||
local niao = arg[1]
|
||||
local reload = arg[2]
|
||||
if reload==0 then
|
||||
self._leftcard = 1
|
||||
self._leftcard = 1
|
||||
local rightpanel = self._view:GetChild('right_panel')
|
||||
local tex_round = rightpanel:GetChild('tex_round')
|
||||
if tex_round ~= nil then
|
||||
tex_round.text = '第 ' .. _room.curren_round .. ' 局'
|
||||
end
|
||||
self._view:GetChild('tex_round').text = '第 ' .. _room.curren_round .. ' 局 百息结算 '
|
||||
if reload == 0 then
|
||||
self._leftcard = 1
|
||||
self._leftcard = 1
|
||||
local rightpanel = self._view:GetChild('right_panel')
|
||||
local tex_round = rightpanel:GetChild('tex_round')
|
||||
if tex_round ~= nil then
|
||||
tex_round.text = '第 ' .. _room.curren_round .. ' 局'
|
||||
end
|
||||
self._view:GetChild('tex_round').text = '第 ' .. _room.curren_round .. ' 局 百息结算 '
|
||||
|
||||
self._state.selectedIndex = 1
|
||||
self:closeTipOnTuoguan()
|
||||
local list = _room.player_list
|
||||
for i = 1, #list do
|
||||
local p = list[i]
|
||||
p.hu_xi = 0
|
||||
local _info = self._player_card_info[self:GetPos(p.seat)]
|
||||
_info:SetPlayer(p)
|
||||
local info = self._player_info[self:GetPos(p.seat)]
|
||||
info:FillData(p)
|
||||
info:MarkBank(p.seat == _room.banker_seat)
|
||||
info:Ready(false)
|
||||
--info:UpdatePiao(-1)
|
||||
end
|
||||
|
||||
end
|
||||
self._state.selectedIndex = 1
|
||||
self:closeTipOnTuoguan()
|
||||
local list = _room.player_list
|
||||
for i = 1, #list do
|
||||
local p = list[i]
|
||||
p.hu_xi = 0
|
||||
local _info = self._player_card_info[self:GetPos(p.seat)]
|
||||
_info:SetPlayer(p)
|
||||
local info = self._player_info[self:GetPos(p.seat)]
|
||||
info:FillData(p)
|
||||
info:MarkBank(p.seat == _room.banker_seat)
|
||||
info:Ready(false)
|
||||
--info:UpdatePiao(-1)
|
||||
end
|
||||
end
|
||||
self._player_card_info[1]:ShwoDaNiao(niao)
|
||||
end)
|
||||
|
||||
|
||||
_gamectr:AddEventListener(GameEvent.OnEventDaNiao, function(...)
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local seat = arg[1]
|
||||
local niao = arg[2]
|
||||
if self.seat==seat then
|
||||
if self.seat == seat then
|
||||
self._player_card_info[seat]:HideDaNiao(niao)
|
||||
end
|
||||
local head_info = self._player_info[self:GetPos(seat)]
|
||||
head_info:UpdateNiao(niao)
|
||||
|
||||
end)
|
||||
|
||||
|
||||
|
|
@ -266,7 +264,7 @@ function M:EventInit()
|
|||
--info._view:GetController('huxi').selectedIndex = 1
|
||||
info._view:GetChild('huxi').text = p.hu_xi
|
||||
info._view:GetController('zhanji').selectedIndex = 1
|
||||
info._view:GetChild('tex_jifen').text = p.total_score --d2ad(p.total_hp)
|
||||
info._view:GetChild('tex_jifen').text = p.total_score --d2ad(p.total_hp)
|
||||
info._view:GetChild('tex_jifen_text').text = "总胡息"
|
||||
--[[if _room.hpOnOff == 1 or _room:checkHpNonnegative() then
|
||||
if p.total_hp == nil then
|
||||
|
|
@ -287,7 +285,7 @@ function M:EventInit()
|
|||
_gamectr:AddEventListener(
|
||||
GameEvent.GetCard,
|
||||
function(...)
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local seat = arg[1]
|
||||
local card = arg[2]
|
||||
local _leftcard = arg[3]
|
||||
|
|
@ -313,7 +311,7 @@ function M:EventInit()
|
|||
_gamectr:AddEventListener(
|
||||
GameEvent.AddCard,
|
||||
function(...)
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local seat = arg[1]
|
||||
local card = arg[2]
|
||||
self._popEvent = false
|
||||
|
|
@ -334,7 +332,7 @@ function M:EventInit()
|
|||
_gamectr:AddEventListener(
|
||||
GameEvent.EventTurn,
|
||||
function(...)
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local seat = arg[1]
|
||||
local list = _room.player_list
|
||||
local readyNum = 0
|
||||
|
|
@ -365,7 +363,7 @@ function M:EventInit()
|
|||
_gamectr:AddEventListener(
|
||||
GameEvent.FangWei,
|
||||
function(...)
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local seat = arg[1]
|
||||
local card = arg[2]
|
||||
--self:__CloseTip()
|
||||
|
|
@ -389,23 +387,22 @@ function M:EventInit()
|
|||
--
|
||||
self:__CloseTip()
|
||||
--把牌弄回原位
|
||||
-- info:ResetCards(card)
|
||||
-- info:ResetCards(card)
|
||||
if seat == self._room.self_player.seat then
|
||||
if seat == self._room.self_player.seat then
|
||||
local buttonData = info.outcard_button
|
||||
local context = {}
|
||||
context.sender = buttonData.btn_card
|
||||
context.sender.data = buttonData
|
||||
context.sender.y = -300
|
||||
context.sender.touchable = true
|
||||
info:__OnDragEnd(context)
|
||||
info:UpdateIsOnClick(true)
|
||||
end
|
||||
if seat == self._room.self_player.seat then
|
||||
local buttonData = info.outcard_button
|
||||
local context = {}
|
||||
context.sender = buttonData.btn_card
|
||||
context.sender.data = buttonData
|
||||
context.sender.y = -300
|
||||
context.sender.touchable = true
|
||||
info:__OnDragEnd(context)
|
||||
info:UpdateIsOnClick(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
)
|
||||
fangwei_msg:Show()
|
||||
|
||||
end
|
||||
)
|
||||
|
||||
|
|
@ -414,7 +411,7 @@ function M:EventInit()
|
|||
function(...)
|
||||
self:__CloseTip()
|
||||
self._left_time = 0
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local p = arg[1]
|
||||
local card = arg[2]
|
||||
local seat = p.seat
|
||||
|
|
@ -428,7 +425,6 @@ function M:EventInit()
|
|||
info:UpdateIsOnClick(true)
|
||||
info:SendChangeCard()
|
||||
info:ChuPaiTiShi()
|
||||
|
||||
end
|
||||
local list = _room.player_list
|
||||
for i = 1, #list do
|
||||
|
|
@ -455,7 +451,7 @@ function M:EventInit()
|
|||
self:__CloseTip()
|
||||
self._popEvent = false
|
||||
self._left_time = 0
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local seat = arg[1]
|
||||
local card = arg[2]
|
||||
local p = _room:GetPlayerBySeat(seat)
|
||||
|
|
@ -469,11 +465,11 @@ function M:EventInit()
|
|||
_gamectr:AddEventListener(
|
||||
GameEvent.FZTips,
|
||||
function(...)
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local _tip = arg[1]
|
||||
local _uid = arg[2]
|
||||
local _fptype = arg[3]
|
||||
self:__FangziTip(_tip, _uid,_fptype)
|
||||
self:__FangziTip(_tip, _uid, _fptype)
|
||||
end
|
||||
)
|
||||
|
||||
|
|
@ -485,7 +481,7 @@ function M:EventInit()
|
|||
self._left_time = 0
|
||||
self:__CloseTip()
|
||||
self._popEvent = false
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local w = arg[1]
|
||||
local l = arg[2]
|
||||
local cards = arg[3]
|
||||
|
|
@ -519,10 +515,10 @@ function M:EventInit()
|
|||
_gamectr:AddEventListener(
|
||||
GameEvent.ZPResult1,
|
||||
function(...)
|
||||
--printlog("ZPResult111ssssssttteessssssttt")
|
||||
--printlog("ZPResult111ssssssttteessssssttt")
|
||||
self._popEvent = false
|
||||
self._left_time = 0
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local result = arg[1]
|
||||
local liuju = result.liuju
|
||||
local data = result.info_list
|
||||
|
|
@ -554,7 +550,7 @@ function M:EventInit()
|
|||
p.total_score = data[i].total_score
|
||||
|
||||
info._view:GetController('zhanji').selectedIndex = 1
|
||||
info._view:GetChild('tex_jifen').text =p.total_score
|
||||
info._view:GetChild('tex_jifen').text = p.total_score
|
||||
info._view:GetChild('tex_jifen_text').text = "总胡息"
|
||||
card_info:Clear()
|
||||
info:UpdateScore()
|
||||
|
|
@ -599,7 +595,7 @@ function M:EventInit()
|
|||
GameEvent.ZPResult2,
|
||||
function(...)
|
||||
self._left_time = 0
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local total_result = arg[2]
|
||||
local result = arg[1]
|
||||
local over = arg[3]
|
||||
|
|
@ -622,17 +618,16 @@ function M:EventInit()
|
|||
|
||||
|
||||
|
||||
_gamectr:AddEventListener(
|
||||
_gamectr:AddEventListener(
|
||||
GameEvent.FangPaoOk,
|
||||
function(...)
|
||||
self._left_time = 0
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local seat = arg[1]
|
||||
local card = arg[2]
|
||||
--禁牌 把手上的牌都禁掉
|
||||
-- local card_info = self._player_card_info[self:GetPos(seat)]
|
||||
-- card_info:banHandCards(self._room.self_player.card_list)
|
||||
|
||||
-- local card_info = self._player_card_info[self:GetPos(seat)]
|
||||
-- card_info:banHandCards(self._room.self_player.card_list)
|
||||
end
|
||||
)
|
||||
end
|
||||
|
|
@ -647,11 +642,11 @@ end
|
|||
function M:ChangeCards(list)
|
||||
local _gamectr = ControllerManager.GetController(GameController)
|
||||
if _gamectr then
|
||||
_gamectr:SendChangeCards(list)
|
||||
end
|
||||
_gamectr:SendChangeCards(list)
|
||||
end
|
||||
end
|
||||
|
||||
function M:__FangziTip(tip, _uid,fptype)
|
||||
function M:__FangziTip(tip, _uid, fptype)
|
||||
local _gamectr = self._gamectr
|
||||
local _chipeng_tip = UIPackage.CreateObject('Main_RunBeard', 'Gcm_action_tips')
|
||||
self._chipeng_tip = _chipeng_tip
|
||||
|
|
@ -675,15 +670,14 @@ function M:__FangziTip(tip, _uid,fptype)
|
|||
tip_hu = true
|
||||
tip_id = td.id
|
||||
--自动放炮
|
||||
if td.weight==7 then
|
||||
if td.weight == 7 then
|
||||
zdhu = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if td.type == 6 and td.weight == 8 then
|
||||
fpao = false
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if fpao and zdhu then
|
||||
|
|
@ -698,7 +692,7 @@ function M:__FangziTip(tip, _uid,fptype)
|
|||
local url = 'ui://Main_RunBeard/Btn_fztip'
|
||||
local btn_t = _lit_fanzi:AddItemFromPool(url)
|
||||
btn_t.icon = 'ui://Main_RunBeard/newop_' .. td.type
|
||||
btn_t.data = {tip, td, tip_hu}
|
||||
btn_t.data = { tip, td, tip_hu }
|
||||
btn_t.onClick:Set(self.__TipAction, self)
|
||||
end
|
||||
|
||||
|
|
@ -727,7 +721,7 @@ function M:__FangziTip(tip, _uid,fptype)
|
|||
)
|
||||
end
|
||||
--禁止放跑
|
||||
if fptype == 1 and tip_hu == false then
|
||||
if fptype == 1 and tip_hu == false then
|
||||
_gamectr:SendAction(_uid)
|
||||
_chipeng_tip:Dispose()
|
||||
self._chipeng_tip = nil
|
||||
|
|
@ -738,6 +732,7 @@ function M:__FangziTip(tip, _uid,fptype)
|
|||
_chipeng_tip.y = _chipeng_tip.y - 50
|
||||
end
|
||||
end
|
||||
|
||||
function M:__TipAction(context)
|
||||
local data = context.sender.data
|
||||
local _gamectr = self._gamectr
|
||||
|
|
@ -749,11 +744,11 @@ function M:__TipAction(context)
|
|||
if (#list > 1) or td.type == 1 then
|
||||
local chiflag = true
|
||||
for key, value in pairs(list) do
|
||||
if value['bi_list'] ~=nil then
|
||||
if value['bi_list'] ~= nil then
|
||||
chiflag = false
|
||||
end
|
||||
end
|
||||
if #list>1 then
|
||||
if #list > 1 then
|
||||
chiflag = false
|
||||
end
|
||||
if chiflag then
|
||||
|
|
@ -788,7 +783,7 @@ function M:__TipAction(context)
|
|||
end
|
||||
end
|
||||
)
|
||||
-- self._chipeng_tip.visible = false
|
||||
-- self._chipeng_tip.visible = false
|
||||
return
|
||||
end
|
||||
if tip_hu and td.type ~= 8 then
|
||||
|
|
@ -944,7 +939,7 @@ function M:deepcopy(object)
|
|||
end
|
||||
|
||||
function M:OnFangziAction(...)
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local _player_card_info = self._player_card_info
|
||||
local fz = arg[1]
|
||||
local player = arg[2]
|
||||
|
|
@ -1009,8 +1004,8 @@ function M:OnFangziAction(...)
|
|||
end
|
||||
)
|
||||
end
|
||||
-- if false then
|
||||
if fz.type ~= RB_FZType.Kan and fz.type ~= RB_FZType.Bi then
|
||||
-- if false then
|
||||
if fz.type ~= RB_FZType.Kan and fz.type ~= RB_FZType.Bi then
|
||||
--printlog("jefe self RB_FZType 2=======")
|
||||
local info = _player_card_info[self:GetPos(player.seat)]
|
||||
local pNode = info._mask_liangpai
|
||||
|
|
@ -1041,7 +1036,7 @@ function M:OnFangziAction(...)
|
|||
elseif fz.type == RB_FZType.Ti then
|
||||
self:PlaySound(player.self_user.sex, 'F_SaoChuan')
|
||||
effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'ti')
|
||||
-- effect:GetChild("icon2").icon = UIPackage.GetItemURL("Main_RunBeard", "ti")
|
||||
-- effect:GetChild("icon2").icon = UIPackage.GetItemURL("Main_RunBeard", "ti")
|
||||
end
|
||||
|
||||
effect.touchable = false
|
||||
|
|
@ -1054,7 +1049,6 @@ function M:OnFangziAction(...)
|
|||
effect:Dispose()
|
||||
end
|
||||
)
|
||||
|
||||
end
|
||||
if (player == self._room.self_player) then
|
||||
coroutine.start(
|
||||
|
|
@ -1124,10 +1118,9 @@ function M:ReloadRoom()
|
|||
info._view:GetChild('huxi').text = p.hu_xi
|
||||
|
||||
|
||||
info._view:GetController('zhanji').selectedIndex = 1
|
||||
info._view:GetChild('tex_jifen').text = p.total_score -- d2ad(p.total_hp)
|
||||
info._view:GetChild('tex_jifen_text').text = "总胡息"
|
||||
|
||||
info._view:GetController('zhanji').selectedIndex = 1
|
||||
info._view:GetChild('tex_jifen').text = p.total_score -- d2ad(p.total_hp)
|
||||
info._view:GetChild('tex_jifen_text').text = "总胡息"
|
||||
end
|
||||
|
||||
local card_info = self._player_card_info[self:GetPos(p.seat)]
|
||||
|
|
@ -1144,8 +1137,8 @@ function M:ReloadRoom()
|
|||
card_info:ChuPaiTiShi()
|
||||
if
|
||||
self._room.self_player.card_list ~= nil and
|
||||
#self._room.self_player.handcard_list == #self._room.self_player.card_list
|
||||
then
|
||||
#self._room.self_player.handcard_list == #self._room.self_player.card_list
|
||||
then
|
||||
local _list = self:deepcopy(self._room.self_player.card_list)
|
||||
local cards = {}
|
||||
for i = 1, #_list do
|
||||
|
|
@ -1184,7 +1177,7 @@ function M:ReloadRoom()
|
|||
if tex_round ~= nil then
|
||||
tex_round.text = '第 ' .. room.curren_round .. ' 局'
|
||||
end
|
||||
self._view:GetChild('tex_round').text = '第 ' .. room.curren_round .. ' 局 百息结算'
|
||||
self._view:GetChild('tex_round').text = '第 ' .. room.curren_round .. ' 局 百息结算'
|
||||
end
|
||||
|
||||
function M:PlayChatSound(sex, chat_index)
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ end
|
|||
|
||||
--- Create a new
|
||||
function M.new()
|
||||
setmetatable(M, {__index = PlayBackView})
|
||||
local self = setmetatable({}, {__index = M})
|
||||
setmetatable(M, { __index = PlayBackView })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
self.class = 'PlayBackView'
|
||||
self:init()
|
||||
|
||||
|
|
@ -139,15 +139,13 @@ function M:FillRoomData(data)
|
|||
infoHand:UpdateScore()
|
||||
end
|
||||
end
|
||||
self.CheckServerErrorList={}
|
||||
self.CheckServerErrorList = {}
|
||||
self:UpdateRound(self._room.curren_round)
|
||||
self:GenerateAllStepData(data)
|
||||
self:ShowStep(1)
|
||||
self:UpdateStep(1)
|
||||
end
|
||||
|
||||
|
||||
|
||||
function M:ShowStep(index)
|
||||
local step = self._step[index + 1]
|
||||
self:UpdateStep(index + 1)
|
||||
|
|
@ -157,7 +155,7 @@ function M:ShowStep(index)
|
|||
self._chipeng_tip = nil
|
||||
end
|
||||
if self._lit_fanzi then
|
||||
self._lit_fanzi=nil
|
||||
self._lit_fanzi = nil
|
||||
end
|
||||
|
||||
local _chipeng_tip = UIPackage.CreateObject('Main_RunBeard', 'Gcm_action_tips')
|
||||
|
|
@ -165,13 +163,14 @@ function M:ShowStep(index)
|
|||
self._lit_fanzi = _chipeng_tip:GetChild('lit_fanzi')
|
||||
self._lit_fanzi:RemoveChildrenToPool()
|
||||
|
||||
|
||||
printlog("lingmeng ShowStep", self._step[index + 1].cmd)
|
||||
pt(self._step[index + 1])
|
||||
for i = 1, #step.player_card_data do
|
||||
local p = self._room:GetPlayerBySeat(i)
|
||||
local info = self._player_card_info[self:GetPos(i)]
|
||||
p.card_list = step.player_card_data[i].card_list
|
||||
p.outcard_list = step.player_card_data[i].outcard_list
|
||||
-- p.tip_list = step.player_card_data[i].tip_list
|
||||
-- p.tip_list = step.player_card_data[i].tip_list
|
||||
p.fz_list = step.player_card_data[i].fz_list
|
||||
p.hu_xi = step.player_card_data[i].hu_xi
|
||||
p.hand_left_count = #p.card_list
|
||||
|
|
@ -199,18 +198,17 @@ function M:ShowStep(index)
|
|||
end
|
||||
end
|
||||
|
||||
if index>1 then
|
||||
for k,v in pairs(self.CheckServerErrorList) do
|
||||
----printlog("k===>>>",k)
|
||||
----printlog("v===>>>",v)
|
||||
----printlog(k,index)
|
||||
--pt(p.card_list)
|
||||
if tonumber(index+1)>tonumber(k) then
|
||||
list_remove(p.card_list,v)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
if index > 1 then
|
||||
for k, v in pairs(self.CheckServerErrorList) do
|
||||
----printlog("k===>>>",k)
|
||||
----printlog("v===>>>",v)
|
||||
----printlog(k,index)
|
||||
--pt(p.card_list)
|
||||
if tonumber(index + 1) > tonumber(k) then
|
||||
list_remove(p.card_list, v)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
|
@ -221,23 +219,24 @@ function M:ShowStep(index)
|
|||
info:InitHandCard(false)
|
||||
end
|
||||
|
||||
if step.cmd == Record_Event.Evt_ChangePaiXing then
|
||||
local _card_list = {}
|
||||
for i = 1, #step.card_list do
|
||||
local data = {}
|
||||
data.card_item = step.card_list[i].card
|
||||
data.index_X = step.card_list[i].X
|
||||
data.index_Y = step.card_list[i].Y
|
||||
_card_list[#_card_list + 1] = data
|
||||
end
|
||||
local info = self._player_card_info[self:GetPos(step.seat)]
|
||||
if step.card_list[1].card ~= nil then
|
||||
info:UpdateHandCards(_card_list)
|
||||
else
|
||||
info:UpdateHandCards(step.card_list)
|
||||
end
|
||||
end
|
||||
--end
|
||||
-- if step.cmd == Record_Event.Evt_ChangePaiXing then
|
||||
-- local _card_list = {}
|
||||
-- for i = 1, #step.card_list do
|
||||
-- local data = {}
|
||||
-- data.card_item = step.card_list[i].card
|
||||
-- data.index_X = step.card_list[i].X
|
||||
-- data.index_Y = step.card_list[i].Y
|
||||
-- _card_list[#_card_list + 1] = data
|
||||
-- end
|
||||
-- local info = self._player_card_info[self:GetPos(step.seat)]
|
||||
-- if step.card_list[1].card ~= nil then
|
||||
-- info:UpdateHandCards(_card_list)
|
||||
-- -- info:InitHandCard(_card_list)
|
||||
-- else
|
||||
-- info:UpdateHandCards(step.card_list)
|
||||
-- end
|
||||
-- end
|
||||
--end
|
||||
|
||||
if step.cmd == Record_Event.Evt_OutCard or step.cmd == Record_Event.Evt_GetCard then
|
||||
if step.DiceCard ~= nil and step.DiceCard ~= 0 then
|
||||
|
|
@ -258,12 +257,12 @@ function M:ShowStep(index)
|
|||
|
||||
|
||||
if step.cmd == Record_Event.Evt_TipAction then
|
||||
if step.player_card_data[i].tip_list[index]~=nil then
|
||||
if step.player_card_data[i].tip_list[index] ~= nil then
|
||||
for key, value in pairs(step.player_card_data[i].tip_list[index]) do
|
||||
local td = value
|
||||
local url = 'ui://Main_RunBeard/Btn_fztip'
|
||||
local btn_t = self._lit_fanzi:AddItemFromPool(url)
|
||||
btn_t.icon = 'ui://Main_RunBeard/newop_' ..td
|
||||
btn_t.icon = 'ui://Main_RunBeard/newop_' .. td
|
||||
end
|
||||
|
||||
local url1 = 'ui://Main_RunBeard/Btn_fztip'
|
||||
|
|
@ -274,15 +273,8 @@ function M:ShowStep(index)
|
|||
_chipeng_tip:Center()
|
||||
self._chipeng_tip.x = self._chipeng_tip.x + 200
|
||||
self._chipeng_tip.y = self._chipeng_tip.y - 50
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
|
@ -327,10 +319,16 @@ function M:ShowStep(index)
|
|||
if data[i]['hp_info'] then
|
||||
p.total_score = d2ad(data[i].hp_info.cur_hp)
|
||||
local stotal_hp = data[i].hp_info.total_hp
|
||||
local total_score = data[i].total_score
|
||||
info._view:GetController('zhanji').selectedIndex = 0
|
||||
if _room.hpOnOff == 1 or _room:checkHpNonnegative() then
|
||||
info._view:GetController('huxi').selectedIndex = 1
|
||||
info._view:GetChild('huxi').text = d2ad(stotal_hp)
|
||||
|
||||
|
||||
info._view:GetController('zhanji').selectedIndex = 1
|
||||
info._view:GetChild('tex_jifen').text = d2ad(stotal_hp)
|
||||
|
||||
info._view:GetChild('tex_jifen').text = total_score
|
||||
end
|
||||
end
|
||||
info:UpdateScore(p.total_score)
|
||||
|
|
@ -348,11 +346,11 @@ end
|
|||
|
||||
function M:GenerateAllStepData(data)
|
||||
local cmdList = self.cmdList
|
||||
--pt(cmdList)
|
||||
-- pt(cmdList)
|
||||
self._step = {}
|
||||
local step = {}
|
||||
local info = data.info
|
||||
--pt(info)
|
||||
--pt(info)
|
||||
step.cmd = ''
|
||||
step.left_card = info.left_card
|
||||
step.win = 0
|
||||
|
|
@ -368,6 +366,7 @@ function M:GenerateAllStepData(data)
|
|||
u.fz_list = {}
|
||||
u.outcard_list = {}
|
||||
u.hu_xi = 0
|
||||
u.total_score = p.total_score
|
||||
step.player_card_data[u.seat] = u
|
||||
end
|
||||
self._step[#self._step + 1] = step
|
||||
|
|
@ -396,6 +395,7 @@ function M:CmdGetCard(cmd, index)
|
|||
data.seat = cmd.seat
|
||||
data.DiceCard = cmd.data.card
|
||||
end
|
||||
|
||||
function M:CmdThrowCard(cmd, index)
|
||||
local data = self:CopyLastStep(index)
|
||||
data.cmd = cmd.cmd
|
||||
|
|
@ -405,14 +405,15 @@ function M:CmdThrowCard(cmd, index)
|
|||
data.out_card_list = cmd.data.card
|
||||
u.outcard_list[#u.outcard_list + 1] = cmd.data.card
|
||||
end
|
||||
|
||||
function M:CmdAddCard(cmd, index)
|
||||
----printlog("CmdAddCard======>>>",index,cmd.data.card)
|
||||
----printlog("CmdAddCard======>>>",index,cmd.data.card)
|
||||
local data = self:CopyLastStep(index)
|
||||
data.cmd = cmd.cmd
|
||||
local _room = self._room
|
||||
local u = data.player_card_data[cmd.seat]
|
||||
u.card_list[#u.card_list + 1] = cmd.data.card
|
||||
--pt(u.card_list)
|
||||
--pt(u.card_list)
|
||||
end
|
||||
|
||||
function M:onResult(cmd, index)
|
||||
|
|
@ -422,6 +423,7 @@ function M:onResult(cmd, index)
|
|||
end
|
||||
|
||||
function M:CmdChangePaiXing(cmd, index)
|
||||
printlog("lingmeng CmdChangePaiXing", index)
|
||||
local data = self:CopyLastStep(index)
|
||||
data.cmd = cmd.cmd
|
||||
data.seat = cmd.seat
|
||||
|
|
@ -504,11 +506,11 @@ function M:CmdAction(cmd, index)
|
|||
num = num + 1
|
||||
end
|
||||
end
|
||||
--table.insert(self.CheckServerErrorList,card)
|
||||
if self.CheckServerErrorList==nil then
|
||||
self.CheckServerErrorList={}
|
||||
end
|
||||
self.CheckServerErrorList[index]=card
|
||||
--table.insert(self.CheckServerErrorList,card)
|
||||
if self.CheckServerErrorList == nil then
|
||||
self.CheckServerErrorList = {}
|
||||
end
|
||||
self.CheckServerErrorList[index] = card
|
||||
local isAddTi = false
|
||||
for i = 1, #p.fz_list do
|
||||
if p.fz_list[i].card == card then
|
||||
|
|
@ -534,16 +536,16 @@ function M:CmdWin(cmd, index)
|
|||
data.win = cmd.seat
|
||||
end
|
||||
|
||||
function M:CmdTipAction(cmd,index)
|
||||
function M:CmdTipAction(cmd, index)
|
||||
local data = self:CopyLastStep(index)
|
||||
data.cmd = cmd.cmd
|
||||
data.seat = cmd.seat
|
||||
local u = data.player_card_data[cmd.seat]
|
||||
data.tip_list = cmd.data.tip_list
|
||||
local tips = {}
|
||||
if #cmd.data.tip_list>0 then
|
||||
local tips = {}
|
||||
if #cmd.data.tip_list > 0 then
|
||||
for i = 1, #cmd.data.tip_list do
|
||||
tips[cmd.data.tip_list[i].type] = cmd.data.tip_list[i].type
|
||||
tips[cmd.data.tip_list[i].type] = cmd.data.tip_list[i].type
|
||||
end
|
||||
end
|
||||
u.tip_list[index] = tips
|
||||
|
|
@ -564,7 +566,7 @@ function M:CopyLastStep(index)
|
|||
step.player_card_data = {}
|
||||
local card_data = step.player_card_data
|
||||
for i = 1, #last_step.player_card_data do
|
||||
-- pt(last_step.player_card_data[i])
|
||||
-- pt(last_step.player_card_data[i])
|
||||
card_data[i] = {}
|
||||
card_data[i].card_list = self:deepcopy(last_step.player_card_data[i].card_list)
|
||||
card_data[i].outcard_list = self:deepcopy(last_step.player_card_data[i].outcard_list)
|
||||
|
|
@ -573,7 +575,7 @@ function M:CopyLastStep(index)
|
|||
card_data[i].tip_list = self:deepcopy(last_step.player_card_data[i].tip_list)
|
||||
card_data[i].hu_xi = self:deepcopy(last_step.player_card_data[i].hu_xi)
|
||||
end
|
||||
--pt(card_data)
|
||||
--pt(card_data)
|
||||
self._step[#self._step + 1] = step
|
||||
return step
|
||||
end
|
||||
|
|
@ -713,7 +715,6 @@ function M:OnUpdate()
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
function M:Destroy()
|
||||
UpdateBeat:Remove(self.OnUpdate, self)
|
||||
PlayBackView.Destroy(self)
|
||||
|
|
|
|||
Loading…
Reference in New Issue