观战最新
|
|
@ -123,7 +123,6 @@ end
|
|||
--观战进入房间
|
||||
function M:WitnessGame(group_id, player_id, room_id)
|
||||
local _client = ControllerManager.GameNetClinet
|
||||
print("lingmeng game_client", _client)
|
||||
if not _client then
|
||||
return
|
||||
end
|
||||
|
|
@ -346,7 +345,6 @@ function M:OnEventPlayerReady(evt_data)
|
|||
else
|
||||
p.isSendCardState = false
|
||||
end
|
||||
print("lingmengOnEventPlayerReady")
|
||||
DispatchEvent(self._dispatcher, GameEvent.PlayerReady, p)
|
||||
end
|
||||
)
|
||||
|
|
|
|||
|
|
@ -241,7 +241,6 @@ function M:PublicWitnessRoom(cmd, roomid, group_id, callback, game_id, pid)
|
|||
pt(_data)
|
||||
local _client = ControllerManager.GroupClient
|
||||
_client:send(cmd, _data, function(res)
|
||||
printlog("++++++++++++111111111111111111111111111111111111")
|
||||
pt(res)
|
||||
if (res.ReturnCode == 0) then
|
||||
local json = res.Data
|
||||
|
|
@ -267,7 +266,6 @@ function M:PublicWitnessRoom(cmd, roomid, group_id, callback, game_id, pid)
|
|||
end
|
||||
j_data["pos"] = DataManager.SelfUser.location:Location2String()
|
||||
printlog("++++++++++++++++++++++++++++++++++++++++++")
|
||||
print("lingmeng 你要的IP信息", room.server_host)
|
||||
__ConntectGameServer(Protocol.GAME_WITNESS_ROOM, room, room.server_host, j_data, function(res1)
|
||||
printlog("===============================-------------")
|
||||
pt(res1)
|
||||
|
|
|
|||
|
|
@ -169,12 +169,10 @@ function M:OnEventSendCards(evt_data)
|
|||
end
|
||||
|
||||
function M:OnEventOutCard(evt_data)
|
||||
print("lingmeng OnEventOutCard")
|
||||
local seat = evt_data["seat"]
|
||||
local card = evt_data["card"]
|
||||
local ting_list = nil
|
||||
local p = self._room:GetPlayerBySeat(seat)
|
||||
print("lingmeng OnEventOutCard1", #self._cacheEvent)
|
||||
self._cacheEvent:Enqueue(function()
|
||||
local _room = self._room
|
||||
_room.last_outcard_seat = seat
|
||||
|
|
@ -189,11 +187,9 @@ function M:OnEventOutCard(evt_data)
|
|||
p.hand_left_count = p.hand_left_count - 1
|
||||
if not p.outcard_list then p.outcard_list = {} end
|
||||
p.outcard_list[#p.outcard_list + 1] = card
|
||||
print("lingmeng OnEventOutCard2")
|
||||
DispatchEvent(self._dispatcher, TX_GameEvent.OutCard, p, card)
|
||||
end
|
||||
end)
|
||||
print("lingmeng OnEventOutCard1-2", #self._cacheEvent)
|
||||
end
|
||||
|
||||
function M:OnEventTakeCard(evt_data)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
local EXRoomConfig = import(".EXRoomConfig")
|
||||
local EXClearingView = import(".EXClearingView")
|
||||
local TX_GameEvent = import(".GameEvent")
|
||||
local PlayerInfoView = import(".EXPlayerInfoView")
|
||||
local MJPlayerSelfCardInfoView = import(".MJPlayerSelfCardInfoView")
|
||||
local MJPlayerCardInfoView = require("main.majiang.MJPlayerCardInfoView")
|
||||
|
||||
local Record_Event = import(".RecordEvent")
|
||||
|
||||
|
|
@ -29,6 +32,7 @@ function M:init()
|
|||
self._new_hide = false
|
||||
self._queue = false
|
||||
self._style = 1
|
||||
self._popEvent = true
|
||||
self:InitView()
|
||||
end
|
||||
|
||||
|
|
@ -37,22 +41,56 @@ function M:InitView(url)
|
|||
UIPackage.AddPackage("extend/majiang/lichuan/ui/Extend_MJ_LiChuan")
|
||||
BaseView.InitView(self, string.format("ui://Main_Majiang/Main_new_%d_jiangxi", room.room_config.people_num))
|
||||
self:EventInit()
|
||||
UpdateBeat:Add(self.OnUpdate, self)
|
||||
|
||||
local _cardbox = self._view:GetChild("cardbox")
|
||||
--self._view:GetChild("panel_record"):GetChild("btn_LastStep").enabled = false
|
||||
self._ctr_cardbox = _cardbox:GetController("c1")
|
||||
local centerBox = self._view:GetChild("Comp_ConterBox")
|
||||
self._ctr_cardbox = centerBox:GetController("seat")
|
||||
self._tex_leftTime = centerBox:GetChild("Text_Time")
|
||||
self._tex_round = self._view:GetChild("tex_round")
|
||||
self._tex_LeftCard = self._view:GetChild("remaining_card")
|
||||
self._anchor = self._view:GetChild("mask_tips")
|
||||
end
|
||||
|
||||
function M:FillRoomData(data)
|
||||
------------------渲染桌面信息--------------------------
|
||||
|
||||
local config = ExtendManager.GetExtendConfig(room.game_id)
|
||||
local mode = config:GetGameInfo()
|
||||
local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config))
|
||||
|
||||
self._view:GetChild('text_time').text = os.date("%H:%M", os.time())
|
||||
self._view:GetChild('text_roomId').text = room.room_id
|
||||
self._view:GetChild('wanfa_text').text = gamePlay
|
||||
self._ctr_state = self._view:GetController("state")
|
||||
|
||||
self._text_remined = self._view:GetChild('remaining_card')
|
||||
self._text_round = self._view:GetChild('text_round')
|
||||
self._cursor = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Ani_play_bj")
|
||||
|
||||
self:InitPlayerInfoView()
|
||||
self._player_card_info = {}
|
||||
local _player_card_info = self._player_card_info
|
||||
for i = 1, #room.player_list do
|
||||
local p = room.player_list[i]
|
||||
local index = self:GetPos(p.seat)
|
||||
local info = self._player_info[index]
|
||||
local tem = self._view:GetChild("player_card_info" .. index)
|
||||
local cardInfo = _player_card_info[index]
|
||||
cardInfo = self:NewMJPlayerCardInfoView(tem, index)
|
||||
cardInfo:SetPlayer(p)
|
||||
cardInfo:UpdateHandCardWitness(false)
|
||||
cardInfo:UpdateOutCardList(nil, nil, self._cursor)
|
||||
for i = 1, #p.fz_list do
|
||||
cardInfo:UpdateFzList(p.fz_list[i], -1)
|
||||
end
|
||||
info:FillData(p)
|
||||
info._view.visible = true
|
||||
end
|
||||
-------------------------------------------------------
|
||||
|
||||
self._ctr_state.selectedIndex = 4
|
||||
end
|
||||
|
||||
function M:EventInit()
|
||||
-- UIPackage.AddPackage("extend/majiang/hongzhong/ui/Extend_MJ_HongZhong")
|
||||
print("lingmeng EventInit")
|
||||
MainView.EventInit(self)
|
||||
local _room = self._room
|
||||
local _view = self._view
|
||||
|
|
@ -80,6 +118,14 @@ function M:EventInit()
|
|||
end)
|
||||
_gamectr:AddEventListener(TX_GameEvent.EventTurn, function(...)
|
||||
print("lingmeng witness EventTurn")
|
||||
local arg = { ... }
|
||||
self._left_time = 15
|
||||
local seat = arg[1]
|
||||
self:UpdateCardBox(self:GetPos(seat))
|
||||
local playerInfo = self._player_info[self:GetPos(seat)]
|
||||
playerInfo.hand_left_count = info.hand_left_count + 1
|
||||
local info = self._player_card_info[self:GetPos(seat)]
|
||||
info:UpdateHandCardWitness(true)
|
||||
end)
|
||||
|
||||
_gamectr:AddEventListener(TX_GameEvent.OutHint, function(...)
|
||||
|
|
@ -88,7 +134,23 @@ function M:EventInit()
|
|||
|
||||
local _gcm_outcard_url = "ui://Main_Majiang/Gcm_OutCard"
|
||||
_gamectr:AddEventListener(TX_GameEvent.OutCard, function(...)
|
||||
print("lingmeng witness OutCard")
|
||||
self._left_time = 0
|
||||
local arg = { ... }
|
||||
local p = arg[1]
|
||||
local card = arg[2]
|
||||
local seat = p.seat
|
||||
local info = self._player_card_info[self:GetPos(seat)]
|
||||
self:RemoveCursor()
|
||||
info:UpdateHandCardWitness(false)
|
||||
info:UpdateOutCardList(nil, nil, self._cursor)
|
||||
print("ling 2zhihouq")
|
||||
self:PlaySound("LiChuan_MJ", p.self_user.sex, tostring(card))
|
||||
self:PlayMJSound("chupai.mp3")
|
||||
print("ling 2zhihou")
|
||||
if seat == _room.self_player.seat then
|
||||
_room.curren_outcard_seat = -1
|
||||
end
|
||||
print("ling 2zhihou2")
|
||||
end)
|
||||
_gamectr:AddEventListener(TX_GameEvent.GetCard, function(...)
|
||||
print("lingmeng witness GetCard")
|
||||
|
|
@ -98,9 +160,7 @@ function M:EventInit()
|
|||
print("lingmeng witness FZTips")
|
||||
end)
|
||||
|
||||
_gamectr:AddEventListener(TX_GameEvent.FangziAction, function()
|
||||
print("lingmeng witness FangziAction")
|
||||
end)
|
||||
_gamectr:AddEventListener(TX_GameEvent.FangziAction, handler(self, self.OnFangziAction))
|
||||
|
||||
_gamectr:AddEventListener(TX_GameEvent.ZPHuCard, function(...)
|
||||
print("lingmeng witness ZPHuCard")
|
||||
|
|
@ -131,229 +191,106 @@ function M:EventInit()
|
|||
end)
|
||||
end
|
||||
|
||||
function M:ShowStep(index)
|
||||
local step = self._step[index + 1]
|
||||
self:UpdateLeftCard(step.left_card)
|
||||
-- self._ctr_cardbox.selectedIndex = step.current_out_seat
|
||||
self:UpdateCardBox(self:GetPos(step.current_out_seat))
|
||||
self:UpdateStep(index + 1)
|
||||
if step.cmd ~= Record_Event.Evt_OutCard then
|
||||
self:RemoveCursor()
|
||||
end
|
||||
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.hand_left_count = #p.card_list
|
||||
info:Clear()
|
||||
info:ResetFzList()
|
||||
p.piao_niao = step.player_card_data[i].piao_niao
|
||||
local head_info = self._player_info[self:GetPos(i)]
|
||||
if p.piao_niao and p.piao_niao > 0 then
|
||||
head_info._view:GetChild("mask_piao").title = "飘分 " .. p.piao_niao
|
||||
head_info._view:GetController("piao_niao").selectedIndex = 1
|
||||
else
|
||||
head_info._view:GetController("piao_niao").selectedIndex = 0
|
||||
end
|
||||
if step.cmd == Record_Event.Evt_OutCard and i == step.last_out_seat then
|
||||
local card = p.outcard_list[#p.outcard_list]
|
||||
info:UpdateOutCardList(nil, nil, self._cursor)
|
||||
else
|
||||
info:UpdateOutCardList()
|
||||
end
|
||||
if step.cmd == Record_Event.Evt_GetCard and p.seat == step.current_out_seat then
|
||||
info:UpdateHandCard(true, true)
|
||||
else
|
||||
info:UpdateHandCard(false, true)
|
||||
end
|
||||
end
|
||||
if step.cmd == Record_Event.Evt_Win then
|
||||
self._win_pic = UIPackage.CreateObjectFromURL("ui://Main_Majiang/胡")
|
||||
local info = self._player_card_info[self:GetPos(step.win)]
|
||||
info._mask_liangpai:AddChild(self._win_pic)
|
||||
self._win_pic:Center()
|
||||
else
|
||||
if self._win_pic then
|
||||
self._win_pic:Dispose()
|
||||
end
|
||||
end
|
||||
if step.cmd == Record_Event.Evt_Niao then
|
||||
local niao_list = step.niao
|
||||
self._niao = UIPackage.CreateObjectFromURL("ui://Extend_MJ_LiChuan/Panel_Birds")
|
||||
local list = self._niao:GetChild("Lst_birds")
|
||||
list:RemoveChildrenToPool()
|
||||
for i = 1, #niao_list do
|
||||
local item = list:AddItemFromPool()
|
||||
item.icon = UIPackage.GetItemURL("Main_Majiang", "201_" .. niao_list[i].card)
|
||||
if niao_list[i].score > 0 then
|
||||
item:GetController("bg").selectedIndex = 2
|
||||
end
|
||||
end
|
||||
self._view:AddChild(self._niao)
|
||||
self._view:AddChild(self._view:GetChild("panel_record"))
|
||||
self._niao:Center()
|
||||
else
|
||||
if self._niao then
|
||||
self._niao:Dispose()
|
||||
end
|
||||
end
|
||||
if step.cmd == Record_Event.Evt_Result then
|
||||
if not self.result then
|
||||
self.result = EXClearingView.new(self._root_view, true)
|
||||
self.result:InitData(0, self._room, step.result_data)
|
||||
self.result._view.x = (GRoot.inst.width - self.result._view.width) * -0.5
|
||||
self.result._view.width = GRoot.inst.width
|
||||
self.result._view.height = GRoot.inst.height
|
||||
self.result._view:GetChild("btn_confirm").visible = false
|
||||
self._anchor:AddChild(self.result._view)
|
||||
self.result._view.x = self._anchor.x * -1
|
||||
self.result._view.y = self._anchor.y * -1
|
||||
else
|
||||
self.result._view.visible = true
|
||||
end
|
||||
-- self.result._view:Center()
|
||||
else
|
||||
if self.result then
|
||||
self.result._view.visible = false
|
||||
end
|
||||
function M:InitPlayerInfoView()
|
||||
self._player_info = {}
|
||||
local _player_info = self._player_info
|
||||
for i = 1, self._room.room_config.people_num do
|
||||
local tem = self._view:GetChild(string.format("player_info%d_2", i))
|
||||
_player_info[i] = PlayerInfoView.new(tem, self)
|
||||
tem.visible = false
|
||||
end
|
||||
end
|
||||
|
||||
function M:GenerateAllStepData(data)
|
||||
local cmdList = self.cmdList
|
||||
self._step = {}
|
||||
local step = {}
|
||||
local info = data.info
|
||||
step.cmd = ""
|
||||
step.left_card = info.left_card
|
||||
step.last_out_seat = 0
|
||||
step.current_out_seat = 1
|
||||
step.win = 0
|
||||
step.niao = 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.piao_niao = p.piao_niao
|
||||
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)
|
||||
function M:NewMJPlayerCardInfoView(view, index)
|
||||
if index == 1 then
|
||||
return MJPlayerSelfCardInfoView.new(view, self)
|
||||
end
|
||||
return MJPlayerCardInfoView.new(view, self)
|
||||
end
|
||||
|
||||
function M:CmdGetCard(cmd, index)
|
||||
local data = self:CopyLastStep(index)
|
||||
data.cmd = cmd.cmd
|
||||
data.current_out_seat = cmd.seat
|
||||
data.left_card = cmd.data.left_count
|
||||
local u = data.player_card_data[cmd.seat]
|
||||
u.card_list[#u.card_list + 1] = cmd.data.card
|
||||
end
|
||||
|
||||
function M:CmdOutCard(cmd, index)
|
||||
local data = self:CopyLastStep(index)
|
||||
data.cmd = cmd.cmd
|
||||
data.last_out_seat = cmd.seat
|
||||
local u = data.player_card_data[cmd.seat]
|
||||
list_remove(u.card_list, cmd.data.card)
|
||||
table.sort(u.card_list, self.HandCardSortAndJing)
|
||||
u.outcard_list[#u.outcard_list + 1] = cmd.data.card
|
||||
end
|
||||
|
||||
function M:CmdAction(cmd, index)
|
||||
local data = self:CopyLastStep(index)
|
||||
data.cmd = cmd.cmd
|
||||
data.last_out_seat = 0
|
||||
data.current_out_seat = cmd.seat
|
||||
local u = data.player_card_data[cmd.seat]
|
||||
for i = 1, #cmd.data.opcard do
|
||||
list_remove(u.card_list, cmd.data.opcard[i])
|
||||
end
|
||||
local fz = {}
|
||||
fz.type = cmd.data.type
|
||||
fz.card = cmd.data.card
|
||||
fz.opcard = cmd.data.opcard
|
||||
local uf = data.player_card_data[cmd.data.from_seat]
|
||||
if fz.type ~= FZType.Gang_An and fz.type ~= FZType.Gang_Peng then
|
||||
table.remove(uf.outcard_list, #uf.outcard_list)
|
||||
end
|
||||
if fz.type ~= FZType.Gang_Peng then
|
||||
u.fz_list[#u.fz_list + 1] = fz
|
||||
else
|
||||
for i = 1, #u.fz_list do
|
||||
if u.fz_list[i].type == FZType.Peng and u.fz_list[i].card == fz.card then
|
||||
u.fz_list[i].type = FZType.Gang_Peng
|
||||
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:CmdNiao(cmd, index)
|
||||
local data = self:CopyLastStep(index)
|
||||
data.cmd = cmd.cmd
|
||||
data.niao = cmd.data.niao
|
||||
end
|
||||
|
||||
function M:CmdPiao(cmd, index)
|
||||
local data = self:CopyLastStep(index)
|
||||
data.cmd = cmd.cmd
|
||||
data.player_card_data[cmd.seat].piao_niao = cmd.data.num
|
||||
end
|
||||
|
||||
function M:CmdResult(cmd, index)
|
||||
local data = self:CopyLastStep(index)
|
||||
data.cmd = cmd.cmd
|
||||
data.result_data = cmd.data
|
||||
end
|
||||
|
||||
function M:CopyLastStep(index)
|
||||
local step = {}
|
||||
local last_step = self._step[index]
|
||||
step = membe_deep_clone(last_step)
|
||||
self._step[#self._step + 1] = step
|
||||
step.result_data = nil
|
||||
return step
|
||||
end
|
||||
|
||||
function M:UpdateLeftCard(num)
|
||||
self._tex_LeftCard.text = "剩余 " .. num .. " 张牌"
|
||||
function M:RemoveCursor()
|
||||
self._cursor:RemoveFromParent()
|
||||
end
|
||||
|
||||
function M:UpdateCardBox(seat)
|
||||
local index = seat
|
||||
local index = seat - 1
|
||||
local people_num = self._room.room_config.people_num
|
||||
if people_num == 2 and seat == 2 then
|
||||
index = 3
|
||||
elseif people_num == 3 and seat == 3 then
|
||||
index = 4
|
||||
index = 2
|
||||
end
|
||||
self._ctr_cardbox.selectedIndex = index
|
||||
end
|
||||
|
||||
function M:UpdateRound(round)
|
||||
self._tex_round.text = "第 " .. round .. "/" .. self._room.room_config.round .. " 局"
|
||||
function M:OnFangziAction(...)
|
||||
self:__CloseTip()
|
||||
local arg = { ... }
|
||||
local _player_card_info = self._player_card_info
|
||||
local fz = arg[1]
|
||||
local player = arg[2]
|
||||
local index = arg[3]
|
||||
printlog("OnFangziAction")
|
||||
local info = _player_card_info[self:GetPos(player.seat)]
|
||||
-- local pNode = info._mask_liangpai
|
||||
local effect = UIPackage.CreateObject("Extend_MJ_LiChuan", "FzEffect")
|
||||
if fz.type == FZType.Peng then
|
||||
self:PlaySound("LiChuan_MJ", player.self_user.sex, "peng" .. math.random(1, 3))
|
||||
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
||||
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "碰")
|
||||
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框")
|
||||
elseif fz.type == FZType.Chi then
|
||||
self:PlaySound("LiChuan_MJ", player.self_user.sex, "chi" .. math.random(1, 3))
|
||||
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
||||
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "吃")
|
||||
else
|
||||
self:PlaySound("LiChuan_MJ", player.self_user.sex, "gang" .. math.random(1, 2))
|
||||
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
||||
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "杠")
|
||||
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "杠框")
|
||||
end
|
||||
effect.touchable = false
|
||||
effect:GetTransition("t2"):Play()
|
||||
-- pNode:AddChild(effect)
|
||||
coroutine.start(function()
|
||||
coroutine.wait(0.3)
|
||||
self._popEvent = true
|
||||
end)
|
||||
coroutine.start(function()
|
||||
coroutine.wait(2)
|
||||
effect:Dispose()
|
||||
end)
|
||||
|
||||
self:RemoveCursor()
|
||||
if (player.seat ~= fz.from_seat) then
|
||||
local fs_info = _player_card_info[self:GetPos(fz.from_seat)]
|
||||
fs_info:UpdateOutCardList()
|
||||
end
|
||||
info:UpdateFzList(fz, index, true)
|
||||
local getcard = fz.type == FZType.Peng or fz.type == FZType.Chi
|
||||
printlog(getcard)
|
||||
info:UpdateHandCard(getcard)
|
||||
self:__CloseTip()
|
||||
end
|
||||
|
||||
function M:UpdateStep(step)
|
||||
self._record:GetChild("tex_step").text = "第 " .. step .. " / " .. #self._step .. "步"
|
||||
function M:OnUpdate()
|
||||
if (self._popEvent) then
|
||||
local func = self._gamectr:PopEvent()
|
||||
if (func ~= nil) then
|
||||
if pcall(func) then
|
||||
|
||||
else
|
||||
print("错误报错,不准重连")
|
||||
-- self._gamectr = ControllerManager.GetController(GameController)
|
||||
-- if self._gamectr then
|
||||
-- self._gamectr:ResetConnect()
|
||||
-- end
|
||||
end
|
||||
--func()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function M:GetPos(seat)
|
||||
return ViewUtil.GetPos(self._room.self_player.seat, seat, self._room.room_config.people_num)
|
||||
end
|
||||
|
||||
function M.HandCardSortAndJing(a, b)
|
||||
|
|
|
|||
|
|
@ -221,12 +221,22 @@ function M:FillWitnessData(pd_data)
|
|||
u.sex = _jp["sex"]
|
||||
-- end
|
||||
p.self_user.host_ip = p.self_user.host_ip
|
||||
local _hand_card = _jp["hand_card"]
|
||||
local _hand_card = {}
|
||||
p.hand_left_count = _jp["card_count"]
|
||||
p.card_list = _hand_card
|
||||
--room.self_player.card_list = _hand_card
|
||||
-- table.sort(_hand_card, self.HandCardSortAndJing)
|
||||
p.total_score = _jp["score"]
|
||||
-- p.hand_left_count = #_hand_card
|
||||
p.outcard_list = _jp["outcard_list"]
|
||||
local opcard = _jp["opcard"]
|
||||
for k = 1, #opcard do
|
||||
local op = opcard[k]
|
||||
local fz = {}
|
||||
fz.type = op["type"]
|
||||
fz.card = op["card"]
|
||||
fz.from_seat = op["from_seat"]
|
||||
p.fz_list[#p.fz_list + 1] = fz
|
||||
end
|
||||
-- if _jp.hp_info then
|
||||
-- room.room_config.isNonnegative = 1
|
||||
-- p.cur_hp = _jp.hp_info.cur_hp
|
||||
|
|
@ -234,7 +244,6 @@ function M:FillWitnessData(pd_data)
|
|||
|
||||
room:AddPlayer(p)
|
||||
end
|
||||
room.cmdList = pd_data["cmdList"]
|
||||
end
|
||||
|
||||
function M.HandCardSortAndJing(a, b)
|
||||
|
|
|
|||
|
|
@ -104,7 +104,6 @@ function M:fillCard2(obj, pos_str, card)
|
|||
obj:GetController('jing').selectedIndex = 1
|
||||
end
|
||||
|
||||
|
||||
obj:GetChild("icon").url = 'ui://Main_Majiang/' .. pos_str .. card
|
||||
end
|
||||
|
||||
|
|
@ -135,6 +134,33 @@ function M:UpdateHandCard(getcard, mp)
|
|||
print("lingmenghand", self._ctr_getCard.selectedIndex, self._view_getCard.numItems, self._view_getCard.visible)
|
||||
end
|
||||
|
||||
function M:UpdateHandCardWitness(getcard, isSelf)
|
||||
getcard = getcard or false
|
||||
isSelf = isSelf or false
|
||||
|
||||
self._view_handCardList:RemoveChildren()
|
||||
self._view_getCard:RemoveChildren()
|
||||
|
||||
for i = 0, self._player.hand_left_count - 1 do
|
||||
local btn_card
|
||||
if getcard and i == self._player.hand_left_count - 1 then
|
||||
btn_card = self._view_getCard:AddItemFromPool()
|
||||
else
|
||||
btn_card = self._view_handCardList:AddItemFromPool()
|
||||
end
|
||||
if isSelf then
|
||||
self:FillWitnessCard(btn_card)
|
||||
end
|
||||
end
|
||||
self._view_handCardList.touchable = false
|
||||
self._view_getCard.touchable = false
|
||||
self._ctr_getCard.selectedIndex = getcard and 1 or 0
|
||||
end
|
||||
|
||||
function M:FillWitnessCard(btn_card)
|
||||
btn_card:GetChild("icon").url = 'ui://Main_Majiang/b201_0'
|
||||
end
|
||||
|
||||
-- 获取麻将图片资源位置,可以在扩展中复写
|
||||
function M:GetCardPicPack()
|
||||
-- if DataManager.CurrenRoom.card_type == 2 then
|
||||
|
|
@ -189,6 +215,10 @@ function M:UpdateOutCardList(outcard, card_item, cursor)
|
|||
for i = 0, #outlist - 1 do
|
||||
local outcard = self._view_outCardList:AddItemFromPool()
|
||||
self:fillCard2(outcard, outCardName, outlist[i + 1])
|
||||
if i == #outlist - 1 then
|
||||
outcard:AddChild(cursor)
|
||||
cursor:Center()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -126,6 +126,11 @@ function M:FillHandCard(i, btn_card, tem_card, event)
|
|||
end
|
||||
end
|
||||
|
||||
function M:UpdateHandCardWitness(getcard)
|
||||
self._view_handCardList.columnGap = -10
|
||||
MJPlayerCardInfoView.UpdateHandCardWitness(self, getcard, true)
|
||||
end
|
||||
|
||||
function M:onTouchBegin(context)
|
||||
self.touch = true
|
||||
local button = context.sender
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<component size="2532,1170">
|
||||
<controller name="state" pages="0,准备状态,1,游戏状态,2,回合间状态,3,回放状态,4,观战状态" selected="1"/>
|
||||
<controller name="state" pages="0,准备状态,1,游戏状态,2,回合间状态,3,回放状态,4,观战状态" selected="4"/>
|
||||
<controller name="sdk" pages="0,,1," selected="0"/>
|
||||
<controller name="action" pages="2,空,0,准备,1,开始" selected="0"/>
|
||||
<controller name="3d" pages="0,,1," selected="0"/>
|
||||
|
|
@ -8,25 +8,25 @@
|
|||
<controller name="showNextConfrim" pages="0,不展示,1,展示" selected="0"/>
|
||||
<controller name="more" pages="0,,1," selected="0"/>
|
||||
<displayList>
|
||||
<component id="n115_pkx5" name="player_info1_1" src="pkx5so" fileName="Main_new/Main/PlayerHead_1.xml" xy="71,784" size="144,144">
|
||||
<component id="n115_pkx5" name="player_info1_1" src="pkx5so" fileName="Main_new/Main/PlayerHead_1.xml" xy="1188,897" size="144,144">
|
||||
<gearDisplay controller="state" pages="0,2"/>
|
||||
<gearXY controller="state" pages="1" values="71,784" default="1188,897"/>
|
||||
<gearSize controller="state" default="144,144,1,1"/>
|
||||
<relation target="" sidePair="center-center,bottom-bottom"/>
|
||||
</component>
|
||||
<component id="n141_lu84" name="player_info1_2" src="pkx5so" fileName="Main_new/Main/PlayerHead_1.xml" xy="71,784" size="144,144">
|
||||
<component id="n141_lu84" name="player_info1_2" src="pkx5so" fileName="Main_new/Main/PlayerHead_1.xml" xy="69,774" size="144,144">
|
||||
<gearDisplay controller="state" pages="1,3,4"/>
|
||||
<gearXY controller="state" pages="1,3" values="71,784|71,784" default="737,916"/>
|
||||
<gearXY controller="state" pages="1,3,4" values="71,784|71,784|69,774" default="737,916"/>
|
||||
<relation target="n118_pkx5" sidePair="right-left,top-top"/>
|
||||
</component>
|
||||
<component id="n150_kxhm" name="player_info2_1" src="pkx5so" fileName="Main_new/Main/PlayerHead_1.xml" xy="1867,27" size="144,144">
|
||||
<component id="n150_kxhm" name="player_info2_1" src="pkx5so" fileName="Main_new/Main/PlayerHead_1.xml" xy="1188,909" size="144,144">
|
||||
<gearDisplay controller="state" pages="0,2"/>
|
||||
<gearXY controller="state" pages="0,1,2" values="1188,274|1867,27|1188,274" default="1188,909"/>
|
||||
<relation target="" sidePair="center-center,top-top"/>
|
||||
</component>
|
||||
<component id="n152_kxhm" name="player_info2_2" src="o8k813y" fileName="Main_new/Main_new_2/PlayerHead2_2.xml" xy="1885,27" size="108,108">
|
||||
<component id="n152_kxhm" name="player_info2_2" src="o8k813y" fileName="Main_new/Main_new_2/PlayerHead2_2.xml" xy="1897,43" size="108,108">
|
||||
<gearDisplay controller="state" pages="1,3,4"/>
|
||||
<gearXY controller="state" pages="0,1,3" values="2031,519|1885,27|1885,27" default="1337,909"/>
|
||||
<gearXY controller="state" pages="0,1,3,4" values="2031,519|1885,27|1885,27|1897,43" default="1337,909"/>
|
||||
<relation target="n155_gi99" sidePair="left-right,top-top"/>
|
||||
</component>
|
||||
<component id="n81_l2u4" name="cardbox" src="gq7m5e" fileName="Main_style_2/turn/Gcm_box_4.xml" xy="1278,-294" pivot="0.5,0.5">
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 21 KiB |
|
|
@ -1193,9 +1193,9 @@
|
|||
<image id="k0pa13i" name="b202_109.png" path="/images/cards3/2/" exported="true"/>
|
||||
<image id="k0pa13j" name="b202_503.png" path="/images/cards3/2/" exported="true"/>
|
||||
<image id="k0pa13k" name="back_ce.png" path="/images/cards3/"/>
|
||||
<image id="k0pa13l" name="back_201.png" path="/images/cards3/"/>
|
||||
<image id="k0pa13l" name="back_201.png" path="/images/cards3/" exported="true"/>
|
||||
<image id="k0pa13m" name="back_202.png" path="/images/cards3/"/>
|
||||
<image id="gmbn13n" name="b202_00.png" path="/images/cards3/"/>
|
||||
<image id="gmbn13n" name="b202_00.png" path="/images/cards3/" exported="true"/>
|
||||
<image id="gmbn13o" name="Group 255.png" path="/Main_new/Main/Image/"/>
|
||||
<image id="gmbn13p" name="Group 458.png" path="/Main_new/Main/Image/"/>
|
||||
<image id="gmbn13q" name="Group 459.png" path="/Main_new/Main/Image/"/>
|
||||
|
|
@ -1207,6 +1207,7 @@
|
|||
<component id="inqx13w" name="Player_card_info_2_1.xml" path="/Main_new/Main_new_2/"/>
|
||||
<component id="inqx13x" name="Player_card_info_2_2.xml" path="/Main_new/Main_new_2/"/>
|
||||
<component id="o8k813y" name="PlayerHead2_2.xml" path="/Main_new/Main_new_2/"/>
|
||||
<image id="vum113z" name="b201_0.png" path="/images/cards3/" exported="true"/>
|
||||
</resources>
|
||||
<publish name="Main_Majiang" path="..\wb_unity_pro\Assets\ART\base\main_majiang\ui" packageCount="2"/>
|
||||
</packageDescription>
|
||||
|
Before Width: | Height: | Size: 809 KiB After Width: | Height: | Size: 820 KiB |
|
Before Width: | Height: | Size: 3.0 MiB After Width: | Height: | Size: 3.2 MiB |
|
Before Width: | Height: | Size: 3.7 MiB After Width: | Height: | Size: 3.9 MiB |
|
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 2.7 MiB |
|
Before Width: | Height: | Size: 889 KiB After Width: | Height: | Size: 888 KiB |