master
fpgajie 2026-01-22 03:57:56 +08:00
parent 2270a9f6df
commit 3a45215a20
1499 changed files with 21357 additions and 1588 deletions

View File

@ -16,6 +16,7 @@ local _LocalConfigAllGame = {
-- 10, 33,
-- 90,
-- 22,
55,
66,90
,91
,92

View File

@ -0,0 +1,616 @@
local RB_Protocol = import(".Protocol")
local FZTipList = import(".main.FZData")
local FanPaoFa_GameEvent = import(".FanPaoFa_GameEvent")
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
end
function M:init(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
self._eventmap[RB_Protocol.GAME_EVT_DRAW] = self.OnEventTakeCard
self._eventmap[RB_Protocol.GAME_EVT_DISCARD_TIP] = self.OnEventOutHint
self._eventmap[RB_Protocol.GAME_EVT_DISCARD] = self.OnEventOutCard
self._eventmap[RB_Protocol.GAME_EVT_FZTIPS] = self.OnEventFzTips
self._eventmap[RB_Protocol.GAME_EVT_ACTION] = self.OnEventFzAction
self._eventmap[RB_Protocol.GAME_EVT_HU] = self.OnEventHu
self._eventmap[RB_Protocol.GAME_EVT_FANGPAO_TIP] = self.OnEventFangWei
self._eventmap[RB_Protocol.GAME_EVT_FANGPAO_RSP] = self.OnEventFangPaoOk
self._eventmap[RB_Protocol.GAME_EVT_DANIAO_TIP] = self.OnEventDaNiaoTip
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_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
_client:send(RB_Protocol.GAME_XIPAI, _data)
self.XiPaiCallBack = callBack
end
function M:OnEventDaNiaoTip(evt_data)
if ViewManager.GetCurrenView().dview_class == LobbyView then
self:ReturnToRoom()
return
end
self._cacheEvent:Enqueue(
function()
if self._callback_popEvent then
self._callback_popEvent(true)
end
local niao = evt_data["niao"]
local reload = evt_data["reload"]
DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.OnDaNiaoTips, niao, reload)
ControllerManager.IsSendCard = true
end
)
end
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
end
function M:OnEventDaNiao(evt_data)
self._cacheEvent:Enqueue(
function()
if self._callback_popEvent then
self._callback_popEvent(true)
end
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
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
end
function M:OnEventXiPaiAnim(evt_data)
self._cacheEvent:Enqueue(function()
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
DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.EventXiPai, isXiPai, otherisXiPai)
end)
end
-- 发送出牌指令到服务器
function M:SendOutCard(card)
local _data = {}
_data["card"] = card
local _room = self._room
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)
local _data = {}
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)
end
end
function M:SendFangPao(card)
local _data = {}
if card then
_data["card"] = card
else
_data["card"] = {}
end
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
if _client ~= nil then
_client:send(RB_Protocol.GAME_CHANGE_TYPEfACE, _data)
end
end
function M:ConformToNextGame()
local _client = ControllerManager.GameNetClinet
if _client ~= nil then
_client:send(RB_Protocol.GAME_EVT_CHUI)
end
end
-- 发送放子选择到服务器
function M:SendAction(id, num)
local _data = {}
_data["id"] = id
if num ~= nil then
_data["biid"] = num
end
local _client = ControllerManager.GameNetClinet
if _client ~= nil then
_client:send(RB_Protocol.GAME_ACTION, _data)
end
end
function M:OnEventSendCards(evt_data)
if ViewManager.GetCurrenView().dview_class == LobbyView then
self:ReturnToRoom()
return
end
self._cacheEvent:Enqueue(function()
if self._callback_popEvent then
self._callback_popEvent(true)
end
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 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 = {}
_room.self_player.card_list = {}
_room.player_list[i].hand_left_count = 20
_room.player_list[i].fz_list = {}
_room.player_list[i].card_list = {}
_room.player_list[i].outcard_list = {}
_room.player_list[i].hu_xi = 0
end
_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)
end
function M:OnEventOutCard(evt_data)
local seat = evt_data["seat"]
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)
end
p.DiceCard = card
p.hand_left_count = p.hand_left_count - 1
DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.OutCard, p, card)
end)
end
function M:OnEventQIPAI(evt_data)
local seat = evt_data["seat"]
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)
end)
end
function M:OnEventTakeCard(evt_data)
local _room = self._room
local seat = evt_data["seat"]
local card = evt_data["card"]
local left_count = evt_data["left_count"]
local p = _room:GetPlayerBySeat(seat)
self._cacheEvent:Enqueue(function()
if card ~= 0 then
p.DiceCard = card
end
DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.GetCard, seat, card, left_count)
end)
end
function M:OnAddCard(evt_data)
local _room = self._room
local seat = evt_data["seat"]
local card = evt_data["card"]
local p = _room:GetPlayerBySeat(seat)
self._cacheEvent:Enqueue(function()
if self._callback_popEvent then
self._callback_popEvent(true)
end
p.DiceCard = card
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
end
DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.AddCard, seat, card)
end)
end
function M:OnEventOutHint(evt_data)
self._cacheEvent:Enqueue(function()
if self._callback_popEvent then
self._callback_popEvent(true)
end
DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.OutHint)
end)
end
function M:OnEventTurn(evt_data)
local seat = evt_data["seat"]
self._cacheEvent:Enqueue(function()
if self._callback_popEvent then
self._callback_popEvent(true)
end
DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.EventTurn, seat)
end)
end
function M:OnEventFzTips(evt_data)
self._cacheEvent:Enqueue(function()
if self._callback_popEvent then
self._callback_popEvent(true)
end
local tiplist = FZTipList.new()
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
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"]
self._cacheEvent:Enqueue(function()
if self._callback_popEvent then
self._callback_popEvent(true)
end
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"]
self._cacheEvent:Enqueue(function()
if self._callback_popEvent then
self._callback_popEvent(true)
end
DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.FangPaoOk, seat, card)
end)
end
function M:OnEventFzAction(evt_data)
local _room = self._room
local playerid = evt_data["playerid"]
local card = evt_data["card"]
local actice_card = evt_data["active_card"]
local ftype = evt_data["type"]
local from_seat = evt_data["from_seat"]
local opcard = evt_data["opcard"]
local huxi = evt_data["hu_xi"]
local p = _room:GetPlayerById(playerid)
self._cacheEvent:Enqueue(function()
local isNeedDelHandCard = 0
local flag_pengPao = false
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])
end
end
elseif ftype == RB_FZType.Bi 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])
end
list_remove(_room.self_player.handcard_list, fz.card)
end
elseif ftype == RB_FZType.Peng 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])
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
end
p.fz_list[#p.fz_list + 1] = fz
end
elseif ftype == RB_FZType.ChouWei then
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])
end
end
elseif ftype == RB_FZType.Wei 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])
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
flag_pengPao = true
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
flag_pengPao = false
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
flag_pengPao = 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.Pao
num = 1
remove_num = 0
flag_pengPao = true
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
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
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 or fz.type == RB_FZType.Wei or fz.type == RB_FZType.ChouWei then
-- coroutine.start(function()
-- -- coroutine.wait(0.88)
-- DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.FangziAction, fz, p, isNeedDelHandCard, flag_pengPao)
-- end)
-- else
flag_pengPao = false
DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.FangziAction, fz, p, isNeedDelHandCard, flag_pengPao)
-- end
end)
end
function M:OnEventHu(evt_data)
local cards = evt_data["card"]
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()
if self._callback_popEvent then
self._callback_popEvent(true)
end
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)
end)
end
function M:OneventResult1(evt_data)
local over = evt_data.type
--0小结算 1小大结算 2大结算
self._room.playing = false
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()
if self._callback_popEvent then
self._callback_popEvent(true)
end
DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.ZPResult1, result);
end)
elseif 1 == over or 2 == over then
DataManager.CurrenRoom.Over = true
ControllerManager.SetGameNetClient(nil, true)
local total_result = evt_data.total_result
local result = evt_data.result
self._cacheEvent:Enqueue(function()
if self._callback_popEvent then
self._callback_popEvent(true)
end
DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.ZPResult2, result, total_result, over);
end)
end
end
return M

View File

@ -0,0 +1,188 @@
local EXGameInfo = {}
local M = EXGameInfo
function EXGameInfo.new(blur_view)
setmetatable(M, { __index = IGameInfo })
local self = setmetatable({}, { __index = M })
self.class = 'EXGameInfo'
UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Extend_Poker_FanPaoFa')
UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Info_Poker_FanPaoFa')
return self
end
function M:FillData()
self._maxPlayer = 3 -- 默认玩家人数
self._roundChoice = 3 -- 回合选项数
self._config = UIPackage.CreateObjectFromURL('ui://Info_Poker_FanPaoFa/Cgm_create_room')
if oldGameVersion == 1 then
--self._config:GetChild("xipai").visible=false
end
if oldGameVersion == 2 then
self._config:GetController("xipai").selectedIndex = 1
self.xipaiValueText = self._config:GetChild('xipaifen')
self.xipaiValueText.text = 1
self.xipaiValue = 1
local btn_cr = self._config:GetChild('sdsrbtn')
btn_cr.onClick:Set(
function()
local gniv = GroupNumberInputView_Game.new(nil, function(num)
local value = limit
if otype == 1 then
value = value + ad2d(num)
elseif otype == -1 then
value = value - ad2d(num)
else
value = ad2d(num)
end
if value < 0 then
ViewUtil.ErrorTip(1, "输入数据异常!")
end
self.xipaiValueText.text = value / 100
self.xipaiValue = value / 100
end, 3, nil)
gniv:Show()
end
)
end
end
local _help_url = 'ui://Info_Poker_FanPaoFa/Com_help'
function M:GetHelpUrl()
return _help_url
end
local _icon_url = "ui://Info_Poker_FanPaoFa/icon"
function M:GetIconUrl()
return _icon_url
end
local _icon_url1 = "ui://Info_Poker_FanPaoFa/icon1"
function M:GetIconUrl1()
return _icon_url1
end
function M:SelectedConfigData()
local _config = self._config
local round = _config:GetController('round').selectedIndex + 1 --局数
local Cost = _config:GetController('Cost').selectedIndex
local renshu = _config:GetController('renshu').selectedIndex + 2 --人数
local shoupai = _config:GetController('shoupai').selectedIndex --手牌
local choupai = _config:GetController('choupai').selectedIndex --抽牌
local hunum = _config:GetController('hunum').selectedIndex --多少起胡 0:6,1:10,2:15
local daniao = _config:GetController('daniao').selectedIndex --多少起胡 0:6,1:10,2:15
local fengding = _config:GetController('fengding').selectedIndex + 1 --多少起胡 0:6,1:10,2:15
--名堂--
local tiandihu = _config:GetChild('btn_tiandihu').selected
local honghu = _config:GetChild('btn_honghu').selected
local shisanhong = _config:GetChild('btn_shisanhong').selected
local wuhu = _config:GetChild('btn_wuhu').selected
local yidianhong = _config:GetChild('btn_yidianhong').selected
local yikuaibian = _config:GetChild('btn_yikuaibian').selected
local haidihu = _config:GetChild('btn_haidihu').selected
local kahu = _config:GetChild('btn_kahu').selected
local mingwei = _config:GetChild('btn_mingwei').selected
if shoupai == 1 then
hunum = 0
end
if shoupai == 0 and hunum == 0 then
_config:GetController('hunum').selectedIndex = 1
end
local _data = {}
_data['opt'] = round -- 1 2 8局 16 局
_data['AA'] = Cost
_data['maxPlayers'] = renshu
_data['mode'] = round --模式:
_data['shoupai'] = shoupai --手牌
_data["choupai"] = choupai --抽牌
_data['hunum'] = hunum --胡息计算
_data['daniao'] = daniao --打鸟
_data['tiandihu'] = tiandihu --天地胡
_data['honghu'] = honghu --红胡
_data['shisanhong'] = shisanhong --十三红
_data['wuhu'] = wuhu --乌胡
_data['yidianhong'] = yidianhong --一点红
_data['yikuaibian'] = yikuaibian --一块扁
_data['haidiliao'] = haidihu --海底胡
_data['kahu'] = kahu --卡胡
_data['mingwei'] = mingwei --明偎
_data['fengding'] = fengding
local xi_pai = false
if oldGameVersion == 2 then
if _config:GetChild("xipai") then
--xi_pai = _config:GetChild("xipai").selected
xi_pai = true
end
end
_data['xi_pai'] = xi_pai
local xi_pai_score = 0
if oldGameVersion == 2 then
xi_pai_score = self.xipaiValue
end
_data['xi_pai_score'] = xi_pai_score * 100
return _data
end
function M:LoadConfigData(data)
local _config = self._config
-- data.mode=3
_config:GetController('round').selectedIndex = data.opt - 1 --== 1 and 0 or 1
_config:GetController('Cost').selectedIndex = data.AA
_config:GetController('renshu').selectedIndex = data.maxPlayers == 2 and 0 or 1
_config:GetController('shoupai').selectedIndex = data.shoupai --手牌
_config:GetController('choupai').selectedIndex = data.choupai --抽牌
_config:GetController('hunum').selectedIndex = data.hunum --起胡息
_config:GetController('daniao').selectedIndex = data.daniao --打鸟 0不打1:10,2:20,3:50
_config:GetController('fengding').selectedIndex = data.fengding - 1
_config:GetChild('btn_tiandihu').selected = data.tiandihu --天地胡
_config:GetChild('btn_honghu').selected = data.honghu --红胡
_config:GetChild('btn_shisanhong').selected = data.shisanhong --十三红
_config:GetChild('btn_wuhu').selected = data.wuhu --乌胡
_config:GetChild('btn_yidianhong').selected = data.yidianhong --一点红
_config:GetChild('btn_yikuaibian').selected = data.yikuaibian --一块扁
_config:GetChild('btn_haidihu').selected = data.haidihu --海底胡
_config:GetChild('btn_kahu').selected = data.kahu --卡胡
_config:GetChild('btn_mingwei').selected = data.mingwei --明偎
if oldGameVersion == 2 then
self.xipaiValueText.text = data.xi_pai_score / 100
self.xipaiValue = data.xi_pai_score / 100
end
end
function M:OnChangeOption(ctype)
IGameInfo.OnChangeOption(self, ctype)
local people = self._config:GetController('renshu')
people.onChanged:Set(
function()
self._maxPlayer = people.selectedIndex == 0 and 2 or 3
self:ShowVariablePrice(ctype)
end
)
end
return M

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,723 @@
local ZPPlayBackView = require('main.zipai.ZPPlayBackView')
local PlayerSelfCardInfoView = import('.PlayerSelfCardInfoView')
local PlayerCardInfoView = import('.PlayerCardInfoView')
local RunBeard_ResultView = import('.FanPaoFa_ResultView')
local M = {}
local Record_Event = {
Evt_OutCard = 'OutCard',
Evt_GetCard = 'GetCard',
Evt_Action = 'Action',
Evt_ThrowCard = 'ThrowCard',
Evt_AddCard = 'AddCard',
Evt_ChangePaiXing = 'ChangePaiXing',
Evt_TipAction = "Tips",
Evt_Win = 'Win',
Evt_result = 'result'
}
local function tableSortNumber(a, b)
return a.card_code_number > b.card_code_number
end
--- Create a new
function M.new()
setmetatable(M, { __index = PlayBackView })
local self = setmetatable({}, { __index = M })
self.class = 'PlayBackView'
self:init()
return self
end
function M:InitView(url)
local room = self._room
self._gamectr = ControllerManager.GetController(GameController)
UIPackage.AddPackage('base/main_zipai/ui/Main_RunBeard')
UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Extend_Poker_FanPaoFa')
printlog("room.room_config.people_num"..room.room_config.people_num)
ZPPlayBackView.InitView(self, 'ui://Main_RunBeard/Main_' .. room.room_config.people_num)
UpdateBeat:Add(self.OnUpdate, self)
local user_id = DataManager.SelfUser.account_id
local json_data = Utils.LoadLocalFile(user_id .. room.game_id)
if json_data ~= nil then
local _data = json.decode(json_data)
local typeface = _data['game_typeface']
if typeface == 1 then
room.change_card_display = '6_'
else
room.change_card_display = '6_'
end
end
self._player_card_info = {}
local _player_card_info = self._player_card_info
for i = 1, room.room_config.people_num do
local tem = self._view:GetChild('player_card_info' .. i)
self._player_card_info[i] = self:NewPlayerPokerInfoView(tem, i)
end
local rightpanel = self._view:GetChild('right_panel')
self.btn_setting = rightpanel:GetChild('btn_setting')
self.btn_setting.visible = false
self.tex_time = rightpanel:GetChild('tex_time')
self.tex_time.visible = false
self.gcm_xinhao = rightpanel:GetChild('gcm_xinhao')
self.gcm_xinhao.visible = false
self.pb_batteryLevel = rightpanel:GetChild('pb_batteryLevel')
self.pb_batteryLevel.visible = false
local tex_round_item = rightpanel:GetChild('tex_round')
if tex_round_item ~= nil then
tex_round_item.text = '' .. room.curren_round .. ''
end
local btn_rule = rightpanel:GetChild('btn_log')
if btn_rule ~= nil then
btn_rule.onClick:Set(
function()
if self.RuleView == nil or self.RuleView._is_destroy then
self.RuleView = RoomInfoView.new(self._room)
end
self.RuleView:Show()
end
)
end
local tex_roomid = rightpanel:GetChild('tex_roomid')
tex_roomid.text = room.room_id
rightpanel:GetChild('tex_gametype').text = room.room_config:GetGameName()
self._tex_round = self._view:GetChild('tex_round')
self._tex_LeftCard = self._view:GetChild('remaining_card')
self._eventmap = {}
self._cmdmap = {}
self._cmdmap[Record_Event.Evt_OutCard] = self.CmdOutCard
self._cmdmap[Record_Event.Evt_GetCard] = self.CmdGetCard
self._cmdmap[Record_Event.Evt_Action] = self.CmdAction
self._cmdmap[Record_Event.Evt_ThrowCard] = self.CmdThrowCard
self._cmdmap[Record_Event.Evt_AddCard] = self.CmdAddCard
self._cmdmap[Record_Event.Evt_TipAction] = self.CmdTipAction
self._cmdmap[Record_Event.Evt_Win] = self.CmdWin
self._cmdmap[Record_Event.Evt_ChangePaiXing] = self.CmdChangePaiXing
self._cmdmap[Record_Event.Evt_result] = self.onResult
end
function M:NewPlayerPokerInfoView(view, index)
if index == 1 then
return PlayerSelfCardInfoView.new(view, self)
end
return PlayerCardInfoView.new(view, self)
end
function M:FillRoomData(data)
if self._win_pic then
self._win_pic:Dispose()
end
self._currentStep = 0
local room = DataManager.CurrenRoom
local _player_card_info = self._player_card_info
local roominfo_panel = self._view:GetChild('roominfo_panel')
roominfo_panel:GetChild('tex_roomid').text = room.room_id
roominfo_panel:GetChild('tex_gametype').text = room.room_config:GetGameName()
for i = 1, #room.player_list do
local p = room.player_list[i]
local card_info = _player_card_info[self:GetPos(p.seat)]
card_info:Clear()
card_info:SetPlayer(p)
if p.seat == room.self_player.seat then
card_info:UpdateIsOnClick(false)
end
local infoHand = self._player_info[self:GetPos(p.seat)]
infoHand._view:GetController('huxi').selectedIndex = 1
infoHand._view:GetChild('huxi').text = p.hu_xi
if p.total_hp then
infoHand._view:GetController('zhanji').selectedIndex = 0
if room.hpOnOff == 1 or room:checkHpNonnegative() then
infoHand._view:GetController('zhanji').selectedIndex = 1
infoHand._view:GetChild('tex_jifen').text = d2ad(p.total_hp)
end
infoHand:UpdateScore()
end
end
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)
self:UpdateLeftCard(step.left_card)
if self._chipeng_tip then
self._chipeng_tip:Dispose()
self._chipeng_tip = nil
end
if self._lit_fanzi then
self._lit_fanzi = nil
end
local _chipeng_tip = UIPackage.CreateObject('Main_RunBeard', 'Gcm_action_tips')
self._chipeng_tip = _chipeng_tip
self._lit_fanzi = _chipeng_tip:GetChild('lit_fanzi')
self._lit_fanzi:RemoveChildrenToPool()
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.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
if index == 1 then
info:Clear()
if p.total_hp then
local avHand = self._player_info[self:GetPos(p.seat)]
local room = DataManager.CurrenRoom
avHand._view:GetController('zhanji').selectedIndex = 0
if room.hpOnOff == 1 or room:checkHpNonnegative() then
avHand._view:GetController('zhanji').selectedIndex = 1
avHand._view:GetChild('tex_jifen').text = d2ad(p.total_hp)
end
avHand:UpdateScore()
end
end
if p.hu_xi ~= nil then
local infoHand = self._player_info[self:GetPos(p.seat)]
infoHand._view:GetChild('huxi').text = p.hu_xi
end
if step.cmd == Record_Event.Evt_Action then
if p.fz_list ~= nil and #p.fz_list > 0 then
info:UpdateFzList(p.fz_list)
end
end
if index > 1 then
for k, v in pairs(self.CheckServerErrorList) do
if tonumber(index + 1) > tonumber(k) then
list_remove(p.card_list, v)
end
end
end
if p.seat ~= self._room.self_player.seat then
info:InitHandCard(p.card_list)
else
self._room.self_player.handcard_list = p.card_list
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)
-- -- 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
if p.seat == step.seat then
info:UpdateOutCardList(step.DiceCard)
coroutine.start(
function()
coroutine.wait(1.5)
info:ClearOutCard()
end
)
end
end
end
if p.outcard_list ~= nil then
info:UpdateQiPai(p.outcard_list)
end
if step.cmd == Record_Event.Evt_TipAction 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
end
local url1 = 'ui://Main_RunBeard/Btn_fztip'
local btn_t1 = self._lit_fanzi:AddItemFromPool(url1)
btn_t1.icon = 'ui://Main_RunBeard/newop'
self._view:AddChild(_chipeng_tip)
_chipeng_tip:Center()
self._chipeng_tip.x = self._chipeng_tip.x + 200
self._chipeng_tip.y = self._chipeng_tip.y - 50
end
end
end
-- print("step.cmd ",step.cmdm,Record_Event.Evt_Win)
if step.cmd == Record_Event.Evt_result then
local _room = DataManager.CurrenRoom
local result = step.result
self._win_pic = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/胡')
local info = self._player_card_info[self:GetPos(step.win)]
info._mask_liangpai:AddChild(self._win_pic)
self._win_pic:Center()
if result ~= nil then
if self._clearingView == nil then
self._clearingView = RunBeard_ResultView.new(self._view)
coroutine.start(
function()
coroutine.wait(0.5)
self._clearingView:Show()
end
)
end
local data = result.data.info_list
self._clearingView:InitData(
0,
_room,
result.data,
nil,
function(...)
for i = 1, #data do
local p = _room:GetPlayerBySeat(data[i].seat)
p.total_score = data[i].total_score
-- p.cur_hp = data[i]['cur_hp'] or 0
-- if data[i]['hp_info'] then
-- p.cur_hp = data[i].hp_info.cur_hp
-- end
local card_info = self._player_card_info[self:GetPos(p.seat)]
local info = self._player_info[self:GetPos(p.seat)]
card_info:Clear()
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 = total_score
end
end
info:UpdateScore(p.total_score)
end
self._clearingView = nil
end
)
end
else
if self._win_pic then
self._win_pic:Dispose()
end
end
end
function M:GenerateAllStepData(data)
local cmdList = self.cmdList
-- pt(cmdList)
self._step = {}
local step = {}
local info = data.info
--pt(info)
step.cmd = ''
step.left_card = info.left_card
step.win = 0
step.player_card_data = {}
for i = 1, #self._room.player_list do
local p = info.playerData[i]
local u = {}
u.seat = p.seat
u.card_list = p.hand_card
u.hand_left_count = #u.card_list
u.tip_list = {}
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
for i = 1, #cmdList do
local tem = cmdList[i]
self._cmdmap[tem.cmd](self, tem, i)
end
end
function M:CmdOutCard(cmd, index)
local data = self:CopyLastStep(index)
data.cmd = cmd.cmd
data.current_out_seat = cmd.seat
local u = data.player_card_data[cmd.seat]
list_remove(u.card_list, cmd.data.card)
data.seat = cmd.seat
data.DiceCard = cmd.data.card
end
function M:CmdGetCard(cmd, index)
local data = self:CopyLastStep(index)
data.cmd = cmd.cmd
data.left_card = cmd.data.left_count
local u = data.player_card_data[cmd.seat]
data.seat = cmd.seat
data.DiceCard = cmd.data.card
end
function M:CmdThrowCard(cmd, index)
local data = self:CopyLastStep(index)
data.cmd = cmd.cmd
data.seat = cmd.seat
data.current_seat = cmd.seat
local u = data.player_card_data[cmd.seat]
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)
local data = self:CopyLastStep(index)
data.cmd = cmd.cmd
local _room = self._room
local u = data.player_card_data[cmd.seat]
if u then
u.card_list[#u.card_list + 1] = cmd.data.card
end
--pt(u.card_list)
end
function M:onResult(cmd, index)
local data = self:CopyLastStep(index)
data.cmd = cmd.cmd
data.result = cmd.result
end
function M:CmdChangePaiXing(cmd, index)
local data = self:CopyLastStep(index)
data.cmd = cmd.cmd
data.seat = cmd.seat
data.card_list = cmd.data.card_list
end
function M:CmdAction(cmd, index)
local data = self:CopyLastStep(index)
data.cmd = cmd.cmd
data.seat = cmd.seat
local p = data.player_card_data[cmd.seat]
local fz = {}
p.hu_xi = cmd.data.hu_xi
fz.type = cmd.data.type
fz.card = cmd.data.card
fz.active_card = cmd.data.card
fz.opcard = cmd.data.opcard
local opcard = fz.opcard
local ftype = fz.type
local card = fz.card
local remove_num = #opcard
if ftype == RB_FZType.Chi then
p.fz_list[#p.fz_list + 1] = fz
for i = 1, remove_num do
list_remove(p.card_list, opcard[i])
end
elseif ftype == RB_FZType.Bi then
p.fz_list[#p.fz_list + 1] = fz
for i = 1, remove_num do
list_remove(p.card_list, opcard[i])
end
list_remove(p.card_list, fz.card)
elseif ftype == RB_FZType.Peng then
p.fz_list[#p.fz_list + 1] = fz
for i = 1, remove_num do
list_remove(p.card_list, opcard[i])
end
elseif ftype == RB_FZType.Kan then
local _room = self._room
if #opcard == 2 then
p.card_list[#p.card_list + 1] = card
end
elseif ftype == RB_FZType.ChouWei then
p.fz_list[#p.fz_list + 1] = fz
for i = 1, 2 do
list_remove(p.card_list, opcard[i])
end
elseif ftype == RB_FZType.Wei then
p.fz_list[#p.fz_list + 1] = fz
for i = 1, remove_num do
list_remove(p.card_list, opcard[i])
end
elseif ftype == RB_FZType.Pao then
local num = 0
for i = 1, #p.card_list do
if card == p.card_list[i] then
num = num + 1
end
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
end
end
if num > 0 then
for i = 1, num do
list_remove(p.card_list, card)
end
if isAddTi == false then
p.fz_list[#p.fz_list + 1] = fz
end
end
elseif ftype == RB_FZType.Ti then
local num = 0
for i = 1, #p.card_list do
if card == p.card_list[i] then
num = num + 1
end
end
--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
p.fz_list[i].type = RB_FZType.Ti
isAddTi = true
end
end
if num > 0 then
for i = 1, num do
list_remove(p.card_list, card)
end
if isAddTi == false then
p.fz_list[#p.fz_list + 1] = fz
end
end
end
end
function M:CmdWin(cmd, index)
local data = self:CopyLastStep(index)
data.cmd = cmd.cmd
data.win = cmd.seat
end
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
for i = 1, #cmd.data.tip_list do
tips[cmd.data.tip_list[i].type] = cmd.data.tip_list[i].type
end
end
u.tip_list[index] = tips
end
function M:UpdateLeftCard(num)
self._tex_LeftCard.text = '剩余 ' .. num .. ' 张牌'
end
function M:UpdateRound(round)
self._tex_round.text = '' .. round .. '/' .. self._room.room_config.round .. ''
end
function M:CopyLastStep(index)
local step = {}
local last_step = self._step[index]
step = self:deepcopy(last_step)
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])
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)
card_data[i].fz_list = self:deepcopy(last_step.player_card_data[i].fz_list)
card_data[i].hand_left_count = #card_data[i].card_list
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)
self._step[#self._step + 1] = step
return step
end
-- lua table 深拷贝
function M:deepcopy(object)
local lookup_table = {}
local function _copy(object)
if type(object) ~= 'table' then
return object
elseif lookup_table[object] then
return lookup_table[object]
end
local new_table = {}
lookup_table[object] = new_table
for index, value in pairs(object) do
new_table[_copy(index)] = _copy(value)
end
return setmetatable(new_table, getmetatable(object))
end
return _copy(object)
end
function M:NextRecordPlay()
local result = PlayBackView.NextRecordPlay(self)
if not result then
return
end
self:ChangePlayState(false)
self._speed = 1
self._playFoward = true
self:ChangeTextSpeed()
end
function M:LastRecordPlay()
local result = PlayBackView.LastRecordPlay(self)
if not result then
return
end
self:ChangePlayState(false)
self._speed = 1
self._playFoward = true
self:ChangeTextSpeed()
end
function M:Play()
self:ChangeAlpha()
self:ChangePlayState(not self._play)
if not self._play then
return
end
if (self._currentStep == #self.cmdList and self._playFoward) or (self._currentStep == 0 and not self._playFoward) then
self._currentStep = 0
self._speed = 1
self._playFoward = true
self:ChangeTextSpeed()
end
end
function M:ChangePlayState(state)
self._play = state
self:ChangeTextSpeed()
local btn_play = self._view:GetChild('panel_record'):GetChild('btn_play')
if self._play then
btn_play:GetController('state').selectedIndex = 1
else
btn_play:GetController('state').selectedIndex = 0
end
end
function M:ChangeTextSpeed()
local str1 = self._play and self._speed or ''
self._view:GetChild('panel_record'):GetChild('tex_speed').text = str1
local str2 =
not self._play and (self._playFoward and '播放暂停' or '回退暂停') or
self._playFoward and (self._speed == 1 and '播放' or '快进') or
(self._speed == 1 and '回退' or '快退')
self._view:GetChild('panel_record'):GetChild('tex_2').text = str2
local str3 = self._play and '倍速度' or ''
self._view:GetChild('panel_record'):GetChild('tex_1').text = str3
end
function M:CmdLeftArrows()
self:ChangeAlpha()
self:ChangePlayState(true)
if not self._playFoward then
if self._speed < 16 then
self._speed = self._speed * 2
else
self._speed = 1
end
self:ChangeTextSpeed()
else
self._speed = 1
self._playFoward = false
self:ChangeTextSpeed()
end
end
function M:CmdRightArrows()
self:ChangeAlpha()
self:ChangePlayState(true)
if self._playFoward then
if self._speed < 16 then
self._speed = self._speed * 2
else
self._speed = 1
end
self:ChangeTextSpeed()
else
self._speed = 1
self._playFoward = true
self:ChangeTextSpeed()
end
end
function M:OnUpdate()
if self._play then
if (self._currentStep == #self.cmdList and self._playFoward) then
self:ChangePlayState(false)
--显示结算
ViewUtil.ErrorTip(nil, '当前已是录像结尾了,再次点击播放按钮可重新播放')
return
elseif (self._currentStep == 0 and not self._playFoward) then
self:ChangePlayState(false)
ViewUtil.ErrorTip(nil, '当前已是录像开头了,再次点击播放按钮可重新播放')
return
end
self._timer = self._timer + Time.deltaTime
if self._timer >= 1 / self._speed then
self._timer = 0
local step = self._playFoward and 1 or -1
self._currentStep = self._currentStep + step
self:ShowStep(self._currentStep)
end
end
end
function M:Destroy()
UpdateBeat:Remove(self.OnUpdate, self)
PlayBackView.Destroy(self)
end
function M:UpdateStep(step)
self._record:GetChild('tex_step').text = '' .. step .. ' / ' .. #self._step .. ''
end
return M

View File

@ -0,0 +1,37 @@
local EXPlayer ={
-- 手牌列表
card_list = nil,
-- 剩余牌数
hand_left_count = 0,
-- 出牌列表
outcard_list = nil,
-- 牌组列表
fz_list = nil,
hu_xi =0
}
local M = EXPlayer
--- Create a new EXPlayer
function M.new()
setmetatable(M,{__index = Player})
local self = setmetatable({}, {__index = M})
self.card_list = {}
self.outcard_list = {}
self.fz_list = {}
return self
end
-- 清理玩家数据
function M:Clear()
Player.Clear(self)
self.card_list = {}
self.outcard_list = {}
self.fz_list = {}
self.hand_left_count = 0
self.hu_xi =0
end
return M

View File

@ -0,0 +1,33 @@
local PlayerInfoView = require("Game.View.PlayerInfoView")
local M = {}
function M.new(view, mainView)
setmetatable(M, {__index = PlayerInfoView})
local self = setmetatable({}, {__index = M})
self._view = view
self._main_view = mainView
self:init()
self:Init()
return self
end
function M:UpdateNiao(niao)
if niao~=0 then
self._view:GetController("niao").selectedIndex = 1
self._view:GetChild("niaotext").text = "打鸟"..niao
else
self._view:GetController("niao").selectedIndex = 0
end
end
function M:Init()
self._tex_score.visible=true
end
return M

View File

@ -0,0 +1,69 @@
local M = {}
--- Create a new RoomConfig
function M.new(config)
setmetatable(M,{__index = RoomConfig})
local self = setmetatable({}, {__index = M})
RoomConfig.init(self,config)
self.config=config
self.class = "RoomConfig"
self.round = config["times"]
self.mode = config["mode"]
self.tun = config["tun"]
self.fengding = config["fengding"]
self.tuanyuan = config["tuanyuan"]
self.hanghangxi = config["hanghangxi"]
self.siqi = config["siqi"]
self.shuahou = config["shuahou"]
self.huangfan = config["huangfan"]
self.jiaxingxing = config["jiaxingxing"]
self.tinghu = config["tinghu"]
self.duizifu = config["duizifu"]
self.back = config["back"]
self.yuan = config["yuan"]
self.tianhu =config["tianhu"]
self.dihu =config["dihu"]
self.haihu =config["haihu"]
self.maxPlayers = config["maxPlayers"]
self.qupai = config["qupai"]
self.isHidden = config.isHidden
self.qixihu =config["qixihu"]
self.weipai =config["weipai"]
self.xidouble30 =config["xidouble30"]
self.zimo =config["zimo"]
self.daxiaozi =config["daxiaozi"]
self.hongheihu =config["hongheihu"]
self.yidianhu =config["yidianhu"]
return self
end
function M:GetDes(sp)
sp = sp or " "
local str = "百息结算局" .. sp
str = str .. RoomConfig.GetDes(self, sp)
if self.maxPlayers == 2 then
if self.qupai then
str = str .."去牌"
str = str .. sp
end
end
str = str .. "娄底放炮罚 十五息起胡 明偎 天地胡 20胡100息 30胡翻倍 红黑胡"
str = str .. sp
return str
end
function M:GetGameName()
return "娄底放炮罚"
end
function M:GetGameJS()
local gamerulepanel= UIPackage.CreateObjectFromURL("ui://Extend_Poker_FanPaoFa/gamerule")
return gamerulepanel
end
return M

View File

@ -0,0 +1,236 @@
local EXTEND_MODEL_NAME = ...
local EXGameInfo = import('.EXGameInfo')
local EXMainView = import('.EXMainView')
local EXGameController = import('.EXGameController')
local EXRoomConfig = import('.EXRoomConfig')
local EXPlayBackView = import('.EXPlayBackView')
local explayer = import('.EXPlayer')
local ExtendConfig = {}
local M = ExtendConfig
function ExtendConfig.new()
setmetatable(M, { __index = IExtendConfig })
local self = setmetatable({}, { __index = M })
self.class = 'ExtendConfig'
self.extend_id = 17
self._viewMap = {}
self._viewMap[ViewManager.View_Main] = EXMainView
self._viewMap[ViewManager.View_PlayBack] = EXPlayBackView
return self
end
--卸载资源
function M:UnAllAssets()
UIPackage.RemovePackage('extend/zipai/fanpaofa/ui/Info_Poker_FanPaoFa')
self:UnAssets()
end
--卸载资源
function M:UnAssets()
UIPackage.RemovePackage('extend/zipai/fanpaofa/ui/Extend_Poker_FanPaoFa')
ResourcesManager.UnLoadGroup('ChangDe_ZP')
end
local _gameInfo = nil
function M:GetGameInfo()
if not _gameInfo then
_gameInfo = EXGameInfo.new()
end
return _gameInfo
end
local _ctr_game = nil
function M:GetGameController()
if _ctr_game == nil then
_ctr_game = EXGameController.new()
end
return _ctr_game
end
function M:FillRoomConfig(room, _config)
room.room_config = EXRoomConfig.new(_config)
end
function M:FillRoomData(s2croom)
local room = DataManager.CurrenRoom
local reload = s2croom['reload']
local _tableInfo = s2croom['tableInfo']
local _config = _tableInfo['config']
room.room_config = EXRoomConfig.new(_config)
local playerList = _tableInfo['playerData']
room.curren_round = _tableInfo['round']
for i = 1, #playerList do
local _jp = playerList[i]
local p = explayer.new()
p.seat = _jp['seat']
local online = _jp['online']
p.line_state = online
p.ready = _jp['ready'] == 1 and true or false
local pid = _jp['aid']
if (DataManager.SelfUser.account_id == pid) then
room.self_player = p
p.self_user = DataManager.SelfUser
else
local u = User.new()
u.account_id = pid
p.self_user = u
u.nick_name = _jp['nick']
u.head_url = _jp['portrait']
u.sex = _jp['sex']
end
p.entrust = _jp['entrust']
p.self_user.host_ip = _jp['ip']
p.self_user.location = Location.new(_jp['pos'] or '')
p.cur_hp = _jp['cur_hp'] or 0
p.total_hp = _jp['total_hp'] or 0
if _jp['hp_info'] then
p.cur_hp = _jp.hp_info.cur_hp
p.total_hp = _jp.hp_info.total_hp
end
room:AddPlayer(p)
end
-- 如果重写了player类就需要传第二个参数
-- self:FillPlayerData(playerList, explayer)
if (reload) then
local _reloadInfo = s2croom['reloadInfo']
local _hand_card = _reloadInfo['hand_card']
local _card_list = _reloadInfo['card_list']
local _discard = _reloadInfo['discard']
room.discard = _discard
-- local _index = _reloadInfo["typeface"]
-- if _index ==1 then
-- room.change_card_display = "2_"
-- else
-- room.change_card_display = "1_"
-- end
room.self_player.handcard_list = _hand_card
room.self_player.card_list = {}
for i = 1, #_card_list do
local data = {}
data.card_item = _card_list[i].card
data.index_X = _card_list[i].X
data.index_Y = _card_list[i].Y
room.self_player.card_list[#room.self_player.card_list + 1] = data
end
local active_seat = _reloadInfo['active_seat']
local bank_seat = _reloadInfo['banker_seat']
local playing = _reloadInfo['playing']
local _info_list = _reloadInfo['info_list']
local last_outcard_seat = _reloadInfo['last_outcard_seat']
room.left_count = _reloadInfo['left_card']
room.banker_seat = bank_seat
room.curren_outcard_seat = _reloadInfo['curren_outcard_seat']
if active_seat ~= 0 then
local player = room:GetPlayerBySeat(active_seat)
player.DiceCard = _reloadInfo['acitve_card']
end
room.last_outcard_seat = last_outcard_seat
room.playing = playing
for i = 1, #_info_list do
local tem = _info_list[i]
local playerid = tem['playerid']
local p = room:GetPlayerById(playerid)
local outcard_list = tem['outcard_list']
p.outcard_list = outcard_list
p.total_score = tem['score']
p.hu_xi = tem['hu_xi']
p.hand_left_count = tem['card_count']
p.cur_hp = tem['cur_hp'] or 0
p.total_hp = tem['total_hp'] or 0
if tem['hp_info'] then
p.cur_hp = tem.hp_info.cur_hp
p.total_hp = tem.hp_info.total_hp
end
p.entrust = tem['entrust']
local opcard = tem['opcard']
for k = 1, #opcard do
local op = opcard[k]
local fz = {}
fz.type = op['type']
local data = {}
data[1] = op['card1']
data[2] = op['card3']
fz.opcard = data
fz.card = op['card2']
fz.active_card = op['card2']
p.fz_list[#p.fz_list + 1] = fz
if p.seat == room.self_player.seat then
if fz.type == RB_FZType.Kan then
for i = 1, 3 do
room.self_player.handcard_list[#room.self_player.handcard_list + 1] = fz.card
end
end
end
end
if not playing and room.curren_round > 0 then
self.GetGameController():PlayerReady()
end
end
end
end
function M:FillPlayBackData(pd_data)
local room = DataManager.CurrenRoom
local _tableInfo = pd_data['info']
local _config = _tableInfo['config']
room.room_id = _tableInfo.roomid
room.room_config = EXRoomConfig.new(_config)
room.owner_id = _config['ownerid']
local active_seat = _tableInfo['active_seat']
local bank_seat = _tableInfo['banker_seat']
room.left_count = _tableInfo['left_card']
room.banker_seat = bank_seat
room.curren_turn_seat = active_seat
room.curren_round = _tableInfo['round']
local _info_list = _tableInfo['playerData']
for i = 1, #_info_list do
local _jp = _info_list[i]
local p = room:NewPlayer()
p.seat = _jp['seat']
local online = _jp['online']
p.line_state = online
p.ready = _jp['ready'] == 1 and true or false
local pid = _jp['aid']
if pid == DataManager.SelfUser.account_id then
room.self_player = p
end
local u = User.new()
u.account_id = pid
p.self_user = u
u.nick_name = _jp['nick']
u.head_url = _jp['portrait']
u.sex = _jp['sex']
p.self_user.host_ip = p.self_user.host_ip
local _hand_card = _jp['hand_card']
p.hand_card = _hand_card
if room.self_player ~= nil and p.seat == room.self_player.seat then
room.self_player.handcard_list = _hand_card
end
p.total_score = _jp['score']
p.hand_left_count = #_hand_card
p.cur_hp = _jp['cur_hp'] or 0
p.total_hp = _jp['total_hp'] or 0
if _jp['hp_info'] then
p.cur_hp = _jp.hp_info.cur_hp
p.total_hp = _jp.hp_info.total_hp
end
room:AddPlayer(p)
end
room.cmdList = pd_data['cmdList']
room.result = pd_data['result']
end
return M

View File

@ -0,0 +1,46 @@
local FanPaoFa_GameEvent = {
-- 换座
-- 发牌
SendCards = "SendCards",
-- 胡牌
ZPHuCard = "ZPHuCard",
-- 结算事件
ZPResult1 = "ZPResult1",
-- 大结算事件
ZPResult2 = "ZPResult2",
EventDicelCard ="EventDicelCard",
OnEventTake = "OnEventTake",
OnEcentRecond = "OnEcentRecond",
EventTurn = "EventTurn",
OutHint = "OutHint",
GetCard = "GetCard",
OutCard = "OutCard",
FangziAction = "FangziAction",
FZTips = "FZTips",
QiCard = "QiCard",
AddCard = "AddCard",
EventXiPai="EventXiPai",
FangWei = "FangWei",
FangPaoOk = "FangPaoOk",
OnDaNiaoTips = "OnDaNiaoTips",
OnEventDaNiao = "OnEventDaNiao",
}
return FanPaoFa_GameEvent

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,258 @@
local PlayerCardInfoView = import(".main.ZPPlayerCardInfoView")
---- 对方上面的牌
local M = {}
function M.new(view, mainView)
setmetatable(M, { __index = PlayerCardInfoView })
local self = setmetatable({}, { __index = M })
self.class = "PlayerCardInfoView"
self._view = view
self._mainView = mainView
self:init()
return self
end
function M:UpdateFzList(fz_list, ispaly, seat, flag_pengPao)
-- print("lingmeng UpdateFzList")
-- pt(fz_list)
self._area_fz_list:RemoveChildren(0, -1, true)
for i = 1, #fz_list do
local fzitem = nil
if fz_list[i].type ~= RB_FZType.Kan then
fzitem = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/ComponentNew")
if (ispaly == false) then
fzitem:RemoveChildren(0, -1, true)
end
end
if fz_list[i].type == RB_FZType.Chi or fz_list[i].type == RB_FZType.Bi then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
fzcards:GetController("c2").selectedIndex = 1
fzcards:GetChild("card_" .. 1).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].active_card)
fzcards:GetChild("card_" .. 2).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].opcard[1])
fzcards:GetChild("card_" .. 3).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].opcard[2])
fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, seat, flag_pengPao)
elseif fz_list[i].type == RB_FZType.Peng then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
for j = 1, 3 do
fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
end
fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, seat, flag_pengPao)
elseif fz_list[i].type == RB_FZType.Wei then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
-- for j=1,3 do
-- fzcards:GetChild("card_"..j).icon ="ui://Main_RunBeard/202_1_300"
-- end
-- fzcards:GetChild("card_"..3).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card)--jefe
for j = 1, 3 do
fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300"
end
fzcards:GetChild("card_" .. 1).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card) --jefe
fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, seat, flag_pengPao)
elseif fz_list[i].type == RB_FZType.ChouWei then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
-- for j=1,2 do
-- fzcards:GetChild("card_"..j).icon ="ui://Main_RunBeard/202_1_300"
-- end
-- fzcards:GetChild("card_"..3).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card)
for j = 2, 3 do
fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300"
end
fzcards:GetChild("card_" .. 1).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, seat, flag_pengPao)
elseif fz_list[i].type == RB_FZType.Pao then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4")
for j = 1, 4 do
fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
end
fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, seat, flag_pengPao)
elseif fz_list[i].type == RB_FZType.Ti then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4")
if self._mainView._leftcard == 1 then
for j = 1, 4 do
fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300"
end
else
-- for j=1,4 do
-- if j==4 then
-- fzcards:GetChild("card_"..j).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card)
-- else
-- fzcards:GetChild("card_"..j).icon ="ui://Main_RunBeard/202_1_300"
-- end
-- end
for j = 1, 4 do
if j == 1 then
fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i]
.card)
else
fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300"
end
end
end
fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, seat, flag_pengPao)
end
end
end
function M:playAnim(fzitem, fzcards, size, i, ispaly, seat, flag_pengPao)
if (ispaly == nil) then
ispaly = false
end
local isaddLast = false
-- if (ispaly and i == size and not flag_pengPao) then --匹配最后一个牌
-- local faArray = fzitem:GetChild("chiwei")
-- if (faArray ~= nil) then
-- faArray:AddChild(fzcards)
-- else
-- fzitem:AddChild(fzcards)
-- end
-- else
fzitem:AddChild(fzcards)
-- end
if (seat ~= nil) then
isaddLast = self:isAddFirst(seat)
end
-- if(isaddLast)then
local index_postion = 0
self._area_fz_list:AddChildAt(fzitem, index_postion)
-- else
-- self._area_fz_list:AddChild(fzitem)
-- end
end
function M:isAddFirst(seat)
local isaddLast = false
--[[if(DataManager.CurrenRoom.room_config.people_num ==3)then
if(DataManager.CurrenRoom.self_player.seat == 1)then
if(seat == 2)then
isaddLast = true
end
elseif(DataManager.CurrenRoom.self_player.seat == 2)then
if(seat == 3)then
isaddLast = true
end
elseif(DataManager.CurrenRoom.self_player.seat == 3)then
if(seat == 1)then
isaddLast = true
end
end
elseif DataManager.CurrenRoom.room_config.people_num ==2 then
isaddLast = true
end]]
return isaddLast
end
--摸牌动画
-- function M:PlayingOutCardAnima(card)
-- if (self._area_outcard_list ~= nil and self._area_outcard_list.numChildren > 0) then
-- self._area_outcard_list:GetChildAt(0):GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/202_', card)
-- self._view:GetTransition('t0'):Play()
-- end
-- coroutine.start(
-- function()
-- coroutine.wait(0.1)
-- -- self._bgview.selectedIndex = 1
-- self:ClearOutCard()
-- end
-- )
-- end
function M:UpdateOutCardList(outcard, isShow, isMopai, seat)
if (isShow == nil) then
isShow = false
end
if (isMopai == nil) then
isMopai = false
end
self._area_outcard_list:RemoveChildren(0, -1, true)
local outcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Gcm_OutCard")
if outcard == 0 then
-- outcards:GetChild("icon").icon ="ui://Main_RunBeard/202_1_300"
else
outcards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/203_", outcard)
-- self._bgview.selectedIndex=1
end
outcards.x, outcards.y = 0, 0
local show_di_bg = outcards:GetChild("show_di_bg")
-- show_di_bg.visible = true
if (isShow) then
if outcard == 0 then
show_di_bg.visible = false
end
if (seat ~= nil and outcards ~= nil) then
if (DataManager.CurrenRoom.room_config.people_num == 3) then
if (seat == 2) then
seat = 3
elseif (seat == 3) then
seat = 2
end
elseif DataManager.CurrenRoom.room_config.people_num == 2 then
seat = 3
end
if (isMopai) then
if outcard ~= 0 then
outcards:GetTransition("mopai" .. seat):Play(function()
-- show_di_bg.visible = true
end)
end
else
show_di_bg.visible = false
outcards:GetTransition("cpai" .. seat):Play()
end
else
-- show_di_bg.visible = true
end
else
show_di_bg.visible = false
end
self._area_outcard_list:AddChild(outcards)
end
--弃牌
function M:UpdateQiPai(qi_list, ispaly, seat)
self._area_qipai_list:RemoveChildren(0, -1, true)
for i = 1, #qi_list do
local qicards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Qipais")
qicards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/202_", qi_list[i])
if (ispaly) then
if (i == #qi_list) then
if (DataManager.CurrenRoom.room_config.people_num == 2) then
qicards:GetTransition("t0"):Play()
else
if (DataManager.CurrenRoom.self_player.seat == 1) then
if (seat == 2) then
qicards:GetTransition("t0"):Play()
else
qicards:GetTransition("t1"):Play()
end
elseif (DataManager.CurrenRoom.self_player.seat == 2) then
if (seat == 3) then
qicards:GetTransition("t0"):Play()
else
qicards:GetTransition("t1"):Play()
end
elseif (DataManager.CurrenRoom.self_player.seat == 3) then
if (seat == 1) then
qicards:GetTransition("t0"):Play()
else
qicards:GetTransition("t1"):Play()
end
else
qicards:GetTransition("t0"):Play()
end
end
end
end
self._area_qipai_list:AddChild(qicards)
end
end
return M

View File

@ -0,0 +1,492 @@
local PlayerSelfCardInfoView = import(".main.ZPPlayerSelfCardInfoView")
local CardCheck = import(".main.CardCheck")
local M = {}
--
function M.new(view, mainView)
setmetatable(M, { __index = PlayerSelfCardInfoView })
local self = setmetatable({}, { __index = M })
self.class = "PlayerSelfCardInfoView"
self._view = view
self._mainView = mainView
self._full = true
self:init()
return self
end
function M:onTouchBegin(context)
if DataManager.CurrenRoom == nil or DataManager.CurrenRoom.self_player == nil then
return
end
local button = context.sender
local card = button.data
if DataManager.CurrenRoom.curren_outcard_seat == DataManager.CurrenRoom.self_player.seat then
self:ShowHuTip(card.card_item)
end
card.btn_card:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/204_", card.card_item)
-- card.btn_card:GetController('touch').selectedIndex = 1
card.btn_card.sortingOrder = 100
local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y))
card.btn_card.xy = Vector2.New(card.btn_card.x + 20, card.btn_card.y - 50)
card.touch_pos = xy - button.xy
end
function M:__OnDragEnd(context)
if DataManager.CurrenRoom == nil or DataManager.CurrenRoom.self_player == nil then
return
end
if self.outcard_button then
self.outcard_button = nil
end
local button = context.sender
local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y))
local card = button.data
local _room = DataManager.CurrenRoom
card.btn_card.sortingOrder = 0
if (button.y < self._data_outLinePos - button.height * 0.66 and _room.curren_outcard_seat == _room.self_player.seat) then
button.touchable = false
self.outcard_button = card
self:UpdateIsOnClick(false)
self._mainView:OutCard(card.card_item)
else
local isChangeCard = false
self.outcard_button = nil
card.btn_card:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/201_", card.card_item)
self._area_handcard_list:AddChild(button)
if #self.card_list == 1 then
isChangeCard = false
self:UpdateHandCardsPos()
return
end
local CountCards = {}
for i = 1, #self.card_list do
local lists = {}
if CountCards[self.card_list[i].index_X] == nil then
lists[#lists + 1] = self.card_list[i]
CountCards[self.card_list[i].index_X] = lists
else
CountCards[self.card_list[i].index_X][#CountCards[self.card_list[i].index_X] + 1] = self.card_list[i]
end
end
local minmark = 1
local maxmark = #self.card_list
if card == self.card_list[1] or card == self.card_list[#self.card_list] then
if self.card_list[1].index_X == self.card_list[2].index_X then
minmark = 2
end
if self.card_list[#self.card_list].index_X == self.card_list[#self.card_list - 1].index_X then
maxmark = #self.card_list - 1
end
end
if xy.x < self.card_list[minmark].btn_card.x and #CountCards < 10 and xy.y > self._data_outLinePos then
list_remove(self.card_list, card)
local num = 0
for i = 1, #self.card_list do
if card.index_X == self.card_list[i].index_X and card.index_Y < self.card_list[i].index_Y then
self.card_list[i].index_Y = self.card_list[i].index_Y - 1
end
if card.index_X == self.card_list[i].index_X then
num = num + 1
end
end
if num == 0 then
for i = 1, #self.card_list do
if self.card_list[i].index_X < card.index_X then
self.card_list[i].index_X = self.card_list[i].index_X + 1
end
end
else
for i = 1, #self.card_list do
self.card_list[i].index_X = self.card_list[i].index_X + 1
end
end
card.index_X = 1
card.index_Y = 1
table.insert(self.card_list, 1, card)
isChangeCard = true
elseif xy.x > (self.card_list[maxmark].btn_card.x + button.width) and #CountCards < 10 and xy.y > self._data_outLinePos then
list_remove(self.card_list, card)
local num = 0
for i = 1, #self.card_list do
if card.index_X == self.card_list[i].index_X then
num = num + 1
end
if card.index_X == self.card_list[i].index_X and card.index_Y < self.card_list[i].index_Y then
self.card_list[i].index_Y = self.card_list[i].index_Y - 1
end
end
if num == 0 then
for i = 1, #self.card_list do
if self.card_list[i].index_X > card.index_X then
self.card_list[i].index_X = self.card_list[i].index_X - 1
end
end
end
card.index_X = self.card_list[#self.card_list].index_X + 1
card.index_Y = 1
self.card_list[#self.card_list + 1] = card
isChangeCard = true
else
local MoveCard = false
local MoveCardPos = 0
local MoveCardY = 0
for i = 1, #CountCards do
local card_view = CountCards[i][1]
if card_view ~= nil then
if xy.x > card_view.old_postion.x and xy.x < (card_view.old_postion.x + button.width) and xy.y > self._data_outLinePos then
if card ~= card_view and #CountCards[i] < 4 and card.index_X ~= card_view.index_X then
MoveCardPos = i
MoveCardY = #CountCards[i] + 1
MoveCard = true
list_remove(self.card_list, card)
end
end
end
end
local MoveCardindex = 0
-- local MoveCardY = 0
-- print("lingmeng end", button.y, MoveCard, button.y > self._data_outLinePos,
-- button.x + button.width / 2 > card.old_postion.x and
-- button.x + button.width / 2 < (card.old_postion.x + button.width) and button.y > self._data_outLinePos)
if xy.x > card.old_postion.x and xy.x < (card.old_postion.x + button.width) and button.y > self._data_outLinePos then
if #CountCards[card.index_X] > 1 then
for i = 1, #CountCards[card.index_X] do
local _cv = CountCards[card.index_X][i]
if _cv ~= card then
if xy.y > _cv.btn_card.y and xy.y < (_cv.btn_card.y + button.height) then
--向下移動
if i < card.index_Y then
MoveCardindex = -1
MoveCardPos = card.index_X
MoveCardY = _cv.index_Y
MoveCard = true
list_remove(self.card_list, card)
--向上移動
elseif i > card.index_Y then
MoveCardindex = 1
MoveCardPos = card.index_X
MoveCardY = _cv.index_Y
MoveCard = true
list_remove(self.card_list, card)
end
elseif i == #CountCards[card.index_X] and button.y + button.height / 2 < _cv.btn_card.y then
MoveCardindex = 1
MoveCardPos = card.index_X
MoveCardY = _cv.index_Y
MoveCard = true
list_remove(self.card_list, card)
elseif i == 1 and button.y + button.height / 2 > (_cv.btn_card.y + button.width) then
MoveCardindex = -1
MoveCardPos = card.index_X
MoveCardY = _cv.index_Y
MoveCard = true
list_remove(self.card_list, card)
end
end
end
end
end
-- print("lingmeng end", MoveCard, MoveCardindex)
if MoveCard == true and MoveCardindex == 0 then
local num = 0
for i = 1, #self.card_list do
if card.index_X == self.card_list[i].index_X and card.index_Y < self.card_list[i].index_Y then
self.card_list[i].index_Y = self.card_list[i].index_Y - 1
end
if card.index_X == self.card_list[i].index_X then
num = num + 1
end
end
if num == 0 then
for i = 1, #self.card_list do
if self.card_list[i].index_X > card.index_X then
self.card_list[i].index_X = self.card_list[i].index_X - 1
end
end
if MoveCardPos > card.index_X then
MoveCardPos = MoveCardPos - 1
end
end
card.index_X = MoveCardPos
card.index_Y = MoveCardY
for i = #self.card_list, 1, -1 do
if MoveCardPos == self.card_list[i].index_X then
table.insert(self.card_list, (i + 1), card)
break
end
end
isChangeCard = true
--上下移动
elseif MoveCard == true and MoveCardindex ~= 0 then
for i = 1, #self.card_list do
if card.index_X == self.card_list[i].index_X then
--向下移动
if MoveCardindex == -1 then
if self.card_list[i].index_Y < card.index_Y and self.card_list[i].index_Y >= MoveCardY then
self.card_list[i].index_Y = self.card_list[i].index_Y + 1
end
--向上移动
else
if self.card_list[i].index_Y > card.index_Y and self.card_list[i].index_Y <= MoveCardY then
self.card_list[i].index_Y = self.card_list[i].index_Y - 1
end
end
end
end
card.index_X = MoveCardPos
card.index_Y = MoveCardY
for i = #self.card_list, 1, -1 do
if MoveCardPos == self.card_list[i].index_X and self.card_list[i].index_Y == (MoveCardY - 1) then
table.insert(self.card_list, (i + 1), card)
break
elseif MoveCardPos == self.card_list[i].index_X and self.card_list[i].index_Y == (MoveCardY + 1) then
table.insert(self.card_list, i, card)
break
end
end
isChangeCard = true
else
isChangeCard = false
self._area_handcard_list:AddChild(button)
end
end
self:UpdateHandCardsPos()
if isChangeCard == true then
self:SendChangeCard()
end
end
end
function M:UpdateOutCardList(outcard, isShow, isMopai, seat)
if (isShow == nil) then
isShow = false
end
if (isMopai == nil) then
isMopai = false
end
self._area_outcard_list:RemoveChildren(0, -1, true)
local outcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Gcm_OutCard")
if outcard == 0 then
--outcards:GetChild("icon").icon ="ui://Main_RunBeard/202_1_300"
else
outcards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/203_", outcard)
end
outcards.x, outcards.y = 0, 0
local show_di_bg = outcards:GetChild("show_di_bg")
--show_di_bg.visible = true
if (isShow) then
if outcard == 0 then
show_di_bg.visible = false
end
if (seat ~= nil and outcards ~= nil) then
if (isMopai) then
if outcard ~= 0 then
outcards:GetTransition("mopai" .. seat):Play(function()
-- show_di_bg.visible = true
end)
end
else
show_di_bg.visible = false
outcards:GetTransition("cpai" .. seat):Play()
end
else
--show_di_bg.visible = true
end
else
show_di_bg.visible = false
end
self._area_outcard_list:AddChild(outcards)
end
--弃牌
function M:UpdateQiPai(qi_list, isplay)
self._area_qipai_list:RemoveChildren(0, -1, true)
for i = 1, #qi_list do
local qicards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Qipai")
qicards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/202_", qi_list[i])
if (isplay) then
if (i == #qi_list) then
qicards:GetTransition("t0"):Play()
end
end
self._area_qipai_list:AddChild(qicards)
end
end
--摸牌动画
-- function M:PlayingOutCardAnima(card)
-- if (self._area_outcard_list ~= nil and self._area_outcard_list.numChildren > 0) then
-- self._area_outcard_list:GetChildAt(0):GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/202_', card)
-- self._view:GetTransition('t0'):Play()
-- end
-- coroutine.start(
-- function()
-- coroutine.wait(0.1)
-- -- self._bgview.selectedIndex = 1
-- self:ClearOutCard()
-- end
-- )
-- end
function M:UpdateFzList(fz_list, ispaly, seat, flag_pengPao)
--printlog("UpdateFzList area_fz_list2")
self._area_fz_list:RemoveChildren(0, -1, true)
for i = 1, #fz_list do
local fzitem = nil
if fz_list[i].type ~= RB_FZType.Kan then
fzitem = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/ComponentNew")
if (ispaly == false) then
fzitem:RemoveChildren(0, -1, true)
end
end
if fz_list[i].type == RB_FZType.Chi or fz_list[i].type == RB_FZType.Bi then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
fzcards:GetChild("card_" .. 1).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].active_card)
fzcards:GetController("c2").selectedIndex = 1
fzcards:GetChild("card_" .. 2).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].opcard[1])
fzcards:GetChild("card_" .. 3).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].opcard[2])
fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, flag_pengPao)
elseif fz_list[i].type == RB_FZType.Peng then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
for j = 1, 3 do
fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
end
fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, flag_pengPao)
elseif fz_list[i].type == RB_FZType.Wei then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
fzcards:GetController("c1").selectedIndex = 1
for j = 1, 3 do
if j == 1 then
fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
else
fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300"
end
end
fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, flag_pengPao)
elseif fz_list[i].type == RB_FZType.ChouWei then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
for j = 1, 2 do
fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300"
end
fzcards:GetChild("card_" .. 3).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, flag_pengPao)
elseif fz_list[i].type == RB_FZType.Pao then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4")
for j = 1, 4 do
fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
end
fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, flag_pengPao)
elseif fz_list[i].type == RB_FZType.Ti then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4")
for j = 1, 4 do
if j == 1 then
fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
else
fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300"
end
end
fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, flag_pengPao)
end
end
end
function M:playAnim(fzitem, fzcards, size, i, ispaly, flag_pengPao)
print("lingmeng playAnim", fzitem, fzcards, size, i, ispaly, flag_pengPao)
if (ispaly == nil) then
ispaly = false
end
if (ispaly and i == size and not flag_pengPao) then
local fristCard = self.card_list[1].btn_card
print("lingmeng btn_card", self.card_list[1].index_X)
-- self._area_handcard_list:AddChild(fzcards)
fzcards:SetPivot(0.5, 0.5)
fzcards.rotation = 180
fzcards.xy = fristCard.xy - Vector2.New(fzcards.width, fzcards.height)
--[[
fzcards:TweenMove(
self._area_fz_list.xy + Vector2.New(fzcards.width, 0) * self._area_fz_list.numItems -
self._area_handcard_list.xy, 0.2)
fzcards:TweenScale(Vector2.New(0.5, 0.5), 0.2)
--]]
fzcards:RemoveFromParent()
fzcards.xy = Vector2.zero
fzcards.rotation = 0
fzcards:SetScale(1, 1)
fzitem:AddChild(fzcards)
self._area_fz_list:AddChildAt(fzitem, 0)
--[[
coroutine.start(
function()
coroutine.wait(0.21)
end
)
--]]
else
fzitem:AddChild(fzcards)
self._area_fz_list:AddChildAt(fzitem, 0)
end
end
--出牌提示动画
function M:ChuPaiTiShi()
if DataManager.CurrenRoom == nil or DataManager.CurrenRoom.self_player == nil then
return
end
local chu_player = DataManager.CurrenRoom.self_player
local selfplayeTable = {}
selfplayeTable.handcard_list = chu_player.handcard_list
selfplayeTable.fz_list = chu_player.fz_list
selfplayeTable.tiCount = chu_player.tiCount
selfplayeTable.paoCount = chu_player.paoCount
selfplayeTable.hu_xi = chu_player.hu_xi
local player = membe_deep_clone(selfplayeTable)
local mark_ting = {}
for i = 1, #DataManager.CurrenRoom.self_player.handcard_list do
local card = DataManager.CurrenRoom.self_player.handcard_list[i]
list_remove(player.handcard_list, card)
local _player = membe_deep_clone(player)
local tingList = CardCheck.tingPai(_player, DataManager.CurrenRoom)
local isKan = false
for j = 1, #player.fz_list do
if card == player.fz_list[j].card and player.fz_list[j].type == RB_FZType.Kan then
isKan = true
end
end
if #tingList > 0 and isKan == false then
mark_ting[#mark_ting + 1] = card
end
table.insert(player.handcard_list, card)
table.sort(player.handcard_list, ViewUtil.HandCardSort)
end
if DataManager.CurrenRoom.curren_outcard_seat == DataManager.CurrenRoom.self_player.seat then
self._view:GetController("chupai").selectedIndex = 1
if #mark_ting > 0 then
for i = 1, #mark_ting do
for k = 1, #self.card_list do
local card_view = self.card_list[k]
if card_view.card_item == mark_ting[i] then
card_view.btn_card:GetController("mark_ting").selectedIndex = 1
end
end
end
end
else
self._view:GetController("chupai").selectedIndex = 0
for k = 1, #self.card_list do
local card_view = self.card_list[k]
card_view.btn_card:GetController("mark_ting").selectedIndex = 0
end
end
end
return M

View File

@ -0,0 +1,71 @@
local Protocol = {
-- 出牌
GAME_DIS_CARD = "611",
-- 提示选择行为
GAME_ACTION = "612",
-- 通知服务器手牌队形改变
GAME_CHANGE_CARD = "613",
-- 通知服务器牌字体改变
GAME_CHANGE_TYPEfACE = "615",
-- 发牌协议
GAME_EVT_PLAYER_DEAL = "811",
-- 出牌事件
GAME_EVT_DISCARD = "812",
-- 出牌提示事件
GAME_EVT_DISCARD_TIP = "813",
-- 放子提示事件
GAME_EVT_FZTIPS = "814",
-- action 事件
GAME_EVT_ACTION = "815",
-- 胡牌事件
GAME_EVT_HU = "816",
-- 结算
GAME_EVT_RESULT1 = "817",
-- 弃牌
GAME_EVT_QIPAI = "818",
-- 抓牌
GAME_EVT_DRAW = "819",
-- 放喂提示事件 GAME_EVT_FANGPAO_TIP
GAME_EVT_FANGPAO_TIP = "822",
-- 放跑
GAME_EVT_FANGPAO = "823",
-- 放跑
GAME_EVT_FANGPAO_RSP = "824",
--鸟
GAME_EVT_SEND_NIAO = "831",
--打鸟提示
GAME_EVT_DANIAO_TIP = "832",
--打鸟
GAME_EVT_DANIAO = "833",
-- 转盘指向事件
GAME_EVT_CHANGE_ACTIVE_PLAYER = "820",
--第二十一张牌
GAME_EVT_ADD_CARD = "821",
GAME_XIPAI = "20836",
GAME_EVENT_XIPAI = "20837",
GAME_EVENT_NOTIFY_XIPAI = "20838",
}
return Protocol

View File

@ -0,0 +1,456 @@
-- 检测牌是否存在
local function checkCard(eventCard, cardList, num)
if num == nil then
num = 1
end
local result = 0
for i = 1, #cardList do
if (cardList[i] == eventCard) then
result = result + 1
if (result == num) then
return true
end
end
end
return false
end
-- 移除指定数量的牌
local function removeCard(cardList, card, count)
for i = 1, count do
list_remove(cardList, card)
end
end
local function checkCardAndRomve(eventCard, cardList, num)
if (checkCard(eventCard, cardList, num)) then
removeCard(cardList, eventCard, num)
return true
end
return false
end
-- 获取列表中牌数量
local function cardNum(eventCard, cardList)
local result = 0
for i = 1, #cardList do
local card = cardList[i]
if (card == eventCard) then
result = result + 1
end
end
return result
end
local M = {
pair_count = 0,
cardList = nil,
stack = nil,
stackHuxi = nil
}
function M:push(cardGroup)
self.stack[#self.stack + 1] = cardGroup
end
function M:pushhuxi(cardGroup)
self.stackHuxi[#self.stackHuxi + 1] = cardGroup
end
function M:rollBack()
local cardGroup = self.stack[#self.stack]
table.remove(self.stack, #self.stack)
for _, card in ipairs(cardGroup) do
self.cardList[#self.cardList + 1] = card
end
table.sort(self.cardList)
end
-- 顺子
function M:tryShunzi1(card, player)
if card < 300 and card % 100 > 8 then
return false
end
if (checkCard(card + 1, self.cardList) and checkCard(card + 2, self.cardList)) then
removeCard(self.cardList, card + 1, 1)
removeCard(self.cardList, card + 2, 1)
removeCard(self.cardList, card, 1)
local cardGroup = {card, card + 1, card + 2}
self:push(cardGroup)
local _huxi = 0
if card == 101 then
_huxi = 3
end
if card == 201 then
_huxi = 6
end
self:pushhuxi(_huxi)
return true
end
return false
end
-- 大大小 小小大
function M:tryShunzi2(card)
if card - card % 100 == 100 then
if checkCard(card + 100, self.cardList, 1) and checkCard(card, self.cardList, 2) then
removeCard(self.cardList, card, 2)
removeCard(self.cardList, card + 100, 1)
local cardGroup = {card, card, card + 100}
self:push(cardGroup)
self:pushhuxi(0)
return true
end
if (checkCard(card + 100, self.cardList, 2)) and (checkCard(card, self.cardList, 1)) then
removeCard(self.cardList, card, 1)
removeCard(self.cardList, card + 100, 2)
local cardGroup = {card, card + 100, card + 100}
self:push(cardGroup)
self:pushhuxi(0)
return true
end
else
if (checkCard(card - 100, self.cardList, 1)) and checkCard(card, self.cardList, 2) then
removeCard(self.cardList, card, 2)
removeCard(self.cardList, card - 100, 1)
local cardGroup = {card - 100, card, card}
self:push(cardGroup)
self:pushhuxi(0)
return true
end
if (checkCard(card - 100, self.cardList, 2)) and checkCard(card, self.cardList, 1) then
removeCard(self.cardList, card, 1)
removeCard(self.cardList, card - 100, 2)
local cardGroup = {card, card - 100, card - 100}
self:push(cardGroup)
self:pushhuxi(0)
return true
end
end
--print(card)
return false
-- body
end
-- 2 7 10
function M:tryShunzi3(card, player)
if card % 100 == 2 then
if (checkCard(card + 5, self.cardList, 1)) and (checkCard(card + 8, self.cardList, 1)) then
removeCard(self.cardList, card, 1)
removeCard(self.cardList, card + 5, 1)
removeCard(self.cardList, card + 8, 1)
local cardGroup = {card, card + 5, card + 8}
self:push(cardGroup)
local _huxi = 0
if card == 102 then
_huxi = 3
elseif card == 202 then
_huxi = 6
end
self:pushhuxi(_huxi)
return true
end
end
return false
end
-- 坎
function M:tryKezi(card, player)
if (checkCard(card, self.cardList, 3)) then
removeCard(self.cardList, card, 3)
local cardGroup = {card, card, card}
self:push(cardGroup)
local _huxi = 0
if card < 200 then
_huxi = 1
else
_huxi = 3
end
self:pushhuxi(_huxi)
return true
end
-- print(card)
return false
end
function M:tryPair(card)
if (self.pair_count > 0) then
return false
end
if (checkCard(card, self.cardList, 2)) then
removeCard(self.cardList, card, 2)
local cardGroup = {card, card}
self:push(cardGroup)
self.pair_count = 1
return true
end
-- print(card)
return false
end
function M:tryWin(player)
if #self.cardList == 0 then
if (player.tiCount + player.paoCount + self.kong_count > 0) then
if (self.pair_count == 1) then
return true
end
return false
else
if (self.pair_count > 0) then
return false
end
return true
end
end
local activeCard = 0
for i = 1, #self.cardList do
if (self.cardList[i] == 201 or self.cardList[i] == 202) then
activeCard = self.cardList[i]
break
end
end
if (activeCard == 0) then
activeCard = self.cardList[1]
end
if (activeCard % 100 == 1) then
if self:tryShunzi1(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if self:tryKezi(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if (player.tiCount + player.paoCount + self.kong_count > 0) then
if self:tryPair(activeCard) then
if self:tryWin(player) then
return true
end
self.pair_count = 0
self:rollBack()
end
end
if self:tryShunzi2(activeCard) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
elseif activeCard % 100 == 2 then
if self:tryShunzi3(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if self:tryKezi(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if player.tiCount + player.paoCount + self.kong_count > 0 then
if self:tryPair(activeCard) then
if self:tryWin(player) then
return true
end
self.pair_count = 0
self:rollBack()
end
end
if self:tryShunzi1(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if self:tryShunzi2(activeCard) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
else
if self:tryKezi(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if player.tiCount + player.paoCount + self.kong_count > 0 then
if self:tryPair(activeCard) then
if self:tryWin(player) then
return true
end
self.pair_count = 0
self:rollBack()
end
end
if self:tryShunzi2(activeCard) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if self:tryShunzi1(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
end
return false
end
local function init(self, player, cardInhand, addCard)
self.stack = {}
self.stackHuxi = {}
self.pair_count = 0
self.kong_count = 0
self.cardList = membe_clone(cardInhand)
if addCard == nil then
self.kong_count = 1
else
self.kong_count = 0
self.cardList[#self.cardList + 1] = addCard
end
table.sort(self.cardList)
return self:tryWin(player)
end
function M.tingPai(player, room)
local self = setmetatable({}, {__index = M})
local tingList = {}
local cardInhand = player.handcard_list
if not cardInhand or #cardInhand == 0 then
return tingList
end
local kan_huxi = 0
local kan_cards = {}
for j = 1, #player.fz_list do
for i = 1, #cardInhand do
if cardInhand[i] == player.fz_list[j].active_card and player.fz_list[j].type == 3 then
kan_cards[#kan_cards + 1] = cardInhand[i]
break
end
end
end
if #kan_cards > 0 then
for i = 1, #kan_cards do
if kan_cards[i] > 200 then
kan_huxi = kan_huxi + 6
else
kan_huxi = kan_huxi + 3
end
removeCard(cardInhand, kan_cards[i], 3)
end
end
player.tiCount = 0
player.paoCount = 0
if #player.fz_list > 0 then
for i = 1, #player.fz_list do
if player.fz_list[i].type == 6 then
player.paoCount = player.paoCount + 1
elseif player.fz_list[i].type == 7 then
player.tiCount = player.tiCount + 1
end
end
end
for k = 100, 200, 100 do
for i = 1, 10 do
local tem = k + i
local result = init(self, player, cardInhand, tem)
local num = 0
for k = 1, #self.stackHuxi do
num = num + self.stackHuxi[k]
end
if result == false or (player.hu_xi + num + kan_huxi) < (self:getHuxi(room)) then
if #player.fz_list > 0 then
for k = 1, #player.fz_list do
if tem == player.fz_list[k].active_card then
local ctype = player.fz_list[k].type
if ctype == 2 or ctype == 3 or ctype == 4 or ctype == 5 then
local paohu = init(self, player, cardInhand)
if paohu then
local num2 = 0
for j = 1, #self.stackHuxi do
num2 = num2 + self.stackHuxi[j]
end
if
(num2 + player.hu_xi + kan_huxi + self:GetFzData(tem, ctype)) >=
(self:getHuxi(room))
then
tingList[#tingList + 1] = tem
end
end
end
end
end
end
else
local num1 = 0
for k = 1, #self.stackHuxi do
num1 = num1 + self.stackHuxi[k]
end
if (player.hu_xi + num1 + kan_huxi) >= (self:getHuxi(room)) then
tingList[#tingList + 1] = tem
end
end
end
end
return tingList
end
function M:getHuxi(room)
if room.game_id == 301 then
return 8
end
if room.game_id == 15 then
return 15
end
if room.game_id == 17 then
return 15
end
if room.game_id == 13 or room.game_id == 14 or room.game_id == 23 then
return 15
elseif room.game_id == 26 then
return 10
elseif room.game_id == 29 then
if room.room_config.maxPlayers == 3 then
return 15
else
return 9
end
end
end
function M:GetFzData(tem, ctype)
local huxi
if ctype == 2 then
if tem > 200 then
huxi = 6
else
huxi = 5
end
elseif ctype == 3 then
huxi = 3
elseif ctype == 4 then
huxi = 3
elseif ctype == 5 then
huxi = 3
end
return huxi
end
return M

View File

@ -0,0 +1,758 @@
-- 检测牌是否存在
local function checkCard(eventCard, cardList, num)
if num == nil then
num = 1
end
local result = 0
for i = 1, #cardList do
if (cardList[i] == eventCard) then
result = result + 1
if (result == num) then
return true
end
end
end
return false
end
local function cardType(card)
if card>200 then
return 2
else
return 1
end
end
-- 移除指定数量的牌
local function removeCard(cardList, card, count)
for i = 1, count do
list_remove(cardList, card)
end
end
local function checkCardAndRomve(eventCard, cardList, num)
if (checkCard(eventCard, cardList, num)) then
removeCard(cardList, eventCard, num)
return true
end
return false
end
-- 获取列表中牌数量
local function cardNum(eventCard, cardList)
local result = 0
for i = 1, #cardList do
local card = cardList[i]
if (card == eventCard) then
result = result + 1
end
end
return result
end
local M = {
pair_count = 0,
pairflag = 0,
cardList = nil,
stack = nil,
stackHuxi = nil,
handCardList = nil
}
function M:push(cardGroup)
self.stack[#self.stack + 1] = cardGroup
end
function M:pushhuxi(cardGroup)
self.stackHuxi[#self.stackHuxi + 1] = cardGroup
end
function M:rollBack()
local cardGroup = self.stack[#self.stack]
table.remove(self.stack, #self.stack)
for _, card in ipairs(cardGroup) do
self.cardList[#self.cardList + 1] = card
end
table.sort(self.cardList)
end
--坎
function M:tryKezi(card, player)
if cardNum(card, self.cardList)>=3 then
removeCard(self.cardList, card, cardNum(card, self.cardList))
local cardGroup = {card, card, card}
self:push(cardGroup)
local _huxi = 0
if cardType(card)==1 then
_huxi = 3
else
_huxi = 6
end
self:pushhuxi(_huxi)
return true
end
return false
end
--顺子1
function M:tryShunzi1(card, player)
if card < 200 and card % 100 > 8 then
return false
end
if (cardNum(card + 1, self.cardList)> 0 and cardNum(card + 2, self.cardList) > 0 ) then
removeCard(self.cardList, card, 1)
removeCard(self.cardList, card + 1, 1)
removeCard(self.cardList, card + 2, 1)
local cardGroup = {card, card + 1, card + 2}
self:push(cardGroup)
local _huxi = 0
if card%100==1 then
if card>200 then
_huxi = 6
else
_huxi = 3
end
end
self:pushhuxi(_huxi)
return true
end
return false
end
--顺子2
function M:tryShunzi2(card, player)
if cardType(card) == 1 then
if cardNum(card+100,self.cardList) >= 1 and cardNum(card,self.cardList)>=2 then
removeCard(self.cardList, card, 2)
removeCard(self.cardList, card + 100, 1)
local cardGroup = {card, card, card+100}
self:push(cardGroup)
local _huxi = 0
self:pushhuxi(_huxi)
return true
end
if cardNum(card+100,self.cardList)>=2 then
removeCard(self.cardList, card, 1)
removeCard(self.cardList, card+100, 2)
local cardGroup = {card, card+100, card+100}
self:push(cardGroup)
local _huxi = 0
self:pushhuxi(_huxi)
return true
end
else
if cardNum(card-100,self.cardList) >= 1 and cardNum(card,self.cardList)>=2 then
removeCard(self.cardList, card, 2)
removeCard(self.cardList, card - 100, 1)
local cardGroup = {card, card, card-100}
self:push(cardGroup)
local _huxi = 0
self:pushhuxi(_huxi)
return true
end
if cardNum(card-100,self.cardList)>=2 then
removeCard(self.cardList, card, 1)
removeCard(self.cardList, card-100, 2)
local cardGroup = {card, card-100, card-100}
self:push(cardGroup)
local _huxi = 0
self:pushhuxi(_huxi)
return true
end
end
return false
end
function M:tryShunzi3(card, player)
if card % 100 == 2 then
if cardNum(card + 5, self.cardList)>0 and cardNum(card + 8, self.cardList)>0 then
removeCard(self.cardList, card, 1)
removeCard(self.cardList, card + 5, 1)
removeCard(self.cardList, card + 8, 1)
local cardGroup = {card, card + 5, card + 8}
self:push(cardGroup)
local _huxi = 3
self:pushhuxi(_huxi)
return true
end
else
if cardNum(card + 5, self.cardList)>0 and cardNum(card + 8, self.cardList)>0 then
removeCard(self.cardList, card, 1)
removeCard(self.cardList, card + 5, 1)
removeCard(self.cardList, card + 8, 1)
local cardGroup = {card, card + 5, card + 8}
self:push(cardGroup)
local _huxi = 3
self:pushhuxi(_huxi)
return true
end
end
return false
end
function M:tryPair2(card)
if (self.pair_count > 0) then
return false
end
if (checkCard(card, self.cardList, 1)) then
if card % 100 ==2 then
if (checkCard(card+5, self.cardList, 1)) then
removeCard(self.cardList, card, 1)
removeCard(self.cardList, card+5, 1)
local cardGroup = {card, card+5}
self:push(cardGroup)
local _huxi = 1
self:pushhuxi(_huxi)
self.pair_count = 1
return true
end
if (checkCard(card+8, self.cardList, 1)) then
removeCard(self.cardList, card, 1)
removeCard(self.cardList, card+8, 1)
local cardGroup = {card, card+8}
self:push(cardGroup)
local _huxi = 1
self:pushhuxi(_huxi)
self.pair_count = 1
return true
end
end
if card % 100 ==7 then
if (checkCard(card-5, self.cardList, 1)) then
removeCard(self.cardList, card, 1)
removeCard(self.cardList, card-5, 1)
local cardGroup = {card, card-5}
self:push(cardGroup)
local _huxi = 1
self:pushhuxi(_huxi)
self.pair_count = 1
return true
end
if (checkCard(card+3, self.cardList, 1)) then
removeCard(self.cardList, card, 1)
removeCard(self.cardList, card+3, 1)
local cardGroup = {card, card+3}
self:push(cardGroup)
local _huxi = 1
self:pushhuxi(_huxi)
self.pair_count = 1
return true
end
end
if card % 100 == 10 then
if (checkCard(card-8, self.cardList, 1)) then
removeCard(self.cardList, card, 1)
removeCard(self.cardList, card-8, 1)
local cardGroup = {card, card-8}
self:push(cardGroup)
local _huxi = 1
self:pushhuxi(_huxi)
self.pair_count = 1
return true
end
if (checkCard(card-3, self.cardList, 1)) then
removeCard(self.cardList, card, 1)
removeCard(self.cardList, card-3, 1)
local cardGroup = {card, card-3}
self:push(cardGroup)
local _huxi = 1
self:pushhuxi(_huxi)
self.pair_count = 1
return true
end
end
end
return false
end
function M:tryPair(card)
if (self.pair_count > 0) then
return false
end
if cardNum(card, self.cardList)>=2 then
self.pairflag = 1
removeCard(self.cardList, card, 2)
local cardGroup = {card, card , card}
self:push(cardGroup)
self.pair_count = 1;
local _huxi = 0
self:pushhuxi(_huxi)
return true
end
end
function M:tryWin(player)
--[[ if #self.cardList == 0 then
if (self.pair_count == 1) then
return true
elseif #self.stack>=2 then
local tempPList={}
for i=1,#self.stack do
local card1=self.stack[i][1]
local card2=self.stack[i][2]
table.insert(tempPList,card1)
table.insert(tempPList,card2)
end
if #tempPList~=4 then return false end
table.sort(tempPList)
if tempPList[1]==tempPList[2]+1 and tempPList[2]==tempPList[3]+1 and tempPList[3]==tempPList[4]+1 then
return true
end
end
return false
end
]]
if #self.cardList == 0 then
if (player.tiCount+player.paoCount)>0 then
if self.pair_count ==1 then
return true
end
return false
else
if self.pair_count >0 then
return false
end
return true
end
end
local activeCard = 0
for i = 1, #self.cardList do
if (self.cardList[i] == 201 or self.cardList[i] == 202) then
activeCard = self.cardList[i]
break
end
end
if (activeCard == 0) then
activeCard = self.cardList[1]
end
if (activeCard % 100 == 1) then
if self:tryKezi(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if self:tryShunzi1(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if self:tryShunzi2(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if self:tryShunzi3(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if (player.tiCount + player.paoCount)>0 then
if self:tryPair(activeCard) then
if self:tryWin(player) then
return true
end
self.pair_count = 0
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
end
elseif activeCard % 100 == 2 then
if self:tryShunzi3(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if self:tryKezi(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if self:tryShunzi1(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if self:tryShunzi2(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if self:tryShunzi3(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if (player.tiCount + player.paoCount)>0 then
if self:tryPair(activeCard) then
if self:tryWin(player) then
return true
end
self.pair_count = 0
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
end
else
if self:tryShunzi2(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if self:tryKezi(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if self:tryShunzi1(activeCard, player) then
if self:tryWin(player) then
return true
end
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
if (player.tiCount + player.paoCount)>0 then
if self:tryPair(activeCard) then
if self:tryWin(player) then
return true
end
self.pair_count = 0
self:rollBack()
table.remove(self.stackHuxi, #self.stackHuxi)
end
end
end
return false
end
local function initnew(self,player,cardInhand,addCard)
-- 方案一获取获取pao子坎子顺子话子对子将
self.stack = {}
self.stackHuxi = {}
self.pair_count = 0
self.kong_count = 0
self.drawCard=0
self.cardList = membe_clone(cardInhand)
self.handCardList = membe_clone(cardInhand)
local tmpchongfu = {}
self.handCardList[#self.handCardList+1] = addCard
for i = 1, #self.handCardList do
--获取重复
if tmpchongfu[self.handCardList[i]] ~=nil then
tmpchongfu[self.handCardList[i]] = tmpchongfu[self.handCardList[i]] + 1
else
tmpchongfu[self.handCardList[i]] = 1
end
end
for index, value in pairs(tmpchongfu) do
if value>=3 then
if value==4 then
player.paoCount = player.paoCount+1
end
removeCard(self.handCardList,index,value)
local _huxi = 0
if cardType(index)==1 then
_huxi = 6
else
_huxi = 9
end
self:pushhuxi(_huxi)
end
end
-- pt(tmpchongfu)
-- pt(self.handCardList)
self.cardList = membe_clone( self.handCardList )
-- pt(self.cardList)
table.sort(self.cardList)
--[[local activeCard = 109
self.cardList = {
107,207,109,109,209
}]]
-- local res1 = self:tryShunzi2(activeCard, player)
local res1 = self:tryWin(player)
--printlog(res1)
end
local function init(self, player, cardInhand, addCard)
self.stack = {}
self.stackHuxi = {}
self.pair_count = 0
self.kong_count = 0
self.drawCard=0
self.handCardList = membe_clone(cardInhand)
local tmpchongfu = {}
self.handCardList[#self.handCardList+1] = addCard
for i = 1, #self.handCardList do
--获取重复
if tmpchongfu[self.handCardList[i]] ~=nil then
tmpchongfu[self.handCardList[i]] = tmpchongfu[self.handCardList[i]] + 1
else
tmpchongfu[self.handCardList[i]] = 1
end
end
for index, value in pairs(tmpchongfu) do
if value==4 then
player.paoCount = player.paoCount+1
-- self.tiZi[index] = 1
end
if value == 2 then
self.pairflag = 1
end
end
self.cardList = membe_clone(cardInhand)
if addCard == nil then
self.kong_count = 1
else
self.kong_count = 0
self.cardList[#self.cardList + 1] = addCard
self.drawCard=addCard
end
table.sort(self.cardList)
local res = self:tryWin(player)
return res
end
function M.tingPai(player, room)
local self = setmetatable({}, {__index = M})
local tingList = {}
local cardInhand = player.handcard_list
self.tiZi = {}
if not cardInhand or #cardInhand == 0 then
return tingList
end
local kan_huxi = 0
local kan_cards = {}
if player.tiCount==nil then
player.tiCount = 0
end
if player.paoCount==nil then
player.paoCount = 0
end
for j = 1, #player.fz_list do
for i = 1, #cardInhand do
if cardInhand[i] == player.fz_list[j].active_card and player.fz_list[j].type == 3 then
kan_cards[#kan_cards + 1] = cardInhand[i]
self.tiZi[cardInhand[i]] = 1
break
end
end
if player.fz_list[j].type==6 then
player.paoCount = 1
if cardType(player.fz_list[j].active_card) ==2 then
kan_huxi = kan_huxi + 9
else
kan_huxi = kan_huxi + 6
end
end
if player.fz_list[j].type==7 then
player.tiCount = 1
if cardType(player.fz_list[j].active_card) ==2 then
kan_huxi = kan_huxi + 12
else
kan_huxi = kan_huxi + 9
end
end
if player.fz_list[j].type==2 then
if cardType(player.fz_list[j].active_card) ==2 then
kan_huxi = kan_huxi + 3
else
kan_huxi = kan_huxi + 1
end
end
end
if #kan_cards > 0 then
for i = 1, #kan_cards do
if cardType(kan_cards[i])==2 then
kan_huxi = kan_huxi + 6
else
kan_huxi = kan_huxi + 3
end
removeCard(cardInhand, kan_cards[i], 3)
end
end
for k = 100, 200, 100 do
for i = 1, 10 do
local tem = k + i
-- player.paoCount = 1
local result = init(self, player, cardInhand, tem)
--补充 验证
-- local result2 = initnew(self,player,cardInhand,tem)
local num = 0
for k = 1, #self.stackHuxi do
num = num + self.stackHuxi[k]
end
if result then
local num1 = 0
for k = 1, #self.stackHuxi do
num1 = num1 + self.stackHuxi[k]
end
if (player.hu_xi + num1 + kan_huxi) >= (self:getHuxi(room)-1) then
tingList[#tingList + 1] = tem
end
end
end
end
if next(self.tiZi)~=nil and #tingList > 0 and self.pairflag>0 then
for key, value in pairs(self.tiZi) do
if value>0 then
tingList[#tingList + 1] = key
end
end
end
return tingList
end
function M:getHuxi(room)
if room.game_id == 301 then
return 8
end
if room.room_config.config.hunum==0 then
return 15
end
if room.game_id == 13 or room.game_id == 14 or room.game_id == 23 then
return 15
elseif room.game_id == 26 then
return 10
elseif room.game_id == 29 then
if room.room_config.maxPlayers == 3 then
return 15
else
return 9
end
end
end
function M:GetFzData(tem, ctype)
local huxi
if ctype == 1 then
huxi=1
elseif ctype == 2 then
huxi=1
elseif ctype == 3 then
huxi = 3
elseif ctype == 4 then
huxi = 3
elseif ctype == 5 then
huxi = 3
elseif ctype == 7 then
huxi = 5
end
return huxi
end
return M

View File

@ -0,0 +1,45 @@
RB_FZType =
{
Chi = 1,
Peng = 2,
Kan = 3,
Wei = 4,
ChouWei=5,
Pao = 6,
Ti = 7,
HU = 8,
Bi = 9,
PengPao =10,
WeiPao =11,
WeiTi =12,
KanTi =13,
DuiZi = 14,
zhao = 15,
}
local FZTipList = {
tip_map_id = nil,
tip_map_type = nil
}
local M = FZTipList
function M.new()
local self = {}
setmetatable(self,{__index = FZTipList})
self.tip_map_id = {}
self.tip_map_type = {}
return self
end
function M:AddTip(tip)
self.tip_map_id[tip.id] = tip
local tiplist = self.tip_map_type[tip.weight]
if not tiplist then
tiplist = {}
self.tip_map_type[tip.weight] = tiplist
end
tiplist[#tiplist+1] = tip
end
return M

View File

@ -0,0 +1,69 @@
local HuTipView = {
_view_start_pos = nil,
_touch_start_pos = nil,
}
local M = HuTipView
function M.new(main_view)
local self = {}
self.class = "HuTipView"
setmetatable(self,{__index = HuTipView})
self._main_view = main_view
self:init()
return self
end
local function SetObjEnabled(obj, enabled)
obj.visible = enabled
obj.touchable = enabled
end
function M:OnTouchBegin(context)
self._view_start_pos = Vector2(self._view.x, self._view.y)
self._touch_start_pos = self._main_view._view:GlobalToLocal(Vector2(context.inputEvent.x, context.inputEvent.y))
end
function M:OnTouchMove(context)
local xy = self._main_view._view:GlobalToLocal(Vector2.New(context.inputEvent.x,context.inputEvent.y))
local dist = Vector2(xy.x - self._touch_start_pos.x, xy.y - self._touch_start_pos.y)
local posx = self._view_start_pos.x + dist.x
local posy = self._view_start_pos.y + dist.y
local max_x = self._main_view._view.width - self._view.width
local max_y = self._main_view._view.height - self._view.height
self._view.x = posx < 0 and 0 or posx > max_x and max_x or posx
self._view.y = posy < 0 and 0 or posy > max_y and max_y or posy
end
function M:init()
self._view = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Hu_Tip")
self._main_view._view:AddChild(self._view)
local width = self._view.width
local m_width = self._main_view._view.width
local m_height = self._main_view._view.height
self._view.x = 0.115 * m_width --- 0.5 * width
--self._view.x = 0
self._view.y = 0.65 * m_height
SetObjEnabled(self._view, false)
self._view.onTouchBegin:Add(handler(self, self.OnTouchBegin))
self._view.onTouchMove:Add(handler(self, self.OnTouchMove))
end
function M:FillData(cards)
local lst_card = self._view:GetChild("tingpai")
lst_card:RemoveChildrenToPool()
local num = #cards
if num > 0 then
if num > 4 and num < 28 then
self._view.width = 191 + ((num > 4 and 6 or num) - 3) * 38
self._view.height = 69 + (math.ceil(num / 5) - 1) * 56
end
for i = 1, num do
local item = lst_card:AddItemFromPool()
item:GetChild("icon").icon = "ui://Main_RunBeard/202_1_" .. cards[i]
end
SetObjEnabled(self._view, true)
else
SetObjEnabled(self._view, false)
end
end
return M

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,118 @@
local M = {
btn_card = nil,
card_item = 0,
Hierarchy = 0,
index_X = 0,
index_Y = 0,
isUser = false,
initPos = Vector2.zero
}
function M.InitCardView(card_code, index_X, index_Y, type)
-- setmetatable(M, {__index = CardView})
local self = setmetatable({}, { __index = M })
self._room = DataManager.CurrenRoom
self.btn_card = self:InitUI(card_code, type)
self.card_item = card_code
self.index_X = index_X
self.index_Y = index_Y
self.btn_card.data = self
self:Init()
return self, self.btn_card
end
function M:Init()
self.card_width = 87
self.initPos = Vector2.zero
end
function M:InitUI(card_code, type)
local card
if type == 0 then
card = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Btn_Card")
self.icon = card:GetChild("icon")
self.icon.icon = self:getHandCardItem("ui://Main_RunBeard/201_", card_code)
self.icon:SetScale(self:getCardSize(), self:getCardSize())
card:GetChild("n6"):SetScale(self:getCardSize(), self:getCardSize())
elseif type == 1 then
card = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Gcm_OutCard")
self.icon = card:GetChild("icon")
if card_code == 0 then
self.icon = "ui://Main_RunBeard/202_1_300"
else
self.icon = self:GetCardItem("ui://Main_RunBeard/203_", card_code)
end
end
return card
end
function M:GetCardItem(card_1, card_2)
--printlog("jefe get card_item")
local room = DataManager.CurrenRoom
if room.change_card_display ~= nil then
return card_1 .. room.change_card_display .. card_2
else
return card_1 .. "6_" .. card_2
end
end
function M:getCardSize()
if self._room.change_card_size ~= nil then
return self._room.change_card_size
else
return 1.2
end
end
function M:getHandCardItem(card_1, card_2)
if self._room.change_card_display ~= nil then
if self._room.change_card_display == "1_" then
if self._room.change_card_size ~= nil then
self.card_width = 94 * self._room.change_card_size
else
self.card_width = 94
end
return card_1 .. "4_" .. card_2
end
if self._room.change_card_size ~= nil then
self.card_width = 87 * self._room.change_card_size
else
self.card_width = 87
end
return card_1 .. self._room.change_card_display .. card_2
else
if self._room.change_card_size ~= nil then
self.card_width = 90 * self._room.change_card_size
else
self.card_width = 90
end
return card_1 .. "6_" .. card_2
end
end
function M:UpdateKan()
self.btn_card.touchable = false
self.btn_card:GetController("Kan").selectedIndex = 1
end
function M:UpdateTing(isting)
self.btn_card:GetController("mark_ting").selectedIndex = isting and 1 or 0
end
function M:UpdateIcon()
self.icon.icon = self:getHandCardItem("ui://Main_RunBeard/201_", self.card_item)
-- self.btn_card:TweenMove(self:GetHandCardPos(self, #CountCards), 0.02)
end
function M:UpdateScale()
local size = self._room.change_card_size
-- card_view.btn_card:GetChild("icon").icon = self:getHandCardItem("ui://Main_RunBeard/201_", card_view.card_item)
self.icon:SetScale(size, size)
self.btn_card:GetChild("n6"):SetScale(size, size)
-- self:getCardWidth()
end
return M

View File

@ -0,0 +1,131 @@
local M = {}
function M.InitChiView(gamectr, view, cardInfo)
local self = setmetatable({}, {__index = M})
self._room = DataManager.CurrenRoom
self.class = "ChiView"
self._gamectr = gamectr
self._mainView = view
self._cardInfo = cardInfo
return self
end
function M:UpdateChiView(list, tip_hu, callback, cardInfo)
self:ShowView(list, tip_hu, callback, cardInfo)
end
function M:ShowView(tiplist, tip_hu, callback, cardInfo)
local _pop_tip_choice = UIPackage.CreateObject("Main_RunBeard", "Pop_tip_choice")
local list_choose = _pop_tip_choice:GetChild("Lst_choose")
_pop_tip_choice:GetChild("dibtn").onClick:Add(function()
_pop_tip_choice:Dispose()
end)
-- --list 去重复的
if #tiplist == 1 then
_pop_tip_choice:GetController("bipai").selectedIndex = 3
end
local tip_list = membe_deep_clone(tiplist)
for i = 1, #tiplist do
for k = 1, #tip_list do
if tip_list[k].weight ~= 4 and tiplist[i].id ~= tip_list[k].id then
if tiplist[i].OpCard[1] == tip_list[k].OpCard[1] and tiplist[i].OpCard[2] == tip_list[k].OpCard[2] then
tip_list[i].weight = 4
end
end
end
end
list_choose:RemoveChildrenToPool()
for i = 1, #tip_list do
if tip_list[i].weight ~=4 then
local item_choose = list_choose:AddItemFromPool()
self:SetIcon(item_choose, 2, tip_list[i].OpCard[1])
self:SetIcon(item_choose, 3, tip_list[i].OpCard[2])
self:SetIcon(item_choose, 1, tip_list[i].card)
item_choose.onClick:Add(function()
for k=1,list_choose.numChildren do
list_choose:GetChildAt(k-1):GetController("zhong") .selectedIndex = 0
end
item_choose:GetController("zhong").selectedIndex = 1
if tip_list[i].bi_list ==nil then
callback(tip_list[i].id)
self:CloseTip()
else
self.bilist={}
self._chiid = tip_list[i].id
self:CheckRatioCard(tip_list[i].bi_list,1,tip_list[i].card)
end
end)
end
end
list_choose:ResizeToFit(#tip_list)
_pop_tip_choice:GetChild("di1").width = list_choose.width+110
_pop_tip_choice.xy = Vector2((self._mainView.width - _pop_tip_choice.width)/2, -100)
self._mainView:AddChild(_pop_tip_choice)
self._pop_tip_choice = _pop_tip_choice
end
--比牌显示
function M:CheckRatioCard(_tiplist,index,chicard,_biid)
if _biid ~=nil then
self.bilist={}
self.bilist[#self.bilist+1] = _biid
end
self._pop_tip_choice:GetController("bipai").selectedIndex = index
local Bilist_choose = self._pop_tip_choice:GetChild("Bi_Lst_choose"..index)
Bilist_choose:RemoveChildrenToPool()
for i = 1, #_tiplist do
local item = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Comp_choose")
local item_choose = Bilist_choose:AddChild(item)
self:SetIcon(item_choose, 2, _tiplist[i].opcard[1])
self:SetIcon(item_choose, 3, _tiplist[i].opcard[2])
self:SetIcon(item_choose, 1, chicard)
item_choose:GetController("zhong") .selectedIndex = 0
item_choose.onClick:Add(function()
for k=1,Bilist_choose.numChildren do
Bilist_choose:GetChildAt(k-1):GetController("zhong") .selectedIndex = 0
end
item_choose:GetController("zhong") .selectedIndex = 1
if _tiplist[i].bi_list ==nil then
if tip_hu then
local guo_msg = MsgWindow.new(self._root_view, "确定取消胡吗?", MsgWindow.MsgMode.OkAndCancel)
guo_msg.onOk:Add(function()
self.bilist[#self.bilist+1] = i-1
self._gamectr:SendAction(self._chiid,self.bilist)
guo_msg:Close()
self:CloseTip()
self._cardInfo:UpdateIsOnClick(false)
end)
guo_msg:Show()
else
self.bilist[#self.bilist+1] = i-1
self._gamectr:SendAction(self._chiid,self.bilist)
self:CloseTip()
self._cardInfo:UpdateIsOnClick(false)
end
else
self:CheckRatioCard(_tiplist[i].bi_list,2,chicard,i-1)
end
end)
end
Bilist_choose:ResizeToFit(#_tiplist)
self._pop_tip_choice:GetChild("di"..index+1).width = Bilist_choose.width+110
end
function M:SetIcon(item, index, card)
item:GetChild("card" .. index).icon = UIPackage.GetItemURL("Main_RunBeard", CommonFun:GetCardItem("201_", card))
end
function M:CloseTip()
if (self._pop_tip_choice) then
self._pop_tip_choice:Dispose()
self._pop_tip_choice = nil
end
end
return M

View File

@ -0,0 +1,182 @@
local M = {}
local source_fz_03 = "ui://Main_RunBeard/Fz_0_3"
local source_fz_04 = "ui://Main_RunBeard/Fz_0_4"
local source_card = "ui://Main_RunBeard/202_"
function M:getCardItem(card_1, card_2)
local room = DataManager.CurrenRoom
if room.change_card_display ~= nil then
return card_1 .. room.change_card_display .. card_2
else
return card_1 .. "6_" .. card_2
end
end
function M.InitFzView(fz,isMy,isplay,index,count)
--printlog("jefe InitFzView>>>")
local self = setmetatable({}, {__index = M})
local item,fzcards
if fz.type ~= RB_FZType.Kan then
item = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Component1")--Extend_Poker_AHRunBeard
item:RemoveChildren(0, -1, true)
end
-- local fzItem
if fz.type == RB_FZType.Bi or fz.type == RB_FZType.Chi then
fzcards = self:UpateChiBi(item,fz)
elseif fz.type == RB_FZType.Peng then
fzcards = self:UpdatePeng(item,fz)
elseif fz.type == RB_FZType.Wei or fz.type == RB_FZType.ChouWei then
fzcards = self:UpdateWei(item,fz,isMy)
elseif fz.type == RB_FZType.Ti then
fzcards = self:UpateTi(item,fz)
elseif fz.type == RB_FZType.Pao then
fzcards = self:UpatePao(item,fz)
end
if item ~= nil and fzcards ~= nil then
self:PlayEffect(item,fzcards,isplay,index,count)
end
return item,fzcards
end
function M:UpateChiBi(item,fz)
local fzcards = UIPackage.CreateObjectFromURL(source_fz_03)
local cardId1,cardId2,cardId3
if #fz.opcard == 2 then
cardId1 = fz.card
cardId2 = fz.opcard[1]
cardId3 = fz.opcard[2]
else
cardId1 = fz.opcard[1]
cardId2 = fz.opcard[2]
cardId3 = fz.opcard[3]
end
fzcards:GetChild("card_" .. 1).icon = self:getCardItem(source_card, cardId1)
fzcards:GetController("c2").selectedIndex = 1
fzcards:GetChild("card_" .. 2).icon = self:getCardItem(source_card, cardId2)
-- local card = fz.opcard[2] == nil and fz.opcard[1] or fz.opcard[2]
fzcards:GetChild("card_" .. 3).icon = self:getCardItem(source_card, cardId3)
fzcards.x, fzcards.y = 0, 0
item:AddChildAt(fzcards, 0)
return fzcards
end
function M:UpdatePeng(item,fz)
local fzcards = UIPackage.CreateObjectFromURL(source_fz_03)
for j = 1, 3 do
fzcards:GetChild("card_" .. j).icon = self:getCardItem(source_card, fz.opcard[1])
end
fzcards.x, fzcards.y = 0, 0
item:AddChildAt(fzcards, 0)
return fzcards
end
function M:UpdateWei(item,fz,isMy)
local fzcards = UIPackage.CreateObjectFromURL(source_fz_03)
--fzcards:GetController("c1").selectedIndex=1
local room = DataManager.CurrenRoom
for j = 1, 3 do
if room.room_config.mingwei or fz.type==RB_FZType.ChouWei or isMy then
if j == 3 then
fzcards:GetChild("card_" .. j).icon = self:getCardItem(source_card, fz.opcard[1])
else
fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300"
end
else
--未勾选明偎
-- if isMy then
-- fzcards:GetChild("card_" .. j).icon = self:getCardItem(source_card, fz.opcard[1])
-- fzcards:GetController("c1").selectedIndex = 1
-- else
fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300"
-- end
end
end
fzcards.x, fzcards.y = 0, 0
item:AddChildAt(fzcards,0)
return fzcards
end
function M:UpateTi(item, fz,icon)
local fzcards = UIPackage.CreateObjectFromURL(source_fz_04)
for i = 1, 4 do
if i == 4 and fz.type == RB_FZType.Ti then
fzcards:GetChild("card_" .. i).icon = self:getCardItem(source_card, fz.card)
else
fzcards:GetChild("card_" .. i).icon = "ui://Main_RunBeard/202_1_300"
end
end
fzcards.x, fzcards.y = 0, 0
-- item:AddChildAt(fzcards,0)
return fzcards
end
function M:UpatePao(item, fz,icon)
local fzcards = UIPackage.CreateObjectFromURL(source_fz_04)
for i = 1, 4 do
fzcards:GetChild("card_" .. i).icon = self:getCardItem(source_card, fz.opcard[1])
end
fzcards.x, fzcards.y = 0, 0
return fzcards
end
function M:PlayEffect(fzitem,fzcards,isplay,index,count)
if (isplay == nil) then
isplay = false
end
if (isplay and index == count) then
local faArray = fzitem:GetChild("chiwei")
if (faArray ~= nil) then
faArray:AddChild(fzcards)
else
fzitem:AddChild(fzcards)
end
else
fzitem:AddChild(fzcards)
end
end
function M:PlayEffectOther(fzitem,fzcards, size,i,isplay,seat)
isplay = isplay == nil and false or isplay
local isAddlast = false
local room = DataManager.CurrenRoom
if isplay and i== size then
local faArray = fzitem:GetChild("chiwei")
if room.room_config.people_num == 3 then
if (room.self_player.seat == 1) then
if (seat == 2) then
faArray = fzitem:GetChild("chiwei1")
else
faArray = fzitem:GetChild("chiwei")
end
elseif (room.self_player.seat == 2) then
if (seat == 3) then
faArray = fzitem:GetChild("chiwei1")
else
faArray = fzitem:GetChild("chiwei")
end
elseif (room.self_player.seat == 3) then
if (seat == 1) then
faArray = fzitem:GetChild("chiwei1")
else
faArray = fzitem:GetChild("chiwei")
end
end
end
if (faArray ~= nil) then
faArray:AddChild(fzcards)
else
fzitem:AddChild(fzcards)
end
else
fzitem:AddChild(fzcards)
end
end
return M

View File

@ -0,0 +1,10 @@
local M = {}
setmetatable(M,{__index = GameController})
function M:init(name)
GameController.init(self,name)
end
return M

View File

@ -0,0 +1,24 @@
local ZPGameEvent = {
-- 发牌
SendCards = 'SendCards',
--发最后一张牌
AddCard = 'AddCard',
-- 胡牌
ZPHuCard = 'ZPHuCard',
-- 结算事件
-- ZPResult1 = 'ZPResult1',
-- 大结算事件
ZPResult2 = 'ZPResult2',
-- 转盘指向事件
EventTurn = 'EventTurn',
OutHint = 'OutHint', --出牌tips
GetCard = 'GetCard', --摸牌
OutCard = 'OutCard', --出牌
FangziAction = 'FangziAction', --吃碰等操作事件
FZTips = 'FZTips', --放子提示
QiCard = 'QiCard', --弃牌
FangWei = 'FangWei',
OnDaNiaoTips = "OnDaNiaoTips",--打鸟提示
}
return ZPGameEvent

View File

@ -0,0 +1,407 @@
local PlayerSelfCardInfoView = import('.ZPPlayerSelfCardInfoView')
local PlayerCardInfoView = import('.ZPPlayerCardInfoView')
local ZPSettingView = import('.ZPSettingView')
local ZPTableBG = import('.ZPTableBG')
local HuTipView = import('.HuTipView')
local ZPGameEvent = import('.ZPGameEvent')
local M = {
default_btn = false
}
setmetatable(M, { __index = MainView })
local default_bg = 1
function M:InitView(url, isdisplay, open_social, change_card_size, qihu)
UIPackage.AddPackage('base/main_zipai/ui/Main_RunBeard')
--printlog("OneventResultinit")
MainView.InitView(self, url)
self._full_offset = false
--显示背景
ZPTableBG.LoadTableBG(default_bg, self._room.game_id, self._root_view)
self.qihu = qihu
if qihu ~= nil then
local id = ZPTableBG.GetTableBG(self._room.game_id)
if id > 3 or id <= 0 then
id = 1
end
if self._room.score_times ~= nil and self._room.score_times > 0 then
self._view:GetChild('di_text').text =
self._room.room_config:GetGameName() .. self._room.score_times .. ''
else
self._view:GetChild('di_text').text = self._room.room_config:GetGameName() .. ' ' .. qihu .. '胡息1起'
end
self._view:GetController('bg_state').selectedIndex = id - 1
end
self.cd_time = 0
self.default_btn = open_social
if isdisplay == nil then
isdisplay = false
end
local tex_round = self._view:GetChild('tex_round')
self._tex_leftTime = self._view:GetChild('time')
local remaining_card = self._view:GetChild('remaining_card')
self._tex_LeftCard = self._view:GetChild('remaining_card')
self._rightPanelView._opt = 2
self._rightPanelView:__UpdateTime()
local rightpanel = self._view:GetChild('right_panel')
if (rightpanel ~= nil) then
self.tex_gametype = rightpanel:GetChild('tex_gametype')
if (self.tex_gametype ~= nil) then
self.tex_gametype.text = self._room.room_config:GetGameName()
end
end
self._player_card_info = {}
local _room = self._room
self._hu_tip = HuTipView.new(self)
--加载上次游戏的牌字体
local user_id = DataManager.SelfUser.account_id
local json_data = Utils.LoadLocalFile(user_id .. _room.game_id)
if json_data ~= nil then
local _data = json.decode(json_data)
local typeface = _data['game_typeface']
local _gamectr = self._gamectr
_gamectr:SendChangeTypeFace(typeface)
--printlog("jefe InitView "..typeface)
if typeface == 1 then
if isdisplay then
self._room.change_card_display = '6_'
else
self._room.change_card_display = '6_'
end
elseif typeface == 2 then
self._room.change_card_display = '1_'
elseif typeface == 3 then
self._room.change_card_display = '3_'
elseif typeface == 4 then
self._room.change_card_display = '8_'
end
end
-- self._view.fairyBatching = true
--加载上次游戏的手牌大小
local user_id = DataManager.SelfUser.account_id
local json_data = Utils.LoadLocalFile(user_id .. _room.game_id .. 'cardsize_new')
if json_data ~= nil then
local _data = json.decode(json_data)
local typeface = _data['game_cardsize']
local _gamectr = self._gamectr
if typeface == 0 then
self._room.change_card_size = 1.3
elseif typeface == 1 then
self._room.change_card_size = 1.2
elseif typeface == 2 then
self._room.change_card_size = 1.2
end
else
self._room.change_card_size = change_card_size
end
--printlog("OneventResultinit2")
--加载上次游戏的接收语音
if self.default_btn then
local user_id = DataManager.SelfUser.account_id
local json_data = Utils.LoadLocalFile(user_id .. _room.game_id .. 'yuyin')
local json_data1 = Utils.LoadLocalFile(user_id .. _room.game_id .. 'chupai')
local json_data2 = Utils.LoadLocalFile(user_id .. _room.game_id .. 'fangyan')
self._room.yuyin_typeface = 1
self._room.chupai_typeface = 1
self._room.fangyan_typeface = 1
if json_data ~= nil then
local _data = json.decode(json_data)
local typeface = _data['game_typeface']
self._room.yuyin_typeface = typeface
self:SetInteractEnabled(typeface == 1 and 0 or 1)
end
if json_data1 ~= nil then
local _data = json.decode(json_data1)
local typeface = _data['game_typeface']
self._room.chupai_typeface = typeface
end
if json_data2 ~= nil then
local _data = json.decode(json_data2)
local typeface = _data['game_typeface']
self._room.fangyan_typeface = typeface
end
end
--printlog("OneventResultinit3")
local _player_card_info = self._player_card_info
for i = 1, _room.room_config.people_num do
local tem = self._view:GetChild('player_card_info' .. i)
_player_card_info[i] = self:NewPlayerCardInfoView(tem, i)
end
local list = _room.player_list
for i = 1, #list do
local p = list[i]
local info = _player_card_info[self:GetPos(p.seat)]
info:SetPlayer(p)
info:FillData()
end
self._rightPanelView.ctr_log.selectedIndex = 0
local list = _room.player_list
local readyNum = 0
for i = 1, #list do
local p = list[i]
local info = self._player_info[self:GetPos(p.seat)]
info._view.visible = true
info:FillData(p)
if p.ready then
readyNum = readyNum + 1
end
end
if (_room.curren_round > 0) then
self._rightPanelView.ctr_log.selectedIndex = 0
end
--printlog("OneventResultinit5")
self._ctr_action = self._view:GetController('action')
if _room.banker_seat == _room.self_player.seat and readyNum > 1 and readyNum == _room.room_config.people_num then
elseif not _room.self_player.ready then
local round = DataManager.CurrenRoom.room_config.config.times or 1
local xpconfig = DataManager.CurrenRoom.room_config.config.xi_pai
--[[if xpconfig then
if round>1 then
self._ctr_action.selectedIndex = 1
else
self._ctr_action.selectedIndex = 2
end
else
self._ctr_action.selectedIndex = 1
end]]
self._ctr_action.selectedIndex = 2
else
self._ctr_action.selectedIndex = 0
end
--printlog("OneventResultinit4")
self:ResetHandCard()
--printlog("OneventResultinit6")
self:showBackBtnView()
--printlog("OneventResultinit7")
self:InitXiPai()
--printlog("OneventResultinit8")
self:InitXiPai1()
--printlog("OneventResultinit9")
end
function M:InitXiPai()
self._xipaiPanel = UIPackage.CreateObjectFromURL("ui://Common/panel_handzipai02")
self._root_view:AddChild(self._xipaiPanel)
local offset = get_offset(self._full_offset)
self._xipaiPanel.width = GRoot.inst.width - (offset * 2)
self._xipaiPanel.height = GRoot.inst.height
self._xipaiPanel.x = offset
self._xipaiPanel.visible = false
--self:PlayXiPai()
end
function M:PlayXiPai(xipaiCallBack)
if self._xipaiPanel then
coroutine.start(function()
self._xipaiPanel.visible = true
self._xipaiPanel:GetTransition("XiPai"):Play()
coroutine.wait(3.5)
self._xipaiPanel.visible = false
if xipaiCallBack then
xipaiCallBack()
end
end)
end
end
function M:InitXiPai1()
self._xipaiPanel1 = UIPackage.CreateObjectFromURL("ui://Common/panel_handzipai03")
self._root_view:AddChild(self._xipaiPanel1)
local offset = get_offset(self._full_offset)
self._xipaiPanel1.width = GRoot.inst.width - (offset * 2)
self._xipaiPanel1.height = GRoot.inst.height
self._xipaiPanel1.x = offset
self._xipaiPanel1.visible = false
--self:PlayXiPai()
end
function M:PlayXiPai1(xipaiCallBack)
if self._xipaiPanel1 then
coroutine.start(function()
self._xipaiPanel1.visible = true
self._xipaiPanel1:GetTransition("XiPai"):Play()
coroutine.wait(3.5)
self._xipaiPanel1.visible = false
if xipaiCallBack then
xipaiCallBack()
end
end)
end
end
function M:NewSettingView(cardIndex)
local settingView = ZPSettingView.new(self._view, 2, self.default_btn, cardIndex)
settingView:FillBgSection(
function(url)
LoadGameBg(url, self._root_view)
end,
self._room.game_id,
default_bg,
self._room,
self.qihu
)
return settingView
end
function M:EventInit()
MainView.EventInit(self)
end
function M:NewPlayerCardInfoView(view, index)
if index == 1 then
return PlayerSelfCardInfoView.new(view, self)
end
return PlayerCardInfoView.new(view, self)
end
-- 设置 更新 手牌字体 三套
function M:UpdateCardDisplay(index)
local _gamectr = self._gamectr
_gamectr:SendChangeTypeFace(index)
if index == 1 then
self._room.change_card_display = '6_'
elseif index == 2 then
self._room.change_card_display = '1_'
elseif index == 3 then
self._room.change_card_display = '3_'
elseif index == 4 then
self._room.change_card_display = '8_'
end
for i = 1, #self._room.player_list do
local p = self._room.player_list[i]
local info = self._player_card_info[self:GetPos(p.seat)]
if p.DiceCard ~= nil and p.DiceCard ~= 0 then
info:UpdateOutCardList(p.DiceCard)
end
if p.outcard_list ~= nil and #p.outcard_list > 0 then
info:UpdateQiPai(p.outcard_list)
end
if p.fz_list ~= nil and #p.fz_list > 0 then
info:UpdateFzList(p.fz_list)
end
if p.seat == self._room.self_player.seat then
info:UpdateCardDisplay()
end
end
end
-- 设置 更新 手牌大小
function M:UpdateCardSize(index)
-- print("lingmeng UpdateCardSize")
if index == 0 then
self._room.change_card_size = 1.3
elseif index == 1 then
self._room.change_card_size = 1.2
elseif index == 2 then
self._room.change_card_size = 1.2
end
local info = self._player_card_info[1]
info:UpdateCardSize()
end
-- 设置 更新 方言
function M:UpdateFangyan(index)
self._room.fangyan_typeface = index
end
--刷新手牌排列 按钮 三种 排列方法 在 PendulumRule 里
function M:ResetHandCard(...)
local btn_reset = self._view:GetChild('btn_reset')
--btn_reset.visible=false
btn_reset.onClick:Set(
function(...)
if self._popEvent == false then
return
end
--加载上次的
local index = 1
local user_id = DataManager.SelfUser.account_id
local json_data = Utils.LoadLocalFile(user_id .. 'ResetHandCard')
if json_data ~= nil then
local _data = json.decode(json_data)
index = _data['index']
end
--点击换牌按钮后保存当前游戏的牌字体
local user_id = DataManager.SelfUser.account_id
local _data = {}
_data['ResetHandCard'] = true
if index == 1 then
_data['index'] = 2
elseif index == 2 then
_data['index'] = 3
elseif index == 3 then
_data['index'] = 1
end
local key = user_id .. 'ResetHandCard'
Utils.SaveLocalFile(key, json.encode(_data))
local x = _data['index']
local card_info = self._player_card_info[1]
----printlog("1111111111111111111111111",x)
card_info:InitHandCard(false, x)
end
)
end
function M:showBackBtnView()
local btn_back_lobby = self._view:GetChild('btn_back_lobby')
local btn_jiesan_lobby1 = self._view:GetChild('Btn_jiesan_lobby')
--btn_jiesan_lobby1.displayObject.gameObject:SetActive(false)
--btn_jiesan_lobby1:GetChild("n8").displayObject.gameObject:SetActive(false)
if (btn_jiesan_lobby1 ~= nil) then
btn_jiesan_lobby1.onClick:Set(
function()
if (self.cd_time > 0) then
ViewUtil.ErrorTip(nil, '您还处于解散冷却时间当中,请稍后再试')
else
self.cd_time = 30
self._gamectr:AskDismissRoom(
function(res)
ViewUtil.ErrorTip(res.ReturnCode, '')
end
)
self:onDisBandTimer()
end
end
)
end
end
--解散计时器
function M:onDisBandTimer()
if self.cd_coroutine ~= nil then
coroutine.stop(self.cd_coroutine)
end
self.cd_coroutine =
coroutine.start(
function()
while (self.cd_time > 0) do
self.cd_time = self.cd_time - 1
self.cd_time = math.max(0, self.cd_time)
if self.cd_time > 0 then
coroutine.wait(1)
end
end
end
)
end
function M:Destroy()
UIPackage.RemovePackage('base/main_zipai/ui/Main_RunBeard')
MainView.Destroy(self)
end
return M

View File

@ -0,0 +1,13 @@
local ZPTableBG = import('.ZPTableBG')
local M = {}
setmetatable(M, {__index = PlayBackView})
function M:InitView(url)
PlayBackView.InitView(self, url)
local _view = self._view
ZPTableBG.LoadTableBG(1, self._room.game_id, self._root_view)
end
return M

View File

@ -0,0 +1,37 @@
local EXPlayer ={
-- 手牌列表
card_list = nil,
-- 剩余牌数
hand_left_count = 0,
-- 出牌列表
outcard_list = nil,
-- 牌组列表
fz_list = nil,
hu_xi =0
}
local M = EXPlayer
--- Create a new EXPlayer
function M.new()
setmetatable(M,{__index = Player})
local self = setmetatable({}, {__index = M})
self.card_list = {}
self.outcard_list = {}
self.fz_list = {}
return self
end
-- 清理玩家数据
function M:Clear()
Player.Clear(self)
self.card_list = {}
self.outcard_list = {}
self.fz_list = {}
self.hand_left_count = 0
self.hu_xi =0
end
return M

View File

@ -0,0 +1,459 @@
local PendulumRule = import('.PendulumRule')
AreaOderType = {
left_right = "left_right",
right_left = "right_left",
up_down = "up_down",
down_up = "down_up"
}
local PlayerCardInfoView = {
_view = nil,
_mainView = nil,
_mask_liangpai = nil,
_area_outcard_list = nil,
_area_handcard_list = nil,
}
local function NewCardView(card, cardItem, index_X, index_Y)
local self = {}
setmetatable(self, { __index = CardView })
self.btn_card = card
self.card_item = cardItem
self.index_X = index_X
self.index_Y = index_Y
return self
end
local M = PlayerCardInfoView
function M.new(view, mainView)
local self = {}
setmetatable(self, { __index = M })
self._view = view
self._mainView = mainView
self:init()
return self
end
function M:init()
local view = self._view
self._room = DataManager.CurrenRoom
self._area_outcard_list = view:GetChild("area_outcard_list")
self._bgview = view:GetController("bgview")
self._area_handcard_list = view:GetChild("area_handcard_list")
self._area_fz_list = view:GetChild("area_fz_list")
self._area_qipai_list = view:GetChild("windcard_list")
self._mask_liangpai = view:GetChild("mask_liangpai")
UIPackage.AddPackage("base/main_zipai/ui/Main_RunBeard")
end
function M:SetPlayer(p)
self._player = p
end
function M:FillData(begin)
end
function M:Clear()
self._area_outcard_list:RemoveChildren(0, -1, true)
self._area_fz_list:RemoveChildren(0, -1, true)
self._area_handcard_list:RemoveChildren(0, -1, true)
self._area_qipai_list:RemoveChildren(0, -1, true)
self._mask_liangpai:RemoveChildren(0, -1, true)
end
function M:fillCard(obj, card_type, card)
end
function M:ClearOutCard()
self._area_outcard_list:RemoveChildren(0, -1, true)
end
--弃牌
function M:UpdateQiPai(qi_list)
self._area_qipai_list:RemoveChildren(0, -1, true)
for i = 1, #qi_list do
local qicards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Qipai")
qicards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/202_", qi_list[i])
self._area_qipai_list:AddChild(qicards)
end
end
--放字
function M:UpdateFzList(fz_list)
printlog("UpdateFzList----")
self._area_fz_list:RemoveChildren(0, -1, true)
for i = 1, #fz_list do
local fzitem = nil
if fz_list[i].type ~= RB_FZType.Kan then
fzitem = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Component1")
fzitem:RemoveChildren(0, -1, true)
end
if fz_list[i].type == RB_FZType.Chi or fz_list[i].type == RB_FZType.Bi then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
fzcards:GetController("c2").selectedIndex = 1
fzcards:GetChild("card_" .. 1).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].active_card)
fzcards:GetChild("card_" .. 2).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].opcard[1])
fzcards:GetChild("card_" .. 3).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].opcard[2])
fzcards.x, fzcards.y = 0, 0
fzitem:AddChildAt(fzcards, 0)
self._area_fz_list:AddChild(fzitem)
elseif fz_list[i].type == RB_FZType.Peng then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
for j = 1, 3 do
fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
end
fzcards.x, fzcards.y = 0, 0
fzitem:AddChildAt(fzcards, 0)
self._area_fz_list:AddChild(fzitem)
elseif fz_list[i].type == RB_FZType.Wei then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
for j = 1, 2 do
fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300"
end
fzcards:GetChild("card_" .. 3).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
fzcards.x, fzcards.y = 0, 0
fzitem:AddChildAt(fzcards, 0)
self._area_fz_list:AddChild(fzitem)
elseif fz_list[i].type == RB_FZType.ChouWei then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
for j = 1, 2 do
fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300"
end
fzcards:GetChild("card_" .. 3).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
fzcards.x, fzcards.y = 0, 0
fzitem:AddChildAt(fzcards, 0)
self._area_fz_list:AddChild(fzitem)
elseif fz_list[i].type == RB_FZType.Pao then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4")
for j = 1, 4 do
fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
end
fzcards.x, fzcards.y = 0, 0
fzitem:AddChildAt(fzcards, 0)
self._area_fz_list:AddChild(fzitem)
elseif fz_list[i].type == RB_FZType.Ti then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4")
for j = 1, 4 do
if j == 4 then
fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
else
fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300"
end
end
fzcards.x, fzcards.y = 0, 0
fzitem:AddChildAt(fzcards, 0)
self._area_fz_list:AddChild(fzitem)
end
end
end
--回放手牌
function M:InitHandCard(handcard)
self._area_handcard_list:RemoveChildren(0, -1, true)
local pokerList = PendulumRule.GetHandCard(handcard) --self:PendulumRule(handcard)
self.card_lists = {}
for i = 1, #pokerList do
for j = 1, #pokerList[i] do
local card_code = pokerList[i][j]
local btn_card = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Qipais")
btn_card:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/202_", card_code)
self._area_handcard_list:AddChild(btn_card)
self._area_handcard_list:SetChildIndex(btn_card, 5 - j)
local card_view = NewCardView(btn_card, card_code, i, j)
self.card_lists[#self.card_lists + 1] = card_view
end
end
for j = #self.card_lists, 1, -1 do
local card_view = self.card_lists[j]
card_view.btn_card:RemoveFromParent()
self._area_handcard_list:AddChild(card_view.btn_card)
card_view.btn_card.xy = self:GetHandCardPos(card_view, #pokerList)
end
if self._player.fz_list ~= nil then
for i = 1, #self._player.fz_list do
if self._player.fz_list[i].type == RB_FZType.Kan then
self:UpdateKan(self._player.fz_list[i].card)
end
end
end
end
function M:UpdateHandCards(list)
self.card_lists = {}
self._area_handcard_list:RemoveChildren(0, -1, true)
local CountCards = {}
for i = 1, #list do
CountCards[list[i].index_X] = CountCards[list[i].index_X] == nil and 1 or CountCards[list[i].index_X] + 1
end
for i = 1, #list do
local card_code = list[i].card_item
local btn_card = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Qipais")
btn_card:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/202_", card_code)
local card_view = NewCardView(btn_card, card_code, list[i].index_X, list[i].index_Y)
--存牌堆
self.card_lists[#self.card_lists + 1] = card_view
end
for j = #self.card_lists, 1, -1 do
local card_view = self.card_lists[j]
card_view.btn_card:RemoveFromParent()
self._area_handcard_list:AddChild(card_view.btn_card)
card_view.btn_card.xy = self:GetHandCardPos(card_view, #CountCards)
end
end
--牌位置
function M:GetHandCardPos(cards_view, cards)
local x, y = 0, 0
local card_width = 42 -- 牌的宽度
local middle_x = self._area_handcard_list.width / 2
local start_x = middle_x - (cards / 2 * (card_width))
x = start_x + (card_width) * (cards_view.index_X - 1)
y = 0 - (42 * cards_view.index_Y)
return Vector2.New(x, y)
end
function M:UpdateOutCardList(outcard)
printlog("UpdateOutCardList2222")
self._area_outcard_list:RemoveChildren(0, -1, true)
local outcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Gcm_OutCard")
if outcard == 0 then
outcards:GetChild("icon").icon = "ui://Main_RunBeard/201_1_300"
else
outcards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/203_", outcard)
end
outcards.x, outcards.y = 0, 0
self._area_outcard_list:AddChild(outcards)
-- self._bgview.selectedIndex=1
end
--摸牌动画
function M:PlayingOutCardAnima(card, seat)
local outcards = self._area_outcard_list:GetChildAt(0)
if not outcards then
local outcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Gcm_OutCard")
local show_di_bg = outcards:GetChild("show_di_bg")
show_di_bg.visible = false
self._area_outcard_list:AddChild(outcards)
end
outcards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/203_", card)
outcards:GetTransition("qipai" .. seat):Play()
end
--摆牌规则
function M:PendulumRule(handcard)
local room = DataManager.CurrenRoom
local card_list = handcard
local card_count = #card_list
local cards_map = {}
local CountCards = {}
for i = 1, #card_list do
CountCards[card_list[i]] = CountCards[card_list[i]] == nil and 1 or CountCards[card_list[i]] + 1
end
--find4
for k, v in pairs(CountCards) do
if (v == 4) then
local cs = {}
cs[1] = k
cs[2] = k
cs[3] = k
cs[4] = k
cards_map[#cards_map + 1] = cs
CountCards[k] = 0
card_count = card_count - 4
end
end
--find3
for k, v in pairs(CountCards) do
if (v >= 3) then
local cs = {}
cs[1] = k
cs[2] = k
cs[3] = k
cards_map[#cards_map + 1] = cs
CountCards[k] = CountCards[k] - 3
card_count = card_count - 3
end
end
--find AAa
for i = 201, 210 do
if CountCards[i] ~= nil and CountCards[i] >= 2 then
if CountCards[i - 100] ~= nil and CountCards[i - 100] == 1 then
local cs = {}
cs[1] = i
cs[2] = i
cs[3] = i - 100
cards_map[#cards_map + 1] = cs
CountCards[i] = CountCards[i] - 2;
CountCards[i - 100] = CountCards[i - 100] - 1
card_count = card_count - 3
end
end
end
--find aaA
for i = 101, 110 do
if CountCards[i] ~= nil and (CountCards[i] >= 2) then
if CountCards[i + 100] ~= nil and (CountCards[i + 100] == 1) then
local cs = {}
cs[1] = i
cs[2] = i
cs[3] = i + 100
cards_map[#cards_map + 1] = cs
CountCards[i] = CountCards[i] - 2;
CountCards[i + 100] = CountCards[i + 100] - 1
card_count = card_count - 3
end
end
end
--find2
for k, v in pairs(CountCards) do
if (v >= 2) then
local cs = {}
cs[1] = k
cs[2] = k
cards_map[#cards_map + 1] = cs
CountCards[k] = CountCards[k] - 2
card_count = card_count - 2
end
end
--find 小 2 7 10
local counta = CountCards[102]
if counta ~= nil and counta > 0 then
for i = 1, counta do
if CountCards[102] ~= nil and CountCards[107] ~= nil and CountCards[110] ~= nil and CountCards[102] > 0 and CountCards[107] > 0 and CountCards[110] > 0 then
local cs = {}
cs[1] = 102
cs[2] = 107
cs[3] = 110
cards_map[#cards_map + 1] = cs
CountCards[102] = CountCards[102] - 1
CountCards[107] = CountCards[107] - 1
CountCards[110] = CountCards[110] - 1
card_count = card_count - 3
end
end
end
--find 大 2 7 10
local countA = CountCards[202]
if countA ~= nil and countA > 0 then
for i = 1, countA do
if CountCards[202] ~= nil and CountCards[207] ~= nil and CountCards[210] ~= nil and CountCards[202] > 0 and CountCards[207] > 0 and CountCards[210] > 0 then
local cs = {}
cs[1] = 202
cs[2] = 207
cs[3] = 210
cards_map[#cards_map + 1] = cs
CountCards[202] = CountCards[202] - 1
CountCards[207] = CountCards[207] - 1
CountCards[210] = CountCards[210] - 1
card_count = card_count - 3
end
end
end
--find abc
for i = 101, 110 do
if (CountCards[i] ~= nil and CountCards[i + 1] ~= nil and CountCards[i + 2] ~= nil) and (CountCards[i] > 0 and CountCards[i + 1] > 0 and CountCards[i + 2] > 0) then
local cs = {}
cs[1] = i
cs[2] = i + 1
cs[3] = i + 2
cards_map[#cards_map + 1] = cs
CountCards[i] = CountCards[i] - 1
CountCards[i + 1] = CountCards[i + 1] - 1
CountCards[i + 2] = CountCards[i + 2] - 1
card_count = card_count - 3
end
end
--find ABC
for i = 201, 210 do
if (CountCards[i] ~= nil and CountCards[i + 1] ~= nil and CountCards[i + 2] ~= nil) and (CountCards[i] > 0 and CountCards[i + 1] > 0 and CountCards[i + 2] > 0) then
local cs = {}
cs[1] = i
cs[2] = i + 1
cs[3] = i + 2
cards_map[#cards_map + 1] = cs
CountCards[i] = CountCards[i] - 1
CountCards[i + 1] = CountCards[i + 1] - 1
CountCards[i + 2] = CountCards[i + 2] - 1
card_count = card_count - 3
end
end
--find Aa
for i = 201, 210 do
if CountCards[i] ~= nil and CountCards[i] == 1 then
if CountCards[i - 100] ~= nil and CountCards[i - 100] == 1 then
local cs = {}
cs[1] = i
cs[2] = i - 100
cards_map[#cards_map + 1] = cs
CountCards[i] = CountCards[i] - 1;
CountCards[i - 100] = CountCards[i - 100] - 1
card_count = card_count - 2
end
end
end
local r_count = 9 - #cards_map
local merge = false
merge = r_count < card_count
local singleList = {}
--find else
for k, v in pairs(CountCards) do
if (v == 1) then
singleList[#singleList + 1] = k
CountCards[k] = CountCards[k] - 1
end
end
local index = 0
if merge then index = 3 else index = 1 end
for i = 1, #singleList, index do
local cs = {}
if merge then
cs[#cs + 1] = singleList[i]
if i < #singleList then cs[#cs + 1] = singleList[i + 1] end
if i < #singleList - 1 then cs[#cs + 1] = singleList[i + 2] end
cards_map[#cards_map + 1] = cs
else
cs[#cs + 1] = singleList[i]
cards_map[#cards_map + 1] = cs
end
end
--变成9列--这里牌多了也不会报错了
for i = 9, 1, -1 do
for j = #cards_map, 9, -1 do
if #cards_map[i] < 3 then
cards_map[i][#cards_map[i] + 1] = cards_map[j][1]
list_remove(cards_map[j], cards_map[j][1])
end
end
end
return cards_map
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:GetFzMove()
return self._view:LocalToGlobal(Vector2.New(0, self._area_fz_list.height / 2))
end
return M

View File

@ -0,0 +1,951 @@
local CardCheck = import('.CardCheck')
local PendulumRule = import('.PendulumRule')
AreaOderType = {
left_right = 'left_right',
right_left = 'right_left',
up_down = 'up_down',
down_up = 'down_up'
}
local CardView = {
btn_card = nil,
-- 牌序号
card_item = 0,
-- 牌层级
Hierarchy = 0,
-- 牌的列数
index_X = 0,
-- 每一列第几张牌
index_Y = 0,
-- 原始位置
old_postion = Vector2.zero
}
local function NewCardView(card, cardItem, index_X, index_Y)
local self = {}
setmetatable(self, { __index = CardView })
self.btn_card = card
self.card_item = cardItem
self.index_X = index_X
self.index_Y = index_Y
return self
end
local PlayerSelfCardInfoView = {
_view = nil,
_mainView = nil,
_mask_liangpai = nil,
_area_outcard_list = nil,
_area_handcard_list = nil
}
local M = PlayerSelfCardInfoView
function M.new(view, mainView)
local self = {}
setmetatable(self, { __index = M })
self._view = view
self._mainView = mainView
self:init()
return self
end
function M:init()
local view = self._view
self._isDrg = false
self.card_list = {} -- 牌的btn code type pos 等等
self.cards_count = 0 -- 牌的总列数
self.card_width = 87
self.card_hight = 110
self.outcard_button = nil
self._room = DataManager.CurrenRoom
self._area_handcard_list = view:GetChild('area_handcard_list')
self._area_outcard_list = view:GetChild('area_outcard_list')
-- self._bgview = view:GetController("bgview")
self._area_fz_list = view:GetChild('area_fz_list')
self._area_qipai_list = view:GetChild('windcard_list')
self._view_outLine = view:GetChild('n38')
self._mask_liangpai = view:GetChild('mask_liangpai')
UIPackage.AddPackage('base/main_zipai/ui/Main_RunBeard')
self.ctr_piao = self._view:GetController('piao')
self.ctr_niao = self._view:GetController('niao')
self.ctr_piao_value = self._view:GetController('piaovalue')
self:UpdateOutLine()
self:BtnEvent()
end
function M:ShwoDaNiao(niao)
self.ctr_niao.selectedIndex = 1
end
function M:HideDaNiao(niao)
self.ctr_niao.selectedIndex = 0
end
function M:ShowPiao(piao)
self:UpdateIsOnClick(true)
self.ctr_niao.selectedIndex = piao
-- self:EnableAllPiaoTouch()
end
function M:HidePiao()
self.ctr_niao.selectedIndex = 0
end
function M:BtnEvent()
self.btn_tips = self._view:GetChild('btn_tips')
local function click_niao1(vaule)
local closeNiaoTipsFunc = function()
self.ctr_niao.selectedIndex = 0
end
ControllerManager.GetController(GameController):SendNiao(1, closeNiaoTipsFunc)
end
local function click_niao0(vaule)
local closeNiaoTipsFunc = function()
self.ctr_niao.selectedIndex = 0
end
ControllerManager.GetController(GameController):SendNiao(0, closeNiaoTipsFunc)
end
local btn_budaniao = self._view:GetChild("budaniao")
btn_budaniao.onClick:Set(click_niao0)
local btn_daniao = self._view:GetChild("daniao")
btn_daniao.onClick:Set(click_niao1)
end
function M:EnableAllPiaoTouch()
for i = 1, #self.PiaoList do
self.PiaoList[i].touchable = true
end
end
function M:SetPlayer(p)
self._player = p
end
function M:FillData(begin)
end
function M:Clear()
self.outcard_button = nil
self._area_outcard_list:RemoveChildren(0, -1, true)
-- self._bgview.selectedIndex = 0
self._area_fz_list:RemoveChildren(0, -1, true)
self._area_handcard_list:RemoveChildren(0, -1, true)
self._area_qipai_list:RemoveChildren(0, -1, true)
self._mask_liangpai:RemoveChildren(0, -1, true)
self.card_list = {}
end
function M:fillCard(obj, card_type, cards)
end
function M:ShowHuTip(card)
if DataManager.CurrenRoom == nil or DataManager.CurrenRoom.self_player == nil then
local x = {}
self._mainView._hu_tip:FillData(x)
return
end
local _aplayer = DataManager.CurrenRoom.self_player
local selfplayeTable = {}
selfplayeTable.handcard_list = _aplayer.handcard_list
selfplayeTable.fz_list = _aplayer.fz_list
selfplayeTable.tiCount = _aplayer.tiCount
selfplayeTable.paoCount = _aplayer.paoCount
selfplayeTable.hu_xi = _aplayer.hu_xi
local player = membe_deep_clone(selfplayeTable)
player.tiCount = _aplayer.tiCount
player.paoCount = _aplayer.paoCount
if card ~= nil then
list_remove(player.handcard_list, card)
end
local tingList = CardCheck.tingPai(player, DataManager.CurrenRoom)
if self._mainView._hu_tip ~= nil then
self._mainView._hu_tip:FillData(tingList)
end
end
function M:SetNotPutCard()
local tempNotPutList = DataManager.CurrenRoom.self_player.currentNotPutCardList
if tempNotPutList and #tempNotPutList > 0 then
for i = 1, #tempNotPutList do
self:UpdateKan(tempNotPutList[i])
end
end
end
--手牌
function M:InitHandCard(isPlayAni, index)
if DataManager.CurrenRoom == nil or DataManager.CurrenRoom.self_player == nil then
return
end
self.outcard_button = nil
if self.cor_init_poker ~= nil then
coroutine.stop(self.cor_init_poker)
end
self.cor_init_poker = nil
local _room = DataManager.CurrenRoom
--得到排序好的 list
local pokerList = PendulumRule.GetHandCard(_room.self_player.handcard_list, index)
if pokerList == nil or #pokerList == 0 then
return
end
self.cards_count = #pokerList
self.card_list = {}
self._area_handcard_list:RemoveChildren(0, -1, true)
--开始发牌动画
if isPlayAni == true then
self.cor_init_poker =
coroutine.start(
function()
self._mainView._popEvent = false
if self._mainView._rightPanelView._settingView ~= nil then
self._mainView._rightPanelView._settingView:SetBtnUpdateCardEnable(false)
end
for i = 1, #pokerList do
local pokerListNum = 0
for j = 1, #pokerList[i] do
local card_code = pokerList[i][j]
local btn_card = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Btn_Card')
-- print("lingmeng", self._room.change_card_display, card_code)
btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_code)
btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize())
btn_card:GetChild('n6'):SetScale(self:getCardSize(), self:getCardSize())
self.card_width = btn_card.width * self:getCardSize()
self.card_hight = btn_card.height * self:getCardSize()
local x, y = 500, (j * 85) - 500
btn_card:SetXY(x, y)
self._area_handcard_list:AddChild(btn_card)
self._area_handcard_list:SetChildIndex(btn_card, 5 - j)
local card_view = NewCardView(btn_card, card_code, i, j)
--存牌堆
self.card_list[#self.card_list + 1] = card_view
btn_card.data = card_view
btn_card.onTouchBegin:Set(handler(self, self.onTouchBegin))
btn_card.onTouchMove:Set(handler(self, self.onTouchMove))
btn_card.onTouchEnd:Set(handler(self, self.__OnDragEnd))
end
for j = #self.card_list, 1, -1 do
coroutine.wait(0.005)
if pokerListNum == #pokerList[i] then
break
end
pokerListNum = pokerListNum + 1
local card_view = self.card_list[j]
card_view.btn_card:RemoveFromParent()
self._area_handcard_list:AddChild(card_view.btn_card)
card_view.btn_card:TweenMove(self:GetHandCardPos(card_view, self.cards_count), 0.08)
end
end
self:UpdateHandCardsPos()
self._mainView._popEvent = true
self:UpdateIsOnClick(true)
if self._mainView._rightPanelView._settingView ~= nil then
coroutine.start(
function()
coroutine.wait(1)
self._mainView._rightPanelView._settingView:SetBtnUpdateCardEnable(true)
end
)
end
end
)
else
--没有发牌动画
for i = 1, #pokerList do
for j = 1, #pokerList[i] do
local card_code = pokerList[i][j]
local btn_card = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Btn_Card')
-- print("lingmeng", self._room.change_card_display, card_code)
btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_code)
btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize())
btn_card:GetChild('n6'):SetScale(self:getCardSize(), self:getCardSize())
self.card_width = btn_card.width * self:getCardSize()
self.card_hight = btn_card.height * self:getCardSize()
self._area_handcard_list:AddChild(btn_card)
self._area_handcard_list:SetChildIndex(btn_card, 5 - j)
local card_view = NewCardView(btn_card, card_code, i, j)
--存牌堆
self.card_list[#self.card_list + 1] = card_view
btn_card.data = card_view
btn_card.onTouchBegin:Set(handler(self, self.onTouchBegin))
btn_card.onTouchMove:Set(handler(self, self.onTouchMove))
btn_card.onTouchEnd:Set(handler(self, self.__OnDragEnd))
end
--存牌堆
for j = 1, #self.card_list do
local card_view = self.card_list[j]
card_view.btn_card.xy = self:GetHandCardPos(card_view, self.cards_count)
end
end
if self._player.fz_list ~= nil then
for i = 1, #self._player.fz_list do
if self._player.fz_list[i].type == RB_FZType.Kan then
self:UpdateKan(self._player.fz_list[i].card)
end
end
end
self:UpdateHandCardsPos()
end
self:SetNotPutCard()
end
--更新手牌
function M:UpdateHandCards(list)
self.card_list = {}
self._area_handcard_list:RemoveChildren(0, -1, true)
self.outcard_button = nil
local CountCards = {}
for i = 1, #list do
CountCards[list[i].index_X] = CountCards[list[i].index_X] == nil and 1 or CountCards[list[i].index_X] + 1
end
for i = 1, #list do
local card_code = list[i].card_item
local btn_card = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Btn_Card')
btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_code)
btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize())
btn_card:GetChild('n6'):SetScale(self:getCardSize(), self:getCardSize())
self.card_width = btn_card.width * self:getCardSize()
self.card_hight = btn_card.height * self:getCardSize()
local card_view = NewCardView(btn_card, card_code, list[i].index_X, list[i].index_Y)
--存牌堆
self.card_list[#self.card_list + 1] = card_view
btn_card.data = card_view
btn_card.onTouchBegin:Set(handler(self, self.onTouchBegin))
btn_card.onTouchMove:Set(handler(self, self.onTouchMove))
btn_card.onTouchEnd:Set(handler(self, self.__OnDragEnd))
end
for j = #self.card_list, 1, -1 do
local card_view = self.card_list[j]
card_view.btn_card:RemoveFromParent()
self._area_handcard_list:AddChild(card_view.btn_card)
card_view.btn_card.xy = self:GetHandCardPos(card_view, #CountCards)
end
if self._player.fz_list ~= nil then
for i = 1, #self._player.fz_list do
if self._player.fz_list[i].type == RB_FZType.Kan then
self:UpdateKan(self._player.fz_list[i].card)
end
end
end
self:SetNotPutCard()
end
-- 禁所有手牌
function M:banHandCards(list)
--printlog("---禁所有手牌----")
for i = 1, #list do
local card_code = list[i].card_item
-- local btn_card = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Btn_Card')
-- btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_code)
-- btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize())
-- btn_card:GetChild('n6'):SetScale(self:getCardSize(), self:getCardSize())
-- self.card_width = 87 * self:getCardSize()
-- self.card_hight = 110 * self:getCardSize()
-- local card_view = NewCardView(btn_card, card_code, list[i].index_X, list[i].index_Y)
-- btn_card.data = card_view
-- btn_card.touchable = false
self:UpdateKan(card_code)
end
end
-- --
function M:onTouchBegin(context)
printlog("onTouchBegin")
if DataManager.CurrenRoom == nil or DataManager.CurrenRoom.self_player == nil then
return
end
local button = context.sender
local card = button.data
if DataManager.CurrenRoom.curren_outcard_seat == DataManager.CurrenRoom.self_player.seat then
self:ShowHuTip(card.card_item)
end
card.btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/203_', card.card_item)
-- card.btn_card.sortingOrder = 100
local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y))
card.btn_card.xy = Vector2.New(card.btn_card.x + 20, card.btn_card.y - 50)
card.touch_pos = xy - button.xy
end
function M:onTouchMove(context)
local button = context.sender
local card = button.data
local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y))
button.xy = xy - card.touch_pos
-- print("lingmeng", xy.x, xy.y)
end
--出牌提示动画
function M:ChuPaiTiShi()
if DataManager.CurrenRoom == nil or DataManager.CurrenRoom.self_player == nil then
return
end
if DataManager.CurrenRoom.curren_outcard_seat == DataManager.CurrenRoom.self_player.seat then
self._view:GetController('chupai').selectedIndex = 1
else
self._view:GetController('chupai').selectedIndex = 0
end
end
-- 删手牌
function M:DeleteHandCard(carditem)
local card = nil
if self.outcard_button ~= nil and carditem == self.outcard_button.card_item then
list_remove(self.card_list, self.outcard_button)
self._area_handcard_list:RemoveChild(self.outcard_button.btn_card, true)
card = self.outcard_button
self.outcard_button = nil
else
for i = 1, #self.card_list do
local card_view = self.card_list[i]
if carditem == card_view.card_item then
card_view.btn_card.touchable = false
list_remove(self.card_list, card_view)
card = card_view
--card_view.btn_card:RemoveFromParent()
self._area_handcard_list:RemoveChild(card_view.btn_card, true)
break
end
end
end
if card ~= nil then
local num = 0
for i = 1, #self.card_list do
if card.index_X == self.card_list[i].index_X and card.index_Y < self.card_list[i].index_Y then
self.card_list[i].index_Y = self.card_list[i].index_Y - 1
end
if card.index_X == self.card_list[i].index_X then
num = num + 1
end
end
if num == 0 then
for i = 1, #self.card_list do
if self.card_list[i].index_X > card.index_X then
self.card_list[i].index_X = self.card_list[i].index_X - 1
end
end
end
end
self:UpdateHandCardsPos()
end
--更新手牌的坎
function M:UpdateKan(card)
for i = 1, #self.card_list do
local card_view = self.card_list[i]
if card_view.card_item == card then
card_view.btn_card.touchable = false --禁止牌
card_view.btn_card:GetController('Kan').selectedIndex = 1
end
end
end
-- 手牌更新位置方法 self.card_list 里面的对象 NewCardViewindex_X index_Y 就是xy序号
function M:UpdateHandCardsPos()
--得到有 多少列
local CountCards = {}
for i = 1, #self.card_list do
CountCards[self.card_list[i].index_X] =
CountCards[self.card_list[i].index_X] == nil and 1 or CountCards[self.card_list[i].index_X] + 1
end
for i = #self.card_list, 1, -1 do
local card_view = self.card_list[i]
card_view.btn_card:RemoveFromParent()
self._area_handcard_list:AddChild(card_view.btn_card)
card_view.old_postion = self:GetHandCardPos(card_view, #CountCards)
card_view.btn_card:TweenMove(card_view.old_postion, 0.2)
end
self:ShowHuTip()
end
--刷新手牌字体
function M:UpdateCardDisplay()
local CountCards = {}
for i = 1, #self.card_list do
CountCards[self.card_list[i].index_X] =
CountCards[self.card_list[i].index_X] == nil and 1 or CountCards[self.card_list[i].index_X] + 1
end
for i = #self.card_list, 1, -1 do
local card_view = self.card_list[i]
card_view.btn_card:RemoveFromParent()
card_view.btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_view.card_item)
self.card_width = card_view.btn_card.width * self:getCardSize()
self.card_hight = card_view.btn_card.height * self:getCardSize()
self._area_handcard_list:AddChild(card_view.btn_card)
-- card_view.btn_card:TweenMove(self:GetHandCardPos(card_view, #CountCards), 0.3)
end
self:UpdateOutLine()
self:UpdateHandCardsPos()
end
--更新手牌大小
function M:UpdateCardSize()
-- print("lingmeng UpdateCardSize")
local CountCards = {}
for i = 1, #self.card_list do
CountCards[self.card_list[i].index_X] =
CountCards[self.card_list[i].index_X] == nil and 1 or CountCards[self.card_list[i].index_X] + 1
end
for i = #self.card_list, 1, -1 do
local card_view = self.card_list[i]
card_view.btn_card:RemoveFromParent()
card_view.btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_view.card_item)
card_view.btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize())
card_view.btn_card:GetChild('n6'):SetScale(self:getCardSize(), self:getCardSize())
self.card_width = card_view.btn_card.width * self:getCardSize()
self.card_hight = card_view.btn_card.height * self:getCardSize()
self._area_handcard_list:AddChild(card_view.btn_card)
-- card_view.btn_card:TweenMove(self:GetHandCardPos(card_view, #CountCards), 0.3)
end
self:UpdateOutLine()
self:UpdateHandCardsPos()
end
function M:UpdateOutLine()
if self:getCardSize() == 1.3 then
self._data_outLinePos = 90 - (125 * 3)
elseif self:getCardSize() == 1.2 then
self._data_outLinePos = 90 - (116 * 3)
elseif self:getCardSize() == 0.8 then
self._data_outLinePos = 100 - (93 * 3)
end
self._view_outLine.y = self._data_outLinePos + self._area_handcard_list.height
end
function M:UpdateIsOnClick(isOut)
self._view.touchable = isOut
end
-- 结束 拖拽事件
-- 根据牌结束点的位置 判断是出牌还是调整位置 button.xy 和 牌的xy比较
function M:__OnDragEnd(context)
-- print("lingmeng buyaojina __OnDragEnd")
if DataManager.CurrenRoom == nil or DataManager.CurrenRoom.self_player == nil then
return
end
if self.outcard_button then
self.outcard_button = nil
end
local button = context.sender
local card = button.data
-- card.btn_card.sortingOrder = 0
local _room = DataManager.CurrenRoom
if (button.y < -320 and _room ~= nil and _room.curren_outcard_seat == _room.self_player.seat) then
button.touchable = false
self.outcard_button = card
self:UpdateIsOnClick(false)
self._mainView:OutCard(card.card_item)
else
local isChangeCard = false
self.outcard_button = nil
card.btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card.card_item)
self._area_handcard_list:AddChild(button)
if #self.card_list == 1 then
isChangeCard = false
self:UpdateHandCardsPos()
return
end
local CountCards = {}
for i = 1, #self.card_list do
local lists = {}
if CountCards[self.card_list[i].index_X] == nil then
lists[#lists + 1] = self.card_list[i]
CountCards[self.card_list[i].index_X] = lists
else
CountCards[self.card_list[i].index_X][#CountCards[self.card_list[i].index_X] + 1] = self.card_list[i]
end
end
local minmark = 1
local maxmark = #self.card_list
if card == self.card_list[1] or card == self.card_list[#self.card_list] then
if self.card_list[1].index_X == self.card_list[2].index_X then
minmark = 2
end
if self.card_list[#self.card_list].index_X == self.card_list[#self.card_list - 1].index_X then
maxmark = #self.card_list - 1
end
end
--位置x小于第一张牌 放第一排
if button.x + button.width / 2 < self.card_list[minmark].btn_card.x and #CountCards < 10 then
--位置大于最后一张牌 放最后一排
list_remove(self.card_list, card)
local num = 0
for i = 1, #self.card_list do
if card.index_X == self.card_list[i].index_X and card.index_Y < self.card_list[i].index_Y then
self.card_list[i].index_Y = self.card_list[i].index_Y - 1
end
if card.index_X == self.card_list[i].index_X then
num = num + 1
end
end
if num == 0 then
for i = 1, #self.card_list do
if self.card_list[i].index_X < card.index_X then
self.card_list[i].index_X = self.card_list[i].index_X + 1
end
end
else
for i = 1, #self.card_list do
self.card_list[i].index_X = self.card_list[i].index_X + 1
end
end
card.index_X = 1
card.index_Y = 1
table.insert(self.card_list, 1, card)
isChangeCard = true
elseif button.x + button.width / 2 > (self.card_list[maxmark].btn_card.x + button.width) and #CountCards < 10 then
list_remove(self.card_list, card)
local num = 0
for i = 1, #self.card_list do
if card.index_X == self.card_list[i].index_X then
num = num + 1
end
if card.index_X == self.card_list[i].index_X and card.index_Y < self.card_list[i].index_Y then
self.card_list[i].index_Y = self.card_list[i].index_Y - 1
end
end
if num == 0 then
for i = 1, #self.card_list do
if self.card_list[i].index_X > card.index_X then
self.card_list[i].index_X = self.card_list[i].index_X - 1
end
end
end
card.index_X = self.card_list[#self.card_list].index_X + 1
card.index_Y = 1
self.card_list[#self.card_list + 1] = card
isChangeCard = true
else
--放已有的牌堆上 判断放第几列
local MoveCard = false
local MoveCardPos = 0
local MoveCardY = 0
for i = 1, #CountCards do
local card_view = CountCards[i][1]
if card_view ~= nil then
if
button.x + button.width / 2 > card_view.old_postion.x and
button.x + button.width / 2 < (card_view.old_postion.x + button.width)
then
if card ~= card_view and #CountCards[i] < 4 and card.index_X ~= card_view.index_X then
MoveCardPos = i
MoveCardY = #CountCards[i] + 1
MoveCard = true
list_remove(self.card_list, card)
end
end
end
end
local MoveCardindex = 0
-- local MoveCardY = 0
if
button.x + button.width / 2 > card.old_postion.x and
button.x + button.width / 2 < (card.old_postion.x + button.width)
then
if #CountCards[card.index_X] > 1 then
for i = 1, #CountCards[card.index_X] do
local _cv = CountCards[card.index_X][i]
if _cv ~= card then
if
button.y + button.height / 2 > _cv.btn_card.y and
button.y + button.height / 2 < (_cv.btn_card.y + button.height)
then
--向下移動
if ((button.y + button.height / 2) + 20) > (card.old_postion.y + button.height) then
--向上移動
MoveCardindex = -1
MoveCardPos = card.index_X
MoveCardY = _cv.index_Y
MoveCard = true
list_remove(self.card_list, card)
elseif ((button.y + button.height / 2) - 20) < card.old_postion.y then
MoveCardindex = 1
MoveCardPos = card.index_X
MoveCardY = _cv.index_Y
MoveCard = true
list_remove(self.card_list, card)
end
elseif i == #CountCards[card.index_X] and button.y + button.height / 2 < _cv.btn_card.y then
MoveCardindex = 1
MoveCardPos = card.index_X
MoveCardY = _cv.index_Y
MoveCard = true
list_remove(self.card_list, card)
elseif i == 1 and button.y + button.height / 2 > (_cv.btn_card.y + button.width) then
MoveCardindex = -1
MoveCardPos = card.index_X
MoveCardY = _cv.index_Y
MoveCard = true
list_remove(self.card_list, card)
end
end
end
end
end
if MoveCard == true and MoveCardindex == 0 then
--上下移动
local num = 0
for i = 1, #self.card_list do
if card.index_X == self.card_list[i].index_X and card.index_Y < self.card_list[i].index_Y then
self.card_list[i].index_Y = self.card_list[i].index_Y - 1
end
if card.index_X == self.card_list[i].index_X then
num = num + 1
end
end
if num == 0 then
for i = 1, #self.card_list do
if self.card_list[i].index_X > card.index_X then
self.card_list[i].index_X = self.card_list[i].index_X - 1
end
end
if MoveCardPos > card.index_X then
MoveCardPos = MoveCardPos - 1
end
end
card.index_X = MoveCardPos
card.index_Y = MoveCardY
for i = #self.card_list, 1, -1 do
if MoveCardPos == self.card_list[i].index_X then
table.insert(self.card_list, (i + 1), card)
break
end
end
isChangeCard = true
elseif MoveCard == true and MoveCardindex ~= 0 then
for i = 1, #self.card_list do
if card.index_X == self.card_list[i].index_X then
--向下移动
if MoveCardindex == -1 then
--向上移动
if self.card_list[i].index_Y < card.index_Y and self.card_list[i].index_Y >= MoveCardY then
self.card_list[i].index_Y = self.card_list[i].index_Y + 1
end
else
if self.card_list[i].index_Y > card.index_Y and self.card_list[i].index_Y <= MoveCardY then
self.card_list[i].index_Y = self.card_list[i].index_Y - 1
end
end
end
end
card.index_X = MoveCardPos
card.index_Y = MoveCardY
for i = #self.card_list, 1, -1 do
if MoveCardPos == self.card_list[i].index_X and self.card_list[i].index_Y == (MoveCardY - 1) then
table.insert(self.card_list, (i + 1), card)
break
elseif MoveCardPos == self.card_list[i].index_X and self.card_list[i].index_Y == (MoveCardY + 1) then
table.insert(self.card_list, i, card)
break
end
end
isChangeCard = true
else
isChangeCard = false
self._area_handcard_list:AddChild(button)
end
end
self:UpdateHandCardsPos()
--每次改变手牌排列发给服务器 重连 回放需要用 --回放需要没次改变都要显示
if isChangeCard == true then
self:SendChangeCard()
end
end
end
--改变手牌排列发给服务器
function M:SendChangeCard(...)
local list = {}
for i = 1, #self.card_list do
local data = {}
data.card = self.card_list[i].card_item
data.X = self.card_list[i].index_X
data.Y = self.card_list[i].index_Y
list[#list + 1] = data
end
self._mainView:ChangeCards(list)
end
--计算手牌位置
function M:GetHandCardPos(cards_view, cards)
local x, y = 0, 0
local card_width = self.card_width - (self._room.change_card_display == "8_" and -2 or 5) -- 牌的宽度
local middle_x = self._area_handcard_list.width / 2
local start_x = middle_x - (cards / 2 * (card_width))
x = start_x + (card_width) * (cards_view.index_X - 1)
-- local card_height = self.card_hight
-- y = 90 - card_height * 0.66 * cards_view.index_Y
if self:getCardSize() == 1.3 then
y = 90 - (119 * cards_view.index_Y)
elseif self:getCardSize() == 1.2 then
y = 90 - (110 * cards_view.index_Y)
elseif self:getCardSize() == 0.8 then
y = 100 - (85 * cards_view.index_Y)
end
return Vector2.New(x, y)
end
--更新 吃碰
function M:UpdateFzList(fz_list)
--printlog("UpdateFzList area_fz_list1")
self._area_fz_list:RemoveChildren(0, -1, true)
for i = 1, #fz_list do
local fzitem = nil
if fz_list[i].type ~= RB_FZType.Kan then
fzitem = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Component1')
fzitem:RemoveChildren(0, -1, true)
end
if fz_list[i].type == RB_FZType.Chi or fz_list[i].type == RB_FZType.Bi then
local fzcards = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Fz_0_3')
fzcards:GetChild('card_' .. 1).icon = self:getCardItem('ui://Main_RunBeard/202_', fz_list[i].active_card)
fzcards:GetController('c2').selectedIndex = 1
fzcards:GetChild('card_' .. 2).icon = self:getCardItem('ui://Main_RunBeard/202_', fz_list[i].opcard[1])
fzcards:GetChild('card_' .. 3).icon = self:getCardItem('ui://Main_RunBeard/202_', fz_list[i].opcard[2])
fzcards.x, fzcards.y = 0, 0
fzitem:AddChildAt(fzcards, 0)
self._area_fz_list:AddChild(fzitem)
elseif fz_list[i].type == RB_FZType.Peng then
local fzcards = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Fz_0_3')
for j = 1, 3 do
fzcards:GetChild('card_' .. j).icon = self:getCardItem('ui://Main_RunBeard/202_', fz_list[i].card)
end
fzcards.x, fzcards.y = 0, 0
fzitem:AddChildAt(fzcards, 0)
self._area_fz_list:AddChild(fzitem)
elseif fz_list[i].type == RB_FZType.Wei then
local fzcards = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Fz_0_3')
fzcards:GetController('c1').selectedIndex = 1
for j = 1, 3 do
if j == 1 then
fzcards:GetChild('card_' .. j).icon = 'ui://Main_RunBeard/202_1_300'
else
fzcards:GetChild('card_' .. j).icon = self:getCardItem('ui://Main_RunBeard/202_', fz_list[i].card)
end
end
fzcards.x, fzcards.y = 0, 0
fzitem:AddChildAt(fzcards, 0)
self._area_fz_list:AddChild(fzitem)
elseif fz_list[i].type == RB_FZType.ChouWei then
local fzcards = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Fz_0_3')
fzcards:GetController('c1').selectedIndex = 1
for j = 1, 3 do
if j == 1 then
fzcards:GetChild('card_' .. j).icon = 'ui://Main_RunBeard/202_1_300'
else
fzcards:GetChild('card_' .. j).icon = self:getCardItem('ui://Main_RunBeard/202_', fz_list[i].card)
end
end
fzcards.x, fzcards.y = 0, 0
fzitem:AddChildAt(fzcards, 0)
self._area_fz_list:AddChild(fzitem)
elseif fz_list[i].type == RB_FZType.Pao then
local fzcards = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Fz_0_4')
for j = 1, 4 do
fzcards:GetChild('card_' .. j).icon = self:getCardItem('ui://Main_RunBeard/202_', fz_list[i].card)
end
fzcards.x, fzcards.y = 0, 0
fzitem:AddChildAt(fzcards, 0)
self._area_fz_list:AddChild(fzitem)
elseif fz_list[i].type == RB_FZType.Ti then
local fzcards = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Fz_0_4')
for j = 1, 4 do
if j == 1 then
fzcards:GetChild('card_' .. j).icon = self:getCardItem('ui://Main_RunBeard/202_', fz_list[i].card)
else
fzcards:GetChild('card_' .. j).icon = 'ui://Main_RunBeard/202_1_300'
end
end
fzcards.x, fzcards.y = 0, 0
fzitem:AddChildAt(fzcards, 0)
self._area_fz_list:AddChild(fzitem)
end
end
end
function M:ClearOutCard()
self._area_outcard_list:RemoveChildren(0, -1, true)
-- self._bgview.selectedIndex = 0
end
--出牌
function M:UpdateOutCardList(outcard)
printlog("UpdateOutCardListss" .. outcard)
self._area_outcard_list:RemoveChildren(0, -1, true)
local outcards = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Gcm_OutCard')
if outcard == 0 then
outcards:GetChild('icon').icon = 'ui://Main_RunBeard/201_1_300'
else
outcards:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/203_', outcard)
end
outcards.x, outcards.y = 0, 0
self._area_outcard_list:AddChild(outcards)
-- self._bgview.selectedIndex = 1
end
--弃牌
function M:UpdateQiPai(qi_list)
self._area_qipai_list:RemoveChildren(0, -1, true)
for i = 1, #qi_list do
local qicards = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Qipai')
qicards:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/202_', qi_list[i])
self._area_qipai_list:AddChild(qicards)
end
end
--摸牌动画
function M:PlayingOutCardAnima(card, seat)
local outcards = self._area_outcard_list:GetChildAt(0)
if not outcards then
local outcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Gcm_OutCard")
local show_di_bg = outcards:GetChild("show_di_bg")
show_di_bg.visible = false
self._area_outcard_list:AddChild(outcards)
end
outcards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/203_", card)
outcards:GetTransition("qipai" .. seat):Play()
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:getCardSize()
if self._room.change_card_size ~= nil then
return self._room.change_card_size
else
return 1.2
end
end
function M:GetFzMove()
if #self.card_list then
local fristCard = self.card_list[1].btn_card
return self._area_handcard_list:LocalToGlobal(fristCard.xy)
else
return self._area_fz_list:LocalToGlobal(Vector2.New(0, self._area_fz_list.height / 2))
end
end
return M

View File

@ -0,0 +1,36 @@
local Protocol = {
-- 通知服务器出牌
GAME_DIS_CARD = "611",
-- 通知服务器提示选择行为
GAME_ACTION = "612",
-- 通知服务器手牌队形改变
GAME_CHANGE_CARD = "613",
-- 通知服务器牌字体改变
GAME_CHANGE_TYPEfACE = "615",
-- 发牌协议
GAME_EVT_PLAYER_DEAL = "811",
-- 出牌事件
GAME_EVT_DISCARD = "812",
-- 出牌提示事件
GAME_EVT_DISCARD_TIP = "813",
-- 放子提示事件
GAME_EVT_FZTIPS = "814",
-- action 事件
GAME_EVT_ACTION = "815",
-- 胡牌事件
GAME_EVT_HU = "816",
-- 结算
GAME_EVT_RESULT1 = "817",
-- 弃牌
GAME_EVT_QIPAI = "818",
-- 抓牌
GAME_EVT_DRAW = "819",
-- 转盘指向事件
GAME_EVT_CHANGE_ACTIVE_PLAYER = "820",
--第二十一张牌
GAME_EVT_ADD_CARD = "821",
}
return Protocol

View File

@ -0,0 +1,336 @@
local SettingView = require('Game.View.SettingView')
local ZPTableBG = import('.ZPTableBG')
local ZPSettingView = {
-- 修改牌字体
onEXMainCallback = nil,
-- 修改手牌大小
onUpdataCardSizeCallback = nil,
-- 语音
onEXVoiceCallback = nil,
-- 快速出牌
onEXChuPaiCallback = nil,
-- 方言
onEXFangYanCallback = nil
}
local M = ZPSettingView
function ZPSettingView.new(blur_view, index, open_social, cardIndex)
setmetatable(SettingView, { __index = BaseWindow })
setmetatable(M, { __index = SettingView })
local self = setmetatable({}, { __index = M })
self.class = 'ZPSettingView'
self._currenIndex = 0
self._blur_view = blur_view
self.onCallback = event('onCallback', true)
self.stateIndex = 0
self.cd_time = 0
self._btn_dismiss_room_enable = false
self._close_destroy = true
self.bigSize = 1.4
self.mediumSize = 1.2
self.smallSize = 1.2
self._full = true
self._anim_pop = 2
self._close_zone = true
self._open_social = open_social
self._cardType = cardIndex
self:init('ui://Main_RunBeard/New_SettingWindow')
return self
end
function M:init(url)
SettingView.init(self, url)
if DataManager.CurrenRoom == nil then
return
end
self._view = self._view:GetChild('showview')
local view = self._view
local slider_sound = view:GetChild('slider_sound')
local slider_music = view:GetChild('slider_music')
-- local btn_music = view:GetChild('btn_music')
-- local btn_sound = view:GetChild('btn_sound')
-- btn_music.selected = (GameApplication.Instance.MusicValue < 5 and false or true)
slider_sound.value = GameApplication.Instance.SoundValue
slider_music.value = GameApplication.Instance.MusicValue
-- btn_sound.selected = GameApplication.Instance.SoundValue < 5 and false or true
slider_music.onChanged:Add(
function()
GameApplication.Instance.MusicValue = slider_music.value
-- btn_music.selected = GameApplication.Instance.MusicValue < 5 and false or true
end
)
slider_sound.onChanged:Add(
function()
GameApplication.Instance.SoundValue = slider_sound.value
-- btn_sound.selected = GameApplication.Instance.SoundValue < 5 and false or true
end
)
local room = DataManager.CurrenRoom
local c1 = self._view:GetController('cards')
if self._cardType then
c1.selectedIndex = self._cardType
end
local size = self._view:GetController('size')
if room.change_card_size ~= nil then
if room.change_card_size == self.bigSize then
size.selectedIndex = 0
elseif room.change_card_size == self.mediumSize then
size.selectedIndex = 1
elseif room.change_card_size == self.smallSize then
size.selectedIndex = 2
end
else
room.change_card_size = 0
size.selectedIndex = 0
end
if room.change_card_display ~= nil then
local _str = string.sub(room.change_card_display, 1, 1)
local n = tonumber(_str)
if n == 1 then
c1.selectedIndex = 1
elseif n == 2 then
c1.selectedIndex = 0
elseif n == 8 then
c1.selectedIndex = 3
else
c1.selectedIndex = 2
end
end
if self._open_social then
self._view:GetChild('n78').visible = true
self._view:GetChild('n88').visible = true
self._view:GetChild('n57').visible = true
local yuyin = self._view:GetController('yuyin')
local chupai = self._view:GetController('chupai')
local fangyan = self._view:GetController('fangyan')
local user_id = DataManager.SelfUser.account_id
local json_data = Utils.LoadLocalFile(user_id .. room.game_id .. 'yuyin')
local json_data1 = Utils.LoadLocalFile(user_id .. room.game_id .. 'chupai')
local json_data2 = Utils.LoadLocalFile(user_id .. room.game_id .. 'fangyan')
yuyin.selectedIndex = 1
chupai.selectedIndex = 1
room.yuyin_typeface = 1
room.chupai_typeface = 1
fangyan.selectedIndex = 1
room.fangyan_typeface = 1
if json_data ~= nil then
local _data = json.decode(json_data)
local typeface = _data['game_typeface']
room.yuyin_typeface = typeface
end
if json_data1 ~= nil then
local _data = json.decode(json_data1)
local typeface = _data['game_typeface']
room.chupai_typeface = typeface
end
if json_data2 ~= nil then
local _data = json.decode(json_data2)
local typeface = _data['game_typeface']
room.fangyan_typeface = typeface
end
if room.yuyin_typeface ~= nil then
yuyin.selectedIndex = room.yuyin_typeface
end
if room.chupai_typeface ~= nil then
chupai.selectedIndex = room.chupai_typeface
end
if room.fangyan_typeface ~= nil then
fangyan.selectedIndex = room.fangyan_typeface
end
else
self._view:GetChild('n78').visible = false
self._view:GetChild('n88').visible = false
self._view:GetChild('n57').visible = false
end
c1.onChanged:Set(
function()
if self.onEXMainCallback then
self.onEXMainCallback(c1.selectedIndex + 1)
end
--点击换牌按钮后保存当前游戏的牌字体
local user_id = DataManager.SelfUser.account_id
local _data = {}
_data['game_typeface'] = c1.selectedIndex + 1
local key = user_id .. room.game_id
Utils.SaveLocalFile(key, json.encode(_data))
end
)
size.onChanged:Set(
function()
if self.onUpdataCardSizeCallback then
self.onUpdataCardSizeCallback(size.selectedIndex)
end
--点击换牌按钮后保存当前游戏的牌字体
local user_id = DataManager.SelfUser.account_id
local _data = {}
_data['game_cardsize'] = size.selectedIndex
local key = user_id .. room.game_id .. 'cardsize_new'
Utils.SaveLocalFile(key, json.encode(_data))
end
)
if self._open_social then
self._view:GetChild('n78').visible = false
local yuyin = self._view:GetController('yuyin')
local chupai = self._view:GetController('chupai')
local fangyan = self._view:GetController('fangyan')
yuyin.onChanged:Set(
function()
if self.onEXVoiceCallback then
room.yuyin_typeface = yuyin.selectedIndex
self.onEXVoiceCallback(yuyin.selectedIndex)
end
--点击换牌按钮后保存当前游戏的牌字体
local user_id = DataManager.SelfUser.account_id
local _data = {}
_data['game_typeface'] = yuyin.selectedIndex
local key = user_id .. room.game_id .. 'yuyin'
Utils.SaveLocalFile(key, json.encode(_data))
end
)
chupai.onChanged:Set(
function()
if self.onEXChuPaiCallback then
room.chupai_typeface = chupai.selectedIndex
self.onEXChuPaiCallback(chupai.selectedIndex)
end
--点击换牌按钮后保存当前游戏的牌字体
local user_id = DataManager.SelfUser.account_id
local _data = {}
_data['game_typeface'] = chupai.selectedIndex
local key = user_id .. room.game_id .. 'chupai'
Utils.SaveLocalFile(key, json.encode(_data))
end
)
fangyan.onChanged:Set(
function()
if self.onEXFangYanCallback then
room.fangyan_typeface = fangyan.selectedIndex
self.onEXFangYanCallback(fangyan.selectedIndex)
end
--点击换牌按钮后保存当前游戏的牌字体
local user_id = DataManager.SelfUser.account_id
local _data = {}
_data['game_typeface'] = fangyan.selectedIndex
local key = user_id .. room.game_id .. 'fangyan'
Utils.SaveLocalFile(key, json.encode(_data))
end
)
else
self._view:GetChild('n78').visible = false
end
end
function M:Show()
SettingView.Show(self)
self:UpdateIndex()
self:UpdateCardSizeIndex()
end
--根据存的数据改变设置里面的控制器
function M:UpdateIndex()
local room = DataManager.CurrenRoom
local c1 = self._view:GetController('cards')
if room.change_card_display ~= nil then
local _str = string.sub(room.change_card_display, 1, 1)
local n = tonumber(_str)
if n == 7 then
n = 6
end
if n == 1 then
c1.selectedIndex = 1
elseif n == 2 then
c1.selectedIndex = 0
elseif n == 8 then
c1.selectedIndex = 3
else
c1.selectedIndex = 0
end
end
end
function M:UpdateCardSizeIndex()
local room = DataManager.CurrenRoom
local size = self._view:GetController('size')
if room.change_card_size ~= nil then
if room.change_card_size == self.bigSize then
size.selectedIndex = 0
elseif room.change_card_size == self.mediumSize then
size.selectedIndex = 1
elseif room.change_card_size == self.smallSize then
size.selectedIndex = 2
end
else
size.selectedIndex = 0
end
end
function M:SetBtnUpdateCardEnable(enable)
self._view:GetChild('n37').enabled = enable
self._view:GetChild('n38').enabled = enable
self._view:GetChild('n49').enabled = enable
end
function M:FillBgSection(cb, game_id, default_bg, room, qihu)
if (default_bg == nil) then
default_bg = 1
end
local view = self._view
local lst_bg = view:GetChild('lst_bg')
local ctr_bg = view:GetController('bg')
for i = 1, #bg_config_zipai do
local config = bg_config_zipai[i]
local item = lst_bg:AddItemFromPool()
item.icon = config.thumb
if i > 3 then
ctr_bg:AddPage(i - 1)
end
item.onClick:Add(
function()
cb(config.url)
ctr_bg.selectedIndex = i - 1
if qihu ~= nil then
self._blur_view:GetController('bg_state').selectedIndex = i - 1
end
end
)
end
self._game_id = game_id
self._bg = ZPTableBG.GetTableBG(game_id)
local index = 0
if self._bg > 0 then
lst_bg.selectedIndex = self._bg - 1
index = lst_bg.selectedIndex
else
ctr_bg.selectedIndex = default_bg - 1
index = ctr_bg.selectedIndex
end
if qihu ~= nil then
if index < 3 then
self._blur_view:GetController('bg_state').selectedIndex = index
else
self._blur_view:GetController('bg_state').selectedIndex = 0
end
end
end
function M:Destroy()
local bg_id = self._view:GetController('bg').selectedIndex + 1
if self._bg ~= bg_id then
self._bg = bg_id
ZPTableBG.SaveTableBG(self._game_id, self._bg)
end
SettingView.Destroy(self)
end
return M

View File

@ -0,0 +1,81 @@
-- 记录各游戏的桌面背景
json = require 'cjson'
local ZPTableBG = {}
local M = ZPTableBG
bg_config_zipai = {
{id = 1, url = "base/main_zipai/bg/bg_1", thumb = "ui://Main_RunBeard/table_bg1"},
{id = 2, url = "base/main_zipai/bg/bg_2", thumb = "ui://Main_RunBeard/table_bg2"},
{id = 3, url = "base/main_zipai/bg/bg_3", thumb = "ui://Main_RunBeard/table_bg3"},
}
local function GetBG(data, game_id)
local bg_id = 0
for i = 1, #data do
if data[i].game_id == game_id then
bg_id = data[i].bg_id
break
end
end
return bg_id
end
local function SetBG(data, game_id, bg_id)
local contain_key = false
for i = 1, #data do
if data[i].game_id == game_id then
contain_key = true
if data[i].bg_id ~= bg_id then
data[i].bg_id = bg_id
break
end
end
end
if not contain_key then
local _data = {}
_data.game_id = game_id
_data.bg_id = bg_id
table.insert(data, _data)
end
end
function ZPTableBG.GetTableBG(game_id)
local id = -1
local json_data = Utils.LoadLocalFile(DataManager.SelfUser.account_id .. DataManager.SelfUser.invite_code)
if json_data ~= nil then
local config_data = json.decode(json_data)
id = GetBG(config_data, game_id)
end
return id
end
function ZPTableBG.LoadTableBG(id, game_id, main_view)
local bg_id = M.GetTableBG(game_id)
local index
if bg_id > 0 then
index = bg_id
else
index = id
end
if index>3 then
-- body
index=1
end
local url = bg_config_zipai[index].url
LoadGameBg(url, main_view)
end
function ZPTableBG.SaveTableBG(game_id, bg_id)
local config_data
local json_data = Utils.LoadLocalFile(DataManager.SelfUser.account_id .. DataManager.SelfUser.invite_code)
if json_data ~= nil then
config_data = json.decode(json_data)
else
config_data = {}
end
SetBG(config_data, game_id, bg_id)
Utils.SaveLocalFile(DataManager.SelfUser.account_id .. DataManager.SelfUser.invite_code, json.encode(config_data))
end
return M

View File

@ -0,0 +1,304 @@
local setmetatable = setmetatable
function class(classname, super)
local superType = type(super)
local cls
if superType ~= "function" and superType ~= "table" then
superType = nil
super = nil
end
if superType == "function" or (super and super.__ctype == 1) then
-- inherited from native C++ Object
cls = {}
if superType == "table" then
-- copy fields from super
for k,v in pairs(super) do cls[k] = v end
cls.__create = super.__create
cls.super = super
else
cls.__create = super
cls.ctor = function() end
end
cls.__cname = classname
cls.__ctype = 1
function cls.new(...)
local instance = cls.__create(...)
-- copy fields from class to native object
for k,v in pairs(cls) do instance[k] = v end
instance.class = cls
instance:ctor(...)
return instance
end
else
-- inherited from Lua Object
if super then
cls = {}
setmetatable(cls, {__index = super})
cls.super = super
else
cls = {ctor = function() end}
end
cls.__cname = classname
cls.__ctype = 2 -- lua
cls.__index = cls
function cls.new(...)
local instance = setmetatable({}, cls)
instance.class = cls
instance:ctor(...)
return instance
end
end
return cls
end
-- 刘海偏移
function get_offset(full_offset)
if full_offset then
local r = GRoot.inst.width / GRoot.inst.height
if r >= 2 then
local d = (Screen.dpi /160)
return d * 20
end
end
return 0
end
---lua table 浅拷贝
function membe_clone(orig)
local copy
if type(orig) == "table" then
copy = {}
for orig_key, orig_value in pairs(orig) do
copy[orig_key] = orig_value
end
else -- number, string, boolean, etc
copy = orig
end
return copy
end
-- lua table 深拷贝
function membe_deep_clone(orig)
local copy
if type(orig) == "table" then
copy = {}
for orig_key, orig_value in pairs(orig) do
copy[membe_deep_clone(orig_key)] = membe_deep_clone(orig_value)
end
else
copy = orig
end
return copy
end
---字符串分割函数
function split(str, delimiter)
if str==nil or str=='' or delimiter==nil then
return nil
end
local result = {}
for match in (str..delimiter):gmatch("(.-)"..delimiter) do
table.insert(result, match)
end
return result
end
function handler( obj,func)
return function(...)
return func(obj, ...)
end
end
--重新require一个lua文件替代系统文件。
function unimport(moduleName,currentModuleName)
local package = package
local currentModuleNameParts
local moduleFullName = moduleName
local offset = 1
while true do
if string.byte(moduleName, offset) ~= 46 then -- .
moduleFullName = string.sub(moduleName, offset)
if currentModuleNameParts and #currentModuleNameParts > 0 then
moduleFullName = table.concat(currentModuleNameParts, ".") .. "." .. moduleFullName
end
break
end
offset = offset + 1
if not currentModuleNameParts then
if not currentModuleName then
local n,v = debug.getlocal(3, 1)
currentModuleName = v
end
currentModuleNameParts = string.split(currentModuleName, ".")
end
table.remove(currentModuleNameParts, #currentModuleNameParts)
end
package.loaded[moduleFullName] = nil
package.preload[moduleFullName] = nil
end
function table.nums(t)
local count = 0
for k, v in pairs(t) do
count = count + 1
end
return count
end
-- @param t 要检查的表格(t表示是table)
-- @param table 返回指定表格的所有键key,它是一个键集合的表格
--]]
function table.keys( t )
local keys = {}
for k, _ in pairs( t ) do
keys[#keys + 1] = k
end
return keys
end
function list_remove(t,item)
for i,v in ipairs(t) do
if v == item then
table.remove(t,i)
break
end
end
end
function list_check(t,item)
for i,v in ipairs(t) do
if v == item then
return true
end
end
return false
end
function list_index(t,item)
for i,v in ipairs(t) do
if v == item then
return i
end
end
return 0
end
function list_concat(des,tag)
for i = 1, #tag do
table.insert(des, tag[i])
end
return des
end
function vardump(object, label)
local lookupTable = {}
local result = {}
local function _v(v)
if type(v) == "string" then
v = "\"" .. v .. "\""
end
return tostring(v)
end
local function _vardump(object, label, indent, nest)
label = label or "<var>"
local postfix = ""
if nest > 1 then postfix = "," end
if type(object) ~= "table" then
-- if type(label) == "string" then
result[#result +1] = string.format("%s%s = %s%s", indent, label, _v(object), postfix)
-- else
-- result[#result +1] = string.format("%s%s%s", indent, _v(object), postfix)
-- end
elseif not lookupTable[object] then
lookupTable[object] = true
-- if type(label) == "string" then
result[#result +1 ] = string.format("%s%s = {", indent, label)
-- else
-- result[#result +1 ] = string.format("%s{", indent)
-- end
local indent2 = indent .. " "
local keys = {}
local values = {}
for k, v in pairs(object) do
keys[#keys + 1] = k
values[k] = v
end
table.sort(keys, function(a, b)
if type(a) == "number" and type(b) == "number" then
return a < b
else
return tostring(a) < tostring(b)
end
end)
for i, k in ipairs(keys) do
_vardump(values[k], k, indent2, nest + 1)
end
result[#result +1] = string.format("%s}%s", indent, postfix)
end
end
_vardump(object, label, "", 1)
return table.concat(result, "\n")
end
function sysrandom(min,max)
local num = math.random(min,max)
return num
end
function IsHasDictionary(currentTarget,list)
if list and #list>0 then
for k,v in ipairs(list) do
if v==currentTarget then
return true
end
end
return false
else
return false
end
end
function CheckDictionaryFromContent(target,list)
if list and #list>0 then
for k,v in pairs(list) do
if v.card==target then
return true,k
end
end
else
return false
end
end
function CombineDictionaryAndRemoveSomeItem(list1,list2)
local tempList=membe_clone(list2)
for i=1,#list1 do
if IsHasDictionary(list1[i],list2)==false then
table.insert(tempList,list1[i])
end
end
return tempList
end

View File

@ -0,0 +1,177 @@
local funcs = require("functions")
local CardCheck = require("CardCheck")
function LuaPrint(lua_table, limit, indent, step)
step = step or 0
indent = indent or 0
local content = ""
if limit ~= nil then
if step > limit then
return "..."
end
end
if step > 10 then
return content .. "..."
end
if lua_table == nil then
return "nil"
end
if type(lua_table) == "userdata" or type(lua_table) == "lightuserdata" or type(lua_table) == "thread" then
return tostring(lua_table)
end
if type(lua_table) == "string" or type(lua_table) == "number" then
return "[No-Table]:" .. lua_table
end
for k, v in pairs(lua_table) do
if k ~= "_class_type" then
local szBuffer = ""
Typev = type(v)
if Typev == "table" then
szBuffer = "{"
end
local szPrefix = string.rep(" ", indent)
if Typev == "table" and v._fields then
local kk, vv = next(v._fields)
if type(vv) == "table" then
content = content .. "\n\t" .. kk.name .. "={" .. LuaPrint(vv._fields, 5, indent + 1, step + 1) ..
"}"
else
content = content .. "\n\t" .. kk.name .. "=" .. vv
end
else
if type(k) == "table" then
if k.name then
if type(v) ~= "table" then
content = content .. "\n" .. k.name .. "=" .. v
else
content = content .. "\n" .. k.name .. " = list:"
local tmp = "\n"
for ka, va in ipairs(v) do
tmp = tmp .. "#" .. ka .. "_" .. tostring(va)
end
content = content .. tmp
end
end
elseif type(k) == "function" then
content = content .. "\n fun=function"
else
formatting = szPrefix .. tostring(k) .. " = " .. szBuffer
if Typev == "table" then
content = content .. "\n" .. formatting
content = content .. LuaPrint(v, limit, indent + 1, step + 1)
content = content .. "\n" .. szPrefix .. "},"
else
local szValue = ""
if Typev == "string" then
szValue = string.format("%q", v)
else
szValue = tostring(v)
end
content = content .. "\n" .. formatting .. (szValue or "nil") .. ","
end
end
end
end
end
return content
end
function --printlog(...)
if true then
print(...)
end
end
function pt(...)
if true then
local arg = { ... }
local has = false
for _, v in pairs(arg) do
if v and type(v) == "table" then
has = true
break
end
end
if not has then
print(...)
end
local content = ""
for _, v in pairs(arg) do
if v == "table" then
content = content .. tostring(v) .. "\n"
else
content = content .. "==>[T]:" .. LuaPrint(v, limit), debug.traceback() .. "\n"
end
print(content)
end
end
end
local player = {}
local room = {}
room.game_id = 17
room.room_config = {
config = {
hunum = 0
}
}
player.hu_xi = 0
player.handcard_list ={ 102,
102,
103,
104,
106,
106,
107,
107,
110,
110,
203,
204,
205,
206,
}
player.fz_list = {
{
type = 2,
card = 208,
opcard = {
208,
208,
},
active_card = 208,
},
{
type = 1,
card = 109,
opcard = {
109,
209,
},
active_card = 109,
}
}
--CardCheck.tingPai(player,room)
function millisleep(ms)
local start = os.clock()
while os.clock()-start < ms / 1000 do
-- --printlog(10-os.clock()-start)
--printlog(Time.deltaTime)
end
end
function getMillitime()
return os.clock()*1000
end
millisleep(10000)

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="74,74" extention="Button">
<controller name="button" pages="0,up,1,down" selected="0"/>
<controller name="ban" exported="true" pages="0,,1,,2," selected="2"/>
<displayList>
<loader id="n3_h1uu" name="icon" xy="0,0" size="74,74" url="ui://twf9hyqxtlof79" align="center" vAlign="middle">
<gearIcon controller="ban" pages="1,2" values="ui://twf9hyqxtlof7a|ui://twf9hyqxtlof79" default="ui://twf9hyqxtlof7b"/>
</loader>
</displayList>
<Button downEffect="dark" downEffectValue="0.80"/>
</component>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="84,161">
<controller name="voice" pages="0,,1," selected="0"/>
<controller name="sdk" pages="0,,1," selected="0"/>
<displayList>
<component id="n1_h1uu" name="n1" src="tlof78" fileName="Btn_chat.xml" xy="8,87" controller="ban,0">
<Button icon="ui://twf9hyqxtlof79"/>
</component>
<component id="n2_h1uu" name="n2" src="tlof6s" fileName="component/VoiceMask(1).xml" xy="7,-47">
<gearDisplay controller="voice" pages="1"/>
</component>
<component id="n3_h1uu" name="btn_record" src="tlof78" fileName="Btn_chat.xml" xy="8,0" controller="ban,0">
<gearDisplay controller="sdk" pages="0"/>
<Button icon="ui://twf9hyqxtlof7c"/>
</component>
</displayList>
</component>

View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1334,750" designImage="ui://442j0uepq9kx1k" designImageOffsetX="-200" designImageOffsetY="-100">
<controller name="state" pages="0,准备状态,1,游戏状态,2,回合间状态,3,回放状态" selected="0"/>
<controller name="sdk" pages="0,,1," selected="0"/>
<controller name="action" pages="2,空,0,准备,1,开始" selected="0"/>
<displayList>
<image id="n65_q9kx" name="n65" src="q9kx1l" xy="526,138" alpha="0.6" pkg="442j0uep">
<gearDisplay controller="state" pages="1,3"/>
</image>
<component id="n12" name="btn_wxyqhy" src="tlofa" xy="448,258" group="n13">
<gearDisplay controller="sdk" pages="0"/>
<relation target="" sidePair="middle-middle"/>
</component>
<group id="n13" name="n13" xy="448,258" size="438,147" advanced="true">
<gearDisplay controller="state" pages="0"/>
</group>
<text id="n42_lryk" name="tex_round" xy="691,262" size="119,27" fontSize="20" color="#cccccc" align="center" autoSize="none" text="剩余 5 张牌 1/8局">
<gearDisplay controller="state" pages="1,3"/>
</text>
<text id="n27" name="remaining_card" xy="545,262" size="141,27" fontSize="20" color="#cccccc" align="center" autoSize="none" text="剩余 19 张牌 ">
<gearDisplay controller="state" pages="1,3"/>
</text>
<component id="n37_kba2" name="roominfo_panel1" src="ygxg1b" xy="12,110" size="400,67" touchable="false" pkg="442j0uep">
<gearDisplay controller="state" pages="0,3"/>
<gearXY controller="state" pages="3" values="333,29" default="12,110"/>
<relation target="n33_hp0b" sidePair="top-bottom"/>
</component>
<component id="n62_jali" name="player_card_info2" src="ygxg15" xy="981,2" pkg="442j0uep">
<gearDisplay controller="state" pages="1,3"/>
</component>
<component id="n64_jali" name="player_card_info3" src="ygxg17" xy="155,3" pkg="442j0uep">
<gearDisplay controller="state" pages="1,3"/>
</component>
<component id="n61_jali" name="player_card_info1" src="ygxg14" xy="0,530" size="1334,221" pkg="442j0uep">
<gearDisplay controller="state" pages="1,3"/>
</component>
<component id="n18" name="player_info2" src="ygxgw" xy="1015,213" pkg="442j0uep">
<gearXY controller="state" pages="0,1,3" values="1015,213|1197,146|1197,146" default="1157,213"/>
</component>
<component id="n16" name="player_info3" src="ygxgy" xy="158,212" pkg="442j0uep">
<gearXY controller="state" pages="0,1,3" values="158,212|19,142|19,142" default="28,212"/>
</component>
<component id="n7" name="player_info1" src="ygxgz" xy="621,532" size="189,67" pkg="442j0uep">
<gearXY controller="state" pages="0,1,2,3" values="621,532|13,598|615,516|10,598"/>
</component>
<component id="n31_h1uu" name="roominfo_panel" src="ygxg1c" xy="0,0" pkg="442j0uep">
<gearDisplay controller="state" pages="1,2"/>
</component>
<component id="n32_h1uu" name="gcm_chat" src="tlof77" xy="1222,376">
<gearDisplay controller="state" pages="0,1,2"/>
<relation target="" sidePair="middle-middle"/>
</component>
<component id="n34_k3io" name="btn_ready" src="tlof4" xy="575,654" group="n36_k3io">
<gearDisplay controller="action" pages="0"/>
<Button icon="ui://twf9hyqxtlof7d"/>
</component>
<component id="n35_k3io" name="btn_start" src="tlof4" xy="575,654" group="n36_k3io">
<gearDisplay controller="action" pages="1"/>
<Button icon="ui://twf9hyqxtlof7e"/>
</component>
<group id="n36_k3io" name="n36" xy="575,654" size="184,85" advanced="true" collapsed="true">
<gearDisplay controller="state" pages="0"/>
<relation target="" sidePair="bottom-bottom"/>
</group>
<component id="n46_u4l2" name="btn_rule" src="tlofe" xy="934,29" group="n52_cnxs"/>
<component id="n50_cnxs" name="btn_getRoomNum" src="tlofc" xy="896,656" group="n52_cnxs">
<gearDisplay controller="state" pages="0"/>
<Button icon="ui://twf9hyqxtlof7f"/>
</component>
<component id="n56_cnxs" name="mask_tips" src="tlof6g" xy="658,480" group="n52_cnxs"/>
<group id="n52_cnxs" name="n52" xy="658,29" size="522,707" collapsed="true"/>
<component id="n57_rayb" name="panel_record" src="tlof7g" xy="379,435" alpha="0.5">
<gearDisplay controller="state" pages="3"/>
</component>
<text id="n58_zzcq" name="tex_version" xy="1200,602" size="130,38" fontSize="30" color="#ffffff" align="center" autoSize="none" text="v2.0.0">
<gearDisplay controller="state" pages="0,1,2"/>
<relation target="n32_h1uu" sidePair="top-bottom"/>
</text>
<text id="n146_lr5d" name="time" xy="655,294" size="10,6" visible="false" fontSize="0" color="#cccccc" align="center" leading="0" autoSize="none" text="">
<gearDisplay controller="state" pages="1,3"/>
</text>
<component id="n33_hp0b" name="btn_back_lobby" src="tlofg" xy="0,-1">
<gearDisplay controller="state" pages="0,3"/>
</component>
<component id="n148_hl8v" name="right_panel" src="hl8v6v" xy="969,-1" pkg="442j0uep"/>
<component id="n149_rx2e" name="btn_distance" src="tlof5f" xy="1132,492">
<gearDisplay controller="state" pages="0,1,2"/>
</component>
</displayList>
</component>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="362,100" initName="roominfo_panel">
<displayList>
<image id="n0_h1uu" name="n0" src="h1uu31" pkg="27vd145b" xy="323,0" scale="-1,1"/>
<text id="n1_h1uu" name="n1" xy="13,32" size="61,33" group="n5_h1uu" fontSize="25" color="#ffffff" text="房号:"/>
<text id="n2_h1uu" name="tex_roomid" xy="82,32" size="47,33" group="n5_h1uu" fontSize="25" color="#ffffff" text=" "/>
<text id="n3_h1uu" name="tex_gametype" xy="193,32" size="137,33" group="n5_h1uu" fontSize="25" color="#ffffff" text=" "/>
<text id="n4_h1uu" name="tex_roomconfig" xy="-1,51" size="315,32" group="n5_h1uu" visible="false" fontSize="20" color="#cccccc" align="center" autoSize="none" text=" "/>
<group id="n5_h1uu" name="n5" xy="-1,32" size="331,51"/>
</displayList>
</component>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="563,63" initName="roominfo_panel">
<displayList>
<text id="n1_h1uu" name="n1" xy="9,3" size="55,29" fontSize="22" color="#ffffff" text="房号:"/>
<text id="n2_h1uu" name="tex_roomid" xy="63,3" size="77,29" fontSize="22" color="#ffffff" text=" "/>
<text id="n3_h1uu" name="tex_gametype" xy="162,3" size="125,29" fontSize="22" color="#ffffff" text=" "/>
<text id="n4_h1uu" name="tex_roomconfig" xy="8,31" size="555,32" visible="false" fontSize="20" color="#ffffff" autoSize="none" text=" "/>
</displayList>
</component>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="846,501" extention="Button">
<controller name="show_line" exported="true" pages="0,,1," selected="0"/>
<controller name="show_di" exported="true" pages="0,,1," selected="0"/>
<controller name="style" exported="true" pages="0,,1,,2,,3," selected="0"/>
<displayList>
<image id="n7_trjm" name="n7" src="trjmcih" fileName="images/win/zstk.png" xy="-2,2" size="846,501" pkg="27vd145b">
<gearDisplay controller="style" pages="1"/>
<relation target="" sidePair="width-width,height-height"/>
</image>
<image id="n9_k24k" name="n9" src="tlof55" fileName="images/win/tydk1.png" xy="0,0" size="846,501">
<gearDisplay controller="style" pages="3"/>
<relation target="" sidePair="width-width,height-height"/>
</image>
<image id="n0_lwcl" name="bg" src="tlof43" fileName="images/win/tkd.png" xy="0,0" size="846,501" visible="false">
<gearDisplay controller="style" pages="0"/>
<relation target="" sidePair="height-height,width-width"/>
</image>
<image id="n5_eeqm" name="n5" src="tlof56" fileName="images/win/zz.png" xy="26,74" size="791,311">
<gearDisplay controller="show_di" pages="0"/>
<relation target="" sidePair="width-width,height-height"/>
</image>
<loader id="n4_lwcl" name="icon" xy="136,9" size="593,69" url="ui://twf9hyqxtlof57" align="center" vAlign="middle">
<relation target="" sidePair="center-center"/>
</loader>
</displayList>
<Button/>
</component>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="233,90" extention="Button">
<controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
<displayList>
<image id="n4_vthd" name="n4" src="tlof1" fileName="images/game_bottom_02.png" xy="0,0"/>
</displayList>
<Button downEffect="dark" downEffectValue="0.80"/>
</component>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="163,67" extention="Button">
<controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
<displayList>
<image id="n3_vthd" name="n3" src="tlof3" fileName="images/button.png" xy="0,0"/>
<loader id="n2" name="icon" xy="0,0" size="164,66" align="center" vAlign="middle">
<relation target="" sidePair="width-width,height-height"/>
</loader>
<text id="n4_irlq" name="title" xy="0,0" size="163,67" fontSize="30" color="#ffffff" align="center" vAlign="middle" autoSize="shrink" text=""/>
</displayList>
<Button downEffect="dark" downEffectValue="0.80"/>
</component>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="53,53" extention="Button" initName="btn_rule">
<controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
<displayList>
<image id="n2_u4l2" name="n2" src="tloff" xy="0,0"/>
</displayList>
<Button downEffect="dark" downEffectValue="0.80"/>
</component>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="184,85" extention="Button">
<displayList>
<loader id="n2" name="icon" xy="0,0" size="184,85" align="center" vAlign="middle">
<relation target="" sidePair="width-width,height-height"/>
</loader>
</displayList>
<Button downEffect="dark" downEffectValue="0.80"/>
</component>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="323,106" extention="Button" initName="btn_back_lobby">
<controller name="button" pages="0,up,1,down" selected="0"/>
<displayList>
<image id="n2_hp0b" name="n2" src="h1uu31" fileName="images/game/game_bg_02.png" xy="321,0" scale="-1,1" pkg="27vd145b"/>
<image id="n1" name="n1" src="tlofh" fileName="images/game/Button_Close.png" xy="98,28" scale="1.5,1.5"/>
<image id="n3_hp0b" name="n3" src="tlofi" fileName="images/game/game_icon_01.png" xy="12,23" scale="1.5,1.5"/>
</displayList>
<Button downEffect="dark" downEffectValue="0.80"/>
</component>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="161,65" extention="Button">
<controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
<displayList>
<image id="n1" name="n1" src="tlofd" fileName="images/button00.png" xy="0,0" size="160,65">
<relation target="" sidePair="width-width,height-height"/>
</image>
<loader id="n2" name="icon" xy="0,0" size="161,65" align="center" vAlign="middle">
<relation target="" sidePair="width-width,height-height"/>
</loader>
<text id="n3_irlq" name="title" xy="0,0" size="161,65" fontSize="30" color="#ffffff" align="center" vAlign="middle" autoSize="shrink" text=""/>
</displayList>
<Button downEffect="dark" downEffectValue="0.80"/>
</component>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="87,92" extention="Button" initName="btn_close">
<controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
<controller name="style" exported="true" pages="0,,1," selected="0"/>
<displayList>
<loader id="n3_j046" name="icon" xy="2,3" size="77,79" url="ui://twf9hyqxtlof9" autoSize="true"/>
</displayList>
<Button downEffect="dark" downEffectValue=".8"/>
</component>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="219,61" extention="Button">
<displayList>
<image id="n1" name="n1" src="tlof6" fileName="images/tishi_bottom_01.png" xy="0,0" size="288,82" visible="false"/>
<image id="n4_iukg" name="n4" src="tlof7" fileName="images/new_btns/new_button_redy.png" xy="0,0" visible="false"/>
<loader id="n2" name="icon" xy="0,0" size="219,61" align="center" vAlign="middle"/>
</displayList>
<Button downEffect="dark" downEffectValue="0.80"/>
</component>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="438,147" extention="Button">
<controller name="button" pages="0,up,1,down" selected="0"/>
<displayList>
<image id="n0_jes7" name="n0" src="tlofb" xy="0,0"/>
</displayList>
<Button downEffect="dark" downEffectValue="0.80"/>
</component>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="10,10">
<displayList/>
</component>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="134,134">
<displayList/>
</component>

View File

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1334,750" designImage="ui://3vytbifonu0l2f" designImageOffsetX="-200" designImageOffsetY="-100">
<controller name="state" pages="0,准备状态,1,游戏状态,2,回合间状态,3,回放状态" selected="1"/>
<controller name="sdk" pages="0,,1," selected="0"/>
<controller name="action" pages="2,空,0,准备,1,开始" selected="0"/>
<controller name="jushu" pages="0,,1," selected="0"/>
<displayList>
<image id="n65_q9kx" name="n65" src="tlof75" fileName="component/Main/images/zipai.png" xy="536,138" size="262,70" alpha="0.6">
<gearDisplay controller="state" pages="1,3"/>
</image>
<component id="n12" name="btn_wxyqhy" src="tlofa" fileName="buttons/Btn_wxyq.xml" xy="448,258" group="n13">
<gearDisplay controller="sdk" pages="0"/>
<relation target="" sidePair="middle-middle"/>
</component>
<group id="n13" name="n13" xy="448,258" size="438,147" advanced="true" collapsed="true">
<gearDisplay controller="state" pages="0"/>
</group>
<loader id="n153_8th3" name="cardAnima" xy="625,86" size="50,30" visible="false" touchable="false" url="ui://3bfrwj0h8th37l" autoSize="true">
<gearDisplay controller="state" pages="1"/>
</loader>
<text id="n27" name="remaining_card" xy="596,141" size="141,27" fontSize="20" color="#ffffff" align="center" autoSize="none" text="">
<gearDisplay controller="state" pages="1,3"/>
</text>
<component id="n151_8th3" name="player_card_info2" src="tlof70" fileName="component/Main/component/Player_card_info_2.xml" xy="980,2">
<gearDisplay controller="state" pages="1,3"/>
</component>
<component id="n61_jali" name="player_card_info1" src="tlof6h" fileName="component/Main/component/Player_card_info_1.xml" xy="0,530" size="1334,221">
<gearDisplay controller="state" pages="1,3"/>
</component>
<component id="n147_nu0l" name="player_info2" src="tlof72" fileName="component/Main/component/PlayerHead_2.xml" xy="1185,50"/>
<component id="n7" name="player_info1" src="tlof6y" fileName="component/Main/component/PlayerHead_1.xml" xy="13,598" size="189,67">
<gearXY controller="state" pages="0,1,2,3" values="621,493|13,598|615,516|10,598"/>
</component>
<component id="n32_h1uu" name="gcm_chat" src="tlof77" fileName="Gcm_chat.xml" xy="1222,468">
<gearDisplay controller="state" pages="0,1,2"/>
</component>
<component id="n34_k3io" name="btn_ready" src="tlof4" fileName="buttons/Btn_Yellow.xml" xy="575,654" group="n36_k3io">
<gearDisplay controller="action" pages="0"/>
<Button icon="ui://twf9hyqxtlof7d"/>
</component>
<component id="n35_k3io" name="btn_start" src="tlof4" fileName="buttons/Btn_Yellow.xml" xy="575,654" group="n36_k3io">
<gearDisplay controller="action" pages="1"/>
<Button icon="ui://twf9hyqxtlof7e"/>
</component>
<group id="n36_k3io" name="n36" xy="575,654" size="184,85" advanced="true">
<gearDisplay controller="state" pages="0"/>
<relation target="" sidePair="bottom-bottom"/>
</group>
<component id="n50_cnxs" name="btn_getRoomNum" src="tlofc" fileName="buttons/Btn_blue_long.xml" xy="896,656" group="n52_cnxs">
<gearDisplay controller="state" pages="0"/>
<Button icon="ui://twf9hyqxtlof7f"/>
</component>
<component id="n56_cnxs" name="mask_tips" src="tlof6g" fileName="component/Component1.xml" xy="658,480" group="n52_cnxs"/>
<group id="n52_cnxs" name="n52" xy="658,480" size="522,256"/>
<component id="n57_rayb" name="panel_record" src="tlof7g" fileName="component/record/Record.xml" xy="379,435" alpha="0.5">
<gearDisplay controller="state" pages="3"/>
</component>
<text id="n58_zzcq" name="tex_version" xy="1200,704" size="130,38" fontSize="30" color="#ffffff" align="center" autoSize="none" text="v2.0.0">
<gearDisplay controller="state" pages="0,1,2"/>
<relation target="n32_h1uu" sidePair="top-bottom"/>
</text>
<text id="n146_lr5d" name="time" xy="655,294" size="10,6" visible="false" fontSize="0" color="#cccccc" align="center" leading="0" autoSize="none" text="">
<gearDisplay controller="state" pages="1,3"/>
</text>
<component id="n149_qpk6" name="btn_reset" src="tlof61" fileName="component/Main/component/Folder/component/phone_info/Btn_reset.xml" xy="35,432" size="80,80">
<gearDisplay controller="state" pages="1,2"/>
</component>
<component id="n24" name="right_panel" src="tlof6a" fileName="component/Main/component/Folder/RightPanel.xml" xy="377,6" group="n150_8th3">
<gearDisplay controller="state" pages="0,1,2"/>
</component>
<component id="n33_hp0b" name="btn_back_lobby" src="tlof5z" fileName="component/Main/component/Folder/component/phone_info/Btn_back_lobby.xml" xy="412,7" group="n150_8th3">
<gearDisplay controller="state" pages="0,3"/>
</component>
<component id="n37_kba2" name="roominfo_panel1" src="tlof7q" fileName="component/Main/RoomInfoPanel1.xml" xy="487,10" size="135,67" group="n150_8th3" touchable="false"/>
<component id="n31_h1uu" name="roominfo_panel" src="tlof7q" fileName="component/Main/RoomInfoPanel1.xml" xy="487,10" group="n150_8th3" visible="false"/>
<component id="n46_u4l2" name="btn_rule" src="tlof5x" fileName="component/Main/component/Folder/component/phone_info/Btn_log.xml" xy="790,6" group="n150_8th3"/>
<group id="n150_8th3" name="n150" xy="377,6" size="580,98"/>
<image id="n152_8th3" name="n152" src="tlof6b" fileName="component/Main/images/di00.png" xy="377,6" size="580,86">
<gearDisplay controller="state" pages="3"/>
</image>
<text id="n42_lryk" name="tex_round" xy="607,110" size="119,27" group="n154_r1mo" fontSize="20" color="#ffffff" align="center" autoSize="none" text="剩余 5 张牌 1/8局">
<gearDisplay controller="state" pages="1,3"/>
</text>
<group id="n154_r1mo" name="n154" xy="607,110" size="119,27" advanced="true">
<gearDisplay controller="jushu" pages="1"/>
</group>
</displayList>
<transition name="outcard1">
<item time="0" type="XY" target="n153_8th3" tween="true" startValue="625.3,86.3" endValue="494.58,177.69" duration="4"/>
</transition>
<transition name="outcard2">
<item time="0" type="XY" target="n153_8th3" tween="true" startValue="625.3,86.3" endValue="916,108.27" duration="4"/>
</transition>
</component>

View File

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1334,750" designImage="ui://3vytbifonu0l2f" designImageOffsetX="-200" designImageOffsetY="-100">
<controller name="state" pages="0,准备状态,1,游戏状态,2,回合间状态,3,回放状态" selected="1"/>
<controller name="sdk" pages="0,,1," selected="0"/>
<controller name="action" pages="2,空,0,准备,1,开始" selected="0"/>
<controller name="jushu" pages="0,,1," selected="0"/>
<displayList>
<image id="n148_qpk6" name="n148" src="tlof6b" xy="377,-1" size="580,98">
<gearDisplay controller="state" pages="3"/>
</image>
<image id="n65_q9kx" name="n65" src="tlof75" xy="535,130" size="262,70" alpha="0.6">
<gearDisplay controller="state" pages="1,3"/>
</image>
<component id="n12" name="btn_wxyqhy" src="tlofa" xy="448,258" group="n13">
<gearDisplay controller="sdk" pages="0"/>
<relation target="" sidePair="middle-middle"/>
</component>
<group id="n13" name="n13" xy="448,258" size="438,147" advanced="true">
<gearDisplay controller="state" pages="0"/>
</group>
<text id="n27" name="remaining_card" xy="604,133" size="124,27" fontSize="20" color="#ffffff" align="center" autoSize="none" text="">
<gearDisplay controller="state" pages="1,3"/>
</text>
<loader id="n155_8th3" name="cardAnima" xy="625,86" size="84,249" visible="false" touchable="false">
<gearDisplay controller="state" pages="1"/>
</loader>
<component id="n62_jali" name="player_card_info2" src="tlof70" xy="981,2">
<gearDisplay controller="state" pages="1,3"/>
</component>
<component id="n64_jali" name="player_card_info3" src="tlof71" xy="155,2">
<gearDisplay controller="state" pages="1,3"/>
</component>
<component id="n61_jali" name="player_card_info1" src="tlof6h" xy="0,530" size="1334,221">
<gearDisplay controller="state" pages="1,3"/>
</component>
<component id="n18" name="player_info2" src="tlof72" xy="1185,50">
<gearXY controller="state" pages="0,1,3" values="1015,213|1185,50|1188,42" default="1157,213"/>
</component>
<component id="n16" name="player_info3" src="tlof74" xy="2,50" size="136,146">
<gearXY controller="state" pages="0,1,3" values="158,212|2,50|2,42" default="28,212"/>
</component>
<component id="n7" name="player_info1" src="tlof6y" xy="11,595" size="189,67">
<gearXY controller="state" pages="0,1,2,3" values="609,482|11,595|615,516|10,598"/>
</component>
<component id="n32_h1uu" name="gcm_chat" src="tlof77" xy="1238,487">
<gearDisplay controller="state" pages="0,1,2"/>
</component>
<component id="n50_cnxs" name="btn_getRoomNum" src="tlofc" xy="896,655" group="n149_qpk6">
<gearDisplay controller="state" pages="0"/>
<Button icon="ui://twf9hyqxtlof7f"/>
</component>
<component id="n56_cnxs" name="mask_tips" src="tlof6g" xy="658,479" group="n149_qpk6"/>
<group id="n149_qpk6" name="n149" xy="658,479" size="522,256"/>
<component id="n34_k3io" name="btn_ready" src="tlof4" xy="575,654" group="n36_k3io">
<gearDisplay controller="action" pages="0"/>
<Button icon="ui://twf9hyqxtlof7d"/>
</component>
<component id="n35_k3io" name="btn_start" src="tlof4" xy="575,654" group="n36_k3io">
<gearDisplay controller="action" pages="1"/>
<Button icon="ui://twf9hyqxtlof7e"/>
</component>
<group id="n36_k3io" name="n36" xy="575,654" size="184,85" advanced="true" collapsed="true">
<gearDisplay controller="state" pages="0"/>
<relation target="" sidePair="bottom-bottom"/>
</group>
<text id="n58_zzcq" name="tex_version" xy="1206,703" size="130,38" fontSize="30" color="#ffffff" align="center" autoSize="none" text="v2.0.0">
<gearDisplay controller="state" pages="0,1,2"/>
<relation target="n32_h1uu" sidePair="top-bottom"/>
</text>
<component id="n147_roef" name="btn_distance" src="tlof5f" xy="18,357">
<gearDisplay controller="state" pages="0,1,2"/>
</component>
<component id="n57_rayb" name="panel_record" src="tlof7g" xy="379,435" alpha="0.5">
<gearDisplay controller="state" pages="3"/>
</component>
<component id="n153_qpk6" name="btn_reset" src="tlof61" xy="18,455" size="80,80">
<gearDisplay controller="state" pages="1,2"/>
</component>
<text id="n146_lr5d" name="time" xy="628,184" size="10,6" group="n152_qpk6" visible="false" fontSize="0" color="#cccccc" align="center" leading="0" autoSize="none" text="">
<gearDisplay controller="state" pages="1,3"/>
</text>
<component id="n31_h1uu" name="roominfo_panel" src="tlof7q" xy="611,159" size="151,75" group="n152_qpk6" visible="false" touchable="false"/>
<group id="n152_qpk6" name="n152" xy="611,159" size="151,75" visible="false" advanced="true"/>
<component id="n24" name="right_panel" src="tlof6a" xy="377,6" group="n154_qpk6">
<gearDisplay controller="state" pages="0,1,2"/>
</component>
<component id="n37_kba2" name="roominfo_panel1" src="tlof7q" xy="487,10" size="150,77" group="n154_qpk6" touchable="false"/>
<component id="n33_hp0b" name="btn_back_lobby" src="tlof5z" xy="413,7" group="n154_qpk6">
<gearDisplay controller="state" pages="0,3"/>
</component>
<component id="n151_qpk6" name="btn_rule" src="tlof5x" xy="780,7" group="n154_qpk6"/>
<group id="n154_qpk6" name="n154" xy="377,6" size="580,98"/>
<text id="n42_lryk" name="tex_round" xy="607,104" size="119,27" group="n156_f55q" fontSize="20" color="#ffffff" align="center" autoSize="none" text=" 1/8局">
<gearDisplay controller="state" pages="1,3"/>
</text>
<group id="n156_f55q" name="n156" xy="607,104" size="119,27" advanced="true">
<gearDisplay controller="jushu" pages="1"/>
</group>
</displayList>
<transition name="outcard1">
<item time="0" type="XY" target="n155_8th3" tween="true" startValue="625,86" endValue="494.55,166.45" duration="4"/>
</transition>
<transition name="outcard2">
<item time="0" type="XY" target="n155_8th3" tween="true" startValue="625,86" endValue="918,106" duration="4"/>
</transition>
<transition name="outcard3">
<item time="0" type="XY" target="n155_8th3" tween="true" startValue="625,86" endValue="348.41,106.14" duration="4"/>
</transition>
</component>

View File

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1334,750" designImage="ui://3vytbifonu0l2f" designImageOffsetX="-200" designImageOffsetY="-100">
<controller name="state" pages="0,准备状态,1,游戏状态,2,回合间状态,3,回放状态" selected="1"/>
<controller name="sdk" pages="0,,1," selected="0"/>
<controller name="action" pages="2,空,0,准备,1,开始" selected="0"/>
<controller name="jushu" pages="0,,1," selected="0"/>
<displayList>
<image id="n148_qpk6" name="n148" src="tlof6b" xy="377,-1" size="580,98">
<gearDisplay controller="state" pages="3"/>
</image>
<image id="n65_q9kx" name="n65" src="tlof75" xy="535,130" size="262,70" alpha="0.6">
<gearDisplay controller="state" pages="1,3"/>
</image>
<component id="n12" name="btn_wxyqhy" src="tlofa" xy="448,258" group="n13">
<gearDisplay controller="sdk" pages="0"/>
<relation target="" sidePair="middle-middle"/>
</component>
<group id="n13" name="n13" xy="448,258" size="438,147" advanced="true">
<gearDisplay controller="state" pages="0"/>
</group>
<text id="n27" name="remaining_card" xy="604,133" size="124,27" fontSize="20" color="#ffffff" align="center" autoSize="none" text="">
<gearDisplay controller="state" pages="1,3"/>
</text>
<loader id="n155_8th3" name="cardAnima" xy="625,86" size="84,249" visible="false" touchable="false">
<gearDisplay controller="state" pages="1"/>
</loader>
<component id="n62_jali" name="player_card_info3" src="tlof70" xy="981,2">
<gearDisplay controller="state" pages="1,3"/>
</component>
<component id="n159_f55q" name="player_card_info2" src="tlof6e" xy="0,530"/>
<component id="n64_jali" name="player_card_info4" src="tlof71" xy="155,2">
<gearDisplay controller="state" pages="1,3"/>
</component>
<component id="n61_jali" name="player_card_info1" src="tlof6h" xy="0,529" size="1334,221">
<gearDisplay controller="state" pages="1,3"/>
</component>
<component id="n18" name="player_info3" src="tlof72" xy="1185,50">
<gearXY controller="state" pages="0,1,2,3" values="1185,50|1185,50|1185,50|1188,42"/>
</component>
<component id="n16" name="player_info4" src="tlof74" xy="2,50" size="136,146">
<gearXY controller="state" pages="0,1,2,3" values="2,50|2,50|2,50|2,42"/>
</component>
<component id="n7" name="player_info1" src="tlof6y" xy="11,595" size="189,67">
<gearXY controller="state" pages="0,1,2,3" values="609,482|11,595|11,595|10,598"/>
</component>
<component id="n50_cnxs" name="btn_getRoomNum" src="tlofc" xy="896,655" group="n149_qpk6" visible="false">
<gearDisplay controller="state" pages="0"/>
<Button icon="ui://twf9hyqxtlof7f"/>
</component>
<component id="n56_cnxs" name="mask_tips" src="tlof6g" xy="658,479" group="n149_qpk6"/>
<group id="n149_qpk6" name="n149" xy="658,479" size="522,256" advanced="true"/>
<component id="n34_k3io" name="btn_ready" src="tlof4" xy="575,654" group="n36_k3io">
<gearDisplay controller="action" pages="0"/>
<Button icon="ui://twf9hyqxtlof7d"/>
</component>
<component id="n35_k3io" name="btn_start" src="tlof4" xy="575,654" group="n36_k3io">
<gearDisplay controller="action" pages="1"/>
<Button icon="ui://twf9hyqxtlof7e"/>
</component>
<group id="n36_k3io" name="n36" xy="575,654" size="184,85" advanced="true" collapsed="true">
<gearDisplay controller="state" pages="0"/>
<relation target="" sidePair="bottom-bottom"/>
</group>
<component id="n147_roef" name="btn_distance" src="tlof5f" xy="18,357">
<gearDisplay controller="state" pages="0,1,2"/>
</component>
<component id="n57_rayb" name="panel_record" src="tlof7g" xy="379,435" alpha="0.5">
<gearDisplay controller="state" pages="3"/>
</component>
<component id="n153_qpk6" name="btn_reset" src="tlof61" xy="18,455" size="80,80">
<gearDisplay controller="state" pages="1,2"/>
</component>
<text id="n146_lr5d" name="time" xy="628,184" size="10,6" group="n152_qpk6" visible="false" fontSize="0" color="#cccccc" align="center" leading="0" autoSize="none" text="">
<gearDisplay controller="state" pages="1,3"/>
</text>
<component id="n31_h1uu" name="roominfo_panel" src="tlof7q" xy="611,159" size="151,75" group="n152_qpk6" visible="false" touchable="false"/>
<group id="n152_qpk6" name="n152" xy="611,159" size="151,75" visible="false" advanced="true"/>
<component id="n24" name="right_panel" src="tlof6a" xy="377,6" group="n154_qpk6">
<gearDisplay controller="state" pages="0,1,2"/>
</component>
<component id="n37_kba2" name="roominfo_panel1" src="tlof7q" xy="487,10" size="150,77" group="n154_qpk6" touchable="false"/>
<component id="n33_hp0b" name="btn_back_lobby" src="tlof5z" xy="413,7" group="n154_qpk6">
<gearDisplay controller="state" pages="0,3"/>
</component>
<component id="n151_qpk6" name="btn_rule" src="tlof5x" xy="780,7" group="n154_qpk6"/>
<group id="n154_qpk6" name="n154" xy="377,6" size="580,98"/>
<component id="n156_f55q" name="player_info2" src="tlof72" xy="1183,544">
<gearXY controller="state" pages="0,1,2,3" values="1186,535|1183,544|1185,535|1188,535"/>
</component>
<text id="n58_zzcq" name="tex_version" xy="1197,698" size="130,38" fontSize="30" color="#ffffff" align="center" autoSize="none" text="v2.0.0">
<gearDisplay controller="state" pages="0,1,2,3"/>
</text>
<component id="n158_f55q" name="gcm_chat" src="tlof6c" xy="1147,323"/>
<text id="n42_lryk" name="tex_round" xy="607,104" size="119,27" group="n162_f55q" fontSize="20" color="#ffffff" align="center" autoSize="none" text=" 1/8局">
<gearDisplay controller="state" pages="1,3"/>
</text>
<group id="n162_f55q" name="n162" xy="607,104" size="119,27" advanced="true">
<gearDisplay controller="jushu" pages="1"/>
</group>
</displayList>
<transition name="outcard1">
<item time="0" type="XY" target="n155_8th3" tween="true" startValue="625,86" endValue="494.55,166.45" duration="4"/>
</transition>
<transition name="outcard2">
<item time="0" type="XY" target="n155_8th3" tween="true" startValue="625,86" endValue="918,106" duration="4"/>
</transition>
<transition name="outcard3">
<item time="0" type="XY" target="n155_8th3" tween="true" startValue="625,86" endValue="348.41,106.14" duration="4"/>
</transition>
</component>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="42,42">
<displayList>
<loader id="n0_lr5d" name="icon" xy="0,0" pivot="0.5,0.5" size="42,42" autoSize="true"/>
</displayList>
<transition name="t0">
<item time="0" type="Scale" target="n0_lr5d" tween="true" startValue="1.5,1.5" endValue="1,1" duration="6"/>
<item time="0" type="XY" target="n0_lr5d" tween="true" startValue="-134.05,-27.92" endValue="0,0" duration="6"/>
</transition>
<transition name="t1">
<item time="0" type="Scale" target="n0_lr5d" tween="true" startValue="1.5,1.5" endValue="1,1" duration="6"/>
<item time="0" type="XY" target="n0_lr5d" tween="true" startValue="107.99,-16.24" endValue="0,0" duration="6"/>
</transition>
</component>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="150,80" initName="roominfo_panel">
<displayList>
<text id="n1_h1uu" name="n1" xy="0,0" size="63,32" group="n5_qpk6" fontSize="25" color="#ffffff" text="房号:"/>
<text id="n2_h1uu" name="tex_roomid" xy="61,0" size="96,32" group="n5_qpk6" fontSize="25" color="#ffffff" text="2345672"/>
<text id="n3_h1uu" name="tex_gametype" xy="1,30" size="149,40" group="n5_qpk6" fontSize="25" color="#ffffff" autoSize="none" text="湘乡告胡子 "/>
<text id="n4_h1uu" name="tex_roomconfig" xy="115,4" size="10,9" group="n5_qpk6" visible="false" fontSize="1" color="#ffffff" autoSize="none" text=" "/>
<text id="n6_fc32" name="tex_times" xy="0,60" pivot="0,0.5" size="151,32" group="n5_qpk6" fontSize="25" color="#ffffff" autoSize="none" text=""/>
<group id="n5_qpk6" name="n5" xy="0,0" size="157,92"/>
</displayList>
</component>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="74,74" extention="Button">
<controller name="button" pages="0,up,1,down" selected="0"/>
<displayList>
<loader id="n3_h1uu" name="icon" xy="0,0" size="74,74" url="ui://twf9hyqxtlof68" align="center" vAlign="middle"/>
</displayList>
<Button downEffect="dark" downEffectValue="0.80"/>
</component>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="184,74">
<controller name="voice" pages="0,,1," selected="1"/>
<displayList>
<component id="n1_h1uu" name="n1" src="tlof6d" xy="110,0">
<Button icon="ui://twf9hyqxtlof69"/>
</component>
<component id="n2_h1uu" name="n2" src="tlof64" xy="7,-47">
<gearDisplay controller="voice" pages="1"/>
</component>
<component id="n3_h1uu" name="btn_record" src="tlof6d" xy="8,0"/>
</displayList>
</component>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="580,98">
<controller name="xinhao" pages="0,,1," selected="0"/>
<controller name="log" pages="0,,1," selected="0"/>
<displayList>
<component id="n20_qpk6" name="btn_log" src="tlof5x" xy="437,2" size="59,73" group="n19_qpk6" visible="false" touchable="false"/>
<image id="n15_qpk6" name="n15" src="tlof6b" xy="0,0" size="580,98" group="n19_qpk6"/>
<component id="n1" name="btn_setting" src="tlof5k" xy="496,1" size="71,94" group="n19_qpk6"/>
<component id="n5" name="pb_batteryLevel" src="tlof5m" xy="281,11" group="n19_qpk6" touchable="false">
<ProgressBar value="62" max="100"/>
</component>
<component id="n6" name="gcm_xinhao" src="tlof5p" xy="280,50" size="106,22" group="n19_qpk6" touchable="false">
<gearDisplay controller="xinhao" pages="0"/>
</component>
<component id="n9" name="gcm_wifi" src="tlof5t" xy="280,49" group="n19_qpk6" aspect="true" touchable="false">
<gearDisplay controller="xinhao" pages="1"/>
</component>
<text id="n7" name="tex_data" xy="325,50" size="46,34" group="n19_qpk6" visible="false" fontSize="22" color="#ffffff" align="center" vAlign="middle" autoSize="none" text="2017-07-09"/>
<text id="n12_yyhx" name="tex_time" xy="326,4" size="59,32" group="n19_qpk6" fontSize="25" color="#ffffff" vAlign="middle" text="19:30"/>
<group id="n19_qpk6" name="n19" xy="0,0" size="580,98"/>
</displayList>
</component>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="77,44">
<displayList>
<image id="n4_h1uu" name="n4" src="tlof65" xy="0,0"/>
<image id="n1" name="n1" src="tlof66" xy="0,4"/>
<image id="n2" name="n2" src="tlof67" xy="0,1"/>
</displayList>
<transition name="t0" autoPlay="true" autoPlayRepeat="-1">
<item time="0" type="Visible" target="n2" value="false"/>
<item time="0" type="Visible" target="n1" value="false"/>
<item time="0" type="Visible" target="n4_h1uu" value="false"/>
<item time="10" type="Visible" target="n1" value="true"/>
<item time="20" type="Visible" target="n2" value="true"/>
<item time="32" type="Visible" target="n4_h1uu" value="true"/>
<item time="44" type="Visible" target="n4_h1uu" value="true"/>
</transition>
</component>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="59,89" extention="Button" initName="btn_back_lobby">
<controller name="button" pages="0,up,1,down" selected="0"/>
<displayList>
<image id="n3_hp0b" name="n3" src="tlof60" xy="5,0" pivot="0.5,0.5" size="50,48" aspect="true"/>
<text id="n4_8th3" name="n4" xy="0,55" size="59,34" fontSize="20" color="#ffffff" align="center" autoSize="none" text="返回"/>
</displayList>
<Button downEffect="dark" downEffectValue="0.80"/>
</component>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="59,89" extention="Button" initName="btn_back_lobby">
<controller name="button" pages="0,up,1,down" selected="0"/>
<displayList>
<image id="n3_hp0b" name="n3" src="tlof60" fileName="component/Main/component/Folder/images/phone_info/game_icon_01.png" xy="5,0" pivot="0.5,0.5" size="50,48" aspect="true"/>
<text id="n4_8th3" name="n4" xy="0,55" size="59,34" fontSize="20" color="#ffffff" align="center" autoSize="none" text="解散"/>
</displayList>
<Button downEffect="dark" downEffectValue="0.80"/>
</component>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="70,89" extention="Button">
<displayList>
<image id="n1" name="n1" src="tlof5y" xy="12,0" pivot="0.5,0.5" size="45,50" aspect="true"/>
<text id="n2_8th3" name="n2" xy="5,55" size="60,34" fontSize="20" color="#ffffff" align="center" autoSize="none" text="说明"/>
</displayList>
<Button downEffect="dark" downEffectValue="0.80"/>
</component>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="80,80" extention="Button" initName="btn_back_lobby">
<controller name="button" pages="0,up,1,down" selected="0"/>
<displayList>
<image id="n3_hp0b" name="n3" src="tlof62" xy="-2,0" pivot="0.5,0"/>
</displayList>
<Button downEffect="dark" downEffectValue="0.80"/>
</component>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="70,89" extention="Button">
<displayList>
<image id="n1" name="n1" src="tlof5l" xy="10,0" pivot="0.5,0.5" size="50,50" aspect="true"/>
<text id="n2_8th3" name="n2" xy="5,55" size="59,34" fontSize="20" color="#ffffff" align="center" autoSize="none" text="设置"/>
</displayList>
<Button downEffect="dark" downEffectValue="0.80"/>
</component>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="106,26">
<controller name="c1" pages="0,,1,,2," selected="0"/>
<displayList>
<image id="n4_h1uu" name="n4" src="tlof5q" xy="17,0" color="#00ff00">
<gearColor controller="c1" pages="1,2" values="#666666|#666666" default="#00ff00"/>
</image>
<image id="n5_h1uu" name="n5" src="tlof5r" xy="0,0" color="#00ff00">
<gearColor controller="c1" pages="0,1" values="#00ff00|#ffff00" default="#666666"/>
</image>
<image id="n6_h1uu" name="n6" src="tlof5s" xy="-17,0" color="#00ff00">
<gearColor controller="c1" pages="0,1,2" values="#00ff00|#ffff00|#ff0000"/>
</image>
<text id="n7_7paf" name="n7" xy="21,0" size="85,24" fontSize="18" color="#00ff00" text="10 ms">
<gearColor controller="c1" pages="0,1,2" values="#00ff00,#000000|#ffff00,#000000|#ff0000,#000000"/>
<relation target="n5_h1uu" sidePair="middle-middle"/>
</text>
</displayList>
<relation target="n7_7paf" sidePair="rightext-right"/>
</component>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="27,20">
<controller name="c1" pages="0,,1,,2,,3,,4," selected="0"/>
<displayList>
<image id="n4_h1uu" name="n4" src="tlof5u" xy="0,0"/>
<image id="n5_h1uu" name="n5" src="tlof5v" xy="0,0">
<gearDisplay controller="c1" pages="2,3,4"/>
</image>
<image id="n6_h1uu" name="n6" src="tlof5w" xy="0,0">
<gearDisplay controller="c1" pages="4"/>
</image>
</displayList>
</component>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="34,16" extention="ProgressBar">
<displayList>
<image id="n5_h1uu" name="n5" src="tlof5n" xy="0,0"/>
<image id="n4" name="bar" src="tlof5o" xy="0,0" fillMethod="hz"/>
</displayList>
<ProgressBar/>
</component>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="236,119" opaque="false" initName="gcm_info">
<controller name="room_owner" pages="0,,1," selected="1"/>
<controller name="bank" pages="0,,1," selected="1"/>
<controller name="read" pages="0,,1," selected="0"/>
<controller name="offline" pages="0,,1," selected="0"/>
<controller name="mask_voice" pages="0,,1," selected="0"/>
<controller name="dismiss_room" pages="0,,1," selected="0"/>
<controller name="time" pages="0,,1," selected="0"/>
<controller name="huxi" pages="0,,1," selected="0"/>
<controller name="tuo" pages="0,,1," selected="0"/>
<controller name="piao" pages="0,,1," selected="0"/>
<displayList>
<image id="n28_e54q" name="n28" src="tlof2u" xy="-1,-51" size="100,98" group="n33_e7qn" aspect="true"/>
<image id="n34_u4l2" name="zhuang" src="e54q3w" pkg="27vd145b" xy="-40,-92" group="n33_e7qn">
<gearDisplay controller="time" pages="1"/>
</image>
<component id="n5" name="btn_head" src="tlof32" xy="10,-41" size="79,79" group="n33_e7qn" aspect="true"/>
<graph id="n32_kba2" name="offLine" xy="4,-47" size="90,90" group="n33_e7qn" aspect="true" touchable="false" type="eclipse" lineSize="0" fillColor="#b3000000">
<gearDisplay controller="offline" pages="1"/>
</graph>
<text id="n37_aawn" name="n37" xy="16,-17" size="65,37" group="n33_e7qn" fontSize="30" color="#ffffff" text="离线">
<gearDisplay controller="offline" pages="1"/>
</text>
<image id="n6" name="fangzhu" src="tlof6m" xy="-2,6" group="n33_e7qn">
<gearDisplay controller="room_owner" pages="1"/>
</image>
<component id="n36_h4ge" name="n36" pkg="27vd145b" xy="9,-41" group="n33_e7qn" touchable="false">
<gearDisplay controller="dismiss_room" pages="1"/>
</component>
<image id="n57_fnpw" name="n57" src="tlof6n" xy="65,-53" group="n33_e7qn">
<gearDisplay controller="bank" pages="1"/>
</image>
<group id="n33_e7qn" name="n33" xy="-40,-92" size="180,180"/>
<image id="n8" name="ready" src="tlof6r" xy="133,-58">
<gearDisplay controller="read" pages="1"/>
</image>
<component id="n29_e54q" name="info" src="tlof5i" xy="-9,57"/>
<component id="n31_e54q" name="chat" src="tlof6z" xy="-18,-137" alpha="0"/>
<component id="n27_e54q" name="face" src="tlof6q" xy="58,-141" alpha="0"/>
<loader id="n39_oqwm" name="icon" xy="23,-28" size="53,52" visible="false" align="center" vAlign="middle"/>
<image id="n40_jali" name="n40" src="tlof6p" xy="-54,-154">
<gearDisplay controller="mask_voice" pages="1"/>
</image>
<component id="n41_jali" name="n41" src="tlof6s" xy="-8,-128">
<gearDisplay controller="mask_voice" pages="1"/>
</component>
<image id="n48_m25s" name="n48" src="tlof6w" xy="-10,109" size="139,40" group="n51_m25s"/>
<text id="n49_m25s" name="huxi" xy="65,109" size="48,38" group="n51_m25s" fontSize="28" color="#ffffff" align="center" vAlign="middle" autoSize="none" singleLine="true" text="0&#xA;"/>
<text id="n50_m25s" name="n50" xy="2,110" size="68,38" group="n51_m25s" fontSize="25" color="#ffffff" align="center" vAlign="middle" autoSize="none" singleLine="true" text="胡息:&#xA;"/>
<group id="n51_m25s" name="n51" xy="-10,109" size="139,40" advanced="true" collapsed="true">
<gearDisplay controller="huxi" pages="1"/>
</group>
<image id="n52_nu0l" name="n52" src="tlof6x" xy="-2,20">
<gearDisplay controller="tuo" pages="1"/>
</image>
<image id="n54_r1mo" name="n54" src="dafga1" xy="-20,21" group="n56_r1mo" pkg="442j0uep">
<gearDisplay controller="piao" pages="1"/>
</image>
<text id="n55_r1mo" name="piaotext" xy="18,26" size="69,37" group="n56_r1mo" fontSize="15" color="#ffd554" align="center" vAlign="middle" autoSize="none" text="飘鸟 10&#xA;">
<gearDisplay controller="piao" pages="1"/>
</text>
<group id="n56_r1mo" name="n56" xy="-20,21" size="148,42"/>
</displayList>
</component>

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="144,151" opaque="false" initName="gcm_info">
<controller name="room_owner" pages="0,,1," selected="1"/>
<controller name="bank" pages="0,,1," selected="1"/>
<controller name="read" pages="0,,1," selected="0"/>
<controller name="offline" pages="0,,1," selected="0"/>
<controller name="mask_voice" pages="0,,1," selected="0"/>
<controller name="time" pages="0,,1," selected="0"/>
<controller name="huxi" pages="0,,1," selected="0"/>
<controller name="tuo" pages="0,,1," selected="0"/>
<controller name="piao" pages="0,,1," selected="0"/>
<displayList>
<image id="n34_e7qn" name="n34" src="tlof2u" xy="18,0" size="100,98" group="n39_e7qn" aspect="true"/>
<image id="n38_e7qn" name="zhuang" src="e54q3w" pkg="27vd145b" xy="-20,-38" group="n39_e7qn" aspect="true">
<gearDisplay controller="time" pages="1"/>
</image>
<component id="n35_e7qn" name="btn_head" src="tlof32" xy="29,10" size="79,79" group="n39_e7qn" aspect="true"/>
<graph id="n36_e7qn" name="offLine" xy="23,4" size="90,90" group="n39_e7qn" aspect="true" touchable="false" type="eclipse" lineSize="0" fillColor="#b3000000">
<gearDisplay controller="offline" pages="1"/>
</graph>
<image id="n37_e7qn" name="fangzhu" src="tlof6m" xy="17,53" group="n39_e7qn">
<gearDisplay controller="room_owner" pages="1"/>
</image>
<text id="n42_aawn" name="n42" xy="36,33" size="65,37" group="n39_e7qn" fontSize="30" color="#ffffff" text="离线">
<gearDisplay controller="offline" pages="1"/>
</text>
<image id="n58_fnpw" name="n58" src="tlof6n" xy="83,1" group="n39_e7qn">
<gearDisplay controller="bank" pages="1"/>
</image>
<group id="n39_e7qn" name="n39" xy="-20,-38" size="180,180"/>
<image id="n8" name="ready" src="tlof6r" xy="-135,50">
<gearDisplay controller="read" pages="1"/>
</image>
<component id="n29_e54q" name="info" src="tlof5i" xy="4,101" size="140,52"/>
<loader id="n44_oqwm" name="icon" xy="44,25" size="50,50" visible="false" align="center" vAlign="middle"/>
<image id="n46_jali" name="n46" src="tlof6p" xy="-22,-89">
<gearDisplay controller="mask_voice" pages="1"/>
</image>
<component id="n45_jali" name="n45" src="tlof6s" xy="27,-63">
<gearDisplay controller="mask_voice" pages="1"/>
</component>
<image id="n47_lr5d" name="n47" src="tlof6w" xy="4,-38" size="139,40" group="n49_lr5d"/>
<text id="n48_lr5d" name="huxi" xy="79,-37" size="48,38" group="n49_lr5d" fontSize="28" color="#ffffff" align="center" vAlign="middle" autoSize="none" singleLine="true" text="0&#xA;"/>
<text id="n53_m25s" name="n53" xy="16,-36" size="68,38" group="n49_lr5d" fontSize="25" color="#ffffff" align="center" vAlign="middle" autoSize="none" singleLine="true" text="胡息:&#xA;"/>
<group id="n49_lr5d" name="n49" xy="4,-38" size="139,40" advanced="true">
<gearDisplay controller="huxi" pages="1"/>
</group>
<image id="n54_nu0l" name="n54" src="tlof6x" xy="18,67">
<gearDisplay controller="tuo" pages="1"/>
</image>
<component id="n31_e54q" name="chat" src="tlof73" xy="-147,1" alpha="0"/>
<component id="n27_e54q" name="face" src="tlof6q" xy="-131,4" alpha="0"/>
<image id="n55_r1mo" name="n55" src="dafga1" xy="-4,65" group="n57_r1mo" pkg="442j0uep">
<gearDisplay controller="piao" pages="1"/>
</image>
<text id="n56_r1mo" name="piaotext" xy="33,70" size="69,37" group="n57_r1mo" fontSize="15" color="#ffd554" align="center" vAlign="middle" autoSize="none" text="飘鸟 10&#xA;">
<gearDisplay controller="piao" pages="1"/>
</text>
<group id="n57_r1mo" name="n57" xy="-4,65" size="148,42"/>
</displayList>
<transition name="t0" autoPlay="true" autoPlayRepeat="-1"/>
</component>

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="242,100" opaque="false" initName="gcm_info">
<controller name="room_owner" pages="0,,1," selected="1"/>
<controller name="bank" pages="0,,1," selected="1"/>
<controller name="read" pages="0,,1," selected="0"/>
<controller name="offline" pages="0,,1," selected="0"/>
<controller name="mask_voice" pages="0,,1," selected="0"/>
<controller name="huxi" pages="0,,1," selected="0"/>
<controller name="time" pages="0,,1," selected="0"/>
<controller name="tuo" pages="0,,1," selected="0"/>
<controller name="piao" pages="0,,1," selected="0"/>
<displayList>
<image id="n32_e7qn" name="n32" src="tlof2u" xy="2,3" size="100,98" group="n37_e7qn" aspect="true"/>
<image id="n36_e7qn" name="zhuang" src="e54q3w" pkg="27vd145b" xy="-37,-40" group="n37_e7qn" aspect="true">
<gearDisplay controller="time" pages="1"/>
</image>
<component id="n33_e7qn" name="btn_head" src="tlof32" xy="13,12" size="79,79" group="n37_e7qn" aspect="true"/>
<graph id="n34_e7qn" name="offLine" xy="7,7" size="90,90" group="n37_e7qn" aspect="true" touchable="false" type="eclipse" lineSize="0" fillColor="#b3000000">
<gearDisplay controller="offline" pages="1"/>
</graph>
<image id="n35_e7qn" name="fangzhu" src="tlof6m" xy="3,55" group="n37_e7qn">
<gearDisplay controller="room_owner" pages="1"/>
</image>
<text id="n40_aawn" name="n40" xy="20,33" size="65,37" group="n37_e7qn" fontSize="30" color="#ffffff" text="离线">
<gearDisplay controller="offline" pages="1"/>
</text>
<image id="n56_fnpw" name="n56" src="tlof6n" xy="62,1" group="n37_e7qn">
<gearDisplay controller="bank" pages="1"/>
</image>
<group id="n37_e7qn" name="n37" xy="-37,-40" size="180,180"/>
<component id="n31_e54q" name="chat" src="tlof6o" xy="-16,74" size="163,121" alpha="0"/>
<component id="n27_e54q" name="face" src="tlof6q" xy="100,72" alpha="0"/>
<image id="n8" name="ready" src="tlof6r" xy="103,80">
<gearDisplay controller="read" pages="1"/>
</image>
<component id="n29_e54q" name="info" src="tlof5i" xy="102,22"/>
<loader id="n42_oqwm" name="icon" xy="28,26" size="50,50" visible="false" align="center" vAlign="middle"/>
<image id="n43_jali" name="n43" src="tlof6p" xy="-35,209" scale="1,-1">
<gearDisplay controller="mask_voice" pages="1"/>
</image>
<component id="n44_jali" name="n44" src="tlof6s" xy="13,140">
<gearDisplay controller="mask_voice" pages="1"/>
</component>
<image id="n45_nu0l" name="n45" src="tlof6w" xy="100,78" size="139,40" group="n48_nu0l"/>
<text id="n46_nu0l" name="huxi" xy="175,79" size="48,38" group="n48_nu0l" fontSize="28" color="#ffffff" align="center" vAlign="middle" autoSize="none" singleLine="true" text="0&#xA;"/>
<text id="n47_nu0l" name="n47" xy="112,80" size="68,38" group="n48_nu0l" fontSize="25" color="#ffffff" align="center" vAlign="middle" autoSize="none" singleLine="true" text="胡息:&#xA;"/>
<group id="n48_nu0l" name="n48" xy="100,78" size="139,40" advanced="true">
<gearDisplay controller="huxi" pages="1"/>
</group>
<image id="n52_nu0l" name="n52" src="tlof6x" xy="1,74">
<gearDisplay controller="tuo" pages="1"/>
</image>
<image id="n53_r1mo" name="n53" src="dafga1" xy="-22,70" group="n55_r1mo" pkg="442j0uep">
<gearDisplay controller="piao" pages="1"/>
</image>
<text id="n54_r1mo" name="piaotext" xy="15,75" size="69,37" group="n55_r1mo" fontSize="15" color="#ffd554" align="center" vAlign="middle" autoSize="none" text="飘鸟 10&#xA;">
<gearDisplay controller="piao" pages="1"/>
</text>
<group id="n55_r1mo" name="n55" xy="-22,70" size="148,42"/>
</displayList>
<transition name="t0" autoPlay="true" autoPlayRepeat="-1"/>
</component>

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="136,150" opaque="false" initName="gcm_info">
<controller name="room_owner" pages="0,,1," selected="1"/>
<controller name="bank" pages="0,,1," selected="1"/>
<controller name="read" pages="0,,1," selected="0"/>
<controller name="offline" pages="0,,1," selected="0"/>
<controller name="mask_voice" pages="0,,1," selected="0"/>
<controller name="time" pages="0,,1," selected="0"/>
<controller name="huxi" pages="0,,1," selected="0"/>
<controller name="tuo" pages="0,,1," selected="0"/>
<controller name="piao" pages="0,,1," selected="0"/>
<displayList>
<image id="n32_e7qn" name="n32" src="tlof2u" xy="11,1" size="100,98" group="n37_e7qn" aspect="true"/>
<image id="n36_e7qn" name="zhuang" src="e54q3w" pkg="27vd145b" xy="-29,-41" group="n37_e7qn" aspect="true">
<gearDisplay controller="time" pages="1"/>
</image>
<component id="n33_e7qn" name="btn_head" src="tlof32" xy="22,11" size="79,79" group="n37_e7qn" aspect="true"/>
<graph id="n34_e7qn" name="offLine" xy="17,4" size="90,90" group="n37_e7qn" aspect="true" touchable="false" type="eclipse" lineSize="0" fillColor="#b3000000">
<gearDisplay controller="offline" pages="1"/>
</graph>
<text id="n40_aawn" name="n40" xy="30,34" size="65,37" group="n37_e7qn" fontSize="30" color="#ffffff" text="离线">
<gearDisplay controller="offline" pages="1"/>
</text>
<image id="n35_e7qn" name="fangzhu" src="tlof6m" xy="7,52" group="n37_e7qn">
<gearDisplay controller="room_owner" pages="1"/>
</image>
<image id="n59_fnpw" name="n59" src="tlof6n" xy="74,3" group="n37_e7qn">
<gearDisplay controller="bank" pages="1"/>
</image>
<group id="n37_e7qn" name="n37" xy="-29,-41" size="180,180"/>
<image id="n8" name="ready" src="tlof6r" xy="122,50">
<gearDisplay controller="read" pages="1"/>
</image>
<component id="n29_e54q" name="info" src="tlof5i" xy="-2,98" size="140,52"/>
<loader id="n42_oqwm" name="icon" xy="38,27" size="50,50" visible="false" align="center" vAlign="middle"/>
<image id="n43_jali" name="n43" src="tlof6p" xy="-28,-86">
<gearDisplay controller="mask_voice" pages="1"/>
</image>
<component id="n44_jali" name="n44" src="tlof6s" xy="23,-60">
<gearDisplay controller="mask_voice" pages="1"/>
</component>
<image id="n51_m25s" name="n51" src="tlof6w" xy="-1,-38" size="139,40" group="n54_m25s"/>
<text id="n52_m25s" name="huxi" xy="73,-38" size="48,38" group="n54_m25s" fontSize="28" color="#ffffff" align="center" vAlign="middle" autoSize="none" singleLine="true" text="0&#xA;"/>
<text id="n53_m25s" name="n53" xy="10,-37" size="68,38" group="n54_m25s" fontSize="25" color="#ffffff" align="center" vAlign="middle" autoSize="none" singleLine="true" text="胡息:&#xA;"/>
<group id="n54_m25s" name="n54" xy="-1,-38" size="139,40" advanced="true">
<gearDisplay controller="huxi" pages="1"/>
</group>
<image id="n55_nu0l" name="n55" src="tlof6x" xy="14,64">
<gearDisplay controller="tuo" pages="1"/>
</image>
<component id="n31_e54q" name="chat" src="tlof6z" xy="91,1" alpha="0"/>
<component id="n27_e54q" name="face" src="tlof6q" xy="136,5" alpha="0"/>
<image id="n56_r1mo" name="n56" src="dafga1" xy="-9,63" group="n58_r1mo" pkg="442j0uep">
<gearDisplay controller="piao" pages="1"/>
</image>
<text id="n57_r1mo" name="piaotext" xy="28,68" size="69,37" group="n58_r1mo" fontSize="15" color="#ffd554" align="center" vAlign="middle" autoSize="none" text="飘鸟 10&#xA;">
<gearDisplay controller="piao" pages="1"/>
</text>
<group id="n58_r1mo" name="n58" xy="-9,63" size="148,42"/>
</displayList>
<transition name="t0" autoPlay="true" autoPlayRepeat="-1"/>
</component>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1334,217" opaque="false" initName="player_card_info">
<controller name="chupai" pages="0,,1," selected="1"/>
<displayList>
<list id="n36_lr5d" name="windcard_list" xy="960,-160" size="369,81" layout="flow_hz" lineGap="5" colGap="5" defaultItem="ui://twf9hyqxtlof6f" align="right" vAlign="middle"/>
<list id="n35_lr5d" name="area_fz_list" xy="570,-327" size="200,135" layout="row" selectionMode="none" lineGap="3" colGap="5" defaultItem="ui://v6yvqp7wlr5d30" align="center"/>
<component id="n27" name="area_outcard_list" src="tlof6g" xy="490,-350" size="65,84"/>
<component id="n25" name="area_handcard_list" src="tlof6g" xy="160,81" size="1039,131"/>
<component id="n37_n1ry" name="mask_liangpai" src="tlof6g" xy="600,-250" size="5,5"/>
<component id="n38_ey1o" name="n38" src="tlof6i" xy="116,-295">
<gearDisplay controller="chupai" pages="1"/>
</component>
</displayList>
<transition name="t0">
<item time="0" type="XY" target="n27" tween="true" startValue="490,-350" endValue="1136.53,-161.41" duration="4"/>
<item time="7" type="XY" target="n27" value="490,-350"/>
</transition>
</component>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="200,750" opaque="false" initName="player_card_info">
<displayList>
<component id="n52_oske" name="area_handcard_list" src="tlof6g" xy="-160,358" size="300,175" touchable="false"/>
<list id="n47_lr5d" name="area_fz_list" xy="-110,45" size="315,173" layout="row" scroll="horizontal" colGap="5" defaultItem="ui://v6yvqp7wlr5d30" align="right"/>
<list id="n48_lr5d" name="windcard_list" xy="3,215" size="339,78" layout="flow_hz" selectionMode="none" scroll="horizontal" lineGap="5" colGap="5" defaultItem="ui://twf9hyqxtlof6f" align="right"/>
<component id="n25" name="area_outcard_list" src="tlof6g" xy="-63,105" size="67,182" touchable="false"/>
<component id="n50_n1ry" name="mask_liangpai" src="tlof6g" xy="-100,150" size="5,5"/>
</displayList>
<transition name="t0">
<item time="0" type="XY" target="n25" tween="true" startValue="-63,105" endValue="121.45,295" duration="4"/>
<item time="7" type="XY" target="n25" value="-63,105"/>
</transition>
</component>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1334,216" pivot="0.3,0" opaque="false" initName="player_card_info">
<displayList>
<list id="n26_nu0l" name="windcard_list" xy="965,-122" size="369,101" layout="flow_hz" lineGap="5" colGap="5" defaultItem="ui://twf9hyqxtlof6f" align="right"/>
<list id="n27_nu0l" name="area_fz_list" xy="981,13" size="200,135" layout="row" selectionMode="none" lineGap="3" colGap="5" defaultItem="ui://v6yvqp7wlr5d30" align="right"/>
<component id="n33_nu0l" name="mask_liangpai" src="tlof6g" xy="898,-249" size="5,5"/>
<component id="n37_nu0l" name="area_handcard_list" src="tlof6g" xy="799,-182" size="300,175" touchable="false"/>
<component id="n35_nu0l" name="area_outcard_list" src="tlof6g" xy="979,-326" size="65,84"/>
</displayList>
<transition name="t0">
<item time="0" type="XY" target="n35_nu0l" tween="true" startValue="979,-326" endValue="1137,-123.73" duration="4"/>
<item time="7" type="XY" target="n35_nu0l" value="979,-326"/>
</transition>
</component>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="233,750" opaque="false" initName="player_card_info">
<displayList>
<component id="n31_oske" name="area_handcard_list" src="tlof6g" xy="36,358" size="300,175" touchable="false"/>
<list id="n27_lr5d" name="area_fz_list" xy="-20,45" size="254,180" layout="row" selectionMode="none" colGap="5" defaultItem="ui://v6yvqp7wlr5d30"/>
<list id="n28_lr5d" name="windcard_list" xy="-144,215" size="334,109" layout="flow_hz" lineGap="1" colGap="5" defaultItem="ui://twf9hyqxtlof6f"/>
<component id="n22" name="area_outcard_list" src="tlof6g" xy="209,105" size="117,228" touchable="false"/>
<component id="n29_n1ry" name="mask_liangpai" src="tlof6g" xy="0,150" size="10,10"/>
</displayList>
<transition name="t0">
<item time="0" type="XY" target="n22" tween="true" startValue="209,105" endValue="-42.48,300" duration="4"/>
<item time="8" type="XY" target="n22" value="209,105"/>
</transition>
</component>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1052,3">
<displayList>
<image id="n0_ey1o" name="n0" src="tlof6j" xy="0,0"/>
<image id="n1_ey1o" name="n1" src="tlof6j" xy="132,0"/>
<image id="n2_ey1o" name="n2" src="tlof6j" xy="263,0"/>
<image id="n3_ey1o" name="n3" src="tlof6j" xy="395,0"/>
<image id="n4_ey1o" name="n4" src="tlof6j" xy="527,0"/>
<image id="n5_ey1o" name="n5" src="tlof6j" xy="659,0" size="160,3"/>
<image id="n7_ey1o" name="n7" src="tlof6j" xy="952,0" size="164,3"/>
<text id="n8_ey1o" name="n8" xy="790,-10" size="194,24" fontSize="18" color="#ffffff" align="center" vAlign="middle" autoSize="none" text="按住滑动出牌"/>
<image id="n9_pzkr" name="n9" src="tlof6k" xy="1068,124" pivot="1,0" anchor="true" rotation="70"/>
</displayList>
<transition name="t0" autoPlay="true" autoPlayRepeat="-1">
<item time="0" type="Rotation" target="n9_pzkr" tween="true" startValue="45" endValue="75" duration="18"/>
</transition>
</component>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Some files were not shown because too many files have changed in this diff Show More