河池字牌

master
lingmeng 2026-05-29 14:55:31 +08:00
parent 45dae5b2cf
commit 2f0341c42b
760 changed files with 14256 additions and 78 deletions

View File

@ -13,7 +13,7 @@ function LoginController.new()
end end
local _LocalConfigAllGame = { local _LocalConfigAllGame = {
10, 13, 14, 15, 16, 17, 22, 33, 65, 66, 67, 77, 88, 10, 13, 14, 15, 16, 17, 22, 33,34, 65, 66, 67, 77, 88,
101, 102, 103, 104, 105, 106, 107, 101, 102, 103, 104, 105, 106, 107,
108, 108,
301, 201, 202, 203 301, 201, 202, 203

View File

@ -0,0 +1,500 @@
local RB_Protocol = import(".Protocol")
local FZTipList = require("main.zipai.FZData")
local RB_GameEvent = import(".RunBeard_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_RESULT1] = self.OneventResult1
self._eventmap[RB_Protocol.GAME_EVT_QIPAI] = self.OnEventQIPAI
self._eventmap[RB_Protocol.GAME_EVT_ADD_CARD] = self.OnAddCard
self._eventmap[RB_Protocol.GAME_EVENT_XIPAI] = self.OnEventXiPai
self._eventmap[RB_Protocol.GAME_EVENT_NOTIFY_XIPAI] = self.OnEventXiPaiAnim
end
function M:SendXiPaiAction(callBack)
local _data = {}
local _client = ControllerManager.GameNetClinet
_client:send(RB_Protocol.GAME_XIPAI, _data)
self.XiPaiCallBack=callBack
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)
printlog("洗牌动画===》》》》")
pt(evt_data)
local playeridList = evt_data["list"]
local isXiPai=false
local otherisXiPai = false
if playeridList and #playeridList>0 then
for i=1,#playeridList do
local p = self._room:GetPlayerById(playeridList[i])
if p== self._room.self_player then
isXiPai=true
else
otherisXiPai=true
end
end
end
self._cacheEvent:Enqueue(function()
DispatchEvent(self._dispatcher,RB_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: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
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
self._cacheEvent:Enqueue(function()
_room.self_player.handcard_list=handcards
self._room.self_player.hand_left_count = #handcards
DispatchEvent(self._dispatcher,RB_GameEvent.SendCards, p)
ControllerManager.IsSendCard=true
end)
end
function M:OnEventOutCard(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(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,RB_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,RB_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,RB_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()
p.DiceCard = 0
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,RB_GameEvent.AddCard, seat, card)
end)
end
function M:OnEventOutHint(evt_data)
self._cacheEvent:Enqueue(function()
DispatchEvent(self._dispatcher,RB_GameEvent.OutHint)
end)
end
function M:OnEventTurn(evt_data)
local seat = evt_data["seat"]
self._cacheEvent:Enqueue(function()
DispatchEvent(self._dispatcher,RB_GameEvent.EventTurn, seat)
end)
end
function M:OnEventFzTips(evt_data)
self._cacheEvent:Enqueue(function()
local tiplist = FZTipList.new()
local list = evt_data["tip_list"]
local uid = evt_data["uid"]
for i=1,#list do
local dtip = list[i]
local tip = {}
tip.id = dtip["id"]
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
DispatchEvent(self._dispatcher,RB_GameEvent.FZTips, tiplist,uid)
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
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
if p.fz_list[i].type == RB_FZType.Kan then
isNeedDelHandCard =3
for i=1,remove_num do
list_remove(_room.self_player.handcard_list,opcard[i])
end
end
remove_num= 0
p.fz_list[i].type= RB_FZType.Pao
end
end
local num =0
for i=1,#_room.self_player.handcard_list do
if card == _room.self_player.handcard_list[i] then
num=num+1
end
end
if num>0 then
isNeedDelHandCard =num
for i=1,num do
list_remove(_room.self_player.handcard_list,card)
end
local isAddTi =false
for i=1,#p.fz_list do
if p.fz_list[i].card == card then
p.fz_list[i].type= RB_FZType.Pao
isAddTi=true
remove_num= 0
end
end
if isAddTi==false then
p.fz_list[#p.fz_list+1] = fz
end
end
else
local num =0
for i=1,#p.fz_list do
if p.fz_list[i].card == card then
p.fz_list[i].type= RB_FZType.Pao
num=1
remove_num= 0
end
end
if num==0 then
p.fz_list[#p.fz_list+1] = fz
end
end
elseif ftype == RB_FZType.Ti then
if (p == _room.self_player) then
for i=1,#p.fz_list do
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 then
coroutine.start(function()
coroutine.wait(0.5)
DispatchEvent(self._dispatcher,RB_GameEvent.FangziAction, fz, p,isNeedDelHandCard)
end)
else
DispatchEvent(self._dispatcher,RB_GameEvent.FangziAction, fz, p,isNeedDelHandCard)
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()
win_p.card_list = cards
table.sort( win_p.card_list, ViewUtil.HandCardSort)
DispatchEvent(self._dispatcher,RB_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()
DispatchEvent(self._dispatcher,RB_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()
DispatchEvent(self._dispatcher,RB_GameEvent.ZPResult2, result, total_result, over);
end)
end
end
return M

View File

@ -0,0 +1,345 @@
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/hechi/ui/Extend_Poker_HeChi')
UIPackage.AddPackage('extend/zipai/hechi/ui/Info_Poker_HeChi')
return self
end
function M:FillData()
self._maxPlayer = 3 -- 默认玩家人数
self._roundChoice = 3 -- 回合选项数
self._config = UIPackage.CreateObjectFromURL('ui://Extend_Poker_HeChi/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
self.anchouValueText = self._config:GetChild('anchoufen')
self.anchouValueText.text = 1
self.anchouValue = 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
)
local btn_cr2 = self._config:GetChild('anchoubtn')
btn_cr2.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.anchouValueText.text = value / 100
self.anchouValue = value / 100
end, 3, nil)
gniv:Show()
end
)
end
local btn_jia = self._config:GetChild('btn_jia')
local btn_jian = self._config:GetChild('btn_jian')
local btn_jia1 = self._config:GetChild('btn_jia1')
local btn_jian1 = self._config:GetChild('btn_jian1')
local btn_jia2 = self._config:GetChild('btn_jia2')
local btn_jian2 = self._config:GetChild('btn_jian2')
-- local fS=self._config:GetChild('btn_round8'):GetChild("title")
-- fS.text="1局"
-- fS=self._config:GetChild('btn_round16'):GetChild("title")
-- fS.text="8局"
btn_jia.onClick:Set(
function()
if self._config:GetController('tun').selectedIndex ~= 5 then
self._config:GetController('tun').selectedIndex = self._config:GetController('tun').selectedIndex + 1
end
if self._config:GetController('tun').selectedIndex == 5 then
btn_jia.touchable = false
btn_jia.grayed = true
end
if self._config:GetController('tun').selectedIndex > 0 then
btn_jian.touchable = true
btn_jian.grayed = false
end
end
)
btn_jian.onClick:Set(
function()
if self._config:GetController('tun').selectedIndex ~= 0 then
self._config:GetController('tun').selectedIndex = self._config:GetController('tun').selectedIndex - 1
end
if self._config:GetController('tun').selectedIndex == 0 then
btn_jian.touchable = false
btn_jian.grayed = true
end
if self._config:GetController('tun').selectedIndex < 5 then
btn_jia.touchable = true
btn_jia.grayed = false
end
end
)
btn_jia1.onClick:Set(
function()
if self._config:GetController('tun').selectedIndex ~= 5 then
self._config:GetController('tun').selectedIndex = self._config:GetController('tun').selectedIndex + 1
end
if self._config:GetController('tun').selectedIndex == 5 then
btn_jia1.touchable = false
btn_jia1.grayed = true
end
if self._config:GetController('tun').selectedIndex > 0 then
btn_jian1.touchable = true
btn_jian1.grayed = false
end
end
)
btn_jian1.onClick:Set(
function()
if self._config:GetController('tun').selectedIndex ~= 0 then
self._config:GetController('tun').selectedIndex = self._config:GetController('tun').selectedIndex - 1
end
if self._config:GetController('tun').selectedIndex == 0 then
btn_jian1.touchable = false
btn_jian1.grayed = true
end
if self._config:GetController('tun').selectedIndex < 5 then
btn_jia1.touchable = true
btn_jia1.grayed = false
end
end
)
btn_jia2.onClick:Set(
function()
if self._config:GetController('tun').selectedIndex ~= 5 then
self._config:GetController('tun').selectedIndex = self._config:GetController('tun').selectedIndex + 1
end
if self._config:GetController('tun').selectedIndex == 5 then
btn_jia2.touchable = false
btn_jia2.grayed = true
end
if self._config:GetController('tun').selectedIndex > 0 then
btn_jian2.touchable = true
btn_jian2.grayed = false
end
end
)
btn_jian2.onClick:Set(
function()
if self._config:GetController('tun').selectedIndex ~= 0 then
self._config:GetController('tun').selectedIndex = self._config:GetController('tun').selectedIndex - 1
end
if self._config:GetController('tun').selectedIndex == 0 then
btn_jian2.touchable = false
btn_jian2.grayed = true
end
if self._config:GetController('tun').selectedIndex < 5 then
btn_jia2.touchable = true
btn_jia2.grayed = false
end
end
)
end
local _help_url = 'ui://Info_Poker_HeChi/Com_help'
function M:GetHelpUrl()
return _help_url
end
local _icon_url = "ui://Info_Poker_HeChi/icon"
function M:GetIconUrl()
return _icon_url
end
local _icon_url1 = "ui://Info_Poker_HeChi/icon1"
function M:GetIconUrl1()
return _icon_url1
end
local _play_list = { "全名堂", "红黑点", "多红多番" }
function M:GetPlayList()
return _play_list
end
function M:SelectedConfigData()
local _config = self._config
local wanfa_C = _config:GetController('btn_Controller').selectedIndex
local round = _config:GetController('round').selectedIndex + 1 --== 0 and 1 or 2
local Cost = _config:GetController('Cost').selectedIndex
local tun = _config:GetController('tun').selectedIndex
local fengding = _config:GetController('fengding').selectedIndex
local tuanyuan = _config:GetController('tuanyuan').selectedIndex
local hanghangxi = _config:GetController('hanghangxi').selectedIndex
local siqi = _config:GetController('siqi').selectedIndex
local shuahou = _config:GetController('shuahou').selectedIndex
local huangfan = _config:GetController('huangfan').selectedIndex
local jiaxingxing = _config:GetController('jiaxingxing').selectedIndex
local tinghu = _config:GetController('tinghu').selectedIndex
local duizifu = _config:GetController('duizifu').selectedIndex
local back = _config:GetController('Back').selectedIndex
local yuan = _config:GetController('yuan').selectedIndex
local tianhu = _config:GetController('tianhu').selectedIndex
local dihu = _config:GetController('dihu').selectedIndex
local haihu = _config:GetController('haihu').selectedIndex
local renshu = _config:GetController('renshu').selectedIndex == 0 and 2 or 3
-- local qupai = _config:GetController('qupai').selectedIndex == 1 and true or false
local _data = {}
_data['opt'] = round -- 1 2 8局 16 局
_data['mode'] = wanfa_C + 1 -- 1 全名堂 2 红黑点 3 多红多番
_data['AA'] = Cost
_data['maxPlayers'] = renshu
if wanfa_C == 0 then
_data['tun'] = tun -- 充囤 0 1 2 3 4 分别是 1 2 3 4 5
_data['fengding'] = fengding -- 封顶 0 1 2 全名堂分别是 不封顶 100封顶 200封顶
_data['tuanyuan'] = tuanyuan -- 大团圆 0 不选 1 选
_data['hanghangxi'] = hanghangxi -- 行行息 0 不选 1 选
_data['shuahou'] = shuahou -- 耍猴 0 不选 1 选
_data['huangfan'] = huangfan -- 黄番 0 不选 1 选
_data['jiaxingxing'] = jiaxingxing -- 假行行 0 不选 1 选
_data['tinghu'] = tinghu -- 听胡 0 不选 1 选
_data['siqi'] = siqi -- 四七红 0 不选 1 选
_data['back'] = back -- 四七红 0 不选 1 选
_data['yuan'] = yuan -- 四七红 0 不选 1 选
elseif wanfa_C == 1 then
_data['tun'] = tun -- 充囤 0 1 2 3 4 5 分别是 0 1 2 3 4 5
_data['fengding'] = fengding -- 封顶 0 1 2 红黑点分别是 不封顶 单局20封顶 单局 40封顶
_data['duizifu'] = duizifu -- 对子胡 0 不选 1 选
elseif wanfa_C == 2 then
_data['tun'] = tun -- 充囤 0 1 2 3 4 5 分别是 0 1 2 3 4 5
_data['tianhu'] = tianhu
_data['dihu'] = dihu
_data['haihu'] = haihu
_data['tinghu'] = tinghu
_data['huangfan'] = huangfan
_data['fengding'] = fengding -- 封顶 0
end
if renshu == 2 then
_data['qupai'] = false
end
local xi_pai = false
if oldGameVersion == 2 then
if _config:GetChild("xipai") then
xi_pai = _config:GetChild("xipai").selected
end
end
_data['xi_pai'] = xi_pai
local xi_pai_score = 0
local an_chou_score = 0
if oldGameVersion == 2 then
xi_pai_score = self.xipaiValue
an_chou_score = self.anchouValue
end
_data['xi_pai_score'] = xi_pai_score * 100
_data['an_chou_score'] = an_chou_score * 100
_data['xi_pai'] = xi_pai
return _data
end
function M:LoadConfigData(data)
local _config = self._config
_config:GetController('btn_Controller').selectedIndex = data.mode - 1
_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
if data.mode == 1 then
_config:GetController('tun').selectedIndex = data.tun
_config:GetController('fengding').selectedIndex = data.fengding
_config:GetController('tuanyuan').selectedIndex = data.tuanyuan
_config:GetController('hanghangxi').selectedIndex = data.hanghangxi
_config:GetController('siqi').selectedIndex = data.siqi
_config:GetController('shuahou').selectedIndex = data.shuahou
_config:GetController('huangfan').selectedIndex = data.huangfan
_config:GetController('jiaxingxing').selectedIndex = data.jiaxingxing
_config:GetController('tinghu').selectedIndex = data.tinghu
_config:GetController('Back').selectedIndex = data.back
_config:GetController('yuan').selectedIndex = data.yuan
elseif data.mode == 2 then
_config:GetController('tun').selectedIndex = data.tun
_config:GetController('fengding').selectedIndex = data.fengding
_config:GetController('duizifu').selectedIndex = data.duizifu
elseif data.mode == 3 then
_config:GetController('haihu').selectedIndex = 0
_config:GetController('tinghu').selectedIndex = 0
_config:GetController('tianhu').selectedIndex = 0
_config:GetController('dihu').selectedIndex = 0
_config:GetController('huangfan').selectedIndex = 0
_config:GetController('tun').selectedIndex = data.tun
_config:GetController('fengding').selectedIndex = data.fengding
end
if data.maxPlayers == 2 then
--_config:GetController('qupai').selectedIndex = data.qupai == true and 1 or 0
end
if _config:GetChild("xipai") then
_config:GetChild("xipai").selected = data.xi_pai
end
if oldGameVersion == 2 then
self.xipaiValueText.text = data.xi_pai_score / 100
self.xipaiValue = data.xi_pai_score / 100
self.anchouValueText.text = data.an_chou_score / 100
self.anchouValue = data.an_chou_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,662 @@
local ZPPlayBackView = require('main.zipai.ZPPlayBackView')
local PlayerSelfCardInfoView = import('.PlayerSelfCardInfoView')
local PlayerCardInfoView = import('.PlayerCardInfoView')
local RunBeard_ResultView = import('.RunBeard_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_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/hechi/ui/Extend_Poker_HeChi')
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 = '2_'
else
room.change_card_display = '1_'
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_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_panel1')
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)
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.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
--printlog("k===>>>",k)
--printlog("v===>>>",v)
--printlog(k,index)
--pt(p.card_list)
if tonumber(index+1)>tonumber(k) then
list_remove(p.card_list,v)
end
end
end
if 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 p.seat == self._room.self_player.seat then
--[[if step.cmd == Record_Event.Evt_ChangePaiXing then
local _card_list = {}
for i = 1, #step.card_list do
local data = {}
data.card_item = step.card_list[i].card
data.index_X = step.card_list[i].X
data.index_Y = step.card_list[i].Y
_card_list[#_card_list + 1] = data
end
local info = self._player_card_info[self:GetPos(step.seat)]
if step.card_list[1].card ~= nil then
info:UpdateHandCards(_card_list)
else
info:UpdateHandCards(step.card_list)
end
end--]]
--end
if step.cmd == Record_Event.Evt_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
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
info._view:GetController('zhanji').selectedIndex = 0
if _room.hpOnOff == 1 or _room:checkHpNonnegative() then
info._view:GetController('zhanji').selectedIndex = 1
info._view:GetChild('tex_jifen').text = d2ad(stotal_hp)
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.fz_list = {}
u.outcard_list = {}
u.hu_xi = 0
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]
u.card_list[#u.card_list + 1] = cmd.data.card
--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: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
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].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()
printlog("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()
printlog("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,182 @@
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
return self
end
function M:GetDes(sp)
sp = sp or " "
local str = self.round and self.round .. "" .. sp or ""
str = str .. RoomConfig.GetDes(self, sp)
if self.maxPlayers == 2 then
if self.qupai then
str = str .."去牌"
str = str .. sp
end
end
if (self.mode==1) then
str = str .. "全名堂"
str = str .. sp
str = str .. (self.tun)..""
str = str .. sp
if self.fengding == 0 then
str = str .. "不封顶"
str = str .. sp
elseif self.fengding == 1 then
str = str .. "100封顶"
str = str .. sp
elseif self.fengding == 2 then
str = str .. "200封顶"
str = str .. sp
elseif self.fengding == 3 then
str = str .. "300封顶"
str = str .. sp
elseif self.fengding == 4 then
str = str .. "500封顶"
str = str .. sp
elseif self.fengding == 5 then
str = str .. "1000封顶"
str = str .. sp
end
if self.tuanyuan == 1 then
str = str .. "大团圆"
str = str .. sp
end
if self.hanghangxi == 1 then
str = str .. "行行息"
str = str .. sp
end
if self.siqi == 1 then
str = str .. "四七红"
str = str .. sp
end
if self.shuahou == 1 then
str = str .. "耍猴"
str = str .. sp
end
if self.huangfan == 1 then
str = str .. "黄番"
str = str .. sp
end
if self.jiaxingxing == 1 then
str = str .. "假行行"
str = str .. sp
end
if self.tinghu == 1 then
str = str .. "听胡"
str = str .. sp
end
if self.back == 1 then
str = str .. "背靠背"
str = str .. sp
end
if self.yuan == 1 then
str = str .. ""
str = str .. sp
end
elseif (self.mode == 2 ) then
str = str .. "红黑点"
str = str .. sp
str = str .. (self.tun)..""
str = str .. sp
if self.duizifu == 1 then
str = str .. "对子胡"
str = str .. sp
end
if self.fengding == 0 then
str = str .. "不封顶"
str = str .. sp
elseif self.fengding == 1 then
str = str .. "单局20封顶"
str = str .. sp
elseif self.fengding == 2 then
str = str .. "单局40封顶"
str = str .. sp
end
elseif (self.mode == 3 ) then
str = str .. "多红多番"
str = str .. sp
-- if self.tianhu == 1 then
-- str = str .. "天胡"
-- str = str .. sp
-- end
-- if self.dihu == 1 then
-- str = str .. "地胡"
-- str = str .. sp
-- end
-- if self.haihu == 1 then
-- str = str .. "海湖"
-- str = str .. sp
-- end
-- if self.tinghu == 1 then
-- str = str .. "听胡"
-- str = str .. sp
-- end
-- if self.huangfan == 1 then
-- str = str .. "黄番"
-- str = str .. sp
-- end
str = str .. (self.tun)..""
str = str .. sp
if self.fengding == 0 then
str = str .. "不封顶"
str = str .. sp
elseif self.fengding == 1 then
str = str .. "60封顶"
str = str .. sp
elseif self.fengding == 2 then
str = str .. "80封顶"
str = str .. sp
end
end
str = str.sub(str,1,string.len(str)-string.len(sp))
return str
end
function M:GetGameName()
if self.mode == 1 then
return self.maxPlayers .. "人全名堂-河池跑胡子"
elseif self.mode == 2 then
return self.maxPlayers .. "人红黑点-河池跑胡子"
elseif self.mode == 3 then
return self.maxPlayers .. "人多红多番-河池跑胡子"
end
return self.maxPlayers .. "人河池跑胡子"
end
function M:GetGameJS()
local gamerulepanel= UIPackage.CreateObjectFromURL("ui://Extend_Poker_HeChi/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 = 15
self._viewMap = {}
self._viewMap[ViewManager.View_Main] = EXMainView
self._viewMap[ViewManager.View_PlayBack] = EXPlayBackView
return self
end
--卸载资源
function M:UnAllAssets()
UIPackage.RemovePackage('extend/zipai/hechi/ui/Info_Poker_HeChi')
self:UnAssets()
end
--卸载资源
function M:UnAssets()
UIPackage.RemovePackage('extend/zipai/hechi/ui/Extend_Poker_HeChi')
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,267 @@
local PlayerCardInfoView = require("main.zipai.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)
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)
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)
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.x,fzcards.y = 0,0
self:playAnim(fzitem,fzcards,#fz_list,i,ispaly,seat)
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,seat)
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)
elseif fz_list[i].type == RB_FZType.Ti then
local fzcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4")
if self._mainView._leftcard ==1 and self._player.seat ~= DataManager.CurrenRoom.banker_seat 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
end
fzcards.x,fzcards.y = 0,0
self:playAnim(fzitem,fzcards,#fz_list,i,ispaly,seat)
end
end
end
function M:playAnim(fzitem,fzcards, size,i,ispaly,seat)
if(ispaly == nil)then
ispaly =false
end
local isaddLast = false
if(ispaly and i == size)then --匹配最后一个牌
local faArray= fzitem:GetChild("chiwei1")
if(DataManager.CurrenRoom.room_config.people_num ==3)then
if(DataManager.CurrenRoom.self_player.seat == 1)then
if(seat == 2)then
faArray= fzitem:GetChild("chiwei1")
else
faArray= fzitem:GetChild("chiwei")
end
elseif(DataManager.CurrenRoom.self_player.seat == 2) then
if(seat == 3)then
faArray= fzitem:GetChild("chiwei1")
else
faArray= fzitem:GetChild("chiwei")
end
elseif(DataManager.CurrenRoom.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
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)
coroutine.start(function()
coroutine.wait(0.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)
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/Qipai")
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,454 @@
local PlayerSelfCardInfoView = require("main.zipai.ZPPlayerSelfCardInfoView")
local CardCheck = require("main.zipai.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/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:__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 card = button.data
local _room = DataManager.CurrenRoom
card.btn_card.sortingOrder = 0
-- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)
if (button.y < -380 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 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: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)
coroutine.start(function()
coroutine.wait(0.1)
self:ClearOutCard()
end)
end
function M:UpdateFzList(fz_list, ispaly)
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)
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)
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
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)
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)
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)
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
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly)
end
end
end
function M:playAnim(fzitem, fzcards, size, i, ispaly)
if (ispaly == nil) then
ispaly = false
end
if (ispaly and i == size) then
local faArray = fzitem:GetChild("chiwei")
if (faArray ~= nil) then
faArray:AddChild(fzcards)
else
fzitem:AddChild(fzcards)
end
else
fzitem:AddChild(fzcards)
end
self._area_fz_list:AddChild(fzitem)
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
-- print("ChuPaiTiShi",#mark_ting,vardump(player))
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,51 @@
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",
GAME_XIPAI = "20836",
GAME_EVENT_XIPAI = "20837",
GAME_EVENT_NOTIFY_XIPAI = "20838",
}
return Protocol

View File

@ -0,0 +1,39 @@
local RunBeard_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",
}
return RunBeard_GameEvent

View File

@ -0,0 +1,752 @@
require('Game.View.ResultView')
local PendulumRule = require('main.zipai.PendulumRule')
local RunBeard_ResultView = {}
local M = RunBeard_ResultView
function RunBeard_ResultView.new(blur_view, index)
setmetatable(M, {__index = ResultView})
local self = setmetatable({}, {__index = M})
self.class = 'RunBeard_ResultView'
self._currenIndex = 0
if index ~= 1 then
self._blur_view = blur_view
end
self._close_zone = false
self:init('ui://Extend_Poker_HeChi/clearing')
self.xiPaiCtr=self._view:GetController("xipai")
return self
end
function M:init(url)
ResultView.init(self, url)
local btn_share = self._view:GetChild('btn_share')
btn_share.onClick:Set(
function()
ShareScreenShot()
end
)
end
function M:InitData(over, room, result, total_result, callback)
local _overCtr = self._view:GetController('over')
local btn_confirm = self._view:GetChild('btn_confirm')
local btn_result = self._view:GetChild('btn_showResult')
local _btnCtr = self._view:GetController('button')
local _sdkCtr = self._view:GetController('sdk')
local _icon = self._view:GetChild('win_base')
local btn_close = self._view:GetChild('btn_close')
self._view:GetChild('tex_roomnum').text = room.room_id
self._view:GetChild('tex_data').text = os.date('%Y-%m-%d %H:%M', os.time())
local xpconfig=DataManager.CurrenRoom.room_config.config.xi_pai
if xpconfig then
self.xiPaiCtr.selectedIndex=1
else
self.xiPaiCtr.selectedIndex=0
end
local xipai=self._view:GetChild("btn_xipai")
xipai.touchable=true
xipai.onClick:Add(function()
local xiPaiCallBack=function ()
xipai.touchable=false
self.xiPaiCtr.selectedIndex=0
ViewUtil.ErrorTip(1000000,"申请洗牌成功")
end
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:SendXiPaiAction(xiPaiCallBack)
end)
if result and result.xipai_score then
xipai.text="洗牌 积分x"..result.xipai_score
end
if result ~= nil and result.liuju == true then
_icon.icon = 'ui://Main_RunBeard/liuju'
_btnCtr.selectedIndex = 0
_sdkCtr.selectedIndex = 1
_overCtr.selectedIndex = 2
if over ~= 1 then
btn_confirm.onClick:Add(
function()
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:PlayerReady()
self:Close()
if callback then
callback()
end
end
)
self:AddClearItem(room, result, nil, over)
return
else
self.xiPaiCtr.selectedIndex=0
_btnCtr.selectedIndex = 1
_sdkCtr.selectedIndex = 1
btn_result.onClick:Add(
function()
_overCtr.selectedIndex = 3
_btnCtr.selectedIndex = 0
_sdkCtr.selectedIndex = 0
end
)
btn_close.onClick:Add(
function()
ViewManager.ChangeView(ViewManager.View_Lobby)
end
)
self:AddClearItem(room, result, total_result.info_list, over)
end
end
if over == 0 and result.liuju == false then
_icon.icon = 'ui://Main_RunBeard/jiesuan'
_btnCtr.selectedIndex = 0
_sdkCtr.selectedIndex = 1
_overCtr.selectedIndex = 0
btn_confirm.onClick:Add(
function()
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:PlayerReady()
self:Close()
if callback then
callback()
end
end
)
self:AddClearItem(room, result, nil, over)
elseif over == 1 and result.liuju == false then
_icon.icon = 'ui://Main_RunBeard/jiesuan'
_btnCtr.selectedIndex = 1
_sdkCtr.selectedIndex = 1
_overCtr.selectedIndex = 0
btn_result.onClick:Add(
function()
_overCtr.selectedIndex = 3
_btnCtr.selectedIndex = 0
_sdkCtr.selectedIndex = 0
end
)
btn_close.onClick:Add(
function()
ViewManager.ChangeView(ViewManager.View_Lobby)
end
)
self:AddClearItem(room, result, total_result.info_list, over)
else
if result ~= nil then
if result.liuju == false then
_icon.icon = 'ui://Main_RunBeard/jiesuan'
over = 2
_overCtr.selectedIndex = 3
btn_close.onClick:Add(
function()
ViewManager.ChangeView(ViewManager.View_Lobby)
end
)
self:AddClearItem(room, nil, total_result.info_list, over)
end
else
_icon.icon = 'ui://Main_RunBeard/jiesuan'
over = 2
_overCtr.selectedIndex = 3
self.xiPaiCtr.selectedIndex=0
btn_close.onClick:Add(
function()
ViewManager.ChangeView(ViewManager.View_Lobby)
end
)
self:AddClearItem(room, nil, total_result.info_list, over)
end
end
end
function M:AddClearItem(room, data, total_data, over)
local n = over + 1
local list_view1 = self._view:GetChild('player_list')
local list_view2 = self._view:GetChild('player_list_2')
if data ~= nil and data.liuju == true then
self:FillLiuJuItemData(room, data)
if over == 1 then
self:FillItemData2(room, total_data, list_view2)
end
else
if 0 == over or 1 == over and data.liuju == false then
self:FillItemData(room, data, list_view1)
if 1 == over then
self:FillItemData2(room, total_data, list_view2)
end
elseif 2 == over then
self:FillItemData2(room, total_data, list_view2)
end
end
end
function M:GetPos(room, seat)
return ViewUtil.GetPos(room.self_player.seat, seat, room.room_config.people_num)
end
function M:FillLiuJuItemData(room, data)
local qipai_list = self._view:GetChild('qipai_listl')
local _dipaiC = self._view:GetController('qipai')
qipai_list:RemoveChildrenToPool()
if data.throw_card ~= nil and #data.throw_card > 0 then
_dipaiC.selectedIndex = 1
local hand_card = PendulumRule.GetHandCard(data.throw_card, 3)
for k = 1, #hand_card do
local cards = qipai_list:AddItemFromPool()
for j = 1, #hand_card[k] do
cards:GetChild('card_' .. (j)).icon = self:getCardItem('ui://Main_RunBeard/202_', hand_card[k][j])
end
end
else
_dipaiC.selectedIndex = 0
end
for i = 1, #data.info_list do
if data.info_list[i].seat ~= room.self_player.seat and #data.info_list[i].hand_card > 0 then
local card_list
if #data.info_list == 2 then
card_list = self._view:GetChild('card_list_2')
else
if self:GetPos(room, data.info_list[i].seat) == 2 then
card_list = self._view:GetChild('card_list_1')
else
card_list = self._view:GetChild('card_list_3')
end
end
card_list:RemoveChildrenToPool()
for k = 1, #data.info_list[i].opCardList do
local fztype = data.info_list[i].opCardList[k].type
if fztype == RB_FZType.Kan then
local cards = card_list:AddItemFromPool()
for j = 1, 3 do
cards:GetChild('card_' .. j).icon =
self:getCardItem('ui://Main_RunBeard/202_', data.info_list[i].opCardList[k].card1)
end
end
end
local hand_card = PendulumRule.GetHandCard(data.info_list[i].hand_card, 3)
for k = 1, #hand_card do
local item = card_list:AddItemFromPool()
for j = 1, #hand_card[k] do
item:GetChild('card_' .. (j)).icon = self:getCardItem('ui://Main_RunBeard/202_', hand_card[k][j])
end
end
end
end
end
function M:FillItemData(room, data, item)
local dipai_list = self._view:GetChild('dipai_list')
dipai_list:RemoveChildren(0, -1, true)
if data.left_card ~= nil and #data.left_card > 0 then
for i = 1, #data.left_card do
local dipais = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Qipai')
dipais:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/202_', data.left_card[i])
dipai_list:AddChild(dipais)
end
end
local qipai_list = self._view:GetChild('qipai_list')
local _dipaiC = self._view:GetController('qipai')
qipai_list:RemoveChildrenToPool()
if data.throw_card ~= nil and #data.throw_card > 0 then
_dipaiC.selectedIndex = 1
local hand_card = PendulumRule.GetHandCard(data.throw_card, 3)
for k = 1, #hand_card do
local cards = qipai_list:AddItemFromPool()
for j = 1, #hand_card[k] do
cards:GetChild('card_' .. (j)).icon = self:getCardItem('ui://Main_RunBeard/202_', hand_card[k][j])
end
end
else
_dipaiC.selectedIndex = 0
end
local info_list = data.info_list
local Yes_win = false
local win_data = {}
for i = 1, #info_list do
if info_list[i].is_win == true then
Yes_win = true
win_data = info_list[i]
end
end
if win_data.seat == room.self_player.seat then
self._view:GetChild('show_win').visible = true
self._view:GetChild('show_low').visible = false
else
self._view:GetChild('show_win').visible = false
self._view:GetChild('show_low').visible = true
end
if Yes_win == true then
local isWin_Card = true
local p = room:GetPlayerBySeat(win_data.seat)
if p.self_user.account_id == room.owner_id then
self._view:GetController('owner').selectedIndex = 1
end
if p.seat == room.banker_seat then
self._view:GetController('bank').selectedIndex = 1
end
self._view:GetChild('WinerName').text = p.self_user.nick_name
self._view:GetChild('chongtunshu').text = '充囤:' .. room.room_config.tun .. ''
self._view:GetChild('huxi').text = '胡息:' .. win_data.hu_xi
self._view:GetChild('tunshu').text = '基础囤数:' .. win_data.tun
self._view:GetChild('zongtunshu').text = '总囤数:' .. win_data.total_tun
if win_data.round_score >= 0 then
self._view:GetChild('score').text = '游戏分:+' .. win_data.round_score
self._view:GetChild('score').grayed = false
else
self._view:GetChild('score').text = '游戏分:' .. win_data.round_score
self._view:GetChild('score').grayed = true
end
local hp_info = win_data.hp_info
if (hp_info ~= nil and room.hpOnOff == 1 or room:checkHpNonnegative()) then
local round_actual_hp = d2ad(hp_info.round_actual_hp) --// 本局实际输赢体力值
self._view:GetChild('tili_score').visible = true
self._view:GetChild('tili_title').visible = true
if (round_actual_hp > 0) then
self._view:GetChild('tili_score').text = '积分:+' .. round_actual_hp
self._view:GetChild('tili_score').grayed = false
else
self._view:GetChild('tili_score').text = '积分:' .. round_actual_hp
self._view:GetChild('tili_score').grayed = true
end
end
if (hp_info ~= nil and room.hpOnOff == 1 or room:checkHpNonnegative()) then
local isupper_limit = hp_info.upper_limit -- // 输赢是否已达上限
if (isupper_limit) then
self._view:GetChild('yidashangxian').text = '已达上限'
else
self._view:GetChild('yidashangxian').text = ''
end
end
local btn_head = self._view:GetChild('btn_head')
ImageLoad.Load(p.self_user.head_url, btn_head._iconObject)
local fullname_list = self._view:GetChild('fullname_list')
fullname_list:RemoveChildren(0, -1, true)
if win_data.mingtang ~= nil and #win_data.mingtang > 0 then
for i = 1, #win_data.mingtang do
local dipais = UIPackage.CreateObjectFromURL('ui://Extend_Poker_HeChi/FullName')
dipais:GetChild('n0').icon = 'ui://Extend_Poker_HeChi/hu_' .. win_data.mingtang[i].mingtang
if win_data.mingtang[i].type == 1 and win_data.mingtang[i].score ~= 0 then
dipais:GetChild('n2').text = win_data.mingtang[i].score .. ''
elseif win_data.mingtang[i].type == 2 and win_data.mingtang[i].score ~= 0 then
dipais:GetChild('n2').text = win_data.mingtang[i].score .. ''
elseif win_data.mingtang[i].type == 3 and win_data.mingtang[i].score ~= 0 then
dipais:GetChild('n2').text = win_data.mingtang[i].score .. ''
end
fullname_list:AddChild(dipais)
end
end
local card_list = self._view:GetChild('card_list')
card_list:RemoveChildrenToPool()
if #win_data.cardList > 0 then
for i = 1, #win_data.cardList do
-- 1 是对子 2 是三个的
local fztype = win_data.cardList[i].type
if fztype == 1 then
local cards = card_list:AddItemFromPool()
cards:GetChild('card_type').text = ''
cards:GetChild('card_huxi').text = win_data.cardList[i].hu_xi
cards:GetController('c1').selectedIndex = 0
if win_data.cardList[i].card1 == win_data.win_card and isWin_Card == true then
isWin_Card = false
cards:GetController('hu').selectedIndex = 1
end
for j = 1, 2 do
cards:GetChild('card_' .. j).icon =
self:getCardItem('ui://Main_RunBeard/201_', win_data.cardList[i].card1)
end
else
local cards = card_list:AddItemFromPool()
cards:GetChild('card_type').text = ''
if
win_data.cardList[i].card1 == win_data.cardList[i].card2 and
win_data.cardList[i].card1 == win_data.cardList[i].card3
then
cards:GetChild('card_type').text = ''
end
cards:GetChild('card_huxi').text = win_data.cardList[i].hu_xi
cards:GetController('c1').selectedIndex = 1
cards:GetChild('card_1').icon =
self:getCardItem('ui://Main_RunBeard/201_', win_data.cardList[i].card1)
cards:GetChild('card_2').icon =
self:getCardItem('ui://Main_RunBeard/201_', win_data.cardList[i].card2)
cards:GetChild('card_3').icon =
self:getCardItem('ui://Main_RunBeard/201_', win_data.cardList[i].card3)
if isWin_Card == true then
if win_data.cardList[i].card1 == win_data.win_card then
isWin_Card = false
cards:GetController('hu').selectedIndex = 1
elseif win_data.cardList[i].card2 == win_data.win_card then
isWin_Card = false
cards:GetController('hu').selectedIndex = 2
elseif win_data.cardList[i].card3 == win_data.win_card then
isWin_Card = false
cards:GetController('hu').selectedIndex = 3
end
end
end
end
end
for i = 1, #win_data.opCardList do
local fztype = win_data.opCardList[i].type
if fztype == RB_FZType.Chi then
local cards = card_list:AddItemFromPool()
cards:GetChild('card_type').text = ''
cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi
cards:GetController('c1').selectedIndex = 1
cards:GetChild('card_1').icon =
self:getCardItem('ui://Main_RunBeard/201_', win_data.opCardList[i].card1)
cards:GetChild('card_2').icon =
self:getCardItem('ui://Main_RunBeard/201_', win_data.opCardList[i].card2)
cards:GetChild('card_3').icon =
self:getCardItem('ui://Main_RunBeard/201_', win_data.opCardList[i].card3)
if isWin_Card == true then
if win_data.opCardList[i].card1 == win_data.win_card then
isWin_Card = false
cards:GetController('hu').selectedIndex = 1
elseif win_data.opCardList[i].card2 == win_data.win_card then
isWin_Card = false
cards:GetController('hu').selectedIndex = 2
elseif win_data.opCardList[i].card3 == win_data.win_card then
isWin_Card = false
cards:GetController('hu').selectedIndex = 3
end
end
elseif fztype == RB_FZType.Peng then
local cards = card_list:AddItemFromPool()
cards:GetChild('card_type').text = ''
cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi
cards:GetController('c1').selectedIndex = 1
for j = 1, 3 do
cards:GetChild('card_' .. j).icon =
self:getCardItem('ui://Main_RunBeard/201_', win_data.opCardList[i].card1)
end
if win_data.opCardList[i].card1 == win_data.win_card and isWin_Card == true then
isWin_Card = false
cards:GetController('hu').selectedIndex = 1
end
elseif fztype == RB_FZType.Kan then
local cards = card_list:AddItemFromPool()
cards:GetChild('card_type').text = ''
cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi
cards:GetController('c1').selectedIndex = 1
if win_data.opCardList[i].card1 == win_data.win_card and isWin_Card == true then
isWin_Card = false
cards:GetController('hu').selectedIndex = 1
end
for j = 1, 3 do
cards:GetChild('card_' .. j).icon =
self:getCardItem('ui://Main_RunBeard/201_', win_data.opCardList[i].card1)
end
elseif fztype == RB_FZType.Wei or fztype == RB_FZType.ChouWei then
local cards = card_list:AddItemFromPool()
cards:GetChild('card_type').text = ''
cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi
cards:GetController('c1').selectedIndex = 1
if win_data.opCardList[i].card1 == win_data.win_card and isWin_Card == true then
isWin_Card = false
cards:GetController('hu').selectedIndex = 1
end
for j = 1, 3 do
cards:GetChild('card_' .. j).icon =
self:getCardItem('ui://Main_RunBeard/201_', win_data.opCardList[i].card1)
end
elseif fztype == RB_FZType.Pao then
local cards = card_list:AddItemFromPool()
cards:GetChild('card_type').text = ''
cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi
cards:GetController('c1').selectedIndex = 2
if win_data.opCardList[i].card1 == win_data.win_card and isWin_Card == true then
isWin_Card = false
cards:GetController('hu').selectedIndex = 1
end
for j = 1, 4 do
cards:GetChild('card_' .. j).icon =
self:getCardItem('ui://Main_RunBeard/201_', win_data.opCardList[i].card1)
end
elseif fztype == RB_FZType.Ti then
local cards = card_list:AddItemFromPool()
cards:GetChild('card_type').text = ''
cards:GetChild('card_huxi').text = win_data.opCardList[i].hu_xi
cards:GetController('c1').selectedIndex = 2
if win_data.opCardList[i].card1 == win_data.win_card and isWin_Card == true then
isWin_Card = false
cards:GetController('hu').selectedIndex = 1
end
for j = 1, 4 do
cards:GetChild('card_' .. j).icon =
self:getCardItem('ui://Main_RunBeard/201_', win_data.opCardList[i].card1)
end
end
end
if #win_data.hand_card > 0 then
for i = 1, #win_data.hand_card, 4 do
local cards = card_list:AddItemFromPool()
cards:GetChild('card_type').text = ''
cards:GetChild('card_huxi').text = 0
cards:GetController('c1').selectedIndex = 2
for j = 0, 3 do
if (i + j) <= #win_data.hand_card then
cards:GetChild('card_' .. (j + 1)).icon =
self:getCardItem('ui://Main_RunBeard/201_', win_data.hand_card[i + j])
if win_data.hand_card[i + j] == win_data.win_card and isWin_Card == true then
isWin_Card = false
cards:GetController('hu').selectedIndex = j + 1
end
end
end
end
end
end
item:RemoveChildrenToPool()
for i = 1, #info_list do
if info_list[i].is_win == false then
local player = item:AddItemFromPool()
local p = room:GetPlayerBySeat(info_list[i].seat)
if p.self_user.account_id == room.owner_id then
player:GetController('owner').selectedIndex = 1
end
if p.seat == room.banker_seat then
player:GetController('bank').selectedIndex = 1
end
local btn_head = player:GetChild('btn_head')
ImageLoad.Load(p.self_user.head_url, btn_head._iconObject)
player:GetChild('playerName').text = p.self_user.nick_name
if info_list[i].round_score >= 0 then
player:GetChild('score').text = '+' .. info_list[i].round_score
player:GetChild('score').grayed = false
else
player:GetChild('score').text = info_list[i].round_score
player:GetChild('score').grayed = true
end
local hp_info = info_list[i].hp_info
if (hp_info ~= nil and room.hpOnOff == 1 or room:checkHpNonnegative()) then
local round_actual_hp = d2ad(hp_info.round_actual_hp) --// 本局实际输赢体力值
player:GetChild('tili_score').visible = true
player:GetChild('tili_title').visible = true
if (round_actual_hp > 0) then
player:GetChild('tili_score').text = '+' .. round_actual_hp
player:GetChild('tili_score').grayed = false
else
player:GetChild('tili_score').text = '' .. round_actual_hp
player:GetChild('tili_score').grayed = true
end
end
if (hp_info ~= nil and room.hpOnOff == 1 or room:checkHpNonnegative()) then
local isupper_limit = hp_info.upper_limit -- // 输赢是否已达上限
if (isupper_limit) then
player:GetChild('yidashangxian').text = '已达上限'
else
player:GetChild('yidashangxian').text = ''
end
end
local card_list = player:GetChild('card_list')
card_list:RemoveChildrenToPool()
for k = 1, #info_list[i].opCardList do
local fztype = info_list[i].opCardList[k].type
if fztype == RB_FZType.Chi then
local cards = card_list:AddItemFromPool()
cards:GetChild('card_1').icon =
self:getCardItem('ui://Main_RunBeard/202_', info_list[i].opCardList[k].card1)
cards:GetChild('card_2').icon =
self:getCardItem('ui://Main_RunBeard/202_', info_list[i].opCardList[k].card2)
cards:GetChild('card_3').icon =
self:getCardItem('ui://Main_RunBeard/202_', info_list[i].opCardList[k].card3)
elseif fztype == RB_FZType.Peng then
local cards = card_list:AddItemFromPool()
for j = 1, 3 do
cards:GetChild('card_' .. j).icon =
self:getCardItem('ui://Main_RunBeard/202_', info_list[i].opCardList[k].card1)
end
elseif fztype == RB_FZType.Kan then
local cards = card_list:AddItemFromPool()
for j = 1, 3 do
cards:GetChild('card_' .. j).icon =
self:getCardItem('ui://Main_RunBeard/202_', info_list[i].opCardList[k].card1)
end
elseif fztype == RB_FZType.Wei or fztype == RB_FZType.ChouWei then
local cards = card_list:AddItemFromPool()
for j = 1, 3 do
cards:GetChild('card_' .. j).icon =
self:getCardItem('ui://Main_RunBeard/202_', info_list[i].opCardList[k].card1)
end
elseif fztype == RB_FZType.Pao then
local cards = card_list:AddItemFromPool()
for j = 1, 4 do
cards:GetChild('card_' .. j).icon =
self:getCardItem('ui://Main_RunBeard/202_', info_list[i].opCardList[k].card1)
end
elseif fztype == RB_FZType.Ti then
local cards = card_list:AddItemFromPool()
for j = 1, 4 do
cards:GetChild('card_' .. j).icon =
self:getCardItem('ui://Main_RunBeard/202_', info_list[i].opCardList[k].card1)
end
end
end
if #info_list[i].hand_card > 0 then
local hand_card = PendulumRule.GetHandCard(info_list[i].hand_card, 3)
for k = 1, #hand_card do
local cards = card_list:AddItemFromPool()
for j = 1, #hand_card[k] do
cards:GetChild('card_' .. (j)).icon =
self:getCardItem('ui://Main_RunBeard/202_', hand_card[k][j])
end
end
end
end
end
end
function M:FillItemData2(room, data, list)
-- 赋值result_info聊天室分享需要
local player_list = {}
for i = 1, #data do
player_list[i] = {}
local user = room:GetPlayerBySeat(data[i].seat).self_user
local p = room:GetPlayerBySeat(data[i].seat)
player_list[i].id = user.account_id
local total_score = data[i].total_score
player_list[i].hp_info = data[i].hp_info
player_list[i].score = total_score
player_list[i].house = room.owner_id == player_list[i].id and 1 or 0
player_list[i].nick = user.nick_name
player_list[i].head_url = user.head_url
local entrust = data[i].entrust
if entrust == nil then
entrust = false
end
player_list[i].entrust = entrust
player_list[i].param = {}
local wcount = 0
if (data[i].win_count ~= nil) then
wcount = data[i].win_count
end
local hxcount = 0
if (data[i].total_huxi ~= nil) then
hxcount = data[i].total_huxi
end
player_list[i].param[1] = {}
player_list[i].param[1].key = '胡牌次数:'
player_list[i].param[1].value = tostring(wcount)
player_list[i].param[2] = {}
player_list[i].param[2].key = '胡息总数:'
player_list[i].param[2].value = tostring(hxcount)
end
local round = room.room_config.round
self:GenerateRoomResultInfo(round, room.room_config:GetGameName(), room.room_id, room.create_time, player_list)
self:SetGSListlineGap(5)
self:InitBigResult(room, 26)
DataManager.CurrenRoom = nil
-- list:RemoveChildrenToPool()
-- for i =1, #data do
-- local total_score = room:GetTotalScore(data[i].total_score)
-- local item = list:AddItemFromPool()
-- local p = room:GetPlayerBySeat(data[i].seat)
-- if p.self_user.account_id == room.owner_id then
-- item:GetController("owner").selectedIndex = 1
-- end
-- local btn_head = item:GetChild("btn_head")
-- ImageLoad.Load(p.self_user.head_url, btn_head._iconObject)
-- item:GetChild("win_count").text = "胡牌次数:"..data[i].win_count.."次"
-- item:GetChild("total_huxi").text = "胡息总数:"..data[i].total_huxi
-- --点赞
-- self:Click_zan(item, p.self_user.account_id)
-- item:GetChild("name").text = p.self_user.nick_name
-- local hp_info = data[i].hp_info
-- if(hp_info ~=nil and room.hpOnOff == 1 or room:checkHpNonnegative()) then
-- -- --体力值
-- -- local round_actual_hp = d2ad(hp_info.round_actual_hp) --// 本局实际输赢体力值
-- local isupper_limit = hp_info.upper_limit -- // 输赢是否已达上限
-- if(isupper_limit)then
-- item:GetChild("yidashangxian").text = "已达上限"
-- else
-- item:GetChild("yidashangxian").text = ""
-- end
-- end
-- local x = room:GetOriginScore(total_score)
-- if total_score >= 0 then
-- item:GetChild("score").text = "+"..x
-- item:GetChild("score").grayed = false
-- else
-- item:GetChild("score").text = x
-- item:GetChild("score").grayed = true
-- end
-- if room.hpOnOff == 1 and room.score_times ~= 1 or room:checkHpNonnegative() then
-- item:GetController("bei") .selectedIndex=1
-- item:GetChild("sss").text = room.score_times
-- if(hp_info ~= nil)then
-- local round_actual_hp = d2ad(hp_info.total_hp) --// 本局实际输赢体力值
-- total_score = round_actual_hp
-- end
-- if total_score >= 0 then
-- item:GetChild("score1").text = "+"..total_score
-- item:GetChild("score1").grayed = false
-- else
-- item:GetChild("score1").text = total_score
-- item:GetChild("score1").grayed = true
-- end
-- end
-- if #data ==3 then
-- if i ==1 then
-- if total_score >data[2].total_score and total_score >data[3].total_score then
-- item:GetController("winer") .selectedIndex=1
-- end
-- elseif i ==2 then
-- if total_score >data[1].total_score and total_score >data[3].total_score then
-- item:GetController("winer") .selectedIndex=1
-- end
-- elseif i ==3 then
-- if total_score >data[2].total_score and total_score >data[1].total_score then
-- item:GetController("winer") .selectedIndex=1
-- end
-- end
-- else
-- if i ==1 then
-- if total_score >data[2].total_score then
-- item:GetController("winer") .selectedIndex=1
-- end
-- elseif i ==2 then
-- if total_score >data[1].total_score then
-- item:GetController("winer") .selectedIndex=1
-- end
-- end
-- end
-- end
-- DataManager.CurrenRoom = nil
end
function M:LoadHead(p, room)
local btn_head = self._view:GetChild('btn_head')
for i = 1, #room.player_list do
local player = room.player_list[i]
if p.seat == player.seat and player.self_user.head_url ~= '' then
ImageLoad.Load(player.self_user.head_url, btn_head.icon)
end
end
end
function M:getCardItem(card_1, card_2)
local _room = DataManager.CurrenRoom
if _room ~= nil and _room.change_card_display ~= nil then
return card_1 .. _room.change_card_display .. card_2
else
return card_1 .. '2_' .. card_2
end
end
return M

View File

@ -0,0 +1,635 @@
-- 检测牌是否存在
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
self:pushhuxi(_huxi)
return true
end
return false
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 = 1
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 = 1
if self.drawCard~=card then
--printlog("tryKezi====>>>",self.drawCard,card)
_huxi = 3
end
self:pushhuxi(_huxi)
return true
end
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)
local _huxi = 0
self:pushhuxi(_huxi)
self.pair_count = 1
return true
elseif (checkCard(card, self.cardList, 1)) then
if card % 100 <=9 then
if (checkCard(card+1, self.cardList, 1)) then
removeCard(self.cardList, card, 1)
removeCard(self.cardList, card+1, 1)
local cardGroup = {card, card+1}
self:push(cardGroup)
local _huxi = 0
self:pushhuxi(_huxi)
self.pair_count = 1
return true
end
end
if card % 100 <=8 then
if (checkCard(card+2, self.cardList, 1)) then
removeCard(self.cardList, card, 1)
removeCard(self.cardList, card+2, 1)
local cardGroup = {card, card+2}
self:push(cardGroup)
local _huxi = 0
self:pushhuxi(_huxi)
self.pair_count = 1
return true
end
end
if card % 100 >=2 then
if (checkCard(card-1, self.cardList, 1)) then
removeCard(self.cardList, card, 1)
removeCard(self.cardList, card-1, 1)
local cardGroup = {card, card-1}
self:push(cardGroup)
local _huxi = 0
self:pushhuxi(_huxi)
self.pair_count = 1
return true
end
end
if card % 100 >=3 then
if (checkCard(card-2, self.cardList, 1)) then
removeCard(self.cardList, card, 1)
removeCard(self.cardList, card-2, 1)
local cardGroup = {card, card-2}
self:push(cardGroup)
local _huxi = 0
self:pushhuxi(_huxi)
self.pair_count = 1
return true
end
end
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: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:tryWin(player)
if #self.cardList == 0 then
if (self.pair_count == 1) then
return true
elseif self.pair_count == 2 and #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
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 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
if self:tryPair2(activeCard) then
if self:tryWin(player) then
return true
end
self.pair_count = 0
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 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
if self:tryPair2(activeCard) then
if self:tryWin(player) then
return true
end
self.pair_count = 0
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
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 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
if self:tryPair2(activeCard) then
if self:tryWin(player) then
return true
end
self.pair_count = 0
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.drawCard=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
self.drawCard=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
kan_huxi = kan_huxi + 3
removeCard(cardInhand, kan_cards[i], 3)
end
end
player.tiCount = 0
player.paoCount = 0
for k = 100, 200, 100 do
for i = 1, 10 do
local tem = k + i
local result = init(self, player, cardInhand, tem)
if result then
--printlog("是否胡牌===>>>",tem)
end
local num = 0
for k = 1, #self.stackHuxi do
num = num + self.stackHuxi[k]
end
if result then
local num1 = 0
--pt(self.stackHuxi)
for k = 1, #self.stackHuxi do
num1 = num1 + self.stackHuxi[k]
--printlog(self.stackHuxi[k])
end
--printlog("胡息数量===>>>",player.hu_xi,num1,kan_huxi)
if (player.hu_xi + num1 + kan_huxi) >= (self:getHuxi(room)-1) then
tingList[#tingList + 1] = tem
end
end
end
end
return tingList
end
function M:getHuxi(room)
if room.game_id == 15 then
return 8
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.5 * m_width - 0.5 * width
self._view.x = 0
self._view.y = 0.7 * 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,119 @@
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)
local room = DataManager.CurrenRoom
if room.change_card_display ~= nil then
return card_1 .. room.change_card_display .. card_2
else
return card_1 .. "2_" .. card_2
end
end
function M:getCardSize()
if self._room.change_card_size ~= nil then
return self._room.change_card_size
else
return 1
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,23 @@
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'
}
return ZPGameEvent

View File

@ -0,0 +1,452 @@
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')
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() .. ' ' .. qihu .. '胡息起 ' .. self._room.score_times .. ''
else
self._view:GetChild('di_text').text = self._room.room_config:GetGameName() .. ' ' .. qihu .. '胡息起'
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)
if typeface == 1 then
if isdisplay then
self._room.change_card_display = '7_'
else
self._room.change_card_display = '2_'
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.2
elseif typeface == 1 then
self._room.change_card_size = 1
elseif typeface == 2 then
self._room.change_card_size = 0.8
end
else
self._room.change_card_size = change_card_size
end
--加载上次游戏的接收语音
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
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
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
else
self._ctr_action.selectedIndex = 0
end
self:ResetHandCard()
self:showBackBtnView()
self:InitXiPai()
self:InitXiPai1()
local btn_safe = self._view:GetChild('btn_safe')
self.safe_arrow1 = btn_safe:GetChild("arrow1")
self.safe_arrow2 = btn_safe:GetChild("arrow2")
btn_safe.onClick:Set(
function()
self:BtnsSafe()
end
)
local safe_close = self._view:GetChild('safe_close')
safe_close.onClick:Set(
function()
self:BtnsSafe()
end
)
self:BtnsSafe()
end
-- zlx 20260208
function M:BtnsSafe()
local btn_temp1 = self._view:GetChild("btn_back_lobby")
local btn_temp2 = self._view:GetChild("Btn_jiesan_lobby")
local btn_temp3 = self._view:GetChild("btn_leave_lobby")
local btn_temp4 = self._view:GetChild("btn_setting")
local safe_close = self._view:GetChild('safe_close')
local btn_rule = self._view:GetChild('btn_rule')
local gcm_chat = self._view:GetChild('gcm_chat')
btn_temp1.visible = not btn_temp1.visible
btn_temp2.visible = not btn_temp2.visible
btn_temp3.visible = not btn_temp3.visible
btn_temp4.visible = not btn_temp4.visible
safe_close.visible = not safe_close.visible
btn_rule.visible = not btn_rule.visible
gcm_chat.visible = not gcm_chat.visible
local safe = self._view:GetChild("safe_bg")
safe.visible = not safe.visible
if safe.visible then
self.safe_arrow1.visible = false
self.safe_arrow2.visible = true
else
self.safe_arrow1.visible = true
self.safe_arrow2.visible = false
end
local text_playName = self._view:GetChild('text_playName')
if text_playName then
text_playName.text = "放炮罚"
end
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 = '2_'
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)
if index == 0 then
self._room.change_card_size = 1.2
elseif index == 1 then
self._room.change_card_size = 1
elseif index == 2 then
self._room.change_card_size = 0.8
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,476 @@
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._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("jefe 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/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/Qipai")
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/Qipai")
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)
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)
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:ClearOutCard()
end)
--
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.."2_"..card_2
end
end
return M

View File

@ -0,0 +1,879 @@
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._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')
self.ctr_piao = self._view:GetController('piao')
self.ctr_piao_value = self._view:GetController('piaovalue')
self:BtnEvent()
end
function M:ShowPiao(piao)
self:UpdateIsOnClick(true)
self.ctr_piao.selectedIndex = piao
self:EnableAllPiaoTouch()
end
function M:HidePiao()
self.ctr_piao.selectedIndex = 0
end
function M:BtnEvent()
self.btn_tips = self._view:GetChild('btn_tips')
local function click_piao()
local closePiaoTipsFunc=function ()
self.ctr_piao.selectedIndex = 0
end
ControllerManager.GetController(GameController):SendPiao(tonumber(self.ctr_piao_value.selectedPage),closePiaoTipsFunc)
end
self.PiaoList={}
local btn_piao0 = self._view:GetChild('piao0')
btn_piao0.onClick:Set(click_piao)
table.insert(self.PiaoList,btn_piao0)
local btn_piao1 = self._view:GetChild('piao1')
btn_piao1.onClick:Set(click_piao)
table.insert(self.PiaoList,btn_piao1)
local btn_piao2 = self._view:GetChild('piao2')
btn_piao2.onClick:Set(click_piao)
table.insert(self.PiaoList,btn_piao2)
local btn_piao3 = self._view:GetChild('piao3')
btn_piao3.onClick:Set(click_piao)
table.insert(self.PiaoList,btn_piao3)
local btn_piao5 = self._view:GetChild('piao5')
btn_piao5.onClick:Set(click_piao)
table.insert(self.PiaoList,btn_piao5)
local btn_piao8 = self._view:GetChild('piao8')
btn_piao8.onClick:Set(click_piao)
table.insert(self.PiaoList,btn_piao8)
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._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)
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')
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 = 95 * self:getCardSize()
self.card_hight = 123 * 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')
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 = 95 * self:getCardSize()
self.card_hight = 123 * 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 = 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)
--存牌堆
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: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/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
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.3)
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._area_handcard_list:AddChild(card_view.btn_card)
card_view.btn_card:TweenMove(self:GetHandCardPos(card_view, #CountCards), 0.3)
end
end
--更新手牌大小
function M: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 = 87 * self:getCardSize()
self.card_hight = 110 * self:getCardSize()
self._area_handcard_list:AddChild(card_view.btn_card)
card_view.btn_card:TweenMove(self:GetHandCardPos(card_view, #CountCards), 0.3)
end
end
function M:UpdateIsOnClick(isOut)
self._view.touchable = isOut
end
-- 结束 拖拽事件
-- 根据牌结束点的位置 判断是出牌还是调整位置 button.xy 和 牌的xy比较
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 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 -- 牌的宽度
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)
if self:getCardSize() == 1 then
y = 90 - (85 * cards_view.index_Y)
elseif self:getCardSize() == 1.2 then
y = 70 - (110 * cards_view.index_Y)
elseif self:getCardSize() == 0.8 then
y = 100 - (65 * cards_view.index_Y)
end
return Vector2.New(x, y)
end
--更新 吃碰
function M:UpdateFzList(fz_list)
printlog("jefe self 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/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
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.ChouWei then
local fzcards = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Fz_0_3')
fzcards:GetController('c1').selectedIndex = 1
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.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:ClearOutCard()
self._area_outcard_list:RemoveChildren(0, -1, true)
end
--出牌
function M:UpdateOutCardList(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)
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)
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:ClearOutCard()
end
)
end
--得到设置的牌字体
function M:getCardItem(card_1, card_2)
if self._room.change_card_display ~= nil then
--printlog("===========",self._room.change_card_display)
return card_1 .. self._room.change_card_display .. card_2
else
return card_1 .. '2_' .. card_2
end
end
--得到设置的牌大小
function M:getCardSize()
if self._room.change_card_size ~= nil then
return self._room.change_card_size
else
return 1
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.2
self.mediumSize = 1
self.smallSize = 0.8
self._full = true
self._anim_pop = 2
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
printlog("room.change_card_display===>>>",room.change_card_display)
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 = 2
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 = 2
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:GetChild('di_text').text = room.room_config:GetGameName() .. ' ' .. qihu .. '胡息起'
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
-- self._blur_view:GetChild('di_text').text = room.room_config:GetGameName() .. ' ' .. qihu .. '胡息起'
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,84 @@
-- 记录各游戏的桌面背景
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"},
-- {id = 4, url = "base/main_zipai/bg/bg_gold", thumb = "ui://Main_RunBeard/table_bg3"},
-- {id = 5, url = "base/main_zipai/bg/bg8", thumb = "ui://Main_RunBeard/table_bg1"},
-- {id = 6, url = "base/tablebg/bg/bg1", thumb = "ui://Common/b04"},
}
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

@ -432,6 +432,8 @@ function M:getHuxi(room)
else else
return 9 return 9
end end
else
return 15
end end
end end

View File

@ -1,5 +1,5 @@
{ {
"libview.firstColumnWidth": 384, "libview.firstColumnWidth": 413,
"libview.iconScale": 0, "libview.iconScale": 0,
"doc.openedDocs": [ "doc.openedDocs": [
"ui://m7iejg46kwi0hkb", "ui://m7iejg46kwi0hkb",
@ -13,32 +13,7 @@
"auxline2": true, "auxline2": true,
"doc.activeDoc": "ui://7ij0e6i2sv5gk", "doc.activeDoc": "ui://7ij0e6i2sv5gk",
"libview.twoColumn": false, "libview.twoColumn": false,
"libview.expandedNodes": [ "libview.expandedNodes": [],
"h30s8vme",
"/",
"h30s8vme",
"/component/",
"h30s8vme",
"/component/create_room/",
"h30s8vme",
"/component/create_room/image/",
"h30s8vme",
"/mgr/",
"h30s8vme",
"/mgr/imgs/",
"h30s8vme",
"/mgr/imgs/game/",
"d1qrzqpr",
"/",
"7ij0e6i2",
"/",
"7ij0e6i2",
"/component/",
"7ij0e6i2",
"/component/create_room/",
"7ij0e6i2",
"/component/create_room/image/"
],
"auxline1": true, "auxline1": true,
"snapToGrid": true, "snapToGrid": true,
"test.orientation": "landscape", "test.orientation": "landscape",

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://mzvoz9udm1i385" align="center" vAlign="middle">
<gearIcon controller="ban" pages="1,2" values="ui://mzvoz9udm1i386|ui://mzvoz9udm1i385" default="ui://mzvoz9udm1i387"/>
</loader>
</displayList>
<Button downEffect="dark" downEffectValue="0.80"/>
</component>

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

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="m1i384" fileName="Btn_chat.xml" xy="8,87" controller="ban,0">
<Button icon="ui://mzvoz9udm1i385"/>
</component>
<component id="n2_h1uu" name="n2" src="m1i37m" fileName="component/VoiceMask(1).xml" xy="7,-47">
<gearDisplay controller="voice" pages="1"/>
</component>
<component id="n3_h1uu" name="btn_record" src="m1i384" fileName="Btn_chat.xml" xy="8,0" controller="ban,0">
<gearDisplay controller="sdk" pages="0"/>
<Button icon="ui://mzvoz9udm1i388"/>
</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="m1i3a" 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="m1i383" xy="1222,376">
<gearDisplay controller="state" pages="0,1,2"/>
<relation target="" sidePair="middle-middle"/>
</component>
<component id="n34_k3io" name="btn_ready" src="m1i34" xy="575,654" group="n36_k3io">
<gearDisplay controller="action" pages="0"/>
<Button icon="ui://mzvoz9udm1i389"/>
</component>
<component id="n35_k3io" name="btn_start" src="m1i34" xy="575,654" group="n36_k3io">
<gearDisplay controller="action" pages="1"/>
<Button icon="ui://mzvoz9udm1i38a"/>
</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="m1i3e" xy="934,29" group="n52_cnxs"/>
<component id="n50_cnxs" name="btn_getRoomNum" src="m1i3c" xy="896,656" group="n52_cnxs">
<gearDisplay controller="state" pages="0"/>
<Button icon="ui://mzvoz9udm1i38b"/>
</component>
<component id="n56_cnxs" name="mask_tips" src="m1i37a" 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="m1i38c" 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="m1i3g" 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="m1i367" 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="m1i35v" 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="m1i348" 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="m1i35w" 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://mzvoz9udm1i35x" 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="m1i31" 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="m1i33" 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="m1i3f" 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="m1i3h" fileName="images/game/Button_Close.png" xy="98,28" scale="1.5,1.5"/>
<image id="n3_hp0b" name="n3" src="m1i3i" 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="m1i3d" 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="0,2" size="87,92" url="ui://mzvoz9udm1i39" autoSize="true"/>
</displayList>
<Button downEffect="dark" downEffectValue=".8"/>
</component>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="400,169" extention="Button">
<displayList>
<image id="n1" name="n1" src="m1i36" fileName="font/images/tishi_bottom_01.png" xy="0,0" size="288,82" visible="false"/>
<image id="n4_iukg" name="n4" src="m1i37" fileName="font/images/new_btns/new_button_redy.png" xy="0,0" visible="false"/>
<loader id="n2" name="icon" xy="0,0" size="400,169" align="center" vAlign="middle" fill="scaleFree"/>
</displayList>
<Button downEffect="dark" downEffectValue=".8"/>
</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="m1i3b" 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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 936 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

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="m1i37z" 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="m1i3a" 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="m1i37u" 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="m1i37b" 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="m1i37w" fileName="component/Main/component/PlayerHead_2.xml" xy="1185,50"/>
<component id="n7" name="player_info1" src="m1i37s" 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="m1i383" fileName="Gcm_chat.xml" xy="1222,468">
<gearDisplay controller="state" pages="0,1,2"/>
</component>
<component id="n34_k3io" name="btn_ready" src="m1i34" fileName="buttons/Btn_Yellow.xml" xy="575,654" group="n36_k3io">
<gearDisplay controller="action" pages="0"/>
<Button icon="ui://mzvoz9udm1i389"/>
</component>
<component id="n35_k3io" name="btn_start" src="m1i34" fileName="buttons/Btn_Yellow.xml" xy="575,654" group="n36_k3io">
<gearDisplay controller="action" pages="1"/>
<Button icon="ui://mzvoz9udm1i38a"/>
</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="m1i3c" fileName="buttons/Btn_blue_long.xml" xy="896,656" group="n52_cnxs">
<gearDisplay controller="state" pages="0"/>
<Button icon="ui://mzvoz9udm1i38b"/>
</component>
<component id="n56_cnxs" name="mask_tips" src="m1i37a" 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="m1i38c" 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="m1i36t" 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="m1i372" 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="m1i36r" 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="m1i38m" fileName="component/Main/RoomInfoPanel1.xml" xy="487,10" size="135,67" group="n150_8th3" touchable="false"/>
<component id="n31_h1uu" name="roominfo_panel" src="m1i38m" fileName="component/Main/RoomInfoPanel1.xml" xy="487,10" group="n150_8th3" visible="false"/>
<component id="n46_u4l2" name="btn_rule" src="m1i36p" 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="m1i373" 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="m1i373" xy="377,-1" size="580,98">
<gearDisplay controller="state" pages="3"/>
</image>
<image id="n65_q9kx" name="n65" src="m1i37z" xy="535,130" size="262,70" alpha="0.6">
<gearDisplay controller="state" pages="1,3"/>
</image>
<component id="n12" name="btn_wxyqhy" src="m1i3a" 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="m1i37u" xy="981,2">
<gearDisplay controller="state" pages="1,3"/>
</component>
<component id="n64_jali" name="player_card_info3" src="m1i37v" xy="155,2">
<gearDisplay controller="state" pages="1,3"/>
</component>
<component id="n61_jali" name="player_card_info1" src="m1i37b" xy="0,530" size="1334,221">
<gearDisplay controller="state" pages="1,3"/>
</component>
<component id="n18" name="player_info2" src="m1i37w" 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="m1i37y" 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="m1i37s" 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="m1i383" xy="1238,487">
<gearDisplay controller="state" pages="0,1,2"/>
</component>
<component id="n50_cnxs" name="btn_getRoomNum" src="m1i3c" xy="896,655" group="n149_qpk6">
<gearDisplay controller="state" pages="0"/>
<Button icon="ui://mzvoz9udm1i38b"/>
</component>
<component id="n56_cnxs" name="mask_tips" src="m1i37a" 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="m1i34" xy="575,654" group="n36_k3io">
<gearDisplay controller="action" pages="0"/>
<Button icon="ui://mzvoz9udm1i389"/>
</component>
<component id="n35_k3io" name="btn_start" src="m1i34" xy="575,654" group="n36_k3io">
<gearDisplay controller="action" pages="1"/>
<Button icon="ui://mzvoz9udm1i38a"/>
</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="m1i367" xy="18,357">
<gearDisplay controller="state" pages="0,1,2"/>
</component>
<component id="n57_rayb" name="panel_record" src="m1i38c" xy="379,435" alpha="0.5">
<gearDisplay controller="state" pages="3"/>
</component>
<component id="n153_qpk6" name="btn_reset" src="m1i36t" 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="m1i38m" 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="m1i372" xy="377,6" group="n154_qpk6">
<gearDisplay controller="state" pages="0,1,2"/>
</component>
<component id="n37_kba2" name="roominfo_panel1" src="m1i38m" xy="487,10" size="150,77" group="n154_qpk6" touchable="false"/>
<component id="n33_hp0b" name="btn_back_lobby" src="m1i36r" xy="413,7" group="n154_qpk6">
<gearDisplay controller="state" pages="0,3"/>
</component>
<component id="n151_qpk6" name="btn_rule" src="m1i36p" 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="m1i373" xy="377,-1" size="580,98">
<gearDisplay controller="state" pages="3"/>
</image>
<image id="n65_q9kx" name="n65" src="m1i37z" xy="535,130" size="262,70" alpha="0.6">
<gearDisplay controller="state" pages="1,3"/>
</image>
<component id="n12" name="btn_wxyqhy" src="m1i3a" 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="m1i37u" xy="981,2">
<gearDisplay controller="state" pages="1,3"/>
</component>
<component id="n159_f55q" name="player_card_info2" src="m1i378" xy="0,530"/>
<component id="n64_jali" name="player_card_info4" src="m1i37v" xy="155,2">
<gearDisplay controller="state" pages="1,3"/>
</component>
<component id="n61_jali" name="player_card_info1" src="m1i37b" xy="0,529" size="1334,221">
<gearDisplay controller="state" pages="1,3"/>
</component>
<component id="n18" name="player_info3" src="m1i37w" 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="m1i37y" 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="m1i37s" 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="m1i3c" xy="896,655" group="n149_qpk6" visible="false">
<gearDisplay controller="state" pages="0"/>
<Button icon="ui://mzvoz9udm1i38b"/>
</component>
<component id="n56_cnxs" name="mask_tips" src="m1i37a" 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="m1i34" xy="575,654" group="n36_k3io">
<gearDisplay controller="action" pages="0"/>
<Button icon="ui://mzvoz9udm1i389"/>
</component>
<component id="n35_k3io" name="btn_start" src="m1i34" xy="575,654" group="n36_k3io">
<gearDisplay controller="action" pages="1"/>
<Button icon="ui://mzvoz9udm1i38a"/>
</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="m1i367" xy="18,357">
<gearDisplay controller="state" pages="0,1,2"/>
</component>
<component id="n57_rayb" name="panel_record" src="m1i38c" xy="379,435" alpha="0.5">
<gearDisplay controller="state" pages="3"/>
</component>
<component id="n153_qpk6" name="btn_reset" src="m1i36t" 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="m1i38m" 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="m1i372" xy="377,6" group="n154_qpk6">
<gearDisplay controller="state" pages="0,1,2"/>
</component>
<component id="n37_kba2" name="roominfo_panel1" src="m1i38m" xy="487,10" size="150,77" group="n154_qpk6" touchable="false"/>
<component id="n33_hp0b" name="btn_back_lobby" src="m1i36r" xy="413,7" group="n154_qpk6">
<gearDisplay controller="state" pages="0,3"/>
</component>
<component id="n151_qpk6" name="btn_rule" src="m1i36p" 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="m1i37w" 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="m1i374" 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,6 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="42,42">
<displayList>
<loader id="n0_lr5d" name="icon" xy="0,0" size="42,42" autoSize="true"/>
</displayList>
</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://mzvoz9udm1i370" 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="m1i375" xy="110,0">
<Button icon="ui://mzvoz9udm1i371"/>
</component>
<component id="n2_h1uu" name="n2" src="m1i36w" xy="7,-47">
<gearDisplay controller="voice" pages="1"/>
</component>
<component id="n3_h1uu" name="btn_record" src="m1i375" 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="m1i36p" xy="437,2" size="59,73" group="n19_qpk6" visible="false" touchable="false"/>
<image id="n15_qpk6" name="n15" src="m1i373" xy="0,0" size="580,98" group="n19_qpk6"/>
<component id="n1" name="btn_setting" src="m1i36c" xy="496,1" size="71,94" group="n19_qpk6"/>
<component id="n5" name="pb_batteryLevel" src="m1i36e" xy="281,11" group="n19_qpk6" touchable="false">
<ProgressBar value="62" max="100"/>
</component>
<component id="n6" name="gcm_xinhao" src="m1i36h" xy="280,50" size="106,22" group="n19_qpk6" touchable="false">
<gearDisplay controller="xinhao" pages="0"/>
</component>
<component id="n9" name="gcm_wifi" src="m1i36l" 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="m1i36x" xy="0,0"/>
<image id="n1" name="n1" src="m1i36y" xy="0,4"/>
<image id="n2" name="n2" src="m1i36z" 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="m1i36s" 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="m1i36s" 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="m1i36q" 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="m1i36u" 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="m1i36d" 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>

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