亲友圈玩法列表按规则排序

master
罗家炜 2025-06-23 04:57:54 +08:00
parent 8b5c8c3489
commit 095b2079fe
7 changed files with 294 additions and 294 deletions

View File

@ -913,6 +913,7 @@ local function __analysePlayListData(self)
self.playIdList[count] = p_data.id self.playIdList[count] = p_data.id
end end
end end
table.sort(self.playIdList, handler(self, self.SortPlayList))
local lst_layer = self.lst_layer local lst_layer = self.lst_layer
-- printlog("添加玩法====>>>>",count) -- printlog("添加玩法====>>>>",count)
@ -1355,6 +1356,7 @@ function M:__loadLastData()
table.insert(self.curRooms, room) table.insert(self.curRooms, room)
self.playNames[t.id] = t.name self.playNames[t.id] = t.name
end end
table.sort(self.playIdList, handler(self, self.SortPlayList))
self.lst_game.numItems = #self.gameIdList + 1 self.lst_game.numItems = #self.gameIdList + 1
self.lst_layer.visible = false self.lst_layer.visible = false
--self.line1.visible = false --self.line1.visible = false
@ -2124,6 +2126,23 @@ function M:Show()
end end
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() function M:Destroy()
BaseView.Destroy(self) BaseView.Destroy(self)
UpdateBeat:Remove(self.__onUpdate, self) UpdateBeat:Remove(self.__onUpdate, self)

View File

@ -494,6 +494,7 @@ function M:FillFagData()
play.maxPlayers = _data.maxPlayers play.maxPlayers = _data.maxPlayers
play.roomNum = self.hpData.tex_times_room / 100 play.roomNum = self.hpData.tex_times_room / 100
play.maxRound = res.Data.maxRound play.maxRound = res.Data.maxRound
play.gameType = res.Data.gameType
ViewUtil.ShowBannerOnScreenCenter("添加玩法成功") ViewUtil.ShowBannerOnScreenCenter("添加玩法成功")
self.callback(play) self.callback(play)
self:Destroy() self:Destroy()

View File

@ -5,15 +5,15 @@ local M = {}
--- Create a new HZ_GameController --- Create a new HZ_GameController
function M.new() function M.new()
setmetatable(M,{__index = GameController}) setmetatable(M, { __index = GameController })
local self = setmetatable({}, {__index = M}) local self = setmetatable({}, { __index = M })
self:init("放炮罚") self:init("放炮罚")
self.class = "RB_GameController" self.class = "RB_GameController"
return self return self
end end
function M:init(name) 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_PLAYER_DEAL] = self.OnEventSendCards
self._eventmap[RB_Protocol.GAME_EVT_CHANGE_ACTIVE_PLAYER] = self.OnEventTurn self._eventmap[RB_Protocol.GAME_EVT_CHANGE_ACTIVE_PLAYER] = self.OnEventTurn
@ -41,17 +41,13 @@ function M:init(name)
self._eventmap[RB_Protocol.GAME_EVT_RESULT1] = self.OneventResult1 self._eventmap[RB_Protocol.GAME_EVT_RESULT1] = self.OneventResult1
self._eventmap[RB_Protocol.GAME_EVT_QIPAI] = self.OnEventQIPAI self._eventmap[RB_Protocol.GAME_EVT_QIPAI] = self.OnEventQIPAI
self._eventmap[RB_Protocol.GAME_EVT_ADD_CARD] = self.OnAddCard self._eventmap[RB_Protocol.GAME_EVT_ADD_CARD] = self.OnAddCard
end end
function M:SendXiPaiAction(callBack) function M:SendXiPaiAction(callBack)
local _data = {} local _data = {}
local _client = ControllerManager.GameNetClinet local _client = ControllerManager.GameNetClinet
_client:send(RB_Protocol.GAME_XIPAI, _data) _client:send(RB_Protocol.GAME_XIPAI, _data)
self.XiPaiCallBack=callBack self.XiPaiCallBack = callBack
end end
function M:OnEventDaNiaoTip(evt_data) function M:OnEventDaNiaoTip(evt_data)
@ -65,68 +61,63 @@ function M:OnEventDaNiaoTip(evt_data)
self._cacheEvent:Enqueue( self._cacheEvent:Enqueue(
function() function()
DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.OnDaNiaoTips, niao,reload) DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.OnDaNiaoTips, niao, reload)
ControllerManager.IsSendCard=true ControllerManager.IsSendCard = true
end end
) )
end end
function M:SendNiao(niao,callBack) function M:SendNiao(niao, callBack)
local _data = {} local _data = {}
_data["niaoflag"] = niao _data["niaoflag"] = niao
local _client = ControllerManager.GameNetClinet local _client = ControllerManager.GameNetClinet
_client:send(RB_Protocol.GAME_EVT_SEND_NIAO, _data) _client:send(RB_Protocol.GAME_EVT_SEND_NIAO, _data)
self.NiaoTipsCallBack=callBack self.NiaoTipsCallBack = callBack
end end
function M:OnEventDaNiao(evt_data) function M:OnEventDaNiao(evt_data)
local seat = evt_data["seat"] local seat = evt_data["seat"]
local niao = evt_data["niao"] local niao = evt_data["niao"]
if seat==DataManager.CurrenRoom.self_player.seat then if seat == DataManager.CurrenRoom.self_player.seat then
if self.NiaoTipsCallBack then if self.NiaoTipsCallBack then
self.NiaoTipsCallBack() self.NiaoTipsCallBack()
self.NiaoTipsCallBack=nil self.NiaoTipsCallBack = nil
end end
end end
self._cacheEvent:Enqueue( self._cacheEvent:Enqueue(
function() function()
DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.OnEventDaNiao, seat,niao) DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.OnEventDaNiao, seat, niao)
end end
) )
end end
function M:OnEventXiPai(evt_data) function M:OnEventXiPai(evt_data)
if evt_data["result"] == 0 then
if evt_data["result"]==0 then
if self.XiPaiCallBack then if self.XiPaiCallBack then
self.XiPaiCallBack() self.XiPaiCallBack()
end end
else else
ViewUtil.ErrorTip(1000000,"申请洗牌失败") ViewUtil.ErrorTip(1000000, "申请洗牌失败")
end end
end end
function M:OnEventXiPaiAnim(evt_data) function M:OnEventXiPaiAnim(evt_data)
local playeridList = evt_data["list"] local playeridList = evt_data["list"]
local isXiPai=false local isXiPai = false
local otherisXiPai = false local otherisXiPai = false
if playeridList and #playeridList>0 then if playeridList and #playeridList > 0 then
for i=1,#playeridList do for i = 1, #playeridList do
local p = self._room:GetPlayerById(playeridList[i]) local p = self._room:GetPlayerById(playeridList[i])
if p== self._room.self_player then if p == self._room.self_player then
isXiPai=true isXiPai = true
else else
otherisXiPai=true otherisXiPai = true
end end
end end
end end
self._cacheEvent:Enqueue(function() self._cacheEvent:Enqueue(function()
DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.EventXiPai,isXiPai,otherisXiPai) DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.EventXiPai, isXiPai, otherisXiPai)
end) end)
end end
@ -139,15 +130,15 @@ function M:SendOutCard(card)
if _client ~= nil then if _client ~= nil then
_client:send(RB_Protocol.GAME_DIS_CARD, _data) _client:send(RB_Protocol.GAME_DIS_CARD, _data)
end end
end end
--GAME_CHANGE_CARD GAME_DIS_CARD --GAME_CHANGE_CARD GAME_DIS_CARD
function M:SendChangeCards( card_list ) function M:SendChangeCards(card_list)
local _data = {} local _data = {}
if card_list then if card_list then
_data["card_list"] = card_list _data["card_list"] = card_list
else else
_data["card_list"]={} _data["card_list"] = {}
end end
local _client = ControllerManager.GameNetClinet local _client = ControllerManager.GameNetClinet
if _client ~= nil then if _client ~= nil then
@ -160,7 +151,7 @@ function M:SendFangPao(card)
if card then if card then
_data["card"] = card _data["card"] = card
else else
_data["card"]={} _data["card"] = {}
end end
local _client = ControllerManager.GameNetClinet local _client = ControllerManager.GameNetClinet
@ -169,8 +160,6 @@ function M:SendFangPao(card)
end end
end end
function M:SendChangeTypeFace(TypeFace) function M:SendChangeTypeFace(TypeFace)
-- body -- body
local _data = {} local _data = {}
@ -181,8 +170,7 @@ function M:SendChangeTypeFace(TypeFace)
end end
end end
function M:ConformToNextGame()
function M:ConformToNextGame( )
local _client = ControllerManager.GameNetClinet local _client = ControllerManager.GameNetClinet
if _client ~= nil then if _client ~= nil then
_client:send(RB_Protocol.GAME_EVT_CHUI) _client:send(RB_Protocol.GAME_EVT_CHUI)
@ -190,10 +178,10 @@ function M:ConformToNextGame( )
end end
-- 发送放子选择到服务器 -- 发送放子选择到服务器
function M:SendAction(id,num) function M:SendAction(id, num)
local _data = {} local _data = {}
_data["id"] = id _data["id"] = id
if num ~=nil then if num ~= nil then
_data["biid"] = num _data["biid"] = num
end end
local _client = ControllerManager.GameNetClinet local _client = ControllerManager.GameNetClinet
@ -212,21 +200,22 @@ function M:OnEventSendCards(evt_data)
_room.curren_round = _room.curren_round + 1 _room.curren_round = _room.curren_round + 1
if _room.curren_round > 0 then _room.playing = true end if _room.curren_round > 0 then _room.playing = true end
local handcards = {} local handcards = {}
if evt_data.card_list and #evt_data.card_list>0 then if evt_data.card_list and #evt_data.card_list > 0 then
handcards = evt_data["card_list"] handcards = evt_data["card_list"]
else else
ViewUtil.ErrorTip(100000,"发牌数据异常") ViewUtil.ErrorTip(100000, "发牌数据异常")
end end
local p = _room.self_player local p = _room.self_player
local seat =nil local seat = nil
if evt_data.bank_seat then if evt_data.bank_seat then
seat = evt_data["bank_seat"] seat = evt_data["bank_seat"]
else else
ViewUtil.ErrorTip(100001,"发牌座位异常") ViewUtil.ErrorTip(100001, "发牌座位异常")
end _room.banker_seat = seat end
for i=1,#_room.player_list do _room.banker_seat = seat
_room.self_player.handcard_list ={} for i = 1, #_room.player_list do
_room.self_player.handcard_list = {}
_room.self_player.card_list = {} _room.self_player.card_list = {}
_room.player_list[i].hand_left_count = 20 _room.player_list[i].hand_left_count = 20
_room.player_list[i].fz_list = {} _room.player_list[i].fz_list = {}
@ -235,10 +224,10 @@ function M:OnEventSendCards(evt_data)
_room.player_list[i].hu_xi = 0 _room.player_list[i].hu_xi = 0
end end
self._cacheEvent:Enqueue(function() self._cacheEvent:Enqueue(function()
_room.self_player.handcard_list=handcards _room.self_player.handcard_list = handcards
self._room.self_player.hand_left_count = #handcards self._room.self_player.hand_left_count = #handcards
DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.SendCards, p) DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.SendCards, p)
ControllerManager.IsSendCard=true ControllerManager.IsSendCard = true
end) end)
end end
@ -251,12 +240,12 @@ function M:OnEventOutCard(evt_data)
local p = self._room:GetPlayerBySeat(seat) local p = self._room:GetPlayerBySeat(seat)
self._cacheEvent:Enqueue(function() self._cacheEvent:Enqueue(function()
local _room = self._room local _room = self._room
if(seat == _room.self_player.seat) then if (seat == _room.self_player.seat) then
list_remove(_room.self_player.handcard_list,card) list_remove(_room.self_player.handcard_list, card)
end end
p.DiceCard = card p.DiceCard = card
p.hand_left_count = p.hand_left_count -1 p.hand_left_count = p.hand_left_count - 1
DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.OutCard, p,card) DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.OutCard, p, card)
end) end)
end end
@ -266,9 +255,9 @@ function M:OnEventQIPAI(evt_data)
local p = self._room:GetPlayerBySeat(seat) local p = self._room:GetPlayerBySeat(seat)
self._cacheEvent:Enqueue(function() self._cacheEvent:Enqueue(function()
local _room = self._room local _room = self._room
if(not p.outcard_list) then p.outcard_list = {} end if (not p.outcard_list) then p.outcard_list = {} end
p.outcard_list[#p.outcard_list+1] = card p.outcard_list[#p.outcard_list + 1] = card
DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.QiCard, seat,card) DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.QiCard, seat, card)
end) end)
end end
@ -279,10 +268,10 @@ function M:OnEventTakeCard(evt_data)
local left_count = evt_data["left_count"] local left_count = evt_data["left_count"]
local p = _room:GetPlayerBySeat(seat) local p = _room:GetPlayerBySeat(seat)
self._cacheEvent:Enqueue(function() self._cacheEvent:Enqueue(function()
if card ~=0 then if card ~= 0 then
p.DiceCard = card p.DiceCard = card
end end
DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.GetCard, seat, card, left_count) DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.GetCard, seat, card, left_count)
end) end)
end end
@ -294,36 +283,34 @@ function M:OnAddCard(evt_data)
self._cacheEvent:Enqueue(function() self._cacheEvent:Enqueue(function()
p.DiceCard = card 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 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 end
DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.AddCard, seat, card) DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.AddCard, seat, card)
end) end)
end end
function M:OnEventOutHint(evt_data) function M:OnEventOutHint(evt_data)
self._cacheEvent:Enqueue(function() self._cacheEvent:Enqueue(function()
DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.OutHint) DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.OutHint)
end) end)
end end
function M:OnEventTurn(evt_data) function M:OnEventTurn(evt_data)
local seat = evt_data["seat"] local seat = evt_data["seat"]
self._cacheEvent:Enqueue(function() self._cacheEvent:Enqueue(function()
DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.EventTurn, seat) DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.EventTurn, seat)
end) end)
end end
function M:OnEventFzTips(evt_data) function M:OnEventFzTips(evt_data)
self._cacheEvent:Enqueue(function() self._cacheEvent:Enqueue(function()
local tiplist = FZTipList.new() local tiplist = FZTipList.new()
local list = evt_data["tip_list"] local list = evt_data["tip_list"]
local uid = evt_data["uid"] local uid = evt_data["uid"]
local fptype = evt_data['fptype'] local fptype = evt_data['fptype']
for i=1,#list do for i = 1, #list do
local dtip = list[i] local dtip = list[i]
local tip = {} local tip = {}
tip.id = dtip["id"] tip.id = dtip["id"]
@ -341,9 +328,8 @@ function M:OnEventFzTips(evt_data)
end end
tiplist:AddTip(tip) tiplist:AddTip(tip)
-- end -- end
end end
DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.FZTips, tiplist,uid,fptype) DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.FZTips, tiplist, uid, fptype)
end) end)
end end
@ -352,7 +338,7 @@ function M:OnEventFangWei(evt_data)
local seat = evt_data["seat"] local seat = evt_data["seat"]
local card = evt_data["card"] local card = evt_data["card"]
self._cacheEvent:Enqueue(function() self._cacheEvent:Enqueue(function()
DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.FangWei,seat,card) DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.FangWei, seat, card)
end) end)
end end
@ -361,7 +347,7 @@ function M:OnEventFangPaoOk(evt_data)
local seat = evt_data["seat"] local seat = evt_data["seat"]
local card = evt_data["card"] local card = evt_data["card"]
self._cacheEvent:Enqueue(function() self._cacheEvent:Enqueue(function()
DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.FangPaoOk,seat,card) DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.FangPaoOk, seat, card)
end) end)
end end
@ -376,167 +362,160 @@ function M:OnEventFzAction(evt_data)
local huxi = evt_data["hu_xi"] local huxi = evt_data["hu_xi"]
local p = _room:GetPlayerById(playerid) local p = _room:GetPlayerById(playerid)
self._cacheEvent:Enqueue(function() self._cacheEvent:Enqueue(function()
local isNeedDelHandCard =0 local isNeedDelHandCard = 0
p.hu_xi = huxi p.hu_xi = huxi
local fz = {} local fz = {}
fz.card = card fz.card = card
fz.type = ftype fz.type = ftype
fz.active_card = actice_card fz.active_card = actice_card
fz.from_seat = from_seat fz.from_seat = from_seat
fz.opcard =opcard fz.opcard = opcard
local remove_num = #opcard local remove_num = #opcard
if ftype == RB_FZType.Chi then if ftype == RB_FZType.Chi then
p.fz_list[#p.fz_list+1] = fz p.fz_list[#p.fz_list + 1] = fz
if (p == _room.self_player) then if (p == _room.self_player) then
for i=1,remove_num do for i = 1, remove_num do
list_remove(_room.self_player.handcard_list,opcard[i]) list_remove(_room.self_player.handcard_list, opcard[i])
end end
end end
elseif ftype == RB_FZType.Bi then 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 if (p == _room.self_player) then
for i=1,remove_num do for i = 1, remove_num do
list_remove(_room.self_player.handcard_list,opcard[i]) list_remove(_room.self_player.handcard_list, opcard[i])
end end
list_remove(_room.self_player.handcard_list,fz.card) list_remove(_room.self_player.handcard_list, fz.card)
end end
elseif ftype == RB_FZType.Peng then 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 if (p == _room.self_player) then
for i=1,remove_num do for i = 1, remove_num do
list_remove(_room.self_player.handcard_list,opcard[i]) list_remove(_room.self_player.handcard_list, opcard[i])
end end
end end
elseif ftype == RB_FZType.Kan then elseif ftype == RB_FZType.Kan then
if (p == _room.self_player) then if (p == _room.self_player) then
if #opcard==2 then if #opcard == 2 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 end
p.fz_list[#p.fz_list+1] = fz p.fz_list[#p.fz_list + 1] = fz
end end
elseif ftype == RB_FZType.ChouWei then 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 if (p == _room.self_player) then
for i=1,2 do for i = 1, 2 do
list_remove(_room.self_player.handcard_list,opcard[i]) list_remove(_room.self_player.handcard_list, opcard[i])
end end
end end
elseif ftype == RB_FZType.Wei then 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 if (p == _room.self_player) then
for i=1,remove_num do for i = 1, remove_num do
list_remove(_room.self_player.handcard_list,opcard[i]) list_remove(_room.self_player.handcard_list, opcard[i])
end end
end end
elseif ftype == RB_FZType.Pao then elseif ftype == RB_FZType.Pao then
if (p == _room.self_player) 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].card == card then
if p.fz_list[i].type == RB_FZType.Kan then if p.fz_list[i].type == RB_FZType.Kan then
isNeedDelHandCard =3 isNeedDelHandCard = 3
for i=1,remove_num do for i = 1, remove_num do
list_remove(_room.self_player.handcard_list,opcard[i]) list_remove(_room.self_player.handcard_list, opcard[i])
end end
end end
remove_num= 0 remove_num = 0
p.fz_list[i].type= RB_FZType.Pao p.fz_list[i].type = RB_FZType.Pao
end end
end end
local num =0 local num = 0
for i=1,#_room.self_player.handcard_list do for i = 1, #_room.self_player.handcard_list do
if card == _room.self_player.handcard_list[i] then if card == _room.self_player.handcard_list[i] then
num=num+1 num = num + 1
end end
end end
if num>0 then if num > 0 then
isNeedDelHandCard =num isNeedDelHandCard = num
for i=1,num do for i = 1, num do
list_remove(_room.self_player.handcard_list,card) list_remove(_room.self_player.handcard_list, card)
end end
local isAddTi =false local isAddTi = false
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].card == card then
p.fz_list[i].type= RB_FZType.Pao p.fz_list[i].type = RB_FZType.Pao
isAddTi=true isAddTi = true
remove_num= 0 remove_num = 0
end end
end end
if isAddTi==false then if isAddTi == false then
p.fz_list[#p.fz_list+1] = fz p.fz_list[#p.fz_list + 1] = fz
end end
end end
else else
local num =0 local num = 0
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].card == card then
p.fz_list[i].type= RB_FZType.Pao p.fz_list[i].type = RB_FZType.Pao
num=1 num = 1
remove_num= 0 remove_num = 0
end end
end end
if num==0 then if num == 0 then
p.fz_list[#p.fz_list+1] = fz p.fz_list[#p.fz_list + 1] = fz
end end
end end
elseif ftype == RB_FZType.Ti then elseif ftype == RB_FZType.Ti then
if (p == _room.self_player) 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].card == card then
if p.fz_list[i].type == RB_FZType.Kan then if p.fz_list[i].type == RB_FZType.Kan then
isNeedDelHandCard =3 isNeedDelHandCard = 3
for i=1,remove_num do for i = 1, remove_num do
list_remove(_room.self_player.handcard_list,opcard[i]) list_remove(_room.self_player.handcard_list, opcard[i])
end end
end end
remove_num= 0 remove_num = 0
p.fz_list[i].type= RB_FZType.Ti p.fz_list[i].type = RB_FZType.Ti
end end
end end
local num =0 local num = 0
for i=1,#_room.self_player.handcard_list do for i = 1, #_room.self_player.handcard_list do
if card == _room.self_player.handcard_list[i] then if card == _room.self_player.handcard_list[i] then
num=num+1 num = num + 1
end end
end end
if num>0 then if num > 0 then
isNeedDelHandCard =num isNeedDelHandCard = num
for i=1,num do for i = 1, num do
list_remove(_room.self_player.handcard_list,card) list_remove(_room.self_player.handcard_list, card)
end end
local isAddTi =false local isAddTi = false
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].card == card then
p.fz_list[i].type= RB_FZType.Ti p.fz_list[i].type = RB_FZType.Ti
remove_num= 0 remove_num = 0
isAddTi=true isAddTi = true
end end
end end
if isAddTi==false then if isAddTi == false then
p.fz_list[#p.fz_list+1] = fz p.fz_list[#p.fz_list + 1] = fz
end end
end end
else else
local num =0 local num = 0
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].card == card then
p.fz_list[i].type= RB_FZType.Ti p.fz_list[i].type = RB_FZType.Ti
remove_num= 0 remove_num = 0
num=1 num = 1
end end
end end
if num==0 then if num == 0 then
p.fz_list[#p.fz_list+1] = fz p.fz_list[#p.fz_list + 1] = fz
end end
end end
end end
@ -544,12 +523,11 @@ function M:OnEventFzAction(evt_data)
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.start(function()
coroutine.wait(0.5) coroutine.wait(0.5)
DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.FangziAction, fz, p,isNeedDelHandCard) DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.FangziAction, fz, p, isNeedDelHandCard)
end) end)
else else
DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.FangziAction, fz, p,isNeedDelHandCard) DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.FangziAction, fz, p, isNeedDelHandCard)
end end
end) end)
end end
@ -561,8 +539,8 @@ function M:OnEventHu(evt_data)
self._cacheEvent:Enqueue(function() self._cacheEvent:Enqueue(function()
win_p.card_list = cards win_p.card_list = cards
table.sort( win_p.card_list, ViewUtil.HandCardSort) table.sort(win_p.card_list, ViewUtil.HandCardSort)
DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.ZPHuCard, evt_data["seat"],evt_data["from_seat"],cards) DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.ZPHuCard, evt_data["seat"], evt_data["from_seat"], cards)
end) end)
end end
@ -572,7 +550,6 @@ function M:OneventResult1(evt_data)
self._room.playing = false self._room.playing = false
if 0 == over then if 0 == over then
local result = evt_data.result local result = evt_data.result
for i = 1, #self._room.player_list do for i = 1, #self._room.player_list do
local p = self._room.player_list[i] local p = self._room.player_list[i]
@ -581,16 +558,16 @@ function M:OneventResult1(evt_data)
end end
self._cacheEvent:Enqueue(function() self._cacheEvent:Enqueue(function()
DispatchEvent(self._dispatcher,FanPaoFa_GameEvent.ZPResult1, result); DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.ZPResult1, result);
end) end)
elseif 1 == over or 2 == over then elseif 1 == over or 2 == over then
DataManager.CurrenRoom.Over = true DataManager.CurrenRoom.Over = true
ControllerManager.SetGameNetClient(nil,true) ControllerManager.SetGameNetClient(nil, true)
local total_result = evt_data.total_result local total_result = evt_data.total_result
local result = evt_data.result local result = evt_data.result
self._cacheEvent:Enqueue(function() 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 end
end end

View File

@ -18,6 +18,9 @@
"n175_mn85": { "n175_mn85": {
"collapsed": true "collapsed": true
}, },
"n74_i7lq": {
"locked": true
},
"n243_n6w8": { "n243_n6w8": {
"hidden": true "hidden": true
}, },

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<component size="200,750" opaque="false" initName="player_card_info"> <component size="200,750" opaque="false" initName="player_card_info">
<displayList> <displayList>
<list id="n47_lr5d" name="area_fz_list" xy="16,2" pivot="0.5,0.5" size="315,173" rotation="180" layout="row" scroll="horizontal" colGap="5" defaultItem="ui://v6yvqp7wlr5d30" align="right" vAlign="bottom"/> <list id="n47_lr5d" name="area_fz_list" xy="11,2" pivot="0.5,0.5" size="465,173" rotation="180" layout="row" scroll="horizontal" colGap="5" defaultItem="ui://v6yvqp7wyxjj19a" align="right" vAlign="bottom"/>
<list id="n48_lr5d" name="windcard_list" xy="16,196" size="280,78" layout="flow_hz" selectionMode="none" scroll="horizontal" lineGap="1" colGap="1" defaultItem="ui://v6yvqp7wf55qvw" vAlign="bottom"/> <list id="n48_lr5d" name="windcard_list" xy="16,196" size="280,78" layout="flow_hz" selectionMode="none" scroll="horizontal" lineGap="1" colGap="1" defaultItem="ui://v6yvqp7wf55qvw" vAlign="bottom"/>
<component id="n50_n1ry" name="mask_liangpai" src="djzo18" fileName="component/Component1.xml" pkg="27vd145b" xy="200,83" size="5,5"/> <component id="n50_n1ry" name="mask_liangpai" src="djzo18" fileName="component/Component1.xml" pkg="27vd145b" xy="200,83" size="5,5"/>
<component id="n25" name="area_outcard_list" src="djzo18" fileName="component/Component1.xml" pkg="27vd145b" xy="322,19" size="67,182" touchable="false"/> <component id="n25" name="area_outcard_list" src="djzo18" fileName="component/Component1.xml" pkg="27vd145b" xy="322,19" size="67,182" touchable="false"/>

View File

@ -27,7 +27,7 @@
<image id="n245_ilon" name="n245" src="n6w87i9h" fileName="images/Rectangle 9.png" xy="0,1" size="1334,120"> <image id="n245_ilon" name="n245" src="n6w87i9h" fileName="images/Rectangle 9.png" xy="0,1" size="1334,120">
<relation target="" sidePair="width-width%"/> <relation target="" sidePair="width-width%"/>
</image> </image>
<image id="n244_n6w8" name="n244" src="n6w87i9h" fileName="images/Rectangle 9.png" xy="0,661" size="1334,89"> <image id="n244_n6w8" name="n244" src="n6w87i9h" fileName="images/Rectangle 9.png" xy="0,662" size="1334,86">
<relation target="" sidePair="width-width%,height-height%"/> <relation target="" sidePair="width-width%,height-height%"/>
</image> </image>
<image id="n246_ilon" name="n246" src="ilon7i9i" fileName="Rectangle 12.png" xy="0,0" size="249,121"/> <image id="n246_ilon" name="n246" src="ilon7i9i" fileName="Rectangle 12.png" xy="0,0" size="249,121"/>
@ -119,7 +119,7 @@
<image id="n248_ilon" name="n248" src="ilon7i9j" fileName="Rectangle 13.png" xy="261,46" size="212,69" group="n206_jvvo"> <image id="n248_ilon" name="n248" src="ilon7i9j" fileName="Rectangle 13.png" xy="261,46" size="212,69" group="n206_jvvo">
<relation target="" sidePair="left-left,top-top"/> <relation target="" sidePair="left-left,top-top"/>
</image> </image>
<text id="n251_ilon" name="tex_hp_title" xy="273,49" size="76,31" group="n206_jvvo" font="Microsoft YaHei" fontSize="22" color="#ffffff" align="center" vAlign="middle" bold="true" text="疲劳值:"> <text id="n251_ilon" name="tex_hp_title" xy="273,49" size="76,32" group="n206_jvvo" font="Microsoft YaHei" fontSize="22" color="#ffffff" align="center" vAlign="middle" bold="true" text="疲劳值:">
<relation target="" sidePair="left-left,top-top"/> <relation target="" sidePair="left-left,top-top"/>
</text> </text>
<text id="n250_ilon" name="tex_fag" xy="355,49" size="113,32" group="n206_jvvo" font="Microsoft YaHei" fontSize="22" color="#ffffff" vAlign="middle" autoSize="none" bold="true" text="A79B17"> <text id="n250_ilon" name="tex_fag" xy="355,49" size="113,32" group="n206_jvvo" font="Microsoft YaHei" fontSize="22" color="#ffffff" vAlign="middle" autoSize="none" bold="true" text="A79B17">
@ -134,7 +134,7 @@
<text id="n205_jvvo" name="tex_hp" xy="344,80" size="113,32" group="n206_jvvo" font="Microsoft YaHei" fontSize="22" color="#ffffff" vAlign="middle" autoSize="none" bold="true" text="7"> <text id="n205_jvvo" name="tex_hp" xy="344,80" size="113,32" group="n206_jvvo" font="Microsoft YaHei" fontSize="22" color="#ffffff" vAlign="middle" autoSize="none" bold="true" text="7">
<relation target="" sidePair="left-left,top-top"/> <relation target="" sidePair="left-left,top-top"/>
</text> </text>
<text id="n216_ovii" name="n216" xy="221,-77" size="94,41" group="n206_jvvo" visible="false" font="Microsoft YaHei" fontSize="30" color="#ffffff" vAlign="middle" text="积分:"> <text id="n216_ovii" name="n216" xy="221,-77" size="94,42" group="n206_jvvo" visible="false" font="Microsoft YaHei" fontSize="30" color="#ffffff" vAlign="middle" text="积分:">
<relation target="" sidePair="left-left,top-top"/> <relation target="" sidePair="left-left,top-top"/>
</text> </text>
<image id="n229_csp4" name="n229" src="csp47i3u" fileName="images/room/jifen.png" xy="237,-61" group="n206_jvvo" visible="false"/> <image id="n229_csp4" name="n229" src="csp47i3u" fileName="images/room/jifen.png" xy="237,-61" group="n206_jvvo" visible="false"/>
@ -142,7 +142,7 @@
<text id="n253_ilon" name="tex_id" xy="90,53" size="158,39" group="n78_i7lq" font="Microsoft YaHei" fontSize="28" color="#ffffff" vAlign="middle" autoSize="shrink" bold="true" text="老司机带带我"> <text id="n253_ilon" name="tex_id" xy="90,53" size="158,39" group="n78_i7lq" font="Microsoft YaHei" fontSize="28" color="#ffffff" vAlign="middle" autoSize="shrink" bold="true" text="老司机带带我">
<relation target="" sidePair="left-left,top-top"/> <relation target="" sidePair="left-left,top-top"/>
</text> </text>
<text id="n254_ilon" name="tex_tableNum" xy="90,87" size="136,31" group="n78_i7lq" font="Microsoft YaHei" fontSize="22" color="#ffffff" vAlign="middle" bold="true" text="老司机带带我"> <text id="n254_ilon" name="tex_tableNum" xy="90,87" size="136,32" group="n78_i7lq" font="Microsoft YaHei" fontSize="22" color="#ffffff" vAlign="middle" bold="true" text="老司机带带我">
<relation target="" sidePair="left-left,top-top"/> <relation target="" sidePair="left-left,top-top"/>
</text> </text>
<group id="n78_i7lq" name="title" xy="90,11" size="158,108" group="n176_mn85" advanced="true"/> <group id="n78_i7lq" name="title" xy="90,11" size="158,108" group="n176_mn85" advanced="true"/>
@ -187,7 +187,7 @@
<item/> <item/>
<item/> <item/>
</list> </list>
<list id="n122_gg9f" name="lst_layer" xy="17,665" size="1090,80" layout="row" overflow="scroll" scroll="horizontal" lineGap="1" colGap="13" defaultItem="ui://m7iejg46jiu8hef" autoClearItems="true"> <list id="n122_gg9f" name="lst_layer" xy="17,665" size="1090,80" layout="row" overflow="scroll" scroll="horizontal" lineGap="1" colGap="13" defaultItem="ui://m7iejg46jiu8hef" align="center" autoClearItems="true">
<gearDisplay controller="search" pages="0"/> <gearDisplay controller="search" pages="0"/>
<relation target="" sidePair="width-width%,height-height%,bottom-bottom"/> <relation target="" sidePair="width-width%,height-height%,bottom-bottom"/>
<item/> <item/>

View File

@ -6,7 +6,7 @@
<controller name="all" pages="0,,1," selected="0"/> <controller name="all" pages="0,,1," selected="0"/>
<displayList> <displayList>
<component id="n18_pw15" name="pipeijoin" src="pw157i8w" fileName="component/Lst_info/pipeijoin2.xml" xy="3,-79" size="208,50" visible="false" touchable="false"/> <component id="n18_pw15" name="pipeijoin" src="pw157i8w" fileName="component/Lst_info/pipeijoin2.xml" xy="3,-79" size="208,50" visible="false" touchable="false"/>
<image id="n12_oryt" name="n12" src="oryt7i3a" fileName="images/info/button_01.png" xy="0,0" size="181,80" alpha="0.986"> <image id="n12_oryt" name="n12" src="oryt7i3a" fileName="images/info/button_01.png" xy="0,6" size="181,67" alpha="0.986">
<gearDisplay controller="button" pages="0"/> <gearDisplay controller="button" pages="0"/>
<relation target="" sidePair="width-width,height-height"/> <relation target="" sidePair="width-width,height-height"/>
</image> </image>
@ -18,12 +18,12 @@
<gearDisplay controller="all" pages="1"/> <gearDisplay controller="all" pages="1"/>
<gearColor controller="button" pages="0,1" values="#af4300,#000000|#4e1e00,#000000"/> <gearColor controller="button" pages="0,1" values="#af4300,#000000|#4e1e00,#000000"/>
</text> </text>
<text id="n27_n6w8" name="tex_gameName" xy="0,-1" size="180,48" font="Microsoft YaHei" fontSize="32" color="#af4300" align="center" vAlign="middle" autoSize="shrink" bold="true" text="全部游戏"> <text id="n27_n6w8" name="tex_gameName" xy="0,2" size="180,48" font="Microsoft YaHei" fontSize="32" color="#af4300" align="center" vAlign="middle" autoSize="shrink" bold="true" text="全部游戏">
<gearDisplay controller="all" pages="0"/> <gearDisplay controller="all" pages="0"/>
<gearColor controller="button" pages="0,1" values="#af4300,#000000|#4e1e00,#000000"/> <gearColor controller="button" pages="0,1" values="#af4300,#000000|#4e1e00,#000000"/>
<relation target="" sidePair="width-width%,height-height%"/> <relation target="" sidePair="width-width%,height-height%"/>
</text> </text>
<text id="n28_n6w8" name="tex_playName" xy="0,46" size="180,34" font="Microsoft YaHei" fontSize="22" color="#444444" align="center" vAlign="middle" autoSize="shrink" bold="true" text="全部游戏"> <text id="n28_n6w8" name="tex_playName" xy="0,39" size="180,34" font="Microsoft YaHei" fontSize="22" color="#444444" align="center" vAlign="middle" autoSize="shrink" bold="true" text="全部游戏">
<gearDisplay controller="all" pages="0"/> <gearDisplay controller="all" pages="0"/>
<gearColor controller="button" pages="0,1" values="#444444,#000000|#4e1e00,#000000"/> <gearColor controller="button" pages="0,1" values="#444444,#000000|#4e1e00,#000000"/>
<relation target="" sidePair="width-width%,height-height%"/> <relation target="" sidePair="width-width%,height-height%"/>