保险箱积分

master
罗家炜 2025-06-20 02:17:27 +08:00
parent 866ca2e5d6
commit f4393e45d4
6 changed files with 234 additions and 299 deletions

View File

@ -10,7 +10,7 @@ local FGAssistView = import('.FGAssistView')
MainView = {} MainView = {}
-- 继承 BaseView -- 继承 BaseView
setmetatable(MainView, {__index = BaseView}) setmetatable(MainView, { __index = BaseView })
local M = MainView local M = MainView
@ -18,49 +18,48 @@ local M = MainView
local record_baned = 0 local record_baned = 0
function M:init() function M:init()
TimerManager.Clear() TimerManager.Clear()
self._gamectr = ControllerManager.GetController(GameController) self._gamectr = ControllerManager.GetController(GameController)
self._room = DataManager.CurrenRoom self._room = DataManager.CurrenRoom
self._allow_dissmiss = true -- 游戏开始后显示解散房间按钮 self._allow_dissmiss = true -- 游戏开始后显示解散房间按钮
self._multilingual = false -- 游戏支持多语言切换 self._multilingual = false -- 游戏支持多语言切换
self._language = 0 -- 语言默认0,1可以设为需要的方言 self._language = 0 -- 语言默认0,1可以设为需要的方言
self._style = 1 -- 游戏风格 self._style = 1 -- 游戏风格
self._hide_assist = false -- 是否隐藏牌友圈助手 self._hide_assist = false -- 是否隐藏牌友圈助手
self._gps_style = 1 self._gps_style = 1
self.dismiss_cd = 0 self.dismiss_cd = 0
UIPackage.AddPackage('base/chat/ui/Chat') UIPackage.AddPackage('base/chat/ui/Chat')
self.Fix_Msg_Chat = ViewUtil.Fix_Msg_Chat -- 自动回复消息列表 self.Fix_Msg_Chat = ViewUtil.Fix_Msg_Chat -- 自动回复消息列表
self.Fix_Msg_Chat2 = nil -- 自动回复列表2 self.Fix_Msg_Chat2 = nil -- 自动回复列表2
self:InitView() self:InitView()
self:SetTuoGuanState() self:SetTuoGuanState()
end end
function M:SetTuoGuanState() function M:SetTuoGuanState()
--printlog("初始化设置托管状态") --printlog("初始化设置托管状态")
if ControllerManager.enterPlayerData and #ControllerManager.enterPlayerData>0 then if ControllerManager.enterPlayerData and #ControllerManager.enterPlayerData > 0 then
--pt(ControllerManager.enterPlayerData) --pt(ControllerManager.enterPlayerData)
for i=1,#ControllerManager.enterPlayerData do for i = 1, #ControllerManager.enterPlayerData do
local p =self._player_info[self:GetPos(ControllerManager.enterPlayerData[i].seat)] local p = self._player_info[self:GetPos(ControllerManager.enterPlayerData[i].seat)]
--p.seat=ControllerManager.enterPlayerData[i].seat --p.seat=ControllerManager.enterPlayerData[i].seat
local t=ControllerManager.enterPlayerData[i].entrust_time local t = ControllerManager.enterPlayerData[i].entrust_time
--local isShow=ControllerManager.enterPlayerData[i].entrust --local isShow=ControllerManager.enterPlayerData[i].entrust
--if isShow==nil then return end --if isShow==nil then return end
if t and t>0 then if t and t > 0 then
-- p:IsShowTGTips(true,t) -- p:IsShowTGTips(true,t)
else else
end end
end
end ControllerManager.enterPlayerData = nil
ControllerManager.enterPlayerData=nil end
end
end end
function M:InitView(url, isHideIpAdds) function M:InitView(url, isHideIpAdds)
--print("url===>>>") --print("url===>>>")
--print(url) --print(url)
--print(debug.traceback()) --print(debug.traceback())
BaseView.InitView(self, url) BaseView.InitView(self, url)
-- --
@ -78,19 +77,19 @@ function M:InitView(url, isHideIpAdds)
self._gcm_chat = self._view:GetChild('gcm_chat') self._gcm_chat = self._view:GetChild('gcm_chat')
if self._gcm_chat then if self._gcm_chat then
if self._room.ban_chat2 then if self._room.ban_chat2 then
self._gcm_chat:GetController('sdk').selectedIndex = 1 self._gcm_chat:GetController('sdk').selectedIndex = 1
-- self._gcm_chat.visible = false -- self._gcm_chat.visible = false
end end
if self._room.room_config and self._room.room_config.isHidden and self._room.room_config.isHidden == 1 then if self._room.room_config and self._room.room_config.isHidden and self._room.room_config.isHidden == 1 then
-- self._gcm_chat.visible = false -- self._gcm_chat.visible = false
end end
end end
local _view = self._view local _view = self._view
local _room = self._room local _room = self._room
self._state = _view:GetController('state') self._state = _view:GetController('state')
self._ctr_action = _view:GetController("action") self._ctr_action = _view:GetController("action")
self:InitPlayerInfoView(isHideIpAdds) self:InitPlayerInfoView(isHideIpAdds)
@ -111,7 +110,7 @@ function M:InitView(url, isHideIpAdds)
-- 显示玩家距离 -- 显示玩家距离
self.btn_distance = self._view:GetChild('btn_distance') self.btn_distance = self._view:GetChild('btn_distance')
--self.btn_distance.displayObject.gameObject:SetActive(false) --self.btn_distance.displayObject.gameObject:SetActive(false)
if self.btn_distance then if self.btn_distance then
self.btn_distance.onClick:Add(function() self.btn_distance.onClick:Add(function()
if self._room.self_player.seat == 0 then if self._room.self_player.seat == 0 then
@ -120,7 +119,8 @@ function M:InitView(url, isHideIpAdds)
self.distance_view = PlayerDistanceView.new(false, self._gps_style, function(v) self.distance_view = PlayerDistanceView.new(false, self._gps_style, function(v)
self:continue_game(v) self:continue_game(v)
end) end)
self.distance_view._view:GetController("state").selectedIndex = self._state.selectedIndex > 0 and self._state.selectedIndex < 3 and 1 or 0 self.distance_view._view:GetController("state").selectedIndex = self._state.selectedIndex > 0 and
self._state.selectedIndex < 3 and 1 or 0
self.distance_view:Show() self.distance_view:Show()
end) end)
end end
@ -149,7 +149,7 @@ function M:InitView(url, isHideIpAdds)
str_des = string.format('%s %s', str_des, _room.room_config:GetDes()) str_des = string.format('%s %s', str_des, _room.room_config:GetDes())
com_roominfo:GetChild('tex_detail').text = str_des com_roominfo:GetChild('tex_detail').text = str_des
local tex_time = com_roominfo:GetChild('tex_time') local tex_time = com_roominfo:GetChild('tex_time')
self._co_timer =coroutine.start(function() self._co_timer = coroutine.start(function()
while true do while true do
tex_time.text = os.date('%m-%d %H:%M') tex_time.text = os.date('%m-%d %H:%M')
local _client = ControllerManager.GameNetClinet local _client = ControllerManager.GameNetClinet
@ -189,9 +189,9 @@ function M:InitView(url, isHideIpAdds)
-- 语音Stard -- 语音Stard
local gcm_chat = _view:GetChild('gcm_chat') local gcm_chat = _view:GetChild('gcm_chat')
--gcm_chat.displayObject.gameObject:SetActive(false) --gcm_chat.displayObject.gameObject:SetActive(false)
if gcm_chat then if gcm_chat then
-- gcm_chat.visible = false -- gcm_chat.visible = false
local _btn_chat = gcm_chat:GetChild('n1') local _btn_chat = gcm_chat:GetChild('n1')
_btn_chat.onClick:Add(function() _btn_chat.onClick:Add(function()
if self.chat_view == nil then if self.chat_view == nil then
@ -208,7 +208,7 @@ function M:InitView(url, isHideIpAdds)
self._ctr_voice = gcm_chat:GetController('voice') self._ctr_voice = gcm_chat:GetController('voice')
self._btn_record = gcm_chat:GetChild('btn_record') self._btn_record = gcm_chat:GetChild('btn_record')
self._btn_record.displayObject.gameObject:SetActive(false) self._btn_record.displayObject.gameObject:SetActive(false)
self.ctr_record_ban = self._btn_record:GetController('ban') self.ctr_record_ban = self._btn_record:GetController('ban')
self.ctr_record_ban.selectedIndex = record_baned self.ctr_record_ban.selectedIndex = record_baned
self._record_time = 0 self._record_time = 0
@ -231,14 +231,14 @@ function M:InitView(url, isHideIpAdds)
btn_ready.onClick:Set(function() btn_ready.onClick:Set(function()
self._gamectr:PlayerReady() self._gamectr:PlayerReady()
end) end)
local btn_xipai = _view:GetChild('btn_xipai') local btn_xipai = _view:GetChild('btn_xipai')
if btn_xipai then if btn_xipai then
btn_xipai.onClick:Set(function() btn_xipai.onClick:Set(function()
self._gamectr:PlayerXiPai() self._gamectr:PlayerXiPai()
end) end)
end end
local btn_start = _view:GetChild('btn_start') local btn_start = _view:GetChild('btn_start')
btn_start.onClick:Set(function() btn_start.onClick:Set(function()
@ -255,7 +255,7 @@ function M:InitView(url, isHideIpAdds)
self._left_time = 0 self._left_time = 0
self.dismiss_room_cd_time = 0 self.dismiss_room_cd_time = 0
local btn_back_exit = _view:GetChild('btn_back_exit') local btn_back_exit = _view:GetChild('btn_back_exit')
--btn_back_exit.displayObject.gameObject:SetActive(false) --btn_back_exit.displayObject.gameObject:SetActive(false)
if btn_back_exit ~= nil then if btn_back_exit ~= nil then
btn_back_exit.onClick:Set( btn_back_exit.onClick:Set(
function() function()
@ -291,42 +291,42 @@ function M:InitView(url, isHideIpAdds)
end end
) )
end end
local btn_back_lobby = _view:GetChild('btn_back_lobby') local btn_back_lobby = _view:GetChild('btn_back_lobby')
if btn_back_lobby ~= nil then if btn_back_lobby ~= nil then
btn_back_lobby.onClick:Set( btn_back_lobby.onClick:Set(
function() function()
local tip_owner = '您是否退出房间?\n(退出房间后房间将解散)' local tip_owner = '您是否退出房间?\n(退出房间后房间将解散)'
local tip = '您是否退出房间?' -- \n (请注意,申请洗牌后退出,不会返还洗牌分) local tip = '您是否退出房间?' -- \n (请注意,申请洗牌后退出,不会返还洗牌分)
local tipStr = '' local tipStr = ''
if self._room.agent then if self._room.agent then
tipStr = '您是否退出房间?' tipStr = '您是否退出房间?'
else else
tipStr = self._room.owner_id == self._room.self_player.self_user.account_id and tip_owner or tip tipStr = self._room.owner_id == self._room.self_player.self_user.account_id and tip_owner or tip
end end
local _curren_msg = MsgWindow.new(self._root_view, tipStr, MsgWindow.MsgMode.OkAndCancel) local _curren_msg = MsgWindow.new(self._root_view, tipStr, MsgWindow.MsgMode.OkAndCancel)
_curren_msg.onOk:Add( _curren_msg.onOk:Add(
function() function()
if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then
ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。') ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。')
else else
ViewUtil.ShowModalWait(self._root_view) ViewUtil.ShowModalWait(self._root_view)
self._gamectr:LevelRoom( self._gamectr:LevelRoom(
function(res) function(res)
ViewUtil.CloseModalWait() ViewUtil.CloseModalWait()
if res.ReturnCode == 0 then if res.ReturnCode == 0 then
ViewManager.ChangeView(ViewManager.View_Lobby) ViewManager.ChangeView(ViewManager.View_Lobby)
else else
ViewUtil.ErrorTip(res.ReturnCode) ViewUtil.ErrorTip(res.ReturnCode)
end end
end end
) )
end end
end end
) )
_curren_msg:Show() _curren_msg:Show()
end end
) )
end end
--[[local btn_back_lobby = _view:GetChild('btn_back_lobby') --[[local btn_back_lobby = _view:GetChild('btn_back_lobby')
btn_back_lobby.displayObject.gameObject:SetActive(false) btn_back_lobby.displayObject.gameObject:SetActive(false)
if btn_back_lobby ~= nil then if btn_back_lobby ~= nil then
@ -343,7 +343,7 @@ function M:InitView(url, isHideIpAdds)
) )
end--]] end--]]
local btn_leave_lobby = _view:GetChild('btn_leave_lobby') local btn_leave_lobby = _view:GetChild('btn_leave_lobby')
if btn_leave_lobby ~= nil then if btn_leave_lobby ~= nil then
btn_leave_lobby.onClick:Set( btn_leave_lobby.onClick:Set(
function() function()
@ -361,29 +361,25 @@ function M:InitView(url, isHideIpAdds)
-- 显示牌友圈助手 -- 显示牌友圈助手
if self._room.group_id ~= 0 and not self._hide_assist then if self._room.group_id ~= 0 and not self._hide_assist then
local bShow = true
local bShow = true
local l_groups = DataManager.groups local l_groups = DataManager.groups
local group = l_groups:get(self._room.group_id) local group = l_groups:get(self._room.group_id)
if group ~= nil then if group ~= nil then
local option = group.option or 0 local option = group.option or 0
if bit:_and(option,8) > 0 then if bit:_and(option, 8) > 0 then
bShow = false bShow = false
end end
end end
if bShow then if bShow then
--self:ShowFGAssist() --self:ShowFGAssist()
end end
end end
if self._room.self_player.entrust then if self._room.self_player.entrust then
self:MarkSelfTuoguan() self:MarkSelfTuoguan()
end end
--[[local gameCommonBtn = UIPackage.CreateObjectFromURL('ui://Common/gameCommonPanel') --[[local gameCommonBtn = UIPackage.CreateObjectFromURL('ui://Common/gameCommonPanel')
if gameCommonBtn then if gameCommonBtn then
self._view:AddChild(gameCommonBtn) self._view:AddChild(gameCommonBtn)
local shuaxingameBtn=gameCommonBtn:GetChild("shuaxinbtn") local shuaxingameBtn=gameCommonBtn:GetChild("shuaxinbtn")
@ -395,11 +391,6 @@ function M:InitView(url, isHideIpAdds)
) )
end end
end--]] end--]]
end end
function M:continue_game(continue) function M:continue_game(continue)
@ -457,11 +448,11 @@ function M:ShowFGAssist()
self._view:AddChild(btn_assist) self._view:AddChild(btn_assist)
local panel_assist = local panel_assist =
FGAssistView.new( FGAssistView.new(
self._root_view, self._root_view,
function() function()
btn_assist.touchable = true btn_assist.touchable = true
end end
) )
if self._full then if self._full then
btn_assist.x = 40 btn_assist.x = 40
else else
@ -580,7 +571,7 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.PlayerState, GameEvent.PlayerState,
function(...) function(...)
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)]
info._ctr_offline.selectedIndex = p.line_state == 0 and 1 or 0 info._ctr_offline.selectedIndex = p.line_state == 0 and 1 or 0
@ -596,7 +587,7 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.DeskBreak, GameEvent.DeskBreak,
function(...) function(...)
local arg = {...} local arg = { ... }
local code = arg[1] local code = arg[1]
if code == 0 then if code == 0 then
if self.dismissWin == nil then if self.dismissWin == nil then
@ -625,7 +616,7 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.Interaction, GameEvent.Interaction,
function(...) function(...)
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
return return
@ -670,7 +661,7 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.OnKicked, GameEvent.OnKicked,
function() function()
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)
_curren_msg.onOk:Add( _curren_msg.onOk:Add(
@ -681,27 +672,24 @@ function M:EventInit()
_curren_msg:Show() _curren_msg:Show()
end end
) )
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.TupGuanOpen, GameEvent.TupGuanOpen,
function(...) function(...)
--print("刷新托管数据=====") --print("刷新托管数据=====")
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)]
if info and info.IsShowTGTips then if info and info.IsShowTGTips then
info:IsShowTGTips(arg[2],arg[3]) info:IsShowTGTips(arg[2], arg[3])
end end
if info and info.SetShowTGTips then if info and info.SetShowTGTips then
info:SetShowTGTips(arg[2],arg[3]) info:SetShowTGTips(arg[2], arg[3])
end end
end end
) )
end end
-- 设置能否互动,1允许,0禁止 -- 设置能否互动,1允许,0禁止
@ -732,45 +720,45 @@ function M:PlayInteractAnimation(str, mypos, pos)
local total_rotation = (offsetY + offsetX) / 100 * 50 local total_rotation = (offsetY + offsetX) / 100 * 50
self._run_move = self._run_move =
TweenUtils.TweenFloat( TweenUtils.TweenFloat(
0, 0,
1, 1,
0.5, 0.5,
function(value) function(value)
myEff.x = mypos.x + offsetX * value myEff.x = mypos.x + offsetX * value
myEff.y = mypos.y + offsetY * value myEff.y = mypos.y + offsetY * value
if str == '2' then if str == '2' then
myEff.rotation = total_rotation * value myEff.rotation = total_rotation * value
end
end end
end )
)
end end
self._run_eff = self._run_eff =
coroutine.start( coroutine.start(
function() function()
if str ~= '1' then if str ~= '1' then
coroutine.wait(0.5) coroutine.wait(0.5)
else else
local degree = math.atan2(offsetX, offsetY) * 180 / math.pi - 90 local degree = math.atan2(offsetX, offsetY) * 180 / math.pi - 90
if degree < -180 then if degree < -180 then
degree = 360 + degree degree = 360 + degree
end
degree = degree * -1
if degree > 90 or degree < -90 then
degree = degree + 180 * (degree > 90 and -1 or 1)
myEff.scaleX = -1
end
myEff.rotation = degree
coroutine.wait(0.2)
end end
degree = degree * -1 self._view:AddChild(eff)
if degree > 90 or degree < -90 then eff.x = pos.x
degree = degree + 180 * (degree > 90 and -1 or 1) eff.y = pos.y
myEff.scaleX = -1 coroutine.wait(1.5)
end eff:Dispose()
myEff.rotation = degree myEff:Dispose()
coroutine.wait(0.2)
end end
self._view:AddChild(eff) )
eff.x = pos.x
eff.y = pos.y
coroutine.wait(1.5)
eff:Dispose()
myEff:Dispose()
end
)
end end
function M:GetReadyNum() function M:GetReadyNum()
@ -787,13 +775,13 @@ end
function M:OnPlayerEnter(...) function M:OnPlayerEnter(...)
printlog("进入房间222222222222222222++++++++++++++++++++++++++++") printlog("进入房间222222222222222222++++++++++++++++++++++++++++")
local arg = {...} local arg = { ... }
local p = arg[1] local p = arg[1]
if if
p ~= self._room.self_player and self._room.room_config.people_num <= 4 and p ~= self._room.self_player and self._room.room_config.people_num <= 4 and
self._room.room_config.people_num >= 3 and self._room.room_config.people_num >= 3 and
self._gamectr:CheckGPS() self._gamectr:CheckGPS()
then then
if self._room.self_player.seat == 0 then if self._room.self_player.seat == 0 then
return return
end end
@ -803,7 +791,8 @@ function M:OnPlayerEnter(...)
self.distance_view = PlayerDistanceView.new(true, self._gps_style, function(v) self.distance_view = PlayerDistanceView.new(true, self._gps_style, function(v)
self:continue_game(v) self:continue_game(v)
end) end)
self.distance_view._view:GetController("state").selectedIndex = self._state.selectedIndex > 0 and self._state.selectedIndex < 3 and 1 or 0 self.distance_view._view:GetController("state").selectedIndex = self._state.selectedIndex > 0 and
self._state.selectedIndex < 3 and 1 or 0
self.distance_view:Show() self.distance_view:Show()
if self.btn_distance then if self.btn_distance then
self.btn_distance:GetController("state").selectedIndex = 1 self.btn_distance:GetController("state").selectedIndex = 1
@ -815,30 +804,30 @@ function M:OnPlayerEnter(...)
end end
function M:OnPlayerReady(...) function M:OnPlayerReady(...)
local arg = {...} local arg = { ... }
local p = arg[1] local p = arg[1]
if p.isSendCardState~=nil and p.isSendCardState==true then if p.isSendCardState ~= nil and p.isSendCardState == true then
p.isSendCardState=false p.isSendCardState = false
ControllerManager.IsSendCard=false ControllerManager.IsSendCard = false
print("进入设置计时器控制==========") print("进入设置计时器控制==========")
coroutine.start(function() coroutine.start(function()
print("计时器倒计时5s=============") print("计时器倒计时5s=============")
coroutine.wait(5) coroutine.wait(5)
print("当前状态==============") print("当前状态==============")
print(ControllerManager.IsSendCard) print(ControllerManager.IsSendCard)
if ControllerManager.IsSendCard==true then if ControllerManager.IsSendCard == true then
print("以发送开牌======================") print("以发送开牌======================")
return return
else else
print("开始断线重连") print("开始断线重连")
ControllerManager.OnConnect(SocketCode.TimeoutDisconnect) ControllerManager.OnConnect(SocketCode.TimeoutDisconnect)
ViewManager.refreshGameView() ViewManager.refreshGameView()
end end
ControllerManager.IsSendCard=false ControllerManager.IsSendCard = false
end) end)
end end
if p.seat == self._room.self_player.seat then if p.seat == self._room.self_player.seat then
if self._ctr_action then if self._ctr_action then
self._ctr_action.selectedIndex = 0 self._ctr_action.selectedIndex = 0
@ -850,7 +839,7 @@ function M:OnPlayerReady(...)
end end
function M:OnUpdateInfo(...) function M:OnUpdateInfo(...)
local arg = {...} local arg = { ... }
local p = arg[1] local p = arg[1]
local t = arg[2] local t = arg[2]
-- 托管状态变化 -- 托管状态变化
@ -878,8 +867,8 @@ function M:MarkSelfTuoguan()
if self._com_tuoguan then if self._com_tuoguan then
return return
end end
self._com_tuoguan = UIPackage.CreateObjectFromURL('ui://Common/com_tuoguan_self') self._com_tuoguan = UIPackage.CreateObjectFromURL('ui://Common/com_tuoguan_self')
local com_tuoguan = self._com_tuoguan local com_tuoguan = self._com_tuoguan
GRoot.inst:AddChild(com_tuoguan) GRoot.inst:AddChild(com_tuoguan)
@ -914,14 +903,14 @@ function M:MarkSelfTuoguan()
_msg_view = nil _msg_view = nil
end end
) )
local roate=GRoot.inst.width/GRoot.inst.height local roate = GRoot.inst.width / GRoot.inst.height
local num=100 local num = 100
if roate<1.9 then if roate < 1.9 then
num=250 num = 250
end end
com_tuoguan:AddChild(_msg_view) com_tuoguan:AddChild(_msg_view)
_msg_view:GetChild('tex_message').text = '确定要取消托管吗?' _msg_view:GetChild('tex_message').text = '确定要取消托管吗?'
_msg_view.x = (com_tuoguan.width - _msg_view.width) * 0.5-num _msg_view.x = (com_tuoguan.width - _msg_view.width) * 0.5 - num
_msg_view.y = (com_tuoguan.height - com_tuoguan.y - _msg_view.height) * 0.5 _msg_view.y = (com_tuoguan.height - com_tuoguan.y - _msg_view.height) * 0.5
end end
) )
@ -936,7 +925,7 @@ function M:UnmarkSelfTuoguan()
end end
function M:OnPlayerLeave(...) function M:OnPlayerLeave(...)
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)]
info._view.visible = false info._view.visible = false
@ -997,15 +986,17 @@ 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
if pcall(func) then local result, resultInfo = pcall(func)
print("lingmeng PopEvent", result, resultInfo)
else if result then
self._gamectr = ControllerManager.GetController(GameController) else
if self._gamectr then printlog("lingmeng eror", resultInfo)
self._gamectr:ResetConnect() self._gamectr = ControllerManager.GetController(GameController)
end if self._gamectr then
end self._gamectr:ResetConnect()
end
end
--func() --func()
end end
end end
@ -1019,16 +1010,16 @@ function M:OnUpdate()
local leftTime = math.floor(_left_time) local leftTime = math.floor(_left_time)
if leftTime < 10 then if leftTime < 10 then
self._tex_leftTime.text = '0' .. tostring(leftTime) self._tex_leftTime.text = '0' .. tostring(leftTime)
for i=2,4 do for i = 2, 4 do
local text = self["_tex_leftTime"..i] local text = self["_tex_leftTime" .. i]
if text then if text then
text.text = '0' .. tostring(leftTime) text.text = '0' .. tostring(leftTime)
end end
end end
else else
self._tex_leftTime.text = tostring(leftTime) self._tex_leftTime.text = tostring(leftTime)
for i=2,4 do for i = 2, 4 do
local text = self["_tex_leftTime"..i] local text = self["_tex_leftTime" .. i]
if text then if text then
text.text = tostring(leftTime) text.text = tostring(leftTime)
end end
@ -1048,8 +1039,8 @@ function M:OnUpdate()
if self._tex_leftTime then if self._tex_leftTime then
self._tex_leftTime.text = '00' self._tex_leftTime.text = '00'
end end
for i=2,4 do for i = 2, 4 do
local text = self["_tex_leftTime"..i] local text = self["_tex_leftTime" .. i]
if text then if text then
text.text = '00' text.text = '00'
end end
@ -1073,16 +1064,18 @@ function M:OnUpdate()
-- self.dismissWin = nil -- self.dismissWin = nil
-- else -- else
self.dismissWin:OnUpdate(deltaTime) self.dismissWin:OnUpdate(deltaTime)
-- end -- end
end
if self.OnMuShiUpdate then
self:OnMuShiUpdate()
end end
if self.OnMuShiUpdate then
self:OnMuShiUpdate()
end
end end
function M:onLeftTimeOver() function M:onLeftTimeOver()
end end
function M:Clear() function M:Clear()
-- self:__CloseTip() -- self:__CloseTip()
for i = 1, #self._player_info do for i = 1, #self._player_info do
@ -1090,14 +1083,12 @@ function M:Clear()
end end
end end
function M:DestroyPlayerInfo() function M:DestroyPlayerInfo()
for i = 1, #self._player_info do for i = 1, #self._player_info do
self._player_info[i]:Destroy() self._player_info[i]:Destroy()
end end
end end
function M:GetPos(seat) function M:GetPos(seat)
return ViewUtil.GetPos(self._room.self_player.seat, seat, self._room.room_config.people_num) return ViewUtil.GetPos(self._room.self_player.seat, seat, self._room.room_config.people_num)
end end
@ -1117,7 +1108,7 @@ end
--游戏激活 --游戏激活
function M:OnApplicationActive() function M:OnApplicationActive()
--print("游戏激活================") --print("游戏激活================")
if os.time() - last_pause_time > 15 then if os.time() - last_pause_time > 15 then
last_pause_time = os.time() last_pause_time = os.time()
ControllerManager.WebClient:clearActionQueue() ControllerManager.WebClient:clearActionQueue()
@ -1137,16 +1128,17 @@ function M:Show()
self.distance_view = PlayerDistanceView.new(true, self._gps_style, function(v) self.distance_view = PlayerDistanceView.new(true, self._gps_style, function(v)
self:continue_game(v) self:continue_game(v)
end) end)
self.distance_view._view:GetController("state").selectedIndex = self._state.selectedIndex > 0 and self._state.selectedIndex < 3 and 1 or 0 self.distance_view._view:GetController("state").selectedIndex = self._state.selectedIndex > 0 and
self._state.selectedIndex < 3 and 1 or 0
self.distance_view:Show() self.distance_view:Show()
self.btn_distance:GetController("state").selectedIndex = 1 self.btn_distance:GetController("state").selectedIndex = 1
end end
end end
function M:Destroy() function M:Destroy()
TimerManager.Clear() TimerManager.Clear()
self:UnmarkSelfTuoguan() self:UnmarkSelfTuoguan()
self:DestroyPlayerInfo() self:DestroyPlayerInfo()
DSTweenManager.ClearTween() DSTweenManager.ClearTween()
NetResetConnectWindow.CloseNetReset() NetResetConnectWindow.CloseNetReset()
@ -1161,5 +1153,4 @@ function M:Destroy()
BaseView.Destroy(self) BaseView.Destroy(self)
BaseWindow.DestroyAll() BaseWindow.DestroyAll()
ResourcesManager.UnLoadGroup('base_chat') ResourcesManager.UnLoadGroup('base_chat')
end end

View File

@ -7,75 +7,10 @@
"/" "/"
], ],
"libview.iconScale": 0, "libview.iconScale": 0,
"doc.openedDocs": [ "doc.openedDocs": [],
"ui://2d9xdj6zfn7fao",
"ui://m7iejg4610snh5j",
"ui://m7iejg46kwi0hma",
"ui://27vd145bm16m7iji",
"ui://m7iejg46xt5s7ij4",
"ui://m7iejg46xt5s7ij3",
"ui://m7iejg46xt5s7ij2",
"ui://m7iejg46xt5s7iiy",
"ui://m7iejg46gltdhc9",
"ui://m7iejg46irlqi02",
"ui://m7iejg46imp57ih2",
"ui://m7iejg46ilon7i9l",
"ui://m7iejg46iaes7idc",
"ui://m7iejg46iaes7idk",
"ui://m7iejg46iaes7idb",
"ui://m7iejg46iaes7idj",
"ui://m7iejg46ilon7i9m",
"ui://0khx14are0py2",
"ui://m7iejg46ilon7ia2",
"ui://m7iejg46ilon7ias",
"ui://m7iejg46ilon7ibc",
"ui://m7iejg46imp57ihp",
"ui://9n9stu2eprgzf0",
"ui://ppu1wv76j4mf9j",
"ui://ppu1wv76j4mf9d",
"ui://ppu1wv76j4mf9e",
"ui://ppu1wv76j4mf9k",
"ui://v6yvqp7wf55qwa",
"ui://v6yvqp7wf55qw7",
"ui://m7iejg46kwi0hkb",
"ui://m7iejg46mpllhv2",
"ui://m7iejg46kwi0hkl",
"ui://m7iejg46mpllhv5",
"ui://m7iejg46mkdvhdu",
"ui://v6yvqp7wf55qw5",
"ui://v6yvqp7waen81bs",
"ui://v6yvqp7waen81b0",
"ui://v6yvqp7waen81bf",
"ui://v6yvqp7wf55qvt",
"ui://v6yvqp7wf55qwb",
"ui://9n9stu2ethxkcis",
"ui://v0j9abjygq7ms2",
"ui://v0j9abjygq7m8f",
"ui://v0j9abjygq7m8l",
"ui://v0j9abjygq7m8u",
"ui://v0j9abjyp0aisn",
"ui://v0j9abjygq7med",
"ui://v0j9abjyp0aism",
"ui://v0j9abjygq7mgx",
"ui://v0j9abjygq7mh1",
"ui://m7iejg46z3847i6m",
"ui://m7iejg46kwi0hk0",
"ui://m7iejg46imp57igy",
"ui://m7iejg46imp57ih3",
"ui://m7iejg46hsbhhjn",
"ui://m7iejg46l679hwn",
"ui://m7iejg46l679hws",
"ui://m7iejg46n5sxha2",
"ui://m7iejg46cioeho9",
"ui://m7iejg46z3847i6q",
"ui://m7iejg46m16m7igb",
"ui://m7iejg46imp57igl",
"ui://m7iejg46imp57igi"
],
"test.device": "720p Phone", "test.device": "720p Phone",
"canvasColor": 10066329, "canvasColor": 10066329,
"auxline2": true, "auxline2": true,
"doc.activeDoc": "ui://m7iejg46mpllhv5",
"libview.twoColumn": false, "libview.twoColumn": false,
"libview.expandedNodes": [ "libview.expandedNodes": [
"s63l0suw", "s63l0suw",
@ -95,7 +30,15 @@
"v6yvqp7w", "v6yvqp7w",
"/component/Main/", "/component/Main/",
"v6yvqp7w", "v6yvqp7w",
"/component/Main/component/" "/component/Main/component/",
"m7iejg46",
"/",
"m7iejg46",
"/mgr/",
"m7iejg46",
"/mgr/component/",
"m7iejg46",
"/mgr/component/play_set/"
], ],
"auxline1": true, "auxline1": true,
"snapToGrid": true, "snapToGrid": true,

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<component size="55,262"> <component size="55,262">
<controller name="c1" pages="0,,1,,2," selected="2"/> <controller name="c1" pages="0,,1,,2," selected="0"/>
<controller name="hu" pages="0,,1,,2,,3,,4," selected="0"/> <controller name="hu" pages="0,,1,,2,,3,,4," selected="0"/>
<displayList> <displayList>
<loader id="n18_of6w" name="card_4" xy="0,166" pivot="0.5,0.5" size="55,67" group="n19_of6w" aspect="true" rotation="180" fill="scale"> <loader id="n18_of6w" name="card_4" xy="0,166" pivot="0.5,0.5" size="55,67" group="n19_of6w" aspect="true" rotation="180" fill="scale">

View File

@ -24,10 +24,10 @@
<gearDisplay controller="button" pages="1"/> <gearDisplay controller="button" pages="1"/>
<Button icon="ui://v6yvqp7wn1ry3r"/> <Button icon="ui://v6yvqp7wn1ry3r"/>
</component> </component>
<text id="n14_pt1r" name="n14" xy="62,2" size="92,31" group="n19_pt1r" fontSize="22" color="#ffffff" align="center" vAlign="middle" text="房间号:"/> <text id="n14_pt1r" name="n14" xy="62,2" size="92,32" group="n19_pt1r" fontSize="22" color="#ffffff" align="center" vAlign="middle" text="房间号:"/>
<text id="n15_pt1r" name="tex_roomnum" xy="166,1" size="76,41" group="n19_pt1r" fontSize="22" color="#ffffff" vAlign="middle" autoSize="none" text="123456&#xA;"/> <text id="n15_pt1r" name="tex_roomnum" xy="166,1" size="76,41" group="n19_pt1r" fontSize="22" color="#ffffff" vAlign="middle" autoSize="none" text="123456&#xA;"/>
<text id="n16_pt1r" name="tex_game" xy="916,9" size="114,31" group="n19_pt1r" fontSize="22" color="#ffffff" vAlign="middle" text="娄底放炮罚"/> <text id="n16_pt1r" name="tex_game" xy="916,9" size="114,32" group="n19_pt1r" fontSize="22" color="#ffffff" vAlign="middle" text="娄底放炮罚"/>
<text id="n17_pt1r" name="tex_data" xy="1106,3" size="145,39" group="n19_pt1r" fontSize="28" color="#b25116" align="center" vAlign="middle" text="2017-02-12"/> <text id="n17_pt1r" name="tex_data" xy="1106,3" size="150,39" group="n19_pt1r" fontSize="28" color="#b25116" align="center" vAlign="middle" text="2017-02-12"/>
<group id="n19_pt1r" name="room_info" xy="62,1" size="1189,41" group="n70_dunj"/> <group id="n19_pt1r" name="room_info" xy="62,1" size="1189,41" group="n70_dunj"/>
<text id="n49_g8y2" name="n49" xy="475,600" size="457,74" group="n70_dunj" visible="false" fontSize="18" color="#999999" vAlign="middle" autoSize="none" singleLine="true" text="此页面仅用于娱乐竞技展示,禁止一切赌博行为!"> <text id="n49_g8y2" name="n49" xy="475,600" size="457,74" group="n70_dunj" visible="false" fontSize="18" color="#999999" vAlign="middle" autoSize="none" singleLine="true" text="此页面仅用于娱乐竞技展示,禁止一切赌博行为!">
<gearDisplay controller="over" pages="1"/> <gearDisplay controller="over" pages="1"/>
@ -103,7 +103,7 @@
<item/> <item/>
</list> </list>
<text id="n42_n1ry" name="score" xy="986,364" size="256,42" group="n45_n1ry" fontSize="30" color="#924e00" vAlign="middle" autoSize="none" bold="true" singleLine="true" text=""/> <text id="n42_n1ry" name="score" xy="986,364" size="256,42" group="n45_n1ry" fontSize="30" color="#924e00" vAlign="middle" autoSize="none" bold="true" singleLine="true" text=""/>
<text id="n56_fnpw" name="222" xy="767,567" size="82,37" group="n58_fnpw" fontSize="26" color="#b25116" vAlign="middle" text="弃牌:"/> <text id="n56_fnpw" name="222" xy="767,567" size="82,36" group="n58_fnpw" fontSize="26" color="#b25116" vAlign="middle" text="弃牌:"/>
<list id="n62_fnpw" name="qipai_list" xy="955,479" size="298,157" group="n58_fnpw" layout="row" colGap="1" defaultItem="ui://ppu1wv76j4mf9e" vAlign="middle"> <list id="n62_fnpw" name="qipai_list" xy="955,479" size="298,157" group="n58_fnpw" layout="row" colGap="1" defaultItem="ui://ppu1wv76j4mf9e" vAlign="middle">
<item/> <item/>
<item/> <item/>

View File

@ -441,7 +441,7 @@
<image id="thxk7dor" name="Group 638@2x.png" path="/images/index/"/> <image id="thxk7dor" name="Group 638@2x.png" path="/images/index/"/>
<image id="thxk7dos" name="Group 639.png" path="/images/index/"/> <image id="thxk7dos" name="Group 639.png" path="/images/index/"/>
<image id="thxk7dot" name="Group 639@2x.png" path="/images/index/"/> <image id="thxk7dot" name="Group 639@2x.png" path="/images/index/"/>
<image id="thxk7dou" name="Rectangle 23.png" path="/images/index/" scale="9grid" scale9grid="47,17,986,36"/> <image id="thxk7dou" name="Rectangle 23.png" path="/images/index/" scale="9grid" scale9grid="47,17,986,36" atlas="alone"/>
<image id="thxk7dov" name="Rectangle 23@2x.png" path="/images/index/" atlas="alone"/> <image id="thxk7dov" name="Rectangle 23@2x.png" path="/images/index/" atlas="alone"/>
<image id="thxk7dow" name="hecheng 1_00048.png" path="/images/clip_joinRoom/" exported="true" atlas="9"/> <image id="thxk7dow" name="hecheng 1_00048.png" path="/images/clip_joinRoom/" exported="true" atlas="9"/>
<image id="thxk7doz" name="taohua_00064.png" path="/images/clip_bg/" exported="true" atlas="6"/> <image id="thxk7doz" name="taohua_00064.png" path="/images/clip_bg/" exported="true" atlas="6"/>

View File

@ -2,7 +2,7 @@
<component size="1334,750"> <component size="1334,750">
<controller name="manager" pages="0,,1," selected="0"/> <controller name="manager" pages="0,,1," selected="0"/>
<controller name="index" pages="0,,1," selected="0"/> <controller name="index" pages="0,,1," selected="0"/>
<controller name="top" pages="0,,1,,2,,3,,4," selected="0"/> <controller name="top" pages="0,,1,,2,,3,,4," selected="4"/>
<displayList> <displayList>
<image id="n95_xt5s" name="n95" src="xt5s7iit" fileName="images/jifen/Rectangle 424.png" xy="36,36"> <image id="n95_xt5s" name="n95" src="xt5s7iit" fileName="images/jifen/Rectangle 424.png" xy="36,36">
<relation target="" sidePair="width-width%,height-height%"/> <relation target="" sidePair="width-width%,height-height%"/>
@ -43,6 +43,7 @@
<relation target="n87_vyn3" sidePair="left-left%,top-top%"/> <relation target="n87_vyn3" sidePair="left-left%,top-top%"/>
</text> </text>
<text id="n33_gltd" name="n33" xy="1110,145" size="142,61" group="n34_gltd" font="Microsoft YaHei" fontSize="24" color="#884f00" align="center" vAlign="middle" autoSize="none" bold="true" text="当前积分"> <text id="n33_gltd" name="n33" xy="1110,145" size="142,61" group="n34_gltd" font="Microsoft YaHei" fontSize="24" color="#884f00" align="center" vAlign="middle" autoSize="none" bold="true" text="当前积分">
<gearText controller="top" pages="3" values="保险箱积分" default="当前积分"/>
<relation target="" sidePair=""/> <relation target="" sidePair=""/>
<relation target="n87_vyn3" sidePair="left-left%,top-top%"/> <relation target="n87_vyn3" sidePair="left-left%,top-top%"/>
</text> </text>
@ -148,7 +149,7 @@
</text> </text>
<image id="n82_et16" name="n82" pkg="m7iejg46" src="et167i3a" fileName="积分详情11_PxCook.png" xy="-216,0" pivot="0.5,0" visible="false" alpha="0.5"/> <image id="n82_et16" name="n82" pkg="m7iejg46" src="et167i3a" fileName="积分详情11_PxCook.png" xy="-216,0" pivot="0.5,0" visible="false" alpha="0.5"/>
<component id="n105_xt5s" name="btn_all" src="xt5s7iix" fileName="images/jifen/btn_all.xml" xy="167,64" group="n103_xt5s"> <component id="n105_xt5s" name="btn_all" src="xt5s7iix" fileName="images/jifen/btn_all.xml" xy="167,64" group="n103_xt5s">
<Button checked="true" controller="top" page="0"/> <Button controller="top" page="0"/>
</component> </component>
<component id="n106_xt5s" name="btn_filter1" src="xt5s7iiy" fileName="images/jifen/btn_filter1.xml" xy="367,64" group="n103_xt5s"> <component id="n106_xt5s" name="btn_filter1" src="xt5s7iiy" fileName="images/jifen/btn_filter1.xml" xy="367,64" group="n103_xt5s">
<Button controller="top" page="1"/> <Button controller="top" page="1"/>
@ -160,7 +161,7 @@
<Button controller="top" page="3"/> <Button controller="top" page="3"/>
</component> </component>
<component id="n109_xt5s" name="btn_filter64" src="xt5s7ij4" fileName="images/jifen/btn_filter64.xml" xy="967,64" group="n103_xt5s"> <component id="n109_xt5s" name="btn_filter64" src="xt5s7ij4" fileName="images/jifen/btn_filter64.xml" xy="967,64" group="n103_xt5s">
<Button controller="top" page="4"/> <Button checked="true" controller="top" page="4"/>
</component> </component>
<group id="n103_xt5s" name="newFillter" xy="167,64" size="1000,56" advanced="true"> <group id="n103_xt5s" name="newFillter" xy="167,64" size="1000,56" advanced="true">
<relation target="" sidePair="center-center,middle-middle"/> <relation target="" sidePair="center-center,middle-middle"/>