2025-05-24 14:29:14 +08:00
|
|
|
|
--大厅View对象
|
|
|
|
|
|
--author:--
|
|
|
|
|
|
|
|
|
|
|
|
local CreateRoomView = import(".Lobby.CreateRoomView")
|
|
|
|
|
|
local JoinRoomView = import(".Lobby.JoinRoomView")
|
|
|
|
|
|
local LobbySettingView = import(".Lobby.LobbySettingView")
|
|
|
|
|
|
local RankView = import(".Lobby.RankView")
|
|
|
|
|
|
local GroupMainView = import(".NewGroup.GroupMainView")
|
|
|
|
|
|
local NoticeView = import(".Lobby.NoticeView")
|
|
|
|
|
|
local HeadView = import(".Lobby.LobbyHeadView")
|
|
|
|
|
|
local PhoneBindView = import(".Lobby.PhoneBindView")
|
|
|
|
|
|
local RealAddressView = import(".Lobby.RealAddressView")
|
|
|
|
|
|
local LobbyHeadView = import(".Lobby.LobbyHeadView")
|
|
|
|
|
|
LobbyView = {}
|
|
|
|
|
|
|
|
|
|
|
|
local M = {}
|
|
|
|
|
|
|
|
|
|
|
|
function LobbyView.new()
|
|
|
|
|
|
--print("new lobbyView!!!!")
|
2025-05-24 23:17:47 +08:00
|
|
|
|
setmetatable(M, { __index = BaseView })
|
|
|
|
|
|
local self = setmetatable({}, { __index = M })
|
2025-05-24 14:29:14 +08:00
|
|
|
|
self.class = "LobbyView"
|
2025-05-24 23:17:47 +08:00
|
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
|
UIPackage.AddPackage("base/lobby/ui/Lobby")
|
|
|
|
|
|
self.lobby_pause_time = 0
|
|
|
|
|
|
self._full = true
|
|
|
|
|
|
self:InitView("ui://Lobby/Main")
|
|
|
|
|
|
self._close_destroy = false
|
2025-05-24 23:17:47 +08:00
|
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
|
return self
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:InitView(url)
|
2025-05-24 23:17:47 +08:00
|
|
|
|
-- print("init lobbyView!!!!")
|
|
|
|
|
|
BaseView.InitView(self, url)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
self._full_offset = false
|
|
|
|
|
|
local view = self._view
|
|
|
|
|
|
|
2025-05-24 23:17:47 +08:00
|
|
|
|
self:InitClip()
|
|
|
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
|
local btn_head = view:GetChild("btn_head")
|
|
|
|
|
|
ImageLoad.Load(DataManager.SelfUser.head_url, btn_head._iconObject)
|
|
|
|
|
|
btn_head.onClick:Set(function()
|
|
|
|
|
|
-- local headView = HeadView.new(DataManager.SelfUser, nil, function()
|
|
|
|
|
|
-- view:GetChild("tex_name").text = DataManager.SelfUser.nick_name
|
|
|
|
|
|
-- ImageLoad.Load(DataManager.SelfUser.head_url, btn_head._iconObject)
|
|
|
|
|
|
-- end)
|
|
|
|
|
|
-- headView:Show()
|
2025-05-24 23:17:47 +08:00
|
|
|
|
local lobbyHeadView = LobbyHeadView.new(DataManager.SelfUser, DataManager.SelfUser.agent, function()
|
2025-05-24 14:29:14 +08:00
|
|
|
|
ImageLoad.Load(DataManager.SelfUser.head_url, btn_head._iconObject)
|
|
|
|
|
|
end)
|
|
|
|
|
|
lobbyHeadView:Show()
|
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
local btn_teamwork = view:GetChild("btn_teamwork")
|
|
|
|
|
|
btn_teamwork.onClick:Set(function()
|
|
|
|
|
|
-- local headView = HeadView.new(DataManager.SelfUser, nil, function()
|
|
|
|
|
|
-- view:GetChild("tex_name").text = DataManager.SelfUser.nick_name
|
|
|
|
|
|
-- ImageLoad.Load(DataManager.SelfUser.head_url, btn_head._iconObject)
|
|
|
|
|
|
-- end)
|
|
|
|
|
|
-- headView:Show()
|
2025-05-24 23:17:47 +08:00
|
|
|
|
local lobbyHeadView = LobbyHeadView.new(DataManager.SelfUser, DataManager.SelfUser.agent, function()
|
2025-05-24 14:29:14 +08:00
|
|
|
|
ImageLoad.Load(DataManager.SelfUser.head_url, btn_head._iconObject)
|
|
|
|
|
|
end)
|
|
|
|
|
|
lobbyHeadView:Show()
|
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
view:GetChild("tex_name").text = DataManager.SelfUser.nick_name
|
2025-05-26 00:33:00 +08:00
|
|
|
|
view:GetChild("tex_id").text = string.format("ID:%s", DataManager.SelfUser.account_id)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
|
|
|
|
|
|
view:GetChild("gcm_diamo").text = tostring(DataManager.SelfUser.diamo)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local btn_joinroom = self._view:GetChild("btn_joinroom")
|
2025-05-24 23:17:47 +08:00
|
|
|
|
btn_joinroom.onClick:Add(handler(self, self.OnJoinRoomAction))
|
|
|
|
|
|
--btn_joinroom.displayObject.gameObject:SetActive(false)
|
|
|
|
|
|
|
|
|
|
|
|
local createRoomBtn = self._view:GetChild("btn_ChuangJian")
|
2025-05-24 14:29:14 +08:00
|
|
|
|
--createRoomBtn.touchable = false
|
2025-05-24 23:17:47 +08:00
|
|
|
|
createRoomBtn.onClick:Set(function()
|
|
|
|
|
|
local _createRoomView = CreateRoomView.new(1)
|
|
|
|
|
|
_createRoomView.onCeateRoom = function()
|
|
|
|
|
|
ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id)
|
|
|
|
|
|
end
|
|
|
|
|
|
_createRoomView:Show()
|
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
|
local btn_agent = self._view:GetChild("btn_agent")
|
2025-05-24 23:17:47 +08:00
|
|
|
|
--[[ btn_agent.onClick:Set(function()
|
2025-05-24 14:29:14 +08:00
|
|
|
|
local headView = HeadView.new(DataManager.SelfUser,true)
|
|
|
|
|
|
headView:Show()
|
|
|
|
|
|
end)--]]
|
2025-05-24 23:17:47 +08:00
|
|
|
|
btn_agent.displayObject.gameObject:SetActive(false)
|
|
|
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
|
local btn_record = self._view:GetChild("btn_record")
|
2025-05-24 23:17:47 +08:00
|
|
|
|
btn_record.onClick:Add(handler(self, function()
|
|
|
|
|
|
local _rankView = RankView.new(self, true)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
_rankView:Show()
|
|
|
|
|
|
end))
|
2025-05-24 23:17:47 +08:00
|
|
|
|
--btn_record.displayObject.gameObject:SetActive(false)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
|
|
|
|
|
|
local btn_video = self._view:GetChild("btn_video")
|
|
|
|
|
|
--[[btn_video.onClick:Set(function ()
|
|
|
|
|
|
local _rankView = RankView.new(self,true)
|
|
|
|
|
|
_rankView:Show()
|
|
|
|
|
|
end)--]]
|
2025-05-24 23:17:47 +08:00
|
|
|
|
btn_video.displayObject.gameObject:SetActive(false)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
|
|
|
|
|
|
local btn_setting = self._view:GetChild("btn_setting")
|
2025-05-24 23:17:47 +08:00
|
|
|
|
btn_setting.onClick:Set(handler(self, function()
|
2025-05-24 14:29:14 +08:00
|
|
|
|
local settingView = LobbySettingView.new()
|
|
|
|
|
|
settingView:Show()
|
|
|
|
|
|
end))
|
|
|
|
|
|
|
|
|
|
|
|
local btn_exit = self._view:GetChild("btn_exit")
|
2025-05-24 23:17:47 +08:00
|
|
|
|
btn_exit.onClick:Set(handler(self, function()
|
2025-05-24 14:29:14 +08:00
|
|
|
|
local _curren_msg = MsgWindow.new(self._root_view, '确认退出游戏', MsgWindow.MsgMode.OkAndCancel)
|
2025-05-24 23:17:47 +08:00
|
|
|
|
_curren_msg.onOk:Add(function()
|
2025-05-24 14:29:14 +08:00
|
|
|
|
Application.Quit()
|
|
|
|
|
|
end)
|
|
|
|
|
|
_curren_msg:Show()
|
|
|
|
|
|
end))
|
|
|
|
|
|
|
2025-05-24 23:17:47 +08:00
|
|
|
|
local lst_userBG = self._view:GetChild("n118")
|
|
|
|
|
|
lst_userBG.displayObject.gameObject:SetActive(false)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
local lst_user = self._view:GetChild("lst_user")
|
2025-05-24 23:17:47 +08:00
|
|
|
|
lst_user.displayObject.gameObject:SetActive(false)
|
|
|
|
|
|
--[[ lst_user.onClickItem:Set(function (context)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
if context.data.name == "real" then
|
|
|
|
|
|
local real_view = RealAddressView.new(0)
|
|
|
|
|
|
real_view:Show()
|
|
|
|
|
|
elseif context.data.name == "address" then
|
|
|
|
|
|
local real_view = RealAddressView.new(1)
|
|
|
|
|
|
real_view:Show()
|
|
|
|
|
|
elseif context.data.name == "phone" then
|
|
|
|
|
|
local phone_view = PhoneBindView.new()
|
|
|
|
|
|
phone_view:Show()
|
|
|
|
|
|
end
|
|
|
|
|
|
end)--]]
|
2025-05-24 23:17:47 +08:00
|
|
|
|
-- self:__ShowShare()
|
2025-05-24 14:29:14 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local btn_notice = self._view:GetChild("btn_notice")
|
2025-05-24 23:17:47 +08:00
|
|
|
|
--[[ btn_notice.onClick:Set(function()
|
2025-05-24 14:29:14 +08:00
|
|
|
|
local noticeView = NoticeView.new(self._root_view)
|
|
|
|
|
|
noticeView:FillData(DataManager.SelfUser.notices.data)
|
|
|
|
|
|
noticeView:Show()
|
|
|
|
|
|
end)
|
|
|
|
|
|
--]]
|
2025-05-24 23:17:47 +08:00
|
|
|
|
btn_notice.displayObject.gameObject:SetActive(false)
|
|
|
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
|
local btn_service = self._view:GetChild("btn_service")
|
|
|
|
|
|
--[[btn_service.onClick:Set(function()
|
|
|
|
|
|
self:__show_service()
|
|
|
|
|
|
end)--]]
|
2025-05-24 23:17:47 +08:00
|
|
|
|
btn_service.displayObject.gameObject:SetActive(false)
|
|
|
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
|
|
2025-05-24 23:17:47 +08:00
|
|
|
|
self.groupMainView = GroupMainView.new(self._view:GetChild("group"), self._root_view, self._view)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
--self.groupMainView:Show()
|
2025-05-24 23:17:47 +08:00
|
|
|
|
|
|
|
|
|
|
local btn_more_group = self._view:GetChild("btn_more_group")
|
|
|
|
|
|
btn_more_group.onClick:Set(function()
|
|
|
|
|
|
--self.groupMainView._view.visible = true
|
|
|
|
|
|
ViewUtil.ShowModalWait(self._root_view, "请稍等,获取牌友圈中...")
|
|
|
|
|
|
local enterGroupCallBackFunc = function(code)
|
|
|
|
|
|
ViewUtil.CloseModalWait()
|
|
|
|
|
|
if code == 0 then
|
|
|
|
|
|
self.groupMainView._view.visible = true
|
|
|
|
|
|
else
|
|
|
|
|
|
ViewUtil.ErrorTip(10000000, "获取牌友圈失败,请检查网络设置!")
|
|
|
|
|
|
printlog("获取圈子数据失败=======>>>>")
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|
|
|
|
|
|
self.groupMainView:Show(nil, enterGroupCallBackFunc)
|
|
|
|
|
|
end)
|
|
|
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
|
-- local btn_more_group = self._view:GetChild("btn_more_group")
|
|
|
|
|
|
-- btn_more_group.touchable = true
|
|
|
|
|
|
-- btn_more_group.onClick:Set(function()
|
2025-05-24 23:17:47 +08:00
|
|
|
|
-- local groups = DataManager.groups.groupList
|
2025-05-24 14:29:14 +08:00
|
|
|
|
-- if #groups == 0 then
|
|
|
|
|
|
-- self.groupMainView._view.visible = true
|
2025-05-24 23:17:47 +08:00
|
|
|
|
-- self.groupMainView:Show()
|
|
|
|
|
|
-- -- if not DataManager.SelfUser.phone then
|
|
|
|
|
|
-- -- local phone_view = PhoneBindView.new()
|
|
|
|
|
|
-- -- phone_view:Show()
|
|
|
|
|
|
-- -- return
|
|
|
|
|
|
-- -- end
|
|
|
|
|
|
-- else
|
|
|
|
|
|
-- self.groupMainView:DEnterGroup()
|
|
|
|
|
|
-- end
|
|
|
|
|
|
-- --self.groupMainView:DEnterGroup()
|
|
|
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
|
-- end)
|
2025-05-24 23:17:47 +08:00
|
|
|
|
|
|
|
|
|
|
-- self.btn_joingroup.onClick:Set(function()
|
2025-05-24 14:29:14 +08:00
|
|
|
|
-- local groups = DataManager.groups.groupList
|
|
|
|
|
|
-- if #groups == 0 then
|
|
|
|
|
|
-- local jgv = JoinGroupView.new(self._root_view)
|
|
|
|
|
|
-- jgv:Show()
|
|
|
|
|
|
-- else
|
|
|
|
|
|
-- local info = GroupInfoView.new(groups[1], self.fg_info)
|
|
|
|
|
|
-- self._groupInfoView = info
|
|
|
|
|
|
-- info:SetCallBack(function()
|
|
|
|
|
|
-- self._groupInfoView = nil
|
|
|
|
|
|
-- self:Show()
|
|
|
|
|
|
-- self._view.visible = true
|
|
|
|
|
|
-- end)
|
|
|
|
|
|
-- info:Show()
|
|
|
|
|
|
-- self._view.visible = false
|
|
|
|
|
|
-- end
|
|
|
|
|
|
-- if not DataManager.SelfUser.phone then
|
|
|
|
|
|
-- --local phone_view = PhoneBindView.new()
|
|
|
|
|
|
-- --phone_view:Show()
|
|
|
|
|
|
-- -- return
|
|
|
|
|
|
-- end
|
|
|
|
|
|
-- end)
|
|
|
|
|
|
-- self.btn_joingroup.touchable = true
|
2025-05-24 23:17:47 +08:00
|
|
|
|
|
2025-05-24 14:29:14 +08:00
|
|
|
|
|
|
|
|
|
|
local lst_game = self._view:GetChild("lst_game")
|
2025-05-24 23:17:47 +08:00
|
|
|
|
lst_game.displayObject.gameObject:SetActive(false)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
--[[local games = DataManager.SelfUser.games
|
|
|
|
|
|
for i = 1, math.min( 4,#games ) do
|
|
|
|
|
|
local tem = games[i]
|
|
|
|
|
|
local item = lst_game:AddItemFromPool()
|
|
|
|
|
|
item.text = tem.name
|
|
|
|
|
|
local config = ExtendManager.GetExtendConfig(tem.game_id)
|
|
|
|
|
|
config.game_data = tem
|
|
|
|
|
|
local mode = config:GetGameInfo()
|
|
|
|
|
|
item.icon = mode:GetIconUrl()
|
|
|
|
|
|
item.onClick:Set(function ()
|
|
|
|
|
|
local _createRoomView = CreateRoomView.new(i)
|
|
|
|
|
|
_createRoomView.onCeateRoom = function ()
|
|
|
|
|
|
ViewManager.ChangeView(ViewManager.View_Main,DataManager.CurrenRoom.game_id)
|
|
|
|
|
|
end
|
|
|
|
|
|
_createRoomView:Show()
|
|
|
|
|
|
end)
|
|
|
|
|
|
end--]]
|
|
|
|
|
|
|
|
|
|
|
|
local message = self._view:GetChild("com_message")
|
|
|
|
|
|
--message.visible = true
|
|
|
|
|
|
self._message = message:GetChild("message")
|
|
|
|
|
|
self._tex_message = self._message:GetChild("tex_message")
|
|
|
|
|
|
self:__GetMessage()
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:OnJoinRoomAction(context)
|
|
|
|
|
|
local joinRoomView = JoinRoomView.new(self._root_view)
|
|
|
|
|
|
joinRoomView:Show()
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:__show_service()
|
2025-05-24 23:17:47 +08:00
|
|
|
|
local _buy_win = BaseWindow.new("ui://Lobby/Win_service", self._root_view)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
_buy_win._close_destroy = true
|
|
|
|
|
|
_buy_win:Show()
|
|
|
|
|
|
local sview = _buy_win._view
|
|
|
|
|
|
local btn_copy = sview:GetChild("btn_copy")
|
2025-05-24 23:17:47 +08:00
|
|
|
|
btn_copy.onClick:Set(function()
|
|
|
|
|
|
GameApplication.Instance:CopyToClipboard("xbkf888108") --湘北
|
2025-05-24 14:29:14 +08:00
|
|
|
|
-- GameApplication.Instance:CopyToClipboard("ttwmq008")--fb
|
|
|
|
|
|
_buy_win:Destroy()
|
|
|
|
|
|
end)
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:__GetMessage(data)
|
2025-05-24 23:17:47 +08:00
|
|
|
|
-- print("on GetMessage~~~~~~~~~~~~~~~~~~~~~~~~~~~")
|
|
|
|
|
|
if not data or not data.notice_list then
|
|
|
|
|
|
self._mesList = ""
|
|
|
|
|
|
else
|
|
|
|
|
|
local message = self._view:GetChild("com_message")
|
|
|
|
|
|
message.visible = true
|
|
|
|
|
|
local mesl = {}
|
|
|
|
|
|
for i = 1, #data.notice_list do
|
|
|
|
|
|
mesl[i] = data.notice_list[i].informContent
|
|
|
|
|
|
end
|
|
|
|
|
|
self._mesList = mesl
|
2025-05-24 14:29:14 +08:00
|
|
|
|
end
|
2025-05-24 23:17:47 +08:00
|
|
|
|
|
|
|
|
|
|
self:__moveMsg(0)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:__PopMsg(index)
|
2025-05-24 23:17:47 +08:00
|
|
|
|
local num = #self._mesList
|
|
|
|
|
|
index = index + 1
|
|
|
|
|
|
if index > num then index = 1 end
|
|
|
|
|
|
local str = tostring(self._mesList[index])
|
|
|
|
|
|
if str == nil or str == "nil" then str = "" end
|
|
|
|
|
|
return index, string.gsub(str, "\r", "")
|
2025-05-24 14:29:14 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:__moveMsg(index)
|
2025-05-24 23:17:47 +08:00
|
|
|
|
-- print("on moveMsg!!!!!!!!!!!!!!!!!!!!!!!!!")
|
2025-05-24 14:29:14 +08:00
|
|
|
|
if not self._tex_message then return end
|
2025-05-24 23:17:47 +08:00
|
|
|
|
index, self._tex_message.text = self:__PopMsg(index)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
self._tex_message.x = self._message.width
|
|
|
|
|
|
|
|
|
|
|
|
if self._mesTw then
|
|
|
|
|
|
TweenUtils.Kill(self._mesTw)
|
|
|
|
|
|
end
|
2025-05-24 23:17:47 +08:00
|
|
|
|
local change = -self._message.width * 2
|
2025-05-24 14:29:14 +08:00
|
|
|
|
local dd = self._tex_message.width / self._message.width
|
|
|
|
|
|
if dd < 1 then dd = 1 end
|
2025-05-24 23:17:47 +08:00
|
|
|
|
self._mesTw = TweenUtils.TweenFloat(0, 1 * dd, 10 * dd, function(value)
|
|
|
|
|
|
self._tex_message.x = self._message.width + (change * value)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
end)
|
2025-05-24 23:17:47 +08:00
|
|
|
|
TweenUtils.OnComplete(self._mesTw, function()
|
2025-05-24 14:29:14 +08:00
|
|
|
|
self._mesTw = nil
|
|
|
|
|
|
if (#self._mesList == 0) then
|
|
|
|
|
|
self:__GetMessage()
|
|
|
|
|
|
else
|
|
|
|
|
|
self:__PopMsg(index)
|
|
|
|
|
|
self:__moveMsg(index)
|
|
|
|
|
|
end
|
|
|
|
|
|
end)
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:__ShowShare()
|
|
|
|
|
|
local pop_share = self._view:GetChild("pop_share")
|
|
|
|
|
|
local shareUrl = GetGameInfo("invite_link") .. "?uid=" .. DataManager.SelfUser.account_id
|
2025-05-24 23:17:47 +08:00
|
|
|
|
--print("shareUrl=================")
|
|
|
|
|
|
--print(shareUrl)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
local btn_wx_session = pop_share:GetChild("btn_wx_session")
|
2025-05-24 23:17:47 +08:00
|
|
|
|
btn_wx_session.onClick:Add(function()
|
|
|
|
|
|
shareQRCodePicture(shareUrl, 0)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
end)
|
|
|
|
|
|
local btn_wx_line = pop_share:GetChild("btn_wx_line").asButton
|
2025-05-24 23:17:47 +08:00
|
|
|
|
btn_wx_line.onClick:Add(function()
|
|
|
|
|
|
shareQRCodePicture(shareUrl, 1)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
end)
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:OnUpdate()
|
|
|
|
|
|
local roomid = GameApplication.Instance:GetRoomID()
|
|
|
|
|
|
if roomid and string.len(roomid) > 1 then
|
|
|
|
|
|
ControllerManager.WebClient:clearActionQueue()
|
|
|
|
|
|
local joinRoomView = JoinRoomView.new(self._root_view)
|
|
|
|
|
|
joinRoomView:JoinRoom(roomid)
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|
|
|
|
|
|
|
2025-05-24 23:17:47 +08:00
|
|
|
|
function M:Close()
|
2025-05-24 14:29:14 +08:00
|
|
|
|
BaseView.Close(self)
|
2025-05-24 23:17:47 +08:00
|
|
|
|
UpdateBeat:Remove(self.OnUpdate, self)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
coroutine.stopAll()
|
|
|
|
|
|
if self._mesTw then
|
|
|
|
|
|
TweenUtils.Kill(self._mesTw)
|
|
|
|
|
|
end
|
|
|
|
|
|
BaseWindow.DestroyAll()
|
|
|
|
|
|
DSTweenManager.ClearTween()
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:Destroy()
|
2025-05-24 23:17:47 +08:00
|
|
|
|
UpdateBeat:Remove(self.OnUpdate, self)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
if self._mesTw then
|
|
|
|
|
|
TweenUtils.Kill(self._mesTw)
|
|
|
|
|
|
end
|
|
|
|
|
|
self._tex_message = nil
|
|
|
|
|
|
coroutine.stopAll()
|
|
|
|
|
|
BaseView.Destroy(self)
|
|
|
|
|
|
BaseWindow.DestroyAll()
|
|
|
|
|
|
DSTweenManager.ClearTween()
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:Show()
|
|
|
|
|
|
--print("on lobbyView show~~~~~~")
|
|
|
|
|
|
BaseView.Show(self)
|
|
|
|
|
|
ViewUtil.PlaySoundBg()
|
2025-05-24 23:17:47 +08:00
|
|
|
|
UpdateBeat:Add(self.OnUpdate, self)
|
2025-05-28 03:10:00 +08:00
|
|
|
|
self:InitClip()
|
2025-05-24 14:29:14 +08:00
|
|
|
|
-- 如果在圈子内的房间,显示tip
|
|
|
|
|
|
local user = DataManager.SelfUser
|
|
|
|
|
|
local tem = user.notices
|
|
|
|
|
|
if user.group_id ~= 0 then
|
|
|
|
|
|
local msg_tip = MsgWindow.new(self._root_view, "还在圈子的房间中,现在重连吗?", MsgWindow.MsgMode.OkAndCancel)
|
|
|
|
|
|
msg_tip.onOk:Add(function()
|
|
|
|
|
|
if self.groupMainView ~= nil then
|
2025-05-24 23:17:47 +08:00
|
|
|
|
self.groupMainView:Show(user.group_id)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
end
|
2025-05-24 23:17:47 +08:00
|
|
|
|
end)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
msg_tip:Show()
|
|
|
|
|
|
tem.auto_show = false
|
|
|
|
|
|
else
|
|
|
|
|
|
local lobbyCtr1 = ControllerManager.GetController(LoddyController)
|
|
|
|
|
|
lobbyCtr1:UpdateNotice(DataManager.SelfUser.account_id, function(result, data)
|
|
|
|
|
|
-- local data1 = {}
|
|
|
|
|
|
-- data1.notice_list = {}
|
|
|
|
|
|
-- data1.notice_list[1] = "ccccccccccccccccccccccccccc"
|
|
|
|
|
|
if result then
|
|
|
|
|
|
self:__GetMessage(data)
|
|
|
|
|
|
end
|
|
|
|
|
|
end)
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
|
|
|
|
|
self:GetPlayerInfoData()
|
|
|
|
|
|
|
|
|
|
|
|
-- 获取GPS坐标
|
|
|
|
|
|
if not DataManager.SelfUser.location or DataManager.SelfUser.location:Location2String() == "" then
|
|
|
|
|
|
get_gps()
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if self.groupMainView and self.groupMainView._groupInfoView then
|
|
|
|
|
|
self.groupMainView._groupInfoView:hidePipei()
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:GetPlayerInfoData()
|
|
|
|
|
|
local loddyCtr1 = ControllerManager.GetController(LoddyController)
|
|
|
|
|
|
loddyCtr1:UpdatePlayerInfo(function(result, data)
|
2025-05-24 23:17:47 +08:00
|
|
|
|
if result then
|
|
|
|
|
|
self:ShowPlayerInfo(data.raffle, data.diamo, data.newMail)
|
|
|
|
|
|
end
|
|
|
|
|
|
end)
|
2025-05-24 14:29:14 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:ShowPlayerInfo(raffle, diamo, newMail)
|
|
|
|
|
|
self._view:GetChild("gcm_diamo"):GetChild("title").text = diamo or 0
|
2025-05-24 23:17:47 +08:00
|
|
|
|
end
|
2025-05-24 14:29:14 +08:00
|
|
|
|
|
|
|
|
|
|
function M:OnApplicationPause()
|
|
|
|
|
|
ControllerManager.WebClient:clearActionQueue()
|
|
|
|
|
|
-- 切后台时间
|
|
|
|
|
|
if DataManager.SelfUser.cur_group then
|
|
|
|
|
|
self.lobby_pause_time = os.time()
|
|
|
|
|
|
DataManager.SelfUser.cur_group.pause = true
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:OnApplicationActive()
|
|
|
|
|
|
ControllerManager.WebClient:clearActionQueue()
|
|
|
|
|
|
self:GetPlayerInfoData()
|
|
|
|
|
|
-- 切后台太久牌友圈重连
|
|
|
|
|
|
if DataManager.SelfUser.cur_group then
|
|
|
|
|
|
DataManager.SelfUser.cur_group.pause = false
|
|
|
|
|
|
if os.time() - self.lobby_pause_time > 15 then
|
|
|
|
|
|
self.lobby_pause_time = os.time()
|
|
|
|
|
|
DataManager.SelfUser.cur_group:Reconnect()
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|
2025-05-24 23:17:47 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:InitClip()
|
2025-06-05 18:56:24 +08:00
|
|
|
|
local taohuaEnd = 114
|
|
|
|
|
|
local taohuaName = "ui://Lobby/taohua_00"
|
|
|
|
|
|
local taohua = self._view:GetChild('clip_bg')
|
|
|
|
|
|
local taohuaIndex = 0
|
|
|
|
|
|
|
|
|
|
|
|
local renwuEnd = 140
|
|
|
|
|
|
local renwuName = "ui://Lobby/renwu-AE_00"
|
|
|
|
|
|
local renwu = self._view:GetChild('clip_renwu')
|
|
|
|
|
|
local renwuIndex = 0
|
|
|
|
|
|
|
|
|
|
|
|
local pukeEnd = 60
|
|
|
|
|
|
local pukeName = "ui://Lobby/puke_00"
|
|
|
|
|
|
local puke = self._view:GetChild('btn_ChuangJian')
|
|
|
|
|
|
local pukeIndex = 0
|
|
|
|
|
|
|
|
|
|
|
|
local jiangbeiEnd = 180
|
|
|
|
|
|
local jiangbeiName = "ui://Lobby/jiangbei_00"
|
|
|
|
|
|
local jiangbei = self._view:GetChild('btn_more_group')
|
2025-05-24 23:17:47 +08:00
|
|
|
|
local jiangbeiIndex = 0
|
|
|
|
|
|
|
2025-06-05 18:56:24 +08:00
|
|
|
|
local hechengEnd = 96
|
|
|
|
|
|
local hechengName = "ui://Lobby/hecheng 1_00"
|
|
|
|
|
|
local hecheng = self._view:GetChild('btn_joinroom')
|
|
|
|
|
|
local hechengIndex = 0
|
|
|
|
|
|
self.alldonhua = coroutine.start(
|
2025-05-24 23:17:47 +08:00
|
|
|
|
function()
|
|
|
|
|
|
while true do
|
2025-05-25 21:13:09 +08:00
|
|
|
|
taohuaIndex = self:ReplaceClip1(taohuaEnd, taohua, taohuaIndex, taohuaName)
|
2025-05-24 23:17:47 +08:00
|
|
|
|
renwuIndex = self:ReplaceClip1(renwuEnd, renwu, renwuIndex, renwuName)
|
2025-05-25 21:13:09 +08:00
|
|
|
|
pukeIndex = self:ReplaceClip2(pukeEnd, puke, pukeIndex, pukeName)
|
|
|
|
|
|
jiangbeiIndex = self:ReplaceClip2(jiangbeiEnd, jiangbei, jiangbeiIndex, jiangbeiName)
|
|
|
|
|
|
hechengIndex = self:ReplaceClip2(hechengEnd, hecheng, hechengIndex, hechengName)
|
2025-06-05 18:56:24 +08:00
|
|
|
|
coroutine.wait(0.080)
|
2025-05-24 23:17:47 +08:00
|
|
|
|
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)
|
2025-06-05 18:56:24 +08:00
|
|
|
|
return i + 4
|
2025-05-24 23:17:47 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function M:ReplaceClip2(e, t, i, n)
|
|
|
|
|
|
if i > e then
|
|
|
|
|
|
i = 0
|
|
|
|
|
|
end
|
|
|
|
|
|
t.icon = string.format("%s%03d", n, i)
|
2025-06-05 18:56:24 +08:00
|
|
|
|
return i + 4
|
2025-05-24 23:17:47 +08:00
|
|
|
|
end
|