From 095b2079fe97fa6151a81233b1c3dc90b56cdf0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=AE=B6=E7=82=9C?= <2029049582@qq.com> Date: Mon, 23 Jun 2025 04:57:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=B2=E5=8F=8B=E5=9C=88=E7=8E=A9=E6=B3=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8C=89=E8=A7=84=E5=88=99=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Game/View/NewGroup/GroupInfoView.lua | 19 + .../NewGroup/MngView/GroupGameSettingView.lua | 1 + .../zipai/fanpaofa/EXGameController.lua | 547 +++++++++--------- wb_new_ui/.objs/metas/m7iejg46/10snh5j.info | 3 + .../Main/component/Player_card_info_2.xml | 2 +- wb_new_ui/assets/NewGroup/Main_GroupInfo.xml | 10 +- .../component/Lst_info/btn_layer_item.xml | 6 +- 7 files changed, 294 insertions(+), 294 deletions(-) diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua index 534ecf92..fc0904cd 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua @@ -913,6 +913,7 @@ local function __analysePlayListData(self) self.playIdList[count] = p_data.id end end + table.sort(self.playIdList, handler(self, self.SortPlayList)) local lst_layer = self.lst_layer -- printlog("添加玩法====>>>>",count) @@ -1355,6 +1356,7 @@ function M:__loadLastData() table.insert(self.curRooms, room) self.playNames[t.id] = t.name end + table.sort(self.playIdList, handler(self, self.SortPlayList)) self.lst_game.numItems = #self.gameIdList + 1 self.lst_layer.visible = false --self.line1.visible = false @@ -2124,6 +2126,23 @@ function M:Show() end end +function M:SortPlayList(a, b) + local a_play = self.curGroup:getPlay(a) + local b_play = self.curGroup:getPlay(b) + + if a_play.gameType == b_play.gameType then + if a_play.gameId == a_play.gameId then + return a_play.id < b_play.id + else + return a_play.gameId < b_play.gameId + end + else + pt(a_play) + pt(b_play) + return a_play.gameType < b_play.gameType + end +end + function M:Destroy() BaseView.Destroy(self) UpdateBeat:Remove(self.__onUpdate, self) diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView.lua index b319125d..64e4e816 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView.lua @@ -494,6 +494,7 @@ function M:FillFagData() play.maxPlayers = _data.maxPlayers play.roomNum = self.hpData.tex_times_room / 100 play.maxRound = res.Data.maxRound + play.gameType = res.Data.gameType ViewUtil.ShowBannerOnScreenCenter("添加玩法成功") self.callback(play) self:Destroy() diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/EXGameController.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/EXGameController.lua index 4681e304..50630165 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/EXGameController.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/EXGameController.lua @@ -5,15 +5,15 @@ local M = {} --- Create a new HZ_GameController function M.new() - setmetatable(M,{__index = GameController}) - local self = setmetatable({}, {__index = M}) - self:init("放炮罚") - self.class = "RB_GameController" - return self + setmetatable(M, { __index = GameController }) + local self = setmetatable({}, { __index = M }) + self:init("放炮罚") + self.class = "RB_GameController" + return self end function M:init(name) - GameController.init(self,name) + GameController.init(self, name) self._eventmap[RB_Protocol.GAME_EVT_PLAYER_DEAL] = self.OnEventSendCards self._eventmap[RB_Protocol.GAME_EVT_CHANGE_ACTIVE_PLAYER] = self.OnEventTurn @@ -36,98 +36,89 @@ function M:init(name) self._eventmap[RB_Protocol.GAME_EVT_DANIAO] = self.OnEventDaNiao self._eventmap[RB_Protocol.GAME_EVENT_XIPAI] = self.OnEventXiPai - self._eventmap[RB_Protocol.GAME_EVENT_NOTIFY_XIPAI] = self.OnEventXiPaiAnim + self._eventmap[RB_Protocol.GAME_EVENT_NOTIFY_XIPAI] = self.OnEventXiPaiAnim self._eventmap[RB_Protocol.GAME_EVT_RESULT1] = self.OneventResult1 self._eventmap[RB_Protocol.GAME_EVT_QIPAI] = self.OnEventQIPAI self._eventmap[RB_Protocol.GAME_EVT_ADD_CARD] = self.OnAddCard - - - end function M:SendXiPaiAction(callBack) - local _data = {} - local _client = ControllerManager.GameNetClinet + local _client = ControllerManager.GameNetClinet _client:send(RB_Protocol.GAME_XIPAI, _data) - self.XiPaiCallBack=callBack + self.XiPaiCallBack = callBack end function M:OnEventDaNiaoTip(evt_data) - if ViewManager.GetCurrenView().dview_class == LobbyView then + if ViewManager.GetCurrenView().dview_class == LobbyView then self:ReturnToRoom() return end - local niao = evt_data["niao"] + local niao = evt_data["niao"] local reload = evt_data["reload"] - + self._cacheEvent:Enqueue( function() - DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.OnDaNiaoTips, niao,reload) - ControllerManager.IsSendCard=true + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.OnDaNiaoTips, niao, reload) + ControllerManager.IsSendCard = true end ) - - - end -function M:SendNiao(niao,callBack) +function M:SendNiao(niao, callBack) local _data = {} _data["niaoflag"] = niao local _client = ControllerManager.GameNetClinet _client:send(RB_Protocol.GAME_EVT_SEND_NIAO, _data) - self.NiaoTipsCallBack=callBack + self.NiaoTipsCallBack = callBack end function M:OnEventDaNiao(evt_data) local seat = evt_data["seat"] local niao = evt_data["niao"] - if seat==DataManager.CurrenRoom.self_player.seat then - if self.NiaoTipsCallBack then - self.NiaoTipsCallBack() - self.NiaoTipsCallBack=nil - end - end + if seat == DataManager.CurrenRoom.self_player.seat then + if self.NiaoTipsCallBack then + self.NiaoTipsCallBack() + self.NiaoTipsCallBack = nil + end + end self._cacheEvent:Enqueue( function() - DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.OnEventDaNiao, seat,niao) + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.OnEventDaNiao, seat, niao) end ) end function M:OnEventXiPai(evt_data) - - if evt_data["result"]==0 then - if self.XiPaiCallBack then - self.XiPaiCallBack() - end - else - ViewUtil.ErrorTip(1000000,"申请洗牌失败") - end - + if evt_data["result"] == 0 then + if self.XiPaiCallBack then + self.XiPaiCallBack() + end + else + ViewUtil.ErrorTip(1000000, "申请洗牌失败") + end end function M:OnEventXiPaiAnim(evt_data) - local playeridList = evt_data["list"] - local isXiPai=false + local playeridList = evt_data["list"] + local isXiPai = false local otherisXiPai = false - if playeridList and #playeridList>0 then - for i=1,#playeridList do - local p = self._room:GetPlayerById(playeridList[i]) - if p== self._room.self_player then - isXiPai=true - else - otherisXiPai=true - end - end - end - - self._cacheEvent:Enqueue(function() - DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.EventXiPai,isXiPai,otherisXiPai) - end) + if playeridList and #playeridList > 0 then + for i = 1, #playeridList do + local p = self._room:GetPlayerById(playeridList[i]) + if p == self._room.self_player then + isXiPai = true + else + otherisXiPai = true + end + end + end + + self._cacheEvent:Enqueue(function() + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.EventXiPai, isXiPai, otherisXiPai) + end) end -- 发送出牌指令到服务器 @@ -135,70 +126,67 @@ function M:SendOutCard(card) local _data = {} _data["card"] = card local _room = self._room - local _client = ControllerManager.GameNetClinet + local _client = ControllerManager.GameNetClinet if _client ~= nil then _client:send(RB_Protocol.GAME_DIS_CARD, _data) end - end + --GAME_CHANGE_CARD GAME_DIS_CARD -function M:SendChangeCards( card_list ) +function M:SendChangeCards(card_list) local _data = {} - if card_list then - _data["card_list"] = card_list - else - _data["card_list"]={} - end - local _client = ControllerManager.GameNetClinet + if card_list then + _data["card_list"] = card_list + else + _data["card_list"] = {} + end + local _client = ControllerManager.GameNetClinet if _client ~= nil then - _client:send(RB_Protocol.GAME_CHANGE_CARD, _data) + _client:send(RB_Protocol.GAME_CHANGE_CARD, _data) end end function M:SendFangPao(card) local _data = {} - if card then - _data["card"] = card - else - _data["card"]={} - end + if card then + _data["card"] = card + else + _data["card"] = {} + end - local _client = ControllerManager.GameNetClinet + local _client = ControllerManager.GameNetClinet if _client ~= nil then _client:send(RB_Protocol.GAME_EVT_FANGPAO, _data) end end - - function M:SendChangeTypeFace(TypeFace) -- body local _data = {} _data["typeface"] = TypeFace - local _client = ControllerManager.GameNetClinet + local _client = ControllerManager.GameNetClinet if _client ~= nil then - _client:send(RB_Protocol.GAME_CHANGE_TYPEfACE, _data) + _client:send(RB_Protocol.GAME_CHANGE_TYPEfACE, _data) end end - -function M:ConformToNextGame( ) - local _client = ControllerManager.GameNetClinet +function M:ConformToNextGame() + local _client = ControllerManager.GameNetClinet if _client ~= nil then - _client:send(RB_Protocol.GAME_EVT_CHUI) + _client:send(RB_Protocol.GAME_EVT_CHUI) end end -- 发送放子选择到服务器 -function M:SendAction(id,num) +function M:SendAction(id, num) local _data = {} _data["id"] = id - if num ~=nil then + if num ~= nil then _data["biid"] = num end local _client = ControllerManager.GameNetClinet - if _client ~= nil then - _client:send(RB_Protocol.GAME_ACTION, _data) + if _client ~= nil then + _client:send(RB_Protocol.GAME_ACTION, _data) end end @@ -208,25 +196,26 @@ function M:OnEventSendCards(evt_data) return end - local _room = self._room + local _room = self._room _room.curren_round = _room.curren_round + 1 if _room.curren_round > 0 then _room.playing = true end - local handcards = {} - if evt_data.card_list and #evt_data.card_list>0 then - handcards = evt_data["card_list"] - else - ViewUtil.ErrorTip(100000,"发牌数据异常") - end - + local handcards = {} + if evt_data.card_list and #evt_data.card_list > 0 then + handcards = evt_data["card_list"] + else + ViewUtil.ErrorTip(100000, "发牌数据异常") + end + local p = _room.self_player - local seat =nil - if evt_data.bank_seat then - seat = evt_data["bank_seat"] - else - ViewUtil.ErrorTip(100001,"发牌座位异常") - end _room.banker_seat = seat - for i=1,#_room.player_list do - _room.self_player.handcard_list ={} + local seat = nil + if evt_data.bank_seat then + seat = evt_data["bank_seat"] + else + ViewUtil.ErrorTip(100001, "发牌座位异常") + end + _room.banker_seat = seat + for i = 1, #_room.player_list do + _room.self_player.handcard_list = {} _room.self_player.card_list = {} _room.player_list[i].hand_left_count = 20 _room.player_list[i].fz_list = {} @@ -235,11 +224,11 @@ function M:OnEventSendCards(evt_data) _room.player_list[i].hu_xi = 0 end self._cacheEvent:Enqueue(function() - _room.self_player.handcard_list=handcards + _room.self_player.handcard_list = handcards self._room.self_player.hand_left_count = #handcards - DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.SendCards, p) - ControllerManager.IsSendCard=true - end) + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.SendCards, p) + ControllerManager.IsSendCard = true + end) end function M:OnEventOutCard(evt_data) @@ -247,16 +236,16 @@ function M:OnEventOutCard(evt_data) local card = evt_data["card"] --printlog("jefe OnEventOutCard>>>>",card) -- 判断是否对方有偎 - + local p = self._room:GetPlayerBySeat(seat) self._cacheEvent:Enqueue(function() - local _room = self._room - if(seat == _room.self_player.seat) then - list_remove(_room.self_player.handcard_list,card) + local _room = self._room + if (seat == _room.self_player.seat) then + list_remove(_room.self_player.handcard_list, card) end p.DiceCard = card - p.hand_left_count = p.hand_left_count -1 - DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.OutCard, p,card) + p.hand_left_count = p.hand_left_count - 1 + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.OutCard, p, card) end) end @@ -265,10 +254,10 @@ function M:OnEventQIPAI(evt_data) local card = evt_data["card"] local p = self._room:GetPlayerBySeat(seat) self._cacheEvent:Enqueue(function() - local _room = self._room - if(not p.outcard_list) then p.outcard_list = {} end - p.outcard_list[#p.outcard_list+1] = card - DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.QiCard, seat,card) + local _room = self._room + if (not p.outcard_list) then p.outcard_list = {} end + p.outcard_list[#p.outcard_list + 1] = card + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.QiCard, seat, card) end) end @@ -279,10 +268,10 @@ function M:OnEventTakeCard(evt_data) local left_count = evt_data["left_count"] local p = _room:GetPlayerBySeat(seat) self._cacheEvent:Enqueue(function() - if card ~=0 then + if card ~= 0 then p.DiceCard = card end - DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.GetCard, seat, card, left_count) + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.GetCard, seat, card, left_count) end) end @@ -291,77 +280,74 @@ function M:OnAddCard(evt_data) local seat = evt_data["seat"] local card = evt_data["card"] local p = _room:GetPlayerBySeat(seat) - + self._cacheEvent:Enqueue(function() p.DiceCard = card - p.hand_left_count = p.hand_left_count +1 + p.hand_left_count = p.hand_left_count + 1 if (seat == _room.self_player.seat) then - _room.self_player.handcard_list[#_room.self_player.handcard_list+1] = card + _room.self_player.handcard_list[#_room.self_player.handcard_list + 1] = card end - DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.AddCard, seat, card) + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.AddCard, seat, card) end) end function M:OnEventOutHint(evt_data) self._cacheEvent:Enqueue(function() - DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.OutHint) + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.OutHint) end) - end function M:OnEventTurn(evt_data) local seat = evt_data["seat"] self._cacheEvent:Enqueue(function() - DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.EventTurn, seat) + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.EventTurn, seat) end) end function M:OnEventFzTips(evt_data) - self._cacheEvent:Enqueue(function() local tiplist = FZTipList.new() - local list = evt_data["tip_list"] - local uid = evt_data["uid"] + local list = evt_data["tip_list"] + local uid = evt_data["uid"] local fptype = evt_data['fptype'] - for i=1,#list do - local dtip = list[i] - local tip = {} - tip.id = dtip["id"] - - -- if false then - tip.weight = dtip["weight"] - tip.card = dtip["card"] - tip.type = dtip["type"] - tip.bi_list = dtip["bi_list"] - if (dtip["opcard"]) then - local opcard = dtip["opcard"] - tip.OpCard = opcard - table.sort(tip.OpCard) - tip.OpCard[3] = tip.Card - end - tiplist:AddTip(tip) - -- end - + for i = 1, #list do + local dtip = list[i] + local tip = {} + tip.id = dtip["id"] + + -- if false then + tip.weight = dtip["weight"] + tip.card = dtip["card"] + tip.type = dtip["type"] + tip.bi_list = dtip["bi_list"] + if (dtip["opcard"]) then + local opcard = dtip["opcard"] + tip.OpCard = opcard + table.sort(tip.OpCard) + tip.OpCard[3] = tip.Card end - DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.FZTips, tiplist,uid,fptype) + tiplist:AddTip(tip) + -- end + end + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.FZTips, tiplist, uid, fptype) end) end -- 放喂提示 function M:OnEventFangWei(evt_data) - local seat = evt_data["seat"] - local card = evt_data["card"] + local seat = evt_data["seat"] + local card = evt_data["card"] self._cacheEvent:Enqueue(function() - DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.FangWei,seat,card) + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.FangWei, seat, card) end) end --放跑成功 function M:OnEventFangPaoOk(evt_data) - local seat = evt_data["seat"] - local card = evt_data["card"] + local seat = evt_data["seat"] + local card = evt_data["card"] self._cacheEvent:Enqueue(function() - DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.FangPaoOk,seat,card) + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.FangPaoOk, seat, card) end) end @@ -376,180 +362,172 @@ function M:OnEventFzAction(evt_data) local huxi = evt_data["hu_xi"] local p = _room:GetPlayerById(playerid) self._cacheEvent:Enqueue(function() - local isNeedDelHandCard =0 - p.hu_xi = huxi - local fz = {} - fz.card = card - fz.type = ftype - fz.active_card = actice_card - fz.from_seat = from_seat - fz.opcard =opcard - local remove_num = #opcard - if ftype == RB_FZType.Chi then - p.fz_list[#p.fz_list+1] = fz + local isNeedDelHandCard = 0 + p.hu_xi = huxi + local fz = {} + fz.card = card + fz.type = ftype + fz.active_card = actice_card + fz.from_seat = from_seat + fz.opcard = opcard + local remove_num = #opcard + if ftype == RB_FZType.Chi then + p.fz_list[#p.fz_list + 1] = fz if (p == _room.self_player) then - for i=1,remove_num do - list_remove(_room.self_player.handcard_list,opcard[i]) + for i = 1, remove_num do + list_remove(_room.self_player.handcard_list, opcard[i]) end end elseif ftype == RB_FZType.Bi then - p.fz_list[#p.fz_list+1] = fz + p.fz_list[#p.fz_list + 1] = fz if (p == _room.self_player) then - for i=1,remove_num do - list_remove(_room.self_player.handcard_list,opcard[i]) + for i = 1, remove_num do + list_remove(_room.self_player.handcard_list, opcard[i]) end - list_remove(_room.self_player.handcard_list,fz.card) + list_remove(_room.self_player.handcard_list, fz.card) end elseif ftype == RB_FZType.Peng then - p.fz_list[#p.fz_list+1] = fz + p.fz_list[#p.fz_list + 1] = fz if (p == _room.self_player) then - for i=1,remove_num do - list_remove(_room.self_player.handcard_list,opcard[i]) + for i = 1, remove_num do + list_remove(_room.self_player.handcard_list, opcard[i]) end end elseif ftype == RB_FZType.Kan then if (p == _room.self_player) then - if #opcard==2 then - _room.self_player.handcard_list[#_room.self_player.handcard_list+1] = card + if #opcard == 2 then + _room.self_player.handcard_list[#_room.self_player.handcard_list + 1] = card end - p.fz_list[#p.fz_list+1] = fz + p.fz_list[#p.fz_list + 1] = fz end elseif ftype == RB_FZType.ChouWei then - p.fz_list[#p.fz_list+1] = fz + p.fz_list[#p.fz_list + 1] = fz if (p == _room.self_player) then - for i=1,2 do - list_remove(_room.self_player.handcard_list,opcard[i]) + for i = 1, 2 do + list_remove(_room.self_player.handcard_list, opcard[i]) end - end + end elseif ftype == RB_FZType.Wei then - p.fz_list[#p.fz_list+1] = fz + p.fz_list[#p.fz_list + 1] = fz if (p == _room.self_player) then - for i=1,remove_num do - list_remove(_room.self_player.handcard_list,opcard[i]) + for i = 1, remove_num do + list_remove(_room.self_player.handcard_list, opcard[i]) end - end + end elseif ftype == RB_FZType.Pao then - - if (p == _room.self_player) then - for i=1,#p.fz_list do - if p.fz_list[i].card == card then - if p.fz_list[i].type == RB_FZType.Kan then - isNeedDelHandCard =3 - for i=1,remove_num do - list_remove(_room.self_player.handcard_list,opcard[i]) - end - end - remove_num= 0 - p.fz_list[i].type= RB_FZType.Pao - end - end - local num =0 - for i=1,#_room.self_player.handcard_list do - if card == _room.self_player.handcard_list[i] then - num=num+1 - end - end - if num>0 then - isNeedDelHandCard =num - - for i=1,num do - list_remove(_room.self_player.handcard_list,card) - end - local isAddTi =false - for i=1,#p.fz_list do - if p.fz_list[i].card == card then - p.fz_list[i].type= RB_FZType.Pao - isAddTi=true - remove_num= 0 - end - end - if isAddTi==false then - p.fz_list[#p.fz_list+1] = fz - end - end - - else - local num =0 - for i=1,#p.fz_list do - if p.fz_list[i].card == card then - p.fz_list[i].type= RB_FZType.Pao - num=1 - remove_num= 0 - end - end - if num==0 then - p.fz_list[#p.fz_list+1] = fz - end - end - - elseif ftype == RB_FZType.Ti then - if (p == _room.self_player) then - for i=1,#p.fz_list do + for i = 1, #p.fz_list do if p.fz_list[i].card == card then if p.fz_list[i].type == RB_FZType.Kan then - isNeedDelHandCard =3 - for i=1,remove_num do - list_remove(_room.self_player.handcard_list,opcard[i]) + isNeedDelHandCard = 3 + for i = 1, remove_num do + list_remove(_room.self_player.handcard_list, opcard[i]) end end - remove_num= 0 - p.fz_list[i].type= RB_FZType.Ti + remove_num = 0 + p.fz_list[i].type = RB_FZType.Pao end end - local num =0 - for i=1,#_room.self_player.handcard_list do + local num = 0 + for i = 1, #_room.self_player.handcard_list do if card == _room.self_player.handcard_list[i] then - num=num+1 + num = num + 1 end end - if num>0 then - isNeedDelHandCard =num + if num > 0 then + isNeedDelHandCard = num - for i=1,num do - list_remove(_room.self_player.handcard_list,card) + for i = 1, num do + list_remove(_room.self_player.handcard_list, card) end - local isAddTi =false - for i=1,#p.fz_list do + local isAddTi = false + for i = 1, #p.fz_list do if p.fz_list[i].card == card then - p.fz_list[i].type= RB_FZType.Ti - remove_num= 0 - isAddTi=true + p.fz_list[i].type = RB_FZType.Pao + isAddTi = true + remove_num = 0 end end - if isAddTi==false then - p.fz_list[#p.fz_list+1] = fz + if isAddTi == false then + p.fz_list[#p.fz_list + 1] = fz end end - else - local num =0 - for i=1,#p.fz_list do + local num = 0 + for i = 1, #p.fz_list do if p.fz_list[i].card == card then - p.fz_list[i].type= RB_FZType.Ti - remove_num= 0 - num=1 + p.fz_list[i].type = RB_FZType.Pao + num = 1 + remove_num = 0 end end - if num==0 then - p.fz_list[#p.fz_list+1] = fz + if num == 0 then + p.fz_list[#p.fz_list + 1] = fz end + end + elseif ftype == RB_FZType.Ti then + if (p == _room.self_player) then + for i = 1, #p.fz_list do + if p.fz_list[i].card == card then + if p.fz_list[i].type == RB_FZType.Kan then + isNeedDelHandCard = 3 + for i = 1, remove_num do + list_remove(_room.self_player.handcard_list, opcard[i]) + end + end + remove_num = 0 + p.fz_list[i].type = RB_FZType.Ti + end + end + local num = 0 + for i = 1, #_room.self_player.handcard_list do + if card == _room.self_player.handcard_list[i] then + num = num + 1 + end + end + if num > 0 then + isNeedDelHandCard = num - end - + for i = 1, num do + list_remove(_room.self_player.handcard_list, card) + end + local isAddTi = false + for i = 1, #p.fz_list do + if p.fz_list[i].card == card then + p.fz_list[i].type = RB_FZType.Ti + remove_num = 0 + isAddTi = true + end + end + if isAddTi == false then + p.fz_list[#p.fz_list + 1] = fz + end + end + else + local num = 0 + for i = 1, #p.fz_list do + if p.fz_list[i].card == card then + p.fz_list[i].type = RB_FZType.Ti + remove_num = 0 + num = 1 + end + end + if num == 0 then + p.fz_list[#p.fz_list + 1] = fz + end + end end - + p.hand_left_count = p.hand_left_count - remove_num - if fz.type == RB_FZType.Pao or fz.type == RB_FZType.Ti then + if fz.type == RB_FZType.Pao or fz.type == RB_FZType.Ti then coroutine.start(function() coroutine.wait(0.5) - DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.FangziAction, fz, p,isNeedDelHandCard) - end) - else - DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.FangziAction, fz, p,isNeedDelHandCard) + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.FangziAction, fz, p, isNeedDelHandCard) + end) + else + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.FangziAction, fz, p, isNeedDelHandCard) end - end) end @@ -558,11 +536,11 @@ function M:OnEventHu(evt_data) local win_p = self._room:GetPlayerBySeat(evt_data["seat"]) local lose_p = self._room:GetPlayerBySeat(evt_data["from_seat"]) -- print(win_p.hand_left_count) - + self._cacheEvent:Enqueue(function() win_p.card_list = cards - table.sort( win_p.card_list, ViewUtil.HandCardSort) - DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.ZPHuCard, evt_data["seat"],evt_data["from_seat"],cards) + table.sort(win_p.card_list, ViewUtil.HandCardSort) + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.ZPHuCard, evt_data["seat"], evt_data["from_seat"], cards) end) end @@ -570,29 +548,28 @@ function M:OneventResult1(evt_data) local over = evt_data.type --0:小结算 1:小大结算 2:大结算 self._room.playing = false - - if 0 == over then + if 0 == over then local result = evt_data.result for i = 1, #self._room.player_list do local p = self._room.player_list[i] p.hand_left_count = 0 p.outcard_list = {} end - + self._cacheEvent:Enqueue(function() - DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.ZPResult1, result); + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.ZPResult1, result); end) elseif 1 == over or 2 == over then DataManager.CurrenRoom.Over = true - ControllerManager.SetGameNetClient(nil,true) + ControllerManager.SetGameNetClient(nil, true) local total_result = evt_data.total_result - + local result = evt_data.result self._cacheEvent:Enqueue(function() - DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.ZPResult2, result, total_result, over); + DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.ZPResult2, result, total_result, over); end) end end -return M \ No newline at end of file +return M diff --git a/wb_new_ui/.objs/metas/m7iejg46/10snh5j.info b/wb_new_ui/.objs/metas/m7iejg46/10snh5j.info index 3554d73c..2aede8fe 100644 --- a/wb_new_ui/.objs/metas/m7iejg46/10snh5j.info +++ b/wb_new_ui/.objs/metas/m7iejg46/10snh5j.info @@ -18,6 +18,9 @@ "n175_mn85": { "collapsed": true }, + "n74_i7lq": { + "locked": true + }, "n243_n6w8": { "hidden": true }, diff --git a/wb_new_ui/assets/Main_RunBeard/component/Main/component/Player_card_info_2.xml b/wb_new_ui/assets/Main_RunBeard/component/Main/component/Player_card_info_2.xml index 581f0e15..2b78d0b5 100644 --- a/wb_new_ui/assets/Main_RunBeard/component/Main/component/Player_card_info_2.xml +++ b/wb_new_ui/assets/Main_RunBeard/component/Main/component/Player_card_info_2.xml @@ -1,7 +1,7 @@ - + diff --git a/wb_new_ui/assets/NewGroup/Main_GroupInfo.xml b/wb_new_ui/assets/NewGroup/Main_GroupInfo.xml index 13c128e6..8af1efa6 100644 --- a/wb_new_ui/assets/NewGroup/Main_GroupInfo.xml +++ b/wb_new_ui/assets/NewGroup/Main_GroupInfo.xml @@ -27,7 +27,7 @@ - + @@ -119,7 +119,7 @@ - + @@ -134,7 +134,7 @@ - + @@ -142,7 +142,7 @@ - + @@ -187,7 +187,7 @@ - + diff --git a/wb_new_ui/assets/NewGroup/component/Lst_info/btn_layer_item.xml b/wb_new_ui/assets/NewGroup/component/Lst_info/btn_layer_item.xml index f4ecb399..97dfa829 100644 --- a/wb_new_ui/assets/NewGroup/component/Lst_info/btn_layer_item.xml +++ b/wb_new_ui/assets/NewGroup/component/Lst_info/btn_layer_item.xml @@ -6,7 +6,7 @@ - + @@ -18,12 +18,12 @@ - + - +