保险箱积分
parent
866ca2e5d6
commit
f4393e45d4
|
|
@ -10,7 +10,7 @@ local FGAssistView = import('.FGAssistView')
|
|||
MainView = {}
|
||||
|
||||
-- 继承 BaseView
|
||||
setmetatable(MainView, {__index = BaseView})
|
||||
setmetatable(MainView, { __index = BaseView })
|
||||
|
||||
local M = MainView
|
||||
|
||||
|
|
@ -18,49 +18,48 @@ local M = MainView
|
|||
local record_baned = 0
|
||||
|
||||
function M:init()
|
||||
TimerManager.Clear()
|
||||
TimerManager.Clear()
|
||||
self._gamectr = ControllerManager.GetController(GameController)
|
||||
self._room = DataManager.CurrenRoom
|
||||
self._allow_dissmiss = true -- 游戏开始后显示解散房间按钮
|
||||
self._multilingual = false -- 游戏支持多语言切换
|
||||
self._language = 0 -- 语言默认0,1可以设为需要的方言
|
||||
self._style = 1 -- 游戏风格
|
||||
self._hide_assist = false -- 是否隐藏牌友圈助手
|
||||
self._multilingual = false -- 游戏支持多语言切换
|
||||
self._language = 0 -- 语言默认0,1可以设为需要的方言
|
||||
self._style = 1 -- 游戏风格
|
||||
self._hide_assist = false -- 是否隐藏牌友圈助手
|
||||
self._gps_style = 1
|
||||
self.dismiss_cd = 0
|
||||
UIPackage.AddPackage('base/chat/ui/Chat')
|
||||
self.Fix_Msg_Chat = ViewUtil.Fix_Msg_Chat -- 自动回复消息列表
|
||||
self.Fix_Msg_Chat2 = nil -- 自动回复列表2
|
||||
self.Fix_Msg_Chat2 = nil -- 自动回复列表2
|
||||
self:InitView()
|
||||
self:SetTuoGuanState()
|
||||
self:SetTuoGuanState()
|
||||
end
|
||||
|
||||
function M:SetTuoGuanState()
|
||||
--printlog("初始化设置托管状态")
|
||||
if ControllerManager.enterPlayerData and #ControllerManager.enterPlayerData>0 then
|
||||
--pt(ControllerManager.enterPlayerData)
|
||||
for i=1,#ControllerManager.enterPlayerData do
|
||||
local p =self._player_info[self:GetPos(ControllerManager.enterPlayerData[i].seat)]
|
||||
--p.seat=ControllerManager.enterPlayerData[i].seat
|
||||
local t=ControllerManager.enterPlayerData[i].entrust_time
|
||||
--local isShow=ControllerManager.enterPlayerData[i].entrust
|
||||
--if isShow==nil then return end
|
||||
|
||||
if t and t>0 then
|
||||
-- p:IsShowTGTips(true,t)
|
||||
else
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
ControllerManager.enterPlayerData=nil
|
||||
end
|
||||
--printlog("初始化设置托管状态")
|
||||
if ControllerManager.enterPlayerData and #ControllerManager.enterPlayerData > 0 then
|
||||
--pt(ControllerManager.enterPlayerData)
|
||||
for i = 1, #ControllerManager.enterPlayerData do
|
||||
local p = self._player_info[self:GetPos(ControllerManager.enterPlayerData[i].seat)]
|
||||
--p.seat=ControllerManager.enterPlayerData[i].seat
|
||||
local t = ControllerManager.enterPlayerData[i].entrust_time
|
||||
--local isShow=ControllerManager.enterPlayerData[i].entrust
|
||||
--if isShow==nil then return end
|
||||
|
||||
if t and t > 0 then
|
||||
-- p:IsShowTGTips(true,t)
|
||||
else
|
||||
|
||||
end
|
||||
end
|
||||
ControllerManager.enterPlayerData = nil
|
||||
end
|
||||
end
|
||||
|
||||
function M:InitView(url, isHideIpAdds)
|
||||
--print("url===>>>")
|
||||
--print(url)
|
||||
--print(debug.traceback())
|
||||
--print("url===>>>")
|
||||
--print(url)
|
||||
--print(debug.traceback())
|
||||
BaseView.InitView(self, url)
|
||||
--
|
||||
|
||||
|
|
@ -78,19 +77,19 @@ function M:InitView(url, isHideIpAdds)
|
|||
|
||||
self._gcm_chat = self._view:GetChild('gcm_chat')
|
||||
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.visible = false
|
||||
-- self._gcm_chat.visible = false
|
||||
end
|
||||
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
|
||||
|
||||
local _view = self._view
|
||||
local _room = self._room
|
||||
self._state = _view:GetController('state')
|
||||
self._ctr_action = _view:GetController("action")
|
||||
self._ctr_action = _view:GetController("action")
|
||||
|
||||
self:InitPlayerInfoView(isHideIpAdds)
|
||||
|
||||
|
|
@ -111,7 +110,7 @@ function M:InitView(url, isHideIpAdds)
|
|||
|
||||
-- 显示玩家距离
|
||||
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
|
||||
self.btn_distance.onClick:Add(function()
|
||||
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:continue_game(v)
|
||||
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()
|
||||
end)
|
||||
end
|
||||
|
|
@ -149,7 +149,7 @@ function M:InitView(url, isHideIpAdds)
|
|||
str_des = string.format('%s %s', str_des, _room.room_config:GetDes())
|
||||
com_roominfo:GetChild('tex_detail').text = str_des
|
||||
local tex_time = com_roominfo:GetChild('tex_time')
|
||||
self._co_timer =coroutine.start(function()
|
||||
self._co_timer = coroutine.start(function()
|
||||
while true do
|
||||
tex_time.text = os.date('%m-%d %H:%M')
|
||||
local _client = ControllerManager.GameNetClinet
|
||||
|
|
@ -189,9 +189,9 @@ function M:InitView(url, isHideIpAdds)
|
|||
|
||||
-- 语音Stard
|
||||
local gcm_chat = _view:GetChild('gcm_chat')
|
||||
--gcm_chat.displayObject.gameObject:SetActive(false)
|
||||
--gcm_chat.displayObject.gameObject:SetActive(false)
|
||||
if gcm_chat then
|
||||
-- gcm_chat.visible = false
|
||||
-- gcm_chat.visible = false
|
||||
local _btn_chat = gcm_chat:GetChild('n1')
|
||||
_btn_chat.onClick:Add(function()
|
||||
if self.chat_view == nil then
|
||||
|
|
@ -208,7 +208,7 @@ function M:InitView(url, isHideIpAdds)
|
|||
self._ctr_voice = gcm_chat:GetController('voice')
|
||||
|
||||
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.selectedIndex = record_baned
|
||||
self._record_time = 0
|
||||
|
|
@ -231,14 +231,14 @@ function M:InitView(url, isHideIpAdds)
|
|||
btn_ready.onClick:Set(function()
|
||||
self._gamectr:PlayerReady()
|
||||
end)
|
||||
|
||||
local btn_xipai = _view:GetChild('btn_xipai')
|
||||
if btn_xipai then
|
||||
btn_xipai.onClick:Set(function()
|
||||
self._gamectr:PlayerXiPai()
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
local btn_xipai = _view:GetChild('btn_xipai')
|
||||
if btn_xipai then
|
||||
btn_xipai.onClick:Set(function()
|
||||
self._gamectr:PlayerXiPai()
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
local btn_start = _view:GetChild('btn_start')
|
||||
btn_start.onClick:Set(function()
|
||||
|
|
@ -255,7 +255,7 @@ function M:InitView(url, isHideIpAdds)
|
|||
self._left_time = 0
|
||||
self.dismiss_room_cd_time = 0
|
||||
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
|
||||
btn_back_exit.onClick:Set(
|
||||
function()
|
||||
|
|
@ -291,42 +291,42 @@ function M:InitView(url, isHideIpAdds)
|
|||
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
|
||||
btn_back_lobby.onClick:Set(
|
||||
btn_back_lobby.onClick:Set(
|
||||
function()
|
||||
local tip_owner = '您是否退出房间?\n(退出房间后房间将解散)'
|
||||
local tip = '您是否退出房间?' -- \n (请注意,申请洗牌后退出,不会返还洗牌分)
|
||||
local tipStr = ''
|
||||
if self._room.agent then
|
||||
tipStr = '您是否退出房间?'
|
||||
else
|
||||
tipStr = self._room.owner_id == self._room.self_player.self_user.account_id and tip_owner or tip
|
||||
end
|
||||
local _curren_msg = MsgWindow.new(self._root_view, tipStr, MsgWindow.MsgMode.OkAndCancel)
|
||||
_curren_msg.onOk:Add(
|
||||
function()
|
||||
if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then
|
||||
ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。')
|
||||
else
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
self._gamectr:LevelRoom(
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode == 0 then
|
||||
ViewManager.ChangeView(ViewManager.View_Lobby)
|
||||
else
|
||||
ViewUtil.ErrorTip(res.ReturnCode)
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
)
|
||||
_curren_msg:Show()
|
||||
end
|
||||
)
|
||||
end
|
||||
local tip = '您是否退出房间?' -- \n (请注意,申请洗牌后退出,不会返还洗牌分)
|
||||
local tipStr = ''
|
||||
if self._room.agent then
|
||||
tipStr = '您是否退出房间?'
|
||||
else
|
||||
tipStr = self._room.owner_id == self._room.self_player.self_user.account_id and tip_owner or tip
|
||||
end
|
||||
local _curren_msg = MsgWindow.new(self._root_view, tipStr, MsgWindow.MsgMode.OkAndCancel)
|
||||
_curren_msg.onOk:Add(
|
||||
function()
|
||||
if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then
|
||||
ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。')
|
||||
else
|
||||
ViewUtil.ShowModalWait(self._root_view)
|
||||
self._gamectr:LevelRoom(
|
||||
function(res)
|
||||
ViewUtil.CloseModalWait()
|
||||
if res.ReturnCode == 0 then
|
||||
ViewManager.ChangeView(ViewManager.View_Lobby)
|
||||
else
|
||||
ViewUtil.ErrorTip(res.ReturnCode)
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
)
|
||||
_curren_msg:Show()
|
||||
end
|
||||
)
|
||||
end
|
||||
--[[local btn_back_lobby = _view:GetChild('btn_back_lobby')
|
||||
btn_back_lobby.displayObject.gameObject:SetActive(false)
|
||||
if btn_back_lobby ~= nil then
|
||||
|
|
@ -343,7 +343,7 @@ function M:InitView(url, isHideIpAdds)
|
|||
)
|
||||
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
|
||||
btn_leave_lobby.onClick:Set(
|
||||
function()
|
||||
|
|
@ -361,29 +361,25 @@ function M:InitView(url, isHideIpAdds)
|
|||
|
||||
-- 显示牌友圈助手
|
||||
if self._room.group_id ~= 0 and not self._hide_assist then
|
||||
|
||||
local bShow = true
|
||||
local bShow = true
|
||||
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
|
||||
local option = group.option or 0
|
||||
if bit:_and(option,8) > 0 then
|
||||
if bit:_and(option, 8) > 0 then
|
||||
bShow = false
|
||||
end
|
||||
end
|
||||
if bShow then
|
||||
--self:ShowFGAssist()
|
||||
end
|
||||
|
||||
end
|
||||
if self._room.self_player.entrust then
|
||||
|
||||
self:MarkSelfTuoguan()
|
||||
|
||||
end
|
||||
|
||||
|
||||
--[[local gameCommonBtn = UIPackage.CreateObjectFromURL('ui://Common/gameCommonPanel')
|
||||
|
||||
|
||||
--[[local gameCommonBtn = UIPackage.CreateObjectFromURL('ui://Common/gameCommonPanel')
|
||||
if gameCommonBtn then
|
||||
self._view:AddChild(gameCommonBtn)
|
||||
local shuaxingameBtn=gameCommonBtn:GetChild("shuaxinbtn")
|
||||
|
|
@ -395,11 +391,6 @@ function M:InitView(url, isHideIpAdds)
|
|||
)
|
||||
end
|
||||
end--]]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
function M:continue_game(continue)
|
||||
|
|
@ -457,11 +448,11 @@ function M:ShowFGAssist()
|
|||
self._view:AddChild(btn_assist)
|
||||
local panel_assist =
|
||||
FGAssistView.new(
|
||||
self._root_view,
|
||||
function()
|
||||
btn_assist.touchable = true
|
||||
end
|
||||
)
|
||||
self._root_view,
|
||||
function()
|
||||
btn_assist.touchable = true
|
||||
end
|
||||
)
|
||||
if self._full then
|
||||
btn_assist.x = 40
|
||||
else
|
||||
|
|
@ -580,7 +571,7 @@ function M:EventInit()
|
|||
_gamectr:AddEventListener(
|
||||
GameEvent.PlayerState,
|
||||
function(...)
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local p = arg[1]
|
||||
local info = _player_info[self:GetPos(p.seat)]
|
||||
info._ctr_offline.selectedIndex = p.line_state == 0 and 1 or 0
|
||||
|
|
@ -596,7 +587,7 @@ function M:EventInit()
|
|||
_gamectr:AddEventListener(
|
||||
GameEvent.DeskBreak,
|
||||
function(...)
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local code = arg[1]
|
||||
if code == 0 then
|
||||
if self.dismissWin == nil then
|
||||
|
|
@ -625,7 +616,7 @@ function M:EventInit()
|
|||
_gamectr:AddEventListener(
|
||||
GameEvent.Interaction,
|
||||
function(...)
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local p = arg[1]
|
||||
if not p or not p.seat or p.seat == 0 then
|
||||
return
|
||||
|
|
@ -670,7 +661,7 @@ function M:EventInit()
|
|||
_gamectr:AddEventListener(
|
||||
GameEvent.OnKicked,
|
||||
function()
|
||||
printlog("GameEvent.OnKicked====》》》》》")
|
||||
printlog("GameEvent.OnKicked====》》》》》")
|
||||
self:UnmarkSelfTuoguan()
|
||||
local _curren_msg = MsgWindow.new(self._root_view, '由于长时间未准备,你已被踢出房间!', MsgWindow.MsgMode.OnlyOk)
|
||||
_curren_msg.onOk:Add(
|
||||
|
|
@ -681,27 +672,24 @@ function M:EventInit()
|
|||
_curren_msg:Show()
|
||||
end
|
||||
)
|
||||
|
||||
_gamectr:AddEventListener(
|
||||
|
||||
_gamectr:AddEventListener(
|
||||
GameEvent.TupGuanOpen,
|
||||
function(...)
|
||||
--print("刷新托管数据=====")
|
||||
local arg = {...}
|
||||
local p = arg[1]
|
||||
local info = self._player_info[self:GetPos(p.seat)]
|
||||
|
||||
if info and info.IsShowTGTips then
|
||||
info:IsShowTGTips(arg[2],arg[3])
|
||||
end
|
||||
|
||||
if info and info.SetShowTGTips then
|
||||
info:SetShowTGTips(arg[2],arg[3])
|
||||
end
|
||||
|
||||
--print("刷新托管数据=====")
|
||||
local arg = { ... }
|
||||
local p = arg[1]
|
||||
local info = self._player_info[self:GetPos(p.seat)]
|
||||
|
||||
if info and info.IsShowTGTips then
|
||||
info:IsShowTGTips(arg[2], arg[3])
|
||||
end
|
||||
|
||||
if info and info.SetShowTGTips then
|
||||
info:SetShowTGTips(arg[2], arg[3])
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
|
||||
end
|
||||
|
||||
-- 设置能否互动,1允许,0禁止
|
||||
|
|
@ -732,45 +720,45 @@ function M:PlayInteractAnimation(str, mypos, pos)
|
|||
local total_rotation = (offsetY + offsetX) / 100 * 50
|
||||
self._run_move =
|
||||
TweenUtils.TweenFloat(
|
||||
0,
|
||||
1,
|
||||
0.5,
|
||||
function(value)
|
||||
myEff.x = mypos.x + offsetX * value
|
||||
myEff.y = mypos.y + offsetY * value
|
||||
if str == '2' then
|
||||
myEff.rotation = total_rotation * value
|
||||
0,
|
||||
1,
|
||||
0.5,
|
||||
function(value)
|
||||
myEff.x = mypos.x + offsetX * value
|
||||
myEff.y = mypos.y + offsetY * value
|
||||
if str == '2' then
|
||||
myEff.rotation = total_rotation * value
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
)
|
||||
end
|
||||
|
||||
self._run_eff =
|
||||
coroutine.start(
|
||||
function()
|
||||
if str ~= '1' then
|
||||
coroutine.wait(0.5)
|
||||
else
|
||||
local degree = math.atan2(offsetX, offsetY) * 180 / math.pi - 90
|
||||
if degree < -180 then
|
||||
degree = 360 + degree
|
||||
function()
|
||||
if str ~= '1' then
|
||||
coroutine.wait(0.5)
|
||||
else
|
||||
local degree = math.atan2(offsetX, offsetY) * 180 / math.pi - 90
|
||||
if degree < -180 then
|
||||
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
|
||||
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)
|
||||
self._view:AddChild(eff)
|
||||
eff.x = pos.x
|
||||
eff.y = pos.y
|
||||
coroutine.wait(1.5)
|
||||
eff:Dispose()
|
||||
myEff:Dispose()
|
||||
end
|
||||
self._view:AddChild(eff)
|
||||
eff.x = pos.x
|
||||
eff.y = pos.y
|
||||
coroutine.wait(1.5)
|
||||
eff:Dispose()
|
||||
myEff:Dispose()
|
||||
end
|
||||
)
|
||||
)
|
||||
end
|
||||
|
||||
function M:GetReadyNum()
|
||||
|
|
@ -787,13 +775,13 @@ end
|
|||
|
||||
function M:OnPlayerEnter(...)
|
||||
printlog("进入房间222222222222222222++++++++++++++++++++++++++++")
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local p = arg[1]
|
||||
if
|
||||
p ~= self._room.self_player and self._room.room_config.people_num <= 4 and
|
||||
self._room.room_config.people_num >= 3 and
|
||||
self._gamectr:CheckGPS()
|
||||
then
|
||||
self._room.room_config.people_num >= 3 and
|
||||
self._gamectr:CheckGPS()
|
||||
then
|
||||
if self._room.self_player.seat == 0 then
|
||||
return
|
||||
end
|
||||
|
|
@ -803,7 +791,8 @@ function M:OnPlayerEnter(...)
|
|||
self.distance_view = PlayerDistanceView.new(true, self._gps_style, function(v)
|
||||
self:continue_game(v)
|
||||
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()
|
||||
if self.btn_distance then
|
||||
self.btn_distance:GetController("state").selectedIndex = 1
|
||||
|
|
@ -815,30 +804,30 @@ function M:OnPlayerEnter(...)
|
|||
end
|
||||
|
||||
function M:OnPlayerReady(...)
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local p = arg[1]
|
||||
|
||||
if p.isSendCardState~=nil and p.isSendCardState==true then
|
||||
p.isSendCardState=false
|
||||
ControllerManager.IsSendCard=false
|
||||
print("进入设置计时器控制==========")
|
||||
coroutine.start(function()
|
||||
print("计时器倒计时5s=============")
|
||||
coroutine.wait(5)
|
||||
print("当前状态==============")
|
||||
print(ControllerManager.IsSendCard)
|
||||
if ControllerManager.IsSendCard==true then
|
||||
print("以发送开牌======================")
|
||||
return
|
||||
else
|
||||
print("开始断线重连")
|
||||
ControllerManager.OnConnect(SocketCode.TimeoutDisconnect)
|
||||
ViewManager.refreshGameView()
|
||||
end
|
||||
ControllerManager.IsSendCard=false
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
if p.isSendCardState ~= nil and p.isSendCardState == true then
|
||||
p.isSendCardState = false
|
||||
ControllerManager.IsSendCard = false
|
||||
print("进入设置计时器控制==========")
|
||||
coroutine.start(function()
|
||||
print("计时器倒计时5s=============")
|
||||
coroutine.wait(5)
|
||||
print("当前状态==============")
|
||||
print(ControllerManager.IsSendCard)
|
||||
if ControllerManager.IsSendCard == true then
|
||||
print("以发送开牌======================")
|
||||
return
|
||||
else
|
||||
print("开始断线重连")
|
||||
ControllerManager.OnConnect(SocketCode.TimeoutDisconnect)
|
||||
ViewManager.refreshGameView()
|
||||
end
|
||||
ControllerManager.IsSendCard = false
|
||||
end)
|
||||
end
|
||||
|
||||
if p.seat == self._room.self_player.seat then
|
||||
if self._ctr_action then
|
||||
self._ctr_action.selectedIndex = 0
|
||||
|
|
@ -850,7 +839,7 @@ function M:OnPlayerReady(...)
|
|||
end
|
||||
|
||||
function M:OnUpdateInfo(...)
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local p = arg[1]
|
||||
local t = arg[2]
|
||||
-- 托管状态变化
|
||||
|
|
@ -878,8 +867,8 @@ function M:MarkSelfTuoguan()
|
|||
if self._com_tuoguan then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
self._com_tuoguan = UIPackage.CreateObjectFromURL('ui://Common/com_tuoguan_self')
|
||||
local com_tuoguan = self._com_tuoguan
|
||||
GRoot.inst:AddChild(com_tuoguan)
|
||||
|
|
@ -914,14 +903,14 @@ function M:MarkSelfTuoguan()
|
|||
_msg_view = nil
|
||||
end
|
||||
)
|
||||
local roate=GRoot.inst.width/GRoot.inst.height
|
||||
local num=100
|
||||
if roate<1.9 then
|
||||
num=250
|
||||
end
|
||||
local roate = GRoot.inst.width / GRoot.inst.height
|
||||
local num = 100
|
||||
if roate < 1.9 then
|
||||
num = 250
|
||||
end
|
||||
com_tuoguan:AddChild(_msg_view)
|
||||
_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
|
||||
end
|
||||
)
|
||||
|
|
@ -936,7 +925,7 @@ function M:UnmarkSelfTuoguan()
|
|||
end
|
||||
|
||||
function M:OnPlayerLeave(...)
|
||||
local arg = {...}
|
||||
local arg = { ... }
|
||||
local p = arg[1]
|
||||
local info = self._player_info[self:GetPos(p.seat)]
|
||||
info._view.visible = false
|
||||
|
|
@ -997,15 +986,17 @@ function M:OnUpdate()
|
|||
if (self._popEvent) then
|
||||
local func = self._gamectr:PopEvent()
|
||||
if (func ~= nil) then
|
||||
if pcall(func) then
|
||||
|
||||
else
|
||||
|
||||
self._gamectr = ControllerManager.GetController(GameController)
|
||||
if self._gamectr then
|
||||
self._gamectr:ResetConnect()
|
||||
end
|
||||
end
|
||||
local result, resultInfo = pcall(func)
|
||||
print("lingmeng PopEvent", result, resultInfo)
|
||||
if result then
|
||||
|
||||
else
|
||||
printlog("lingmeng eror", resultInfo)
|
||||
self._gamectr = ControllerManager.GetController(GameController)
|
||||
if self._gamectr then
|
||||
self._gamectr:ResetConnect()
|
||||
end
|
||||
end
|
||||
--func()
|
||||
end
|
||||
end
|
||||
|
|
@ -1019,16 +1010,16 @@ function M:OnUpdate()
|
|||
local leftTime = math.floor(_left_time)
|
||||
if leftTime < 10 then
|
||||
self._tex_leftTime.text = '0' .. tostring(leftTime)
|
||||
for i=2,4 do
|
||||
local text = self["_tex_leftTime"..i]
|
||||
for i = 2, 4 do
|
||||
local text = self["_tex_leftTime" .. i]
|
||||
if text then
|
||||
text.text = '0' .. tostring(leftTime)
|
||||
end
|
||||
end
|
||||
else
|
||||
self._tex_leftTime.text = tostring(leftTime)
|
||||
for i=2,4 do
|
||||
local text = self["_tex_leftTime"..i]
|
||||
for i = 2, 4 do
|
||||
local text = self["_tex_leftTime" .. i]
|
||||
if text then
|
||||
text.text = tostring(leftTime)
|
||||
end
|
||||
|
|
@ -1048,8 +1039,8 @@ function M:OnUpdate()
|
|||
if self._tex_leftTime then
|
||||
self._tex_leftTime.text = '00'
|
||||
end
|
||||
for i=2,4 do
|
||||
local text = self["_tex_leftTime"..i]
|
||||
for i = 2, 4 do
|
||||
local text = self["_tex_leftTime" .. i]
|
||||
if text then
|
||||
text.text = '00'
|
||||
end
|
||||
|
|
@ -1073,16 +1064,18 @@ function M:OnUpdate()
|
|||
-- self.dismissWin = nil
|
||||
-- else
|
||||
self.dismissWin:OnUpdate(deltaTime)
|
||||
-- end
|
||||
-- end
|
||||
end
|
||||
|
||||
if self.OnMuShiUpdate then
|
||||
self:OnMuShiUpdate()
|
||||
end
|
||||
|
||||
if self.OnMuShiUpdate then
|
||||
self:OnMuShiUpdate()
|
||||
end
|
||||
end
|
||||
|
||||
function M:onLeftTimeOver()
|
||||
|
||||
|
||||
end
|
||||
|
||||
function M:Clear()
|
||||
-- self:__CloseTip()
|
||||
for i = 1, #self._player_info do
|
||||
|
|
@ -1090,14 +1083,12 @@ function M:Clear()
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
function M:DestroyPlayerInfo()
|
||||
for i = 1, #self._player_info do
|
||||
for i = 1, #self._player_info do
|
||||
self._player_info[i]:Destroy()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function M:GetPos(seat)
|
||||
return ViewUtil.GetPos(self._room.self_player.seat, seat, self._room.room_config.people_num)
|
||||
end
|
||||
|
|
@ -1117,7 +1108,7 @@ end
|
|||
|
||||
--游戏激活
|
||||
function M:OnApplicationActive()
|
||||
--print("游戏激活================")
|
||||
--print("游戏激活================")
|
||||
if os.time() - last_pause_time > 15 then
|
||||
last_pause_time = os.time()
|
||||
ControllerManager.WebClient:clearActionQueue()
|
||||
|
|
@ -1137,16 +1128,17 @@ function M:Show()
|
|||
self.distance_view = PlayerDistanceView.new(true, self._gps_style, function(v)
|
||||
self:continue_game(v)
|
||||
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.btn_distance:GetController("state").selectedIndex = 1
|
||||
end
|
||||
end
|
||||
|
||||
function M:Destroy()
|
||||
TimerManager.Clear()
|
||||
TimerManager.Clear()
|
||||
self:UnmarkSelfTuoguan()
|
||||
self:DestroyPlayerInfo()
|
||||
self:DestroyPlayerInfo()
|
||||
DSTweenManager.ClearTween()
|
||||
|
||||
NetResetConnectWindow.CloseNetReset()
|
||||
|
|
@ -1161,5 +1153,4 @@ function M:Destroy()
|
|||
BaseView.Destroy(self)
|
||||
BaseWindow.DestroyAll()
|
||||
ResourcesManager.UnLoadGroup('base_chat')
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,75 +7,10 @@
|
|||
"/"
|
||||
],
|
||||
"libview.iconScale": 0,
|
||||
"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"
|
||||
],
|
||||
"doc.openedDocs": [],
|
||||
"test.device": "720p Phone",
|
||||
"canvasColor": 10066329,
|
||||
"auxline2": true,
|
||||
"doc.activeDoc": "ui://m7iejg46mpllhv5",
|
||||
"libview.twoColumn": false,
|
||||
"libview.expandedNodes": [
|
||||
"s63l0suw",
|
||||
|
|
@ -95,7 +30,15 @@
|
|||
"v6yvqp7w",
|
||||
"/component/Main/",
|
||||
"v6yvqp7w",
|
||||
"/component/Main/component/"
|
||||
"/component/Main/component/",
|
||||
"m7iejg46",
|
||||
"/",
|
||||
"m7iejg46",
|
||||
"/mgr/",
|
||||
"m7iejg46",
|
||||
"/mgr/component/",
|
||||
"m7iejg46",
|
||||
"/mgr/component/play_set/"
|
||||
],
|
||||
"auxline1": true,
|
||||
"snapToGrid": true,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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"/>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -24,10 +24,10 @@
|
|||
<gearDisplay controller="button" pages="1"/>
|
||||
<Button icon="ui://v6yvqp7wn1ry3r"/>
|
||||
</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
"/>
|
||||
<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="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="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="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"/>
|
||||
<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"/>
|
||||
|
|
@ -103,7 +103,7 @@
|
|||
<item/>
|
||||
</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="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">
|
||||
<item/>
|
||||
<item/>
|
||||
|
|
|
|||
|
|
@ -441,7 +441,7 @@
|
|||
<image id="thxk7dor" name="Group 638@2x.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="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="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"/>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<component size="1334,750">
|
||||
<controller name="manager" 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>
|
||||
<image id="n95_xt5s" name="n95" src="xt5s7iit" fileName="images/jifen/Rectangle 424.png" xy="36,36">
|
||||
<relation target="" sidePair="width-width%,height-height%"/>
|
||||
|
|
@ -43,6 +43,7 @@
|
|||
<relation target="n87_vyn3" sidePair="left-left%,top-top%"/>
|
||||
</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="n87_vyn3" sidePair="left-left%,top-top%"/>
|
||||
</text>
|
||||
|
|
@ -148,7 +149,7 @@
|
|||
</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"/>
|
||||
<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 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"/>
|
||||
|
|
@ -160,7 +161,7 @@
|
|||
<Button controller="top" page="3"/>
|
||||
</component>
|
||||
<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>
|
||||
<group id="n103_xt5s" name="newFillter" xy="167,64" size="1000,56" advanced="true">
|
||||
<relation target="" sidePair="center-center,middle-middle"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue