放炮发动画

master
罗家炜 2025-06-29 22:21:50 +08:00
parent 32e9da5b74
commit 2ed7bd1aa1
443 changed files with 1433 additions and 862 deletions

View File

@ -36,7 +36,11 @@ function M:InitView(url)
self._full_offset = false self._full_offset = false
local view = self._view local view = self._view
-- self:InitClip() if self.alldonhua then
coroutine.step(1, self.alldonhua)
else
self:InitClip()
end
local btn_head = view:GetChild("btn_head") local btn_head = view:GetChild("btn_head")
ImageLoad.Load(DataManager.SelfUser.head_url, btn_head._iconObject) ImageLoad.Load(DataManager.SelfUser.head_url, btn_head._iconObject)
@ -342,6 +346,7 @@ function M:OnUpdate()
end end
function M:Close() function M:Close()
printlog("lingmeng close")
BaseView.Close(self) BaseView.Close(self)
UpdateBeat:Remove(self.OnUpdate, self) UpdateBeat:Remove(self.OnUpdate, self)
coroutine.stopAll() coroutine.stopAll()
@ -365,11 +370,22 @@ function M:Destroy()
end end
function M:Show() function M:Show()
--print("on lobbyView show~~~~~~") print("on lobbyView show~~~~~~")
BaseView.Show(self) BaseView.Show(self)
ViewUtil.PlaySoundBg() ViewUtil.PlaySoundBg()
UpdateBeat:Add(self.OnUpdate, self) UpdateBeat:Add(self.OnUpdate, self)
-- self:InitClip() print("lingmeng show1")
if self.alldonhua then
print("lingmeng show2", coroutine.status(self.alldonhua))
if not coroutine.status(self.alldonhua) == "running" then
print("lingmeng show2")
coroutine.resume(self.alldonhua)
print("lingmeng show3")
end
else
print("lingmeng show4")
self:InitClip()
end
-- 如果在圈子内的房间显示tip -- 如果在圈子内的房间显示tip
local user = DataManager.SelfUser local user = DataManager.SelfUser
local tem = user.notices local tem = user.notices
@ -442,57 +458,57 @@ function M:OnApplicationActive()
end end
end end
-- function M:InitClip() function M:InitClip()
-- local taohuaEnd = 114 -- local taohuaEnd = 114
-- local taohuaName = "ui://Lobby/taohua_00" -- local taohuaName = "ui://Lobby/taohua_00"
-- local taohua = self._view:GetChild('clip_bg') -- local taohua = self._view:GetChild('clip_bg')
-- local taohuaIndex = 0 -- local taohuaIndex = 0
-- local renwuEnd = 140 local renwuEnd = 143
-- local renwuName = "ui://Lobby/renwu-AE_00" local renwuName = "ui://Lobby/renwu-AE_00"
-- local renwu = self._view:GetChild('clip_renwu') local renwu = self._view:GetChild('clip_renwu')
-- local renwuIndex = 0 local renwuIndex = 0
-- local pukeEnd = 60 local pukeEnd = 60
-- local pukeName = "ui://Lobby/puke_00" local pukeName = "ui://Lobby/puke_00"
-- local puke = self._view:GetChild('btn_ChuangJian') local puke = self._view:GetChild('btn_ChuangJian')
-- local pukeIndex = 0 local pukeIndex = 0
-- local jiangbeiEnd = 180 -- local jiangbeiEnd = 180
-- local jiangbeiName = "ui://Lobby/jiangbei_00" -- local jiangbeiName = "ui://Lobby/jiangbei_00"
-- local jiangbei = self._view:GetChild('btn_more_group') -- local jiangbei = self._view:GetChild('btn_more_group')
-- local jiangbeiIndex = 0 -- local jiangbeiIndex = 0
-- local hechengEnd = 96 local hechengEnd = 96
-- local hechengName = "ui://Lobby/hecheng 1_00" local hechengName = "ui://Lobby/hecheng 1_00"
-- local hecheng = self._view:GetChild('btn_joinroom') local hecheng = self._view:GetChild('btn_joinroom')
-- local hechengIndex = 0 local hechengIndex = 0
-- self.alldonhua = coroutine.start( self.alldonhua = coroutine.start(
-- function() function()
-- while true do while true do
-- taohuaIndex = self:ReplaceClip1(taohuaEnd, taohua, taohuaIndex, taohuaName) -- taohuaIndex = self:ReplaceClip1(taohuaEnd, taohua, taohuaIndex, taohuaName)
-- renwuIndex = self:ReplaceClip1(renwuEnd, renwu, renwuIndex, renwuName) renwuIndex = self:ReplaceClip1(renwuEnd, renwu, renwuIndex, renwuName)
-- pukeIndex = self:ReplaceClip2(pukeEnd, puke, pukeIndex, pukeName) pukeIndex = self:ReplaceClip2(pukeEnd, puke, pukeIndex, pukeName)
-- jiangbeiIndex = self:ReplaceClip2(jiangbeiEnd, jiangbei, jiangbeiIndex, jiangbeiName) -- jiangbeiIndex = self:ReplaceClip2(jiangbeiEnd, jiangbei, jiangbeiIndex, jiangbeiName)
-- hechengIndex = self:ReplaceClip2(hechengEnd, hecheng, hechengIndex, hechengName) hechengIndex = self:ReplaceClip2(hechengEnd, hecheng, hechengIndex, hechengName)
-- coroutine.wait(0.080) coroutine.wait(0.001)
-- end end
-- end end
-- ) )
-- end end
-- function M:ReplaceClip1(e, t, i, n) function M:ReplaceClip1(e, t, i, n)
-- if i > e then if i > e then
-- i = 0 i = 0
-- end end
-- t.url = string.format("%s%03d", n, i) t.url = string.format("%s%03d", n, i)
-- return i + 4 return i + 1
-- end end
-- function M:ReplaceClip2(e, t, i, n) function M:ReplaceClip2(e, t, i, n)
-- if i > e then if i > e then
-- i = 0 i = 0
-- end end
-- t.icon = string.format("%s%03d", n, i) t.icon = string.format("%s%03d", n, i)
-- return i + 4 return i + 1
-- end end

View File

@ -82,7 +82,7 @@ function M:init()
self:PhoneLogin() self:PhoneLogin()
end) end)
-- self:InitClip() self:InitClip()
end end
function M:Destroy() function M:Destroy()
@ -96,7 +96,7 @@ end
function M:Show() function M:Show()
BaseView.Show(self) BaseView.Show(self)
self:QuickLogin() self:QuickLogin()
-- self:InitClip() self:InitClip()
end end
local function __goto_lobby(response) local function __goto_lobby(response)
@ -255,32 +255,26 @@ function M:Destroy()
-- ResourcesManager.UnLoad("base/ui/Login.bytes") -- ResourcesManager.UnLoad("base/ui/Login.bytes")
end end
-- function M:InitClip() function M:InitClip()
-- local yunqueEnd = 120 local xuehuaEnd = 120
-- local yunqueName = "ui://Login/yunque_00" local xuehuaName = "ui://Login/xuehua_00"
-- local yunque = self._view:GetChild('clip_yueque') local xuehua = self._view:GetChild('clip_xuehua')
-- local yunqueIndex = 0 local xuehuaIndex = 0
-- local xuehuaEnd = 120 self.donhua = coroutine.start(
-- local xuehuaName = "ui://Login/xuehua_00" function()
-- local xuehua = self._view:GetChild('clip_xuehua') while true do
-- local xuehuaIndex = 0 xuehuaIndex = self:ReplaceClip1(xuehuaEnd, xuehua, xuehuaIndex, xuehuaName)
coroutine.wait(0.12)
end
end
)
end
-- self.donhua = coroutine.start( function M:ReplaceClip1(e, t, i, n)
-- function() if i > e then
-- while true do i = 0
-- -- yunqueIndex = self:ReplaceClip1(yunqueEnd, yunque, yunqueIndex, yunqueName) end
-- xuehuaIndex = self:ReplaceClip1(xuehuaEnd, xuehua, xuehuaIndex, xuehuaName) t.url = string.format("%s%03d", n, i)
-- coroutine.wait(0.12) return i + 6
-- end end
-- end
-- )
-- end
-- function M:ReplaceClip1(e, t, i, n)
-- if i > e then
-- i = 0
-- end
-- t.url = string.format("%s%03d", n, i)
-- return i + 6
-- end

View File

@ -571,6 +571,7 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.PlayerState, GameEvent.PlayerState,
function(...) function(...)
self._popEvent = true
local arg = { ... } local arg = { ... }
local p = arg[1] local p = arg[1]
local info = _player_info[self:GetPos(p.seat)] local info = _player_info[self:GetPos(p.seat)]
@ -587,6 +588,7 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.DeskBreak, GameEvent.DeskBreak,
function(...) function(...)
self._popEvent = true
local arg = { ... } local arg = { ... }
local code = arg[1] local code = arg[1]
if code == 0 then if code == 0 then
@ -616,6 +618,7 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.Interaction, GameEvent.Interaction,
function(...) function(...)
self._popEvent = true
local arg = { ... } local arg = { ... }
local p = arg[1] local p = arg[1]
if not p or not p.seat or p.seat == 0 then if not p or not p.seat or p.seat == 0 then
@ -661,6 +664,7 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.OnKicked, GameEvent.OnKicked,
function() function()
self._popEvent = true
printlog("GameEvent.OnKicked====》》》》》") printlog("GameEvent.OnKicked====》》》》》")
self:UnmarkSelfTuoguan() self:UnmarkSelfTuoguan()
local _curren_msg = MsgWindow.new(self._root_view, '由于长时间未准备,你已被踢出房间!', MsgWindow.MsgMode.OnlyOk) local _curren_msg = MsgWindow.new(self._root_view, '由于长时间未准备,你已被踢出房间!', MsgWindow.MsgMode.OnlyOk)
@ -676,6 +680,7 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.TupGuanOpen, GameEvent.TupGuanOpen,
function(...) function(...)
self._popEvent = true
--print("刷新托管数据=====") --print("刷新托管数据=====")
local arg = { ... } local arg = { ... }
local p = arg[1] local p = arg[1]
@ -774,6 +779,7 @@ function M:GetReadyNum()
end end
function M:OnPlayerEnter(...) function M:OnPlayerEnter(...)
self._popEvent = true
printlog("进入房间222222222222222222++++++++++++++++++++++++++++") printlog("进入房间222222222222222222++++++++++++++++++++++++++++")
local arg = { ... } local arg = { ... }
local p = arg[1] local p = arg[1]
@ -804,6 +810,7 @@ function M:OnPlayerEnter(...)
end end
function M:OnPlayerReady(...) function M:OnPlayerReady(...)
self._popEvent = true
local arg = { ... } local arg = { ... }
local p = arg[1] local p = arg[1]
@ -839,6 +846,7 @@ function M:OnPlayerReady(...)
end end
function M:OnUpdateInfo(...) function M:OnUpdateInfo(...)
self._popEvent = true
local arg = { ... } local arg = { ... }
local p = arg[1] local p = arg[1]
local t = arg[2] local t = arg[2]
@ -925,6 +933,7 @@ function M:UnmarkSelfTuoguan()
end end
function M:OnPlayerLeave(...) function M:OnPlayerLeave(...)
self._popEvent = true
local arg = { ... } local arg = { ... }
local p = arg[1] local p = arg[1]
local info = self._player_info[self:GetPos(p.seat)] local info = self._player_info[self:GetPos(p.seat)]
@ -986,11 +995,16 @@ function M:OnUpdate()
if (self._popEvent) then if (self._popEvent) then
local func = self._gamectr:PopEvent() local func = self._gamectr:PopEvent()
if (func ~= nil) then if (func ~= nil) then
print("lingmeng self._popEvent1", self._popEvent)
if self._flag_fanpaofa then
self._popEvent = false
end
print("lingmeng self._popEvent2", self._popEvent)
local result, resultInfo = pcall(func) local result, resultInfo = pcall(func)
if result then if result then
else else
-- error(resultInfo) print("lingmeng error", resultInfo)
self._gamectr = ControllerManager.GetController(GameController) self._gamectr = ControllerManager.GetController(GameController)
if self._gamectr then if self._gamectr then
self._gamectr:ResetConnect() self._gamectr:ResetConnect()

View File

@ -95,6 +95,7 @@ function ViewManager.GetCurrenView()
end end
function ViewManager.ChangeViewByClass(dview_class, callback) function ViewManager.ChangeViewByClass(dview_class, callback)
print("lingmeng ChangeView", _currenView)
if (_currenView ~= nil) then if (_currenView ~= nil) then
if _currenView._close_destroy then if _currenView._close_destroy then
_currenView:Destroy() _currenView:Destroy()
@ -121,6 +122,7 @@ end
local last_game_id = 0 local last_game_id = 0
function ViewManager.ChangeView(id, game_id, callback) function ViewManager.ChangeView(id, game_id, callback)
print("lingmeng ChangeViewq", id, game_id)
-- if id==2 then -- if id==2 then
-- printlog("cccccccccccccccccccccccccccccccc") -- printlog("cccccccccccccccccccccccccccccccc")
-- printlog(debug.traceback()) -- printlog(debug.traceback())

View File

@ -363,6 +363,7 @@ function M:OnEventFzAction(evt_data)
local p = _room:GetPlayerById(playerid) local p = _room:GetPlayerById(playerid)
self._cacheEvent:Enqueue(function() self._cacheEvent:Enqueue(function()
local isNeedDelHandCard = 0 local isNeedDelHandCard = 0
local flag_pengPao = false
p.hu_xi = huxi p.hu_xi = huxi
local fz = {} local fz = {}
fz.card = card fz.card = card
@ -445,6 +446,7 @@ function M:OnEventFzAction(evt_data)
if p.fz_list[i].card == card then if p.fz_list[i].card == card then
p.fz_list[i].type = RB_FZType.Pao p.fz_list[i].type = RB_FZType.Pao
isAddTi = true isAddTi = true
flag_pengPao = true
remove_num = 0 remove_num = 0
end end
end end
@ -459,6 +461,7 @@ function M:OnEventFzAction(evt_data)
p.fz_list[i].type = RB_FZType.Pao p.fz_list[i].type = RB_FZType.Pao
num = 1 num = 1
remove_num = 0 remove_num = 0
flag_pengPao = true
end end
end end
if num == 0 then if num == 0 then
@ -523,10 +526,10 @@ function M:OnEventFzAction(evt_data)
if fz.type == RB_FZType.Pao or fz.type == RB_FZType.Ti then if fz.type == RB_FZType.Pao or fz.type == RB_FZType.Ti then
coroutine.start(function() coroutine.start(function()
coroutine.wait(0.5) coroutine.wait(0.5)
DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.FangziAction, fz, p, isNeedDelHandCard) DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.FangziAction, fz, p, isNeedDelHandCard, flag_pengPao)
end) end)
else else
DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.FangziAction, fz, p, isNeedDelHandCard) DispatchEvent(self._dispatcher, FanPaoFa_GameEvent.FangziAction, fz, p, isNeedDelHandCard, flag_pengPao)
end end
end) end)
end end

View File

@ -41,6 +41,7 @@ end
function M:InitView(url) function M:InitView(url)
local _room = self._room local _room = self._room
self.Fix_Msg_Chat = Fix_Msg_Chat self.Fix_Msg_Chat = Fix_Msg_Chat
self._flag_fanpaofa = true
ViewUtil.PlayMuisc('FanPaoFa_ZP', 'extend/zipai/fanpaofa/sound/bg.mp3') ViewUtil.PlayMuisc('FanPaoFa_ZP', 'extend/zipai/fanpaofa/sound/bg.mp3')
UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Extend_Poker_FanPaoFa') UIPackage.AddPackage('extend/zipai/fanpaofa/ui/Extend_Poker_FanPaoFa')
@ -168,20 +169,19 @@ function M:EventInit()
local _player_info = self._player_info local _player_info = self._player_info
local _gamectr = self._gamectr local _gamectr = self._gamectr
_gamectr:AddEventListener(GameEvent.EventXiPai, function(...) _gamectr:AddEventListener(GameEvent.EventXiPai, function(...)
self._popEvent = true
local arg = { ... } local arg = { ... }
local currentPlayer1 = arg[1] local currentPlayer1 = arg[1]
local currentPlayer2 = arg[2] local currentPlayer2 = arg[2]
self._popEvent = false
self._player_card_info[1]:HideDaNiao(0) self._player_card_info[1]:HideDaNiao(0)
if (currentPlayer1) then if (currentPlayer1) then
local xipaiCB = function() local xipaiCB = function()
self._popEvent = true
end end
self:PlayXiPai(xipaiCB) self:PlayXiPai(xipaiCB)
end end
if (currentPlayer2) then if (currentPlayer2) then
local xipaiCB2 = function() local xipaiCB2 = function()
self._popEvent = true
end end
self:PlayXiPai1(xipaiCB2) self:PlayXiPai1(xipaiCB2)
end end
@ -189,9 +189,11 @@ function M:EventInit()
_gamectr:AddEventListener(GameEvent.OnDaNiaoTips, function(...) _gamectr:AddEventListener(GameEvent.OnDaNiaoTips, function(...)
self._popEvent = true
local arg = { ... } local arg = { ... }
local niao = arg[1] local niao = arg[1]
local reload = arg[2] local reload = arg[2]
if reload == 0 then if reload == 0 then
self._leftcard = 1 self._leftcard = 1
self._leftcard = 1 self._leftcard = 1
@ -222,9 +224,11 @@ function M:EventInit()
_gamectr:AddEventListener(GameEvent.OnEventDaNiao, function(...) _gamectr:AddEventListener(GameEvent.OnEventDaNiao, function(...)
self._popEvent = true
local arg = { ... } local arg = { ... }
local seat = arg[1] local seat = arg[1]
local niao = arg[2] local niao = arg[2]
if self.seat == seat then if self.seat == seat then
self._player_card_info[seat]:HideDaNiao(niao) self._player_card_info[seat]:HideDaNiao(niao)
end end
@ -236,7 +240,7 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.SendCards, GameEvent.SendCards,
function(...) function(...)
self._popEvent = false self._popEvent = true
self._leftcard = 1 self._leftcard = 1
self._leftcard = 1 self._leftcard = 1
local rightpanel = self._view:GetChild('right_panel') local rightpanel = self._view:GetChild('right_panel')
@ -292,15 +296,28 @@ function M:EventInit()
self._left_time = 15 self._left_time = 15
self._tex_LeftCard.text = '剩余 ' .. _leftcard .. ' 张牌' self._tex_LeftCard.text = '剩余 ' .. _leftcard .. ' 张牌'
local info = self._player_card_info[self:GetPos(seat)] local info = self._player_card_info[self:GetPos(seat)]
print("lingmeng GetCard1")
info:UpdateOutCardList(card, true, true, self:GetPos(seat)) info:UpdateOutCardList(card, true, true, self:GetPos(seat))
if card ~= 0 then if card ~= 0 then
local p = _room:GetPlayerBySeat(seat) local p = _room:GetPlayerBySeat(seat)
print("lingmeng baopai")
-- self:PlaySound(p.self_user.sex, 'F_SaoChuan')
self:PlaySound(p.self_user.sex, 'F_' .. card) self:PlaySound(p.self_user.sex, 'F_' .. card)
else print("lingmeng GetCard2", os.time())
self._popEvent = false
coroutine.start( coroutine.start(
function() function()
coroutine.wait(0.5) coroutine.wait(0.5)
print("lingmeng GetCard2-1", os.time())
self._popEvent = true
end
)
else
print("lingmeng GetCard3", os.time())
coroutine.start(
function()
coroutine.wait(0.5)
print("lingmeng GetCard3-1", os.time())
self._popEvent = true self._popEvent = true
info:ClearOutCard() info:ClearOutCard()
end end
@ -314,8 +331,20 @@ function M:EventInit()
local arg = { ... } local arg = { ... }
local seat = arg[1] local seat = arg[1]
local card = arg[2] local card = arg[2]
self._popEvent = false
local info = self._player_card_info[self:GetPos(seat)] local info = self._player_card_info[self:GetPos(seat)]
coroutine.start(
function()
coroutine.wait(0.2)
if info._area_outcard_list.numChildren > 0 then
local outCard = info._area_outcard_list:GetChildAt(0)
outCard:TweenMove(outCard:GlobalToLocal(info:GetFzMove()), 0.35)
outCard:TweenScale(Vector2.New(0, 0), 0.35)
end
end
)
coroutine.start( coroutine.start(
function() function()
coroutine.wait(0.5) coroutine.wait(0.5)
@ -332,9 +361,11 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.EventTurn, GameEvent.EventTurn,
function(...) function(...)
self._popEvent = true
local arg = { ... } local arg = { ... }
local seat = arg[1] local seat = arg[1]
local list = _room.player_list local list = _room.player_list
local readyNum = 0 local readyNum = 0
for i = 1, #list do for i = 1, #list do
local p = list[i] local p = list[i]
@ -348,8 +379,10 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.OutHint, GameEvent.OutHint,
function(...) function(...)
self._popEvent = true
_room.curren_outcard_seat = _room.self_player.seat _room.curren_outcard_seat = _room.self_player.seat
--printlog("jefe OutHint view>>>>",card) --printlog("jefe OutHint view>>>>",card)
coroutine.start( coroutine.start(
function() function()
coroutine.wait(0.5) coroutine.wait(0.5)
@ -363,9 +396,11 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.FangWei, GameEvent.FangWei,
function(...) function(...)
self._popEvent = true
local arg = { ... } local arg = { ... }
local seat = arg[1] local seat = arg[1]
local card = arg[2] local card = arg[2]
--self:__CloseTip() --self:__CloseTip()
_room.curren_outcard_seat = _room.self_player.seat _room.curren_outcard_seat = _room.self_player.seat
local _player_card_info = self._player_card_info local _player_card_info = self._player_card_info
@ -409,11 +444,13 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.OutCard, GameEvent.OutCard,
function(...) function(...)
self._popEvent = true
self:__CloseTip() self:__CloseTip()
self._left_time = 0 self._left_time = 0
local arg = { ... } local arg = { ... }
local p = arg[1] local p = arg[1]
local card = arg[2] local card = arg[2]
local seat = p.seat local seat = p.seat
local info = self._player_card_info[self:GetPos(seat)] local info = self._player_card_info[self:GetPos(seat)]
@ -433,6 +470,7 @@ function M:EventInit()
info._view:GetController('time').selectedIndex = 0 info._view:GetController('time').selectedIndex = 0
self._player_info[self:GetPos(p.seat)]._view:GetController("huxi").selectedIndex = 1 self._player_info[self:GetPos(p.seat)]._view:GetController("huxi").selectedIndex = 1
end end
self._view_showPalyerOutCardView = info._area_outcard_list
info:UpdateOutCardList(card, true, false, self:GetPos(seat)) info:UpdateOutCardList(card, true, false, self:GetPos(seat))
if self._leftcard == 1 then if self._leftcard == 1 then
self._leftcard = 0 self._leftcard = 0
@ -449,26 +487,34 @@ function M:EventInit()
GameEvent.QiCard, GameEvent.QiCard,
function(...) function(...)
self:__CloseTip() self:__CloseTip()
self._popEvent = false
self._left_time = 0 self._left_time = 0
local arg = { ... } local arg = { ... }
local seat = arg[1] local seat = arg[1]
local card = arg[2] local card = arg[2]
local p = _room:GetPlayerBySeat(seat) local p = _room:GetPlayerBySeat(seat)
local info = self._player_card_info[self:GetPos(seat)] local info = self._player_card_info[self:GetPos(seat)]
info:PlayingOutCardAnima(p.DiceCard) info:PlayingOutCardAnima(card, self:GetPos(seat))
p.DiceCard = 0 coroutine.start(
info:UpdateQiPai(p.outcard_list, true, seat) function()
coroutine.wait(0.2)
self._popEvent = true self._popEvent = true
info:ClearOutCard()
p.DiceCard = 0
info:UpdateQiPai(p.outcard_list, false, seat)
end
)
end end
) )
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.FZTips, GameEvent.FZTips,
function(...) function(...)
self._popEvent = true
local arg = { ... } local arg = { ... }
local _tip = arg[1] local _tip = arg[1]
local _uid = arg[2] local _uid = arg[2]
local _fptype = arg[3] local _fptype = arg[3]
self:__FangziTip(_tip, _uid, _fptype) self:__FangziTip(_tip, _uid, _fptype)
end end
) )
@ -478,9 +524,10 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.ZPHuCard, GameEvent.ZPHuCard,
function(...) function(...)
self._popEvent = true
self._left_time = 0 self._left_time = 0
self:__CloseTip() self:__CloseTip()
self._popEvent = false
local arg = { ... } local arg = { ... }
local w = arg[1] local w = arg[1]
local l = arg[2] local l = arg[2]
@ -506,7 +553,6 @@ function M:EventInit()
function() function()
coroutine.wait(0.7) coroutine.wait(0.7)
he:Dispose() he:Dispose()
self._popEvent = true
end end
) )
end end
@ -515,8 +561,9 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.ZPResult1, GameEvent.ZPResult1,
function(...) function(...)
self._popEvent = true
--printlog("ZPResult111ssssssttteessssssttt") --printlog("ZPResult111ssssssttteessssssttt")
self._popEvent = false
self._left_time = 0 self._left_time = 0
local arg = { ... } local arg = { ... }
local result = arg[1] local result = arg[1]
@ -573,7 +620,6 @@ function M:EventInit()
_room.player_list[i].hu_xi = 0 _room.player_list[i].hu_xi = 0
end end
end end
self._popEvent = true
end end
) )
if _room.curren_round ~= _room.room_config.round then if _room.curren_round ~= _room.room_config.round then
@ -594,11 +640,13 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.ZPResult2, GameEvent.ZPResult2,
function(...) function(...)
self._popEvent = true
self._left_time = 0 self._left_time = 0
local arg = { ... } local arg = { ... }
local total_result = arg[2] local total_result = arg[2]
local result = arg[1] local result = arg[1]
local over = arg[3] local over = arg[3]
local data = result.info_list local data = result.info_list
local x = {} local x = {}
self._hu_tip:FillData(x) self._hu_tip:FillData(x)
@ -621,10 +669,12 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.FangPaoOk, GameEvent.FangPaoOk,
function(...) function(...)
self._popEvent = true
self._left_time = 0 self._left_time = 0
local arg = { ... } local arg = { ... }
local seat = arg[1] local seat = arg[1]
local card = arg[2] local card = arg[2]
--禁牌 把手上的牌都禁掉 --禁牌 把手上的牌都禁掉
-- local card_info = self._player_card_info[self:GetPos(seat)] -- local card_info = self._player_card_info[self:GetPos(seat)]
-- card_info:banHandCards(self._room.self_player.card_list) -- card_info:banHandCards(self._room.self_player.card_list)
@ -948,6 +998,7 @@ function M:OnFangziAction(...)
local fz = arg[1] local fz = arg[1]
local player = arg[2] local player = arg[2]
local num = arg[3] local num = arg[3]
local flag_pengPao = arg[4]
if fz.type == RB_FZType.Peng or fz.type == RB_FZType.Chi or fz.type == RB_FZType.Bi then if fz.type == RB_FZType.Peng or fz.type == RB_FZType.Chi or fz.type == RB_FZType.Bi then
self:__CloseTip() self:__CloseTip()
end end
@ -955,18 +1006,17 @@ function M:OnFangziAction(...)
local info = _player_card_info[self:GetPos(player.seat)] local info = _player_card_info[self:GetPos(player.seat)]
info:UpdateIsOnClick(false) info:UpdateIsOnClick(false)
end end
self._popEvent = false
local info = _player_card_info[self:GetPos(player.seat)] local info = _player_card_info[self:GetPos(player.seat)]
if fz.type == RB_FZType.Wei or fz.type == RB_FZType.ChouWei then -- if fz.type == RB_FZType.Wei or fz.type == RB_FZType.ChouWei then
coroutine.start( -- coroutine.start(
function() -- function()
coroutine.wait(1.2) -- coroutine.wait(1.2)
info:UpdateFzList(player.fz_list, true, player.seat) -- info:UpdateFzList(player.fz_list, true, player.seat)
end) -- end)
else -- else
info:UpdateFzList(player.fz_list, true, player.seat) --更新放子数组 -- info:UpdateFzList(player.fz_list, true, player.seat) --更新放子数组
end -- end
if (player == self._room.self_player) then if (player == self._room.self_player) then
@ -1050,47 +1100,47 @@ function M:OnFangziAction(...)
--printlog("jefe self RB_FZType 4=======") --printlog("jefe self RB_FZType 4=======")
elseif fz.type == RB_FZType.Wei then elseif fz.type == RB_FZType.Wei then
-- effect:GetChild("icon2").icon = UIPackage.GetItemURL("Main_RunBeard", "wei") -- effect:GetChild("icon2").icon = UIPackage.GetItemURL("Main_RunBeard", "wei")
self:PlaySound(player.self_user.sex, 'F_' .. fz.card) -- self:PlaySound(player.self_user.sex, 'F_' .. fz.card)
info:UpdateOutCardList(fz.card, true, true, fz.from_seat) -- info:UpdateOutCardList(fz.card, true, true, fz.from_seat)
coroutine.start( -- coroutine.start(
function() -- function()
coroutine.wait(1.0) -- coroutine.wait(1.0)
info:PlayingOutCardAnima() -- info:PlayingOutCardAnima()
self:PlaySound(player.self_user.sex, 'F_GuoSao') self:PlaySound(player.self_user.sex, 'F_GuoSao')
effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'wei') effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'wei')
effect.touchable = false effect.touchable = false
effect.x, effect.y = -250, -200 effect.x, effect.y = -250, -200
effect:GetTransition('t0'):Play() effect:GetTransition('t0'):Play()
pNode:AddChild(effect) pNode:AddChild(effect)
end) -- end)
coroutine.start( coroutine.start(
function() function()
coroutine.wait(2) coroutine.wait(0.7)
effect:Dispose() effect:Dispose()
end end
) )
elseif fz.type == RB_FZType.ChouWei then elseif fz.type == RB_FZType.ChouWei then
self:PlaySound(player.self_user.sex, 'F_' .. fz.card) -- self:PlaySound(player.self_user.sex, 'F_' .. fz.card)
info:UpdateOutCardList(fz.card, true, true, fz.from_seat) -- info:UpdateOutCardList(fz.card, true, true, fz.from_seat)
coroutine.start( -- coroutine.start(
function() -- function()
coroutine.wait(1.2) -- coroutine.wait(1.2)
info:PlayingOutCardAnima() -- info:PlayingOutCardAnima()
self:PlaySound(player.self_user.sex, 'F_GuoSao') self:PlaySound(player.self_user.sex, 'F_GuoSao')
effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'wei') effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'wei')
effect.touchable = false effect.touchable = false
effect.x, effect.y = -250, -200 effect.x, effect.y = -250, -200
effect:GetTransition('t0'):Play() effect:GetTransition('t0'):Play()
pNode:AddChild(effect) pNode:AddChild(effect)
end) -- end)
coroutine.start( coroutine.start(
function() function()
coroutine.wait(1.7) coroutine.wait(0.7)
effect:Dispose() effect:Dispose()
end end
) )
@ -1099,19 +1149,20 @@ function M:OnFangziAction(...)
self:PlaySound(player.self_user.sex, 'F_KaiDuo') self:PlaySound(player.self_user.sex, 'F_KaiDuo')
effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'pao') effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'pao')
elseif fz.type == RB_FZType.Ti then elseif fz.type == RB_FZType.Ti then
self:PlaySound(player.self_user.sex, 'F_' .. fz.card) -- self:PlaySound(player.self_user.sex, 'F_' .. fz.card)
info:UpdateOutCardList(fz.card, true, true, fz.from_seat) -- info:UpdateOutCardList(fz.card, true, true, fz.from_seat)
effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'ti') effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'ti')
effect.touchable = false effect.touchable = false
effect.x, effect.y = -250, -200 effect.x, effect.y = -250, -200
effect:GetTransition('t0'):Play() effect:GetTransition('t0'):Play()
pNode:AddChild(effect) pNode:AddChild(effect)
coroutine.start( -- coroutine.start(
function() -- function()
coroutine.wait(1.2) -- coroutine.wait(1.2)
print("lingmeng tiqi")
self:PlaySound(player.self_user.sex, 'F_SaoChuan') self:PlaySound(player.self_user.sex, 'F_SaoChuan')
info:PlayingOutCardAnima() -- info:PlayingOutCardAnima()
end) -- end)
coroutine.start( coroutine.start(
function() function()
@ -1145,21 +1196,47 @@ function M:OnFangziAction(...)
) )
end end
if fz.type ~= RB_FZType.Kan then
local time = 0.01
if fz.type == RB_FZType.Wei or fz.type == RB_FZType.ChouWei then
time = 0.3
end
local removeOutcard = _player_card_info[self:GetPos(fz.from_seat)] local removeOutcard = _player_card_info[self:GetPos(fz.from_seat)]
local p = self._room:GetPlayerBySeat(fz.from_seat)
if p.DiceCard ~= nil and fz.active_card == p.DiceCard then
if fz.type == RB_FZType.Wei or fz.type == RB_FZType.ChouWei or fz.type == RB_FZType.Ti or fz.type == RB_FZType.Pao then
coroutine.start( coroutine.start(
function() function()
coroutine.wait(0.8) coroutine.wait(time)
removeOutcard:ClearOutCard() local p = self._room:GetPlayerBySeat(fz.from_seat)
end) if p.DiceCard ~= nil and fz.active_card == p.DiceCard then
local outCard
if removeOutcard._area_outcard_list.numChildren == 0 then
for i = 1, self._room.maxPlayers do
if _player_card_info[i]._area_outcard_list.numChildren > 0 then
outCard = _player_card_info[i]._area_outcard_list:GetChildAt(0)
end
end
else else
removeOutcard:ClearOutCard() outCard = removeOutcard._area_outcard_list:GetChildAt(0)
end
if flag_pengPao then
outCard:TweenMove(outCard:GlobalToLocal(info:GetFzMove()) - Vector2.New(outCard.width, 0), 0.25)
outCard:TweenScale(Vector2.New(0, 0), 0.25)
else
outCard:TweenMove(outCard:GlobalToLocal(info:GetFzMove()) - Vector2.New(outCard.width, 0), 0.25)
outCard:TweenScale(Vector2.New(0, 0), 0.25)
end end
p.DiceCard = nil p.DiceCard = nil
end end
end
)
coroutine.start(
function()
coroutine.wait(0.2 + time)
removeOutcard:ClearOutCard()
info:UpdateFzList(player.fz_list, true, player.seat, flag_pengPao) --更新放子数组
end
)
end
local list = self._room.player_list local list = self._room.player_list
for i = 1, #list do for i = 1, #list do
@ -1168,10 +1245,19 @@ function M:OnFangziAction(...)
info._view:GetChild('huxi').text = p.hu_xi info._view:GetChild('huxi').text = p.hu_xi
end end
self._popEvent = true local time = 0.01
if fz.type ~= RB_FZType.Kan then
time = flag_pengPao and 0.3 or 0.7
if fz.type == RB_FZType.Wei or fz.type == RB_FZType.ChouWei then
time = time + 0.3
end
end
coroutine.start( coroutine.start(
function() function()
coroutine.wait(0.3) print("lingmeng OnFangziAction", time, os.time())
coroutine.wait(time)
self._popEvent = true
local info = _player_card_info[1] local info = _player_card_info[1]
info:UpdateIsOnClick(true) info:UpdateIsOnClick(true)
end end

View File

@ -2,7 +2,6 @@ local PlayerCardInfoView = import(".main.ZPPlayerCardInfoView")
---- 对方上面的牌 ---- 对方上面的牌
local M = {} local M = {}
function M.new(view, mainView) function M.new(view, mainView)
setmetatable(M, { __index = PlayerCardInfoView }) setmetatable(M, { __index = PlayerCardInfoView })
local self = setmetatable({}, { __index = M }) local self = setmetatable({}, { __index = M })
self.class = "PlayerCardInfoView" self.class = "PlayerCardInfoView"
@ -12,9 +11,7 @@ function M.new(view,mainView)
return self return self
end end
function M:UpdateFzList(fz_list, ispaly, seat, flag_pengPao)
function M:UpdateFzList( fz_list ,ispaly,seat)
-- print("lingmeng UpdateFzList") -- print("lingmeng UpdateFzList")
-- pt(fz_list) -- pt(fz_list)
self._area_fz_list:RemoveChildren(0, -1, true) self._area_fz_list:RemoveChildren(0, -1, true)
@ -27,26 +24,21 @@ function M:UpdateFzList( fz_list ,ispaly,seat)
end end
end end
if fz_list[i].type == RB_FZType.Chi or fz_list[i].type == RB_FZType.Bi then 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") local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
fzcards:GetController("c2").selectedIndex = 1 fzcards:GetController("c2").selectedIndex = 1
fzcards:GetChild("card_" .. 1).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].active_card) 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_" .. 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:GetChild("card_" .. 3).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].opcard[2])
fzcards.x, fzcards.y = 0, 0 fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem,fzcards,#fz_list,i,ispaly,seat) self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, seat, flag_pengPao)
elseif fz_list[i].type == RB_FZType.Peng then elseif fz_list[i].type == RB_FZType.Peng then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
for j = 1, 3 do for j = 1, 3 do
fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card) fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
end end
fzcards.x, fzcards.y = 0, 0 fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem,fzcards,#fz_list,i,ispaly,seat) self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, seat, flag_pengPao)
elseif fz_list[i].type == RB_FZType.Wei then elseif fz_list[i].type == RB_FZType.Wei then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
-- for j=1,3 do -- for j=1,3 do
-- fzcards:GetChild("card_"..j).icon ="ui://Main_RunBeard/202_1_300" -- fzcards:GetChild("card_"..j).icon ="ui://Main_RunBeard/202_1_300"
@ -57,8 +49,7 @@ function M:UpdateFzList( fz_list ,ispaly,seat)
end end
fzcards:GetChild("card_" .. 1).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card) --jefe fzcards:GetChild("card_" .. 1).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card) --jefe
fzcards.x, fzcards.y = 0, 0 fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem,fzcards,#fz_list,i,ispaly,seat) self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, seat, flag_pengPao)
elseif fz_list[i].type == RB_FZType.ChouWei then elseif fz_list[i].type == RB_FZType.ChouWei then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
-- for j=1,2 do -- for j=1,2 do
@ -70,17 +61,14 @@ function M:UpdateFzList( fz_list ,ispaly,seat)
end end
fzcards:GetChild("card_" .. 1).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card) fzcards:GetChild("card_" .. 1).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
fzcards.x, fzcards.y = 0, 0 fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem,fzcards,#fz_list,i,ispaly,seat) self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, seat, flag_pengPao)
elseif fz_list[i].type == RB_FZType.Pao then elseif fz_list[i].type == RB_FZType.Pao then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4") local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4")
for j = 1, 4 do for j = 1, 4 do
fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card) fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
end end
fzcards.x, fzcards.y = 0, 0 fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem,fzcards,#fz_list,i,ispaly,seat) self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, seat, flag_pengPao)
elseif fz_list[i].type == RB_FZType.Ti then elseif fz_list[i].type == RB_FZType.Ti then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4") local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4")
if self._mainView._leftcard == 1 then if self._mainView._leftcard == 1 then
@ -97,26 +85,27 @@ function M:UpdateFzList( fz_list ,ispaly,seat)
-- end -- end
for j = 1, 4 do for j = 1, 4 do
if j == 1 then if j == 1 then
fzcards:GetChild("card_"..j).icon =self:getCardItem("ui://Main_RunBeard/202_",fz_list[i].card) fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i]
.card)
else else
fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300" fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300"
end end
end end
end end
fzcards.x, fzcards.y = 0, 0 fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem,fzcards,#fz_list,i,ispaly,seat) self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, seat, flag_pengPao)
end end
end end
end end
function M:playAnim(fzitem,fzcards, size,i,ispaly,seat) function M:playAnim(fzitem, fzcards, size, i, ispaly, seat, flag_pengPao)
if (ispaly == nil) then if (ispaly == nil) then
ispaly = false ispaly = false
end end
local isaddLast = false local isaddLast = false
if(ispaly and i == size)then --匹配最后一个牌 if (ispaly and i == size and not flag_pengPao) then --匹配最后一个牌
local faArray= fzitem:GetChild("chiwei1") local faArray = fzitem:GetChild("chiwei")
if (faArray ~= nil) then if (faArray ~= nil) then
faArray:AddChild(fzcards) faArray:AddChild(fzcards)
@ -159,15 +148,22 @@ function M:isAddFirst(seat)
return isaddLast return isaddLast
end end
function M:PlayingOutCardAnima(card) --摸牌动画
coroutine.start(function() -- function M:PlayingOutCardAnima(card)
coroutine.wait(0.1) -- if (self._area_outcard_list ~= nil and self._area_outcard_list.numChildren > 0) then
self:ClearOutCard() -- self._area_outcard_list:GetChildAt(0):GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/202_', card)
end) -- self._view:GetTransition('t0'):Play()
end -- end
-- coroutine.start(
-- function()
-- coroutine.wait(0.1)
-- -- self._bgview.selectedIndex = 1
-- self:ClearOutCard()
-- end
-- )
-- end
function M:UpdateOutCardList(outcard, isShow, isMopai, seat) function M:UpdateOutCardList(outcard, isShow, isMopai, seat)
if (isShow == nil) then if (isShow == nil) then
isShow = false isShow = false
end end
@ -205,7 +201,6 @@ function M:UpdateOutCardList(outcard,isShow,isMopai,seat)
if outcard ~= 0 then if outcard ~= 0 then
outcards:GetTransition("mopai" .. seat):Play(function() outcards:GetTransition("mopai" .. seat):Play(function()
-- show_di_bg.visible = true -- show_di_bg.visible = true
end) end)
end end
else else
@ -219,7 +214,6 @@ function M:UpdateOutCardList(outcard,isShow,isMopai,seat)
show_di_bg.visible = false show_di_bg.visible = false
end end
self._area_outcard_list:AddChild(outcards) self._area_outcard_list:AddChild(outcards)
end end
--弃牌 --弃牌
@ -227,7 +221,6 @@ function M:UpdateQiPai( qi_list,ispaly,seat)
self._area_qipai_list:RemoveChildren(0, -1, true) self._area_qipai_list:RemoveChildren(0, -1, true)
for i = 1, #qi_list do for i = 1, #qi_list do
local qicards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Qipais") local qicards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Qipais")
pt(qicards)
qicards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/202_", qi_list[i]) qicards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/202_", qi_list[i])
if (ispaly) then if (ispaly) then
if (i == #qi_list) then if (i == #qi_list) then
@ -255,12 +248,11 @@ function M:UpdateQiPai( qi_list,ispaly,seat)
else else
qicards:GetTransition("t0"):Play() qicards:GetTransition("t0"):Play()
end end
end end
end end
end end
self._area_qipai_list:AddChild(qicards) self._area_qipai_list:AddChild(qicards)
end end
end end
return M return M

View File

@ -38,12 +38,12 @@ function M:__OnDragEnd(context)
self.outcard_button = nil self.outcard_button = nil
end end
local button = context.sender local button = context.sender
local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y))
local card = button.data local card = button.data
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
card.btn_card.sortingOrder = 0 card.btn_card.sortingOrder = 0
if (button.y < -380 and _room.curren_outcard_seat == _room.self_player.seat) then if (button.y < self._data_outLinePos - button.height * 0.66 and _room.curren_outcard_seat == _room.self_player.seat) then
button.touchable = false button.touchable = false
self.outcard_button = card self.outcard_button = card
self:UpdateIsOnClick(false) self:UpdateIsOnClick(false)
@ -78,7 +78,7 @@ function M:__OnDragEnd(context)
maxmark = #self.card_list - 1 maxmark = #self.card_list - 1
end end
end end
if button.x + button.width / 2 < self.card_list[minmark].btn_card.x and #CountCards < 10 and button.y > -380 then if xy.x < self.card_list[minmark].btn_card.x and #CountCards < 10 and xy.y > self._data_outLinePos then
list_remove(self.card_list, card) list_remove(self.card_list, card)
local num = 0 local num = 0
for i = 1, #self.card_list do for i = 1, #self.card_list do
@ -104,7 +104,7 @@ function M:__OnDragEnd(context)
card.index_Y = 1 card.index_Y = 1
table.insert(self.card_list, 1, card) table.insert(self.card_list, 1, card)
isChangeCard = true isChangeCard = true
elseif button.x + button.width / 2 > (self.card_list[maxmark].btn_card.x + button.width) and #CountCards < 10 and button.y > -380 then elseif xy.x > (self.card_list[maxmark].btn_card.x + button.width) and #CountCards < 10 and xy.y > self._data_outLinePos then
list_remove(self.card_list, card) list_remove(self.card_list, card)
local num = 0 local num = 0
for i = 1, #self.card_list do for i = 1, #self.card_list do
@ -133,7 +133,7 @@ function M:__OnDragEnd(context)
for i = 1, #CountCards do for i = 1, #CountCards do
local card_view = CountCards[i][1] local card_view = CountCards[i][1]
if card_view ~= nil then 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) and button.y > -380 then if xy.x > card_view.old_postion.x and xy.x < (card_view.old_postion.x + button.width) and xy.y > self._data_outLinePos then
if card ~= card_view and #CountCards[i] < 4 and card.index_X ~= card_view.index_X then if card ~= card_view and #CountCards[i] < 4 and card.index_X ~= card_view.index_X then
MoveCardPos = i MoveCardPos = i
MoveCardY = #CountCards[i] + 1 MoveCardY = #CountCards[i] + 1
@ -145,24 +145,24 @@ function M:__OnDragEnd(context)
end end
local MoveCardindex = 0 local MoveCardindex = 0
-- local MoveCardY = 0 -- local MoveCardY = 0
-- print("lingmeng end", button.y, MoveCard, button.y > -380, -- print("lingmeng end", button.y, MoveCard, button.y > self._data_outLinePos,
-- button.x + button.width / 2 > card.old_postion.x and -- button.x + button.width / 2 > card.old_postion.x and
-- button.x + button.width / 2 < (card.old_postion.x + button.width) and button.y > -380) -- button.x + button.width / 2 < (card.old_postion.x + button.width) and button.y > self._data_outLinePos)
if button.x + button.width / 2 > card.old_postion.x and button.x + button.width / 2 < (card.old_postion.x + button.width) and button.y > -380 then if xy.x > card.old_postion.x and xy.x < (card.old_postion.x + button.width) and button.y > self._data_outLinePos then
if #CountCards[card.index_X] > 1 then if #CountCards[card.index_X] > 1 then
for i = 1, #CountCards[card.index_X] do for i = 1, #CountCards[card.index_X] do
local _cv = CountCards[card.index_X][i] local _cv = CountCards[card.index_X][i]
if _cv ~= card then 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 xy.y > _cv.btn_card.y and xy.y < (_cv.btn_card.y + button.height) then
--向下移動 --向下移動
if ((button.y + button.height / 2) + 20) > (card.old_postion.y + button.height) then if i < card.index_Y then
MoveCardindex = -1 MoveCardindex = -1
MoveCardPos = card.index_X MoveCardPos = card.index_X
MoveCardY = _cv.index_Y MoveCardY = _cv.index_Y
MoveCard = true MoveCard = true
list_remove(self.card_list, card) list_remove(self.card_list, card)
--向上移動 --向上移動
elseif ((button.y + button.height / 2) - 20) < card.old_postion.y then elseif i > card.index_Y then
MoveCardindex = 1 MoveCardindex = 1
MoveCardPos = card.index_X MoveCardPos = card.index_X
MoveCardY = _cv.index_Y MoveCardY = _cv.index_Y
@ -315,15 +315,21 @@ function M:UpdateQiPai(qi_list, isplay)
end end
--摸牌动画 --摸牌动画
function M:PlayingOutCardAnima(card) -- function M:PlayingOutCardAnima(card)
coroutine.start(function() -- if (self._area_outcard_list ~= nil and self._area_outcard_list.numChildren > 0) then
coroutine.wait(0.1) -- self._area_outcard_list:GetChildAt(0):GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/202_', card)
-- self._bgview.selectedIndex = 1 -- self._view:GetTransition('t0'):Play()
self:ClearOutCard() -- end
end) -- coroutine.start(
end -- function()
-- coroutine.wait(0.1)
-- -- self._bgview.selectedIndex = 1
-- self:ClearOutCard()
-- end
-- )
-- end
function M:UpdateFzList(fz_list, ispaly) function M:UpdateFzList(fz_list, ispaly, seat, flag_pengPao)
--printlog("UpdateFzList area_fz_list2") --printlog("UpdateFzList area_fz_list2")
self._area_fz_list:RemoveChildren(0, -1, true) self._area_fz_list:RemoveChildren(0, -1, true)
for i = 1, #fz_list do for i = 1, #fz_list do
@ -343,14 +349,14 @@ function M:UpdateFzList(fz_list, ispaly)
fzcards:GetChild("card_" .. 3).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].opcard[2]) fzcards:GetChild("card_" .. 3).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].opcard[2])
fzcards.x, fzcards.y = 0, 0 fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly) self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, flag_pengPao)
elseif fz_list[i].type == RB_FZType.Peng then elseif fz_list[i].type == RB_FZType.Peng then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
for j = 1, 3 do for j = 1, 3 do
fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card) fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
end end
fzcards.x, fzcards.y = 0, 0 fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly) self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, flag_pengPao)
elseif fz_list[i].type == RB_FZType.Wei then elseif fz_list[i].type == RB_FZType.Wei then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
fzcards:GetController("c1").selectedIndex = 1 fzcards:GetController("c1").selectedIndex = 1
@ -362,7 +368,7 @@ function M:UpdateFzList(fz_list, ispaly)
end end
end end
fzcards.x, fzcards.y = 0, 0 fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly) self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, flag_pengPao)
elseif fz_list[i].type == RB_FZType.ChouWei then elseif fz_list[i].type == RB_FZType.ChouWei then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
for j = 1, 2 do for j = 1, 2 do
@ -370,14 +376,14 @@ function M:UpdateFzList(fz_list, ispaly)
end end
fzcards:GetChild("card_" .. 3).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card) fzcards:GetChild("card_" .. 3).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
fzcards.x, fzcards.y = 0, 0 fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly) self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, flag_pengPao)
elseif fz_list[i].type == RB_FZType.Pao then elseif fz_list[i].type == RB_FZType.Pao then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4") local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4")
for j = 1, 4 do for j = 1, 4 do
fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card) fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
end end
fzcards.x, fzcards.y = 0, 0 fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly) self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, flag_pengPao)
elseif fz_list[i].type == RB_FZType.Ti then elseif fz_list[i].type == RB_FZType.Ti then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4") local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4")
for j = 1, 4 do for j = 1, 4 do
@ -388,27 +394,42 @@ function M:UpdateFzList(fz_list, ispaly)
end end
end end
fzcards.x, fzcards.y = 0, 0 fzcards.x, fzcards.y = 0, 0
self:playAnim(fzitem, fzcards, #fz_list, i, ispaly) self:playAnim(fzitem, fzcards, #fz_list, i, ispaly, flag_pengPao)
end end
end end
end end
function M:playAnim(fzitem, fzcards, size, i, ispaly) function M:playAnim(fzitem, fzcards, size, i, ispaly, flag_pengPao)
print("lingmeng playAnim", fzitem, fzcards, size, i, ispaly, flag_pengPao)
if (ispaly == nil) then if (ispaly == nil) then
ispaly = false ispaly = false
end end
if (ispaly and i == size) then if (ispaly and i == size and not flag_pengPao) then
local faArray = fzitem:GetChild("chiwei") local fristCard = self.card_list[1].btn_card
if (faArray ~= nil) then print("lingmeng btn_card", self.card_list[1].index_X)
faArray:AddChild(fzcards) self._area_handcard_list:AddChild(fzcards)
else fzcards:SetPivot(0.5, 0.5)
fzcards.rotation = 180
fzcards.xy = fristCard.xy - Vector2.New(fzcards.width, fzcards.height)
fzcards:TweenMove(
self._area_fz_list.xy + Vector2.New(fzcards.width, 0) * self._area_fz_list.numItems -
self._area_handcard_list.xy, 0.2)
fzcards:TweenScale(Vector2.New(0.5, 0.5), 0.2)
coroutine.start(
function()
coroutine.wait(0.2)
fzcards:RemoveFromParent()
fzcards.xy = Vector2.zero
fzcards.rotation = 0
fzcards:SetScale(1, 1)
fzitem:AddChild(fzcards) fzitem:AddChild(fzcards)
end
else
fzitem:AddChild(fzcards)
end
self._area_fz_list:AddChildAt(fzitem, 0) self._area_fz_list:AddChildAt(fzitem, 0)
end
)
else
fzitem:AddChild(fzcards)
self._area_fz_list:AddChildAt(fzitem, 0)
end
end end
--出牌提示动画 --出牌提示动画

View File

@ -39,7 +39,6 @@ function M.new(view,mainView)
end end
function M:init() function M:init()
local view = self._view local view = self._view
self._room = DataManager.CurrenRoom self._room = DataManager.CurrenRoom
self._area_outcard_list = view:GetChild("area_outcard_list") self._area_outcard_list = view:GetChild("area_outcard_list")
@ -67,12 +66,10 @@ function M:Clear()
self._mask_liangpai:RemoveChildren(0, -1, true) self._mask_liangpai:RemoveChildren(0, -1, true)
end end
function M:fillCard(obj, card_type, card) function M:fillCard(obj, card_type, card)
end end
function M:ClearOutCard() function M:ClearOutCard()
self._area_outcard_list:RemoveChildren(0, -1, true) self._area_outcard_list:RemoveChildren(0, -1, true)
end end
@ -85,7 +82,6 @@ function M:UpdateQiPai( qi_list)
qicards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/202_", qi_list[i]) qicards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/202_", qi_list[i])
self._area_qipai_list:AddChild(qicards) self._area_qipai_list:AddChild(qicards)
end end
end end
--放字 --放字
@ -99,7 +95,6 @@ function M:UpdateFzList( fz_list )
fzitem:RemoveChildren(0, -1, true) fzitem:RemoveChildren(0, -1, true)
end end
if fz_list[i].type == RB_FZType.Chi or fz_list[i].type == RB_FZType.Bi then 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") local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
fzcards:GetController("c2").selectedIndex = 1 fzcards:GetController("c2").selectedIndex = 1
fzcards:GetChild("card_" .. 1).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].active_card) fzcards:GetChild("card_" .. 1).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].active_card)
@ -108,9 +103,7 @@ function M:UpdateFzList( fz_list )
fzcards.x, fzcards.y = 0, 0 fzcards.x, fzcards.y = 0, 0
fzitem:AddChildAt(fzcards, 0) fzitem:AddChildAt(fzcards, 0)
self._area_fz_list:AddChild(fzitem) self._area_fz_list:AddChild(fzitem)
elseif fz_list[i].type == RB_FZType.Peng then elseif fz_list[i].type == RB_FZType.Peng then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
for j = 1, 3 do for j = 1, 3 do
fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card) fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
@ -118,9 +111,7 @@ function M:UpdateFzList( fz_list )
fzcards.x, fzcards.y = 0, 0 fzcards.x, fzcards.y = 0, 0
fzitem:AddChildAt(fzcards, 0) fzitem:AddChildAt(fzcards, 0)
self._area_fz_list:AddChild(fzitem) self._area_fz_list:AddChild(fzitem)
elseif fz_list[i].type == RB_FZType.Wei then elseif fz_list[i].type == RB_FZType.Wei then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
for j = 1, 2 do for j = 1, 2 do
fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300" fzcards:GetChild("card_" .. j).icon = "ui://Main_RunBeard/202_1_300"
@ -129,7 +120,6 @@ function M:UpdateFzList( fz_list )
fzcards.x, fzcards.y = 0, 0 fzcards.x, fzcards.y = 0, 0
fzitem:AddChildAt(fzcards, 0) fzitem:AddChildAt(fzcards, 0)
self._area_fz_list:AddChild(fzitem) self._area_fz_list:AddChild(fzitem)
elseif fz_list[i].type == RB_FZType.ChouWei then elseif fz_list[i].type == RB_FZType.ChouWei then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3") local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_3")
for j = 1, 2 do for j = 1, 2 do
@ -139,9 +129,7 @@ function M:UpdateFzList( fz_list )
fzcards.x, fzcards.y = 0, 0 fzcards.x, fzcards.y = 0, 0
fzitem:AddChildAt(fzcards, 0) fzitem:AddChildAt(fzcards, 0)
self._area_fz_list:AddChild(fzitem) self._area_fz_list:AddChild(fzitem)
elseif fz_list[i].type == RB_FZType.Pao then elseif fz_list[i].type == RB_FZType.Pao then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4") local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4")
for j = 1, 4 do for j = 1, 4 do
fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card) fzcards:GetChild("card_" .. j).icon = self:getCardItem("ui://Main_RunBeard/202_", fz_list[i].card)
@ -149,9 +137,7 @@ function M:UpdateFzList( fz_list )
fzcards.x, fzcards.y = 0, 0 fzcards.x, fzcards.y = 0, 0
fzitem:AddChildAt(fzcards, 0) fzitem:AddChildAt(fzcards, 0)
self._area_fz_list:AddChild(fzitem) self._area_fz_list:AddChild(fzitem)
elseif fz_list[i].type == RB_FZType.Ti then elseif fz_list[i].type == RB_FZType.Ti then
local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4") local fzcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Fz_0_4")
for j = 1, 4 do for j = 1, 4 do
if j == 4 then if j == 4 then
@ -200,10 +186,7 @@ function M:InitHandCard(handcard)
end end
end end
function M:UpdateHandCards(list) function M:UpdateHandCards(list)
self.card_lists = {} self.card_lists = {}
self._area_handcard_list:RemoveChildren(0, -1, true) self._area_handcard_list:RemoveChildren(0, -1, true)
local CountCards = {} local CountCards = {}
@ -224,7 +207,6 @@ function M:UpdateHandCards( list )
self._area_handcard_list:AddChild(card_view.btn_card) self._area_handcard_list:AddChild(card_view.btn_card)
card_view.btn_card.xy = self:GetHandCardPos(card_view, #CountCards) card_view.btn_card.xy = self:GetHandCardPos(card_view, #CountCards)
end end
end end
--牌位置 --牌位置
@ -238,8 +220,6 @@ function M:GetHandCardPos(cards_view,cards)
return Vector2.New(x, y) return Vector2.New(x, y)
end end
function M:UpdateOutCardList(outcard) function M:UpdateOutCardList(outcard)
printlog("UpdateOutCardList2222") printlog("UpdateOutCardList2222")
self._area_outcard_list:RemoveChildren(0, -1, true) self._area_outcard_list:RemoveChildren(0, -1, true)
@ -255,19 +235,18 @@ function M:UpdateOutCardList(outcard)
end end
--摸牌动画 --摸牌动画
function M:PlayingOutCardAnima(card) function M:PlayingOutCardAnima(card, seat)
if(self._area_outcard_list ~=nil and self._area_outcard_list.numChildren>0)then local outcards = self._area_outcard_list:GetChildAt(0)
self._area_outcard_list:GetChildAt(0):GetChild("icon").icon =self:getCardItem("ui://Main_RunBeard/202_",card) if not outcards then
self._view:GetTransition("t0"):Play() local outcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Gcm_OutCard")
local show_di_bg = outcards:GetChild("show_di_bg")
show_di_bg.visible = false
self._area_outcard_list:AddChild(outcards)
end end
coroutine.start(function() outcards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/203_", card)
coroutine.wait(0.1) outcards:GetTransition("qipai" .. seat):Play()
self:ClearOutCard()
end)
--
end end
--摆牌规则 --摆牌规则
function M:PendulumRule(handcard) function M:PendulumRule(handcard)
local room = DataManager.CurrenRoom local room = DataManager.CurrenRoom
@ -436,7 +415,6 @@ function M:PendulumRule(handcard)
if (v == 1) then if (v == 1) then
singleList[#singleList + 1] = k singleList[#singleList + 1] = k
CountCards[k] = CountCards[k] - 1 CountCards[k] = CountCards[k] - 1
end end
end end
local index = 0 local index = 0
@ -464,8 +442,8 @@ function M:PendulumRule(handcard)
end end
return cards_map return cards_map
end end
function M:getCardItem(card_1, card_2) function M:getCardItem(card_1, card_2)
if self._room.change_card_display ~= nil then if self._room.change_card_display ~= nil then
return card_1 .. self._room.change_card_display .. card_2 return card_1 .. self._room.change_card_display .. card_2
@ -474,5 +452,8 @@ function M:getCardItem( card_1,card_2 )
end end
end end
function M:GetFzMove()
return self._view:LocalToGlobal(Vector2.New(0, self._area_fz_list.height / 2))
end
return M return M

View File

@ -63,11 +63,13 @@ function M:init()
-- self._bgview = view:GetController("bgview") -- self._bgview = view:GetController("bgview")
self._area_fz_list = view:GetChild('area_fz_list') self._area_fz_list = view:GetChild('area_fz_list')
self._area_qipai_list = view:GetChild('windcard_list') self._area_qipai_list = view:GetChild('windcard_list')
self._view_outLine = view:GetChild('n38')
self._mask_liangpai = view:GetChild('mask_liangpai') self._mask_liangpai = view:GetChild('mask_liangpai')
UIPackage.AddPackage('base/main_zipai/ui/Main_RunBeard') UIPackage.AddPackage('base/main_zipai/ui/Main_RunBeard')
self.ctr_piao = self._view:GetController('piao') self.ctr_piao = self._view:GetController('piao')
self.ctr_niao = self._view:GetController('niao') self.ctr_niao = self._view:GetController('niao')
self.ctr_piao_value = self._view:GetController('piaovalue') self.ctr_piao_value = self._view:GetController('piaovalue')
self:UpdateOutLine()
self:BtnEvent() self:BtnEvent()
end end
@ -344,7 +346,6 @@ function M:banHandCards(list)
--printlog("---禁所有手牌----") --printlog("---禁所有手牌----")
for i = 1, #list do for i = 1, #list do
local card_code = list[i].card_item local card_code = list[i].card_item
pt(card_code)
-- local btn_card = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Btn_Card') -- 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').icon = self:getCardItem('ui://Main_RunBeard/201_', card_code)
-- btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize()) -- btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize())
@ -485,6 +486,7 @@ function M:UpdateCardDisplay()
self._area_handcard_list:AddChild(card_view.btn_card) self._area_handcard_list:AddChild(card_view.btn_card)
-- card_view.btn_card:TweenMove(self:GetHandCardPos(card_view, #CountCards), 0.3) -- card_view.btn_card:TweenMove(self:GetHandCardPos(card_view, #CountCards), 0.3)
end end
self:UpdateOutLine()
self:UpdateHandCardsPos() self:UpdateHandCardsPos()
end end
@ -507,9 +509,21 @@ function M:UpdateCardSize()
self._area_handcard_list:AddChild(card_view.btn_card) self._area_handcard_list:AddChild(card_view.btn_card)
-- card_view.btn_card:TweenMove(self:GetHandCardPos(card_view, #CountCards), 0.3) -- card_view.btn_card:TweenMove(self:GetHandCardPos(card_view, #CountCards), 0.3)
end end
self:UpdateOutLine()
self:UpdateHandCardsPos() self:UpdateHandCardsPos()
end end
function M:UpdateOutLine()
if self:getCardSize() == 1.3 then
self._data_outLinePos = 90 - (119 * 4)
elseif self:getCardSize() == 1.2 then
self._data_outLinePos = 90 - (110 * 4)
elseif self:getCardSize() == 0.8 then
self._data_outLinePos = 100 - (85 * 4)
end
self._view_outLine.y = self._data_outLinePos + self._area_handcard_list.height
end
function M:UpdateIsOnClick(isOut) function M:UpdateIsOnClick(isOut)
self._view.touchable = isOut self._view.touchable = isOut
end end
@ -768,9 +782,7 @@ end
--计算手牌位置 --计算手牌位置
function M:GetHandCardPos(cards_view, cards) function M:GetHandCardPos(cards_view, cards)
local x, y = 0, 0 local x, y = 0, 0
print("lingmeng change_card_display", card_width)
local card_width = self.card_width - (self._room.change_card_display == "8_" and -2 or 5) -- 牌的宽度 local card_width = self.card_width - (self._room.change_card_display == "8_" and -2 or 5) -- 牌的宽度
print("lingmeng change_card_display", self.card_width, self._room.change_card_display == "8_", card_width)
local middle_x = self._area_handcard_list.width / 2 local middle_x = self._area_handcard_list.width / 2
local start_x = middle_x - (cards / 2 * (card_width)) local start_x = middle_x - (cards / 2 * (card_width))
@ -783,7 +795,7 @@ function M:GetHandCardPos(cards_view, cards)
elseif self:getCardSize() == 1.2 then elseif self:getCardSize() == 1.2 then
y = 90 - (110 * cards_view.index_Y) y = 90 - (110 * cards_view.index_Y)
elseif self:getCardSize() == 0.8 then elseif self:getCardSize() == 0.8 then
y = 100 - (65 * cards_view.index_Y) y = 100 - (85 * cards_view.index_Y)
end end
return Vector2.New(x, y) return Vector2.New(x, y)
end end
@ -897,18 +909,16 @@ function M:UpdateQiPai(qi_list)
end end
--摸牌动画 --摸牌动画
function M:PlayingOutCardAnima(card) function M:PlayingOutCardAnima(card, seat)
if (self._area_outcard_list ~= nil and self._area_outcard_list.numChildren > 0) then local outcards = self._area_outcard_list:GetChildAt(0)
self._area_outcard_list:GetChildAt(0):GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/202_', card) if not outcards then
self._view:GetTransition('t0'):Play() local outcards = UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Gcm_OutCard")
local show_di_bg = outcards:GetChild("show_di_bg")
show_di_bg.visible = false
self._area_outcard_list:AddChild(outcards)
end end
coroutine.start( outcards:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/203_", card)
function() outcards:GetTransition("qipai" .. seat):Play()
coroutine.wait(0.1)
-- self._bgview.selectedIndex = 1
self:ClearOutCard()
end
)
end end
--得到设置的牌字体 --得到设置的牌字体
@ -929,4 +939,13 @@ function M:getCardSize()
end end
end end
function M:GetFzMove()
if #self.card_list then
local fristCard = self.card_list[1].btn_card
return self._area_handcard_list:LocalToGlobal(fristCard.xy)
else
return self._area_fz_list:LocalToGlobal(Vector2.New(0, self._area_fz_list.height / 2))
end
end
return M return M

View File

@ -69,9 +69,11 @@ end
function coroutine.step(t, co, ...) function coroutine.step(t, co, ...)
local args = { ... } local args = { ... }
print("lingmeng incon1", t, co)
co = co or running() co = co or running()
print("lingmeng incon2", t, co)
local timer = nil local timer = nil
print("lingmeng incon3", t, co)
local action = function() local action = function()
local flag, msg = resume(co, unpack(args)) local flag, msg = resume(co, unpack(args))
@ -81,10 +83,12 @@ function coroutine.step(t, co, ...)
return return
end end
end end
print("lingmeng incon4", t, co)
timer = FrameTimer.New(action, t or 1, 1) timer = FrameTimer.New(action, t or 1, 1)
print("lingmeng incon5", t, co)
comap[co] = timer comap[co] = timer
timer:Start() timer:Start()
print("lingmeng incon6", t, co)
return yield() return yield()
end end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 969 KiB

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@ -1,3 +1,8 @@
{ {
"objectStatus": {
"n45_j34t": {
"collapsed": true
}
},
"fitScreen": "FitSize" "fitScreen": "FitSize"
} }

View File

@ -1,5 +1,8 @@
{ {
"objectStatus": { "objectStatus": {
"n36_k3io": {
"collapsed": true
},
"n34_k3io": { "n34_k3io": {
"hidden": true "hidden": true
}, },

View File

@ -10,34 +10,26 @@
"doc.openedDocs": [ "doc.openedDocs": [
"ui://v6yvqp7wyfzf1h4", "ui://v6yvqp7wyfzf1h4",
"ui://v6yvqp7wcyprwq", "ui://v6yvqp7wcyprwq",
"ui://ppu1wv7699we8b",
"ui://v6yvqp7wf55qwa",
"ui://v6yvqp7wfgao1dn",
"ui://v6yvqp7wvoqg1dy",
"ui://v6yvqp7wlvh412c" "ui://v6yvqp7wlvh412c"
], ],
"test.device": "720p Phone", "test.device": "720p Phone",
"canvasColor": 10066329, "canvasColor": 10066329,
"auxline2": true, "auxline2": true,
"doc.activeDoc": "ui://v6yvqp7wcyprwq", "doc.activeDoc": "ui://v6yvqp7wfgao1dn",
"libview.twoColumn": false, "libview.twoColumn": false,
"libview.expandedNodes": [ "libview.expandedNodes": [
"v6yvqp7w", "v6yvqp7w",
"/", "/",
"v6yvqp7w", "v6yvqp7w",
"/component/",
"v6yvqp7w",
"/component/cards/",
"v6yvqp7w",
"/component/option/",
"v6yvqp7w",
"/component/option/component/",
"v6yvqp7w",
"/component/option/component/card/",
"v6yvqp7w",
"/image/",
"v6yvqp7w",
"/images/", "/images/",
"v6yvqp7w", "v6yvqp7w",
"/images/cards6/", "/images/cards8/",
"v6yvqp7w", "v6yvqp7w",
"/images/cards8/" "/images/clearing/"
], ],
"auxline1": true, "auxline1": true,
"snapToGrid": true, "snapToGrid": true,

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

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