diff --git a/fk101/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua b/fk101/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua index 46176d49..e81cd348 100644 --- a/fk101/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua +++ b/fk101/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua @@ -17,11 +17,11 @@ GroupNumberInputView_Game = import(".MngView.GroupNumberInputView") local GroupInfoView = {} local M = GroupInfoView -local currentSelectPlay=0 +local currentSelectPlay = 0 function GroupInfoView.new(curGroup, fg_info) - setmetatable(M, {__index = BaseView}) - local self = setmetatable({}, {__index = M}) + setmetatable(M, { __index = BaseView }) + local self = setmetatable({}, { __index = M }) self.class = 'GroupInfoView' self.curGroup = curGroup curGroup.layer = 0 @@ -30,14 +30,14 @@ function GroupInfoView.new(curGroup, fg_info) self.gameIdList = {} self.playIdList = {} self._full = true - self._get_data = false -- 标记是否已获取到数据 + self._get_data = false -- 标记是否已获取到数据 self._showVipRooms = 0 self.lstgameVisible = false self.isShowRoomItem = (self.curGroup.lev == 1 or self.curGroup.lev == 2) DataManager.SelfUser.cur_group = self - self.FillGameItemList={} + self.FillGameItemList = {} self:InitView('ui://NewGroup/Main_GroupInfo') - + return self end @@ -110,12 +110,12 @@ local function RoomWeight1(room) elseif #room.plist == 0 then weight = weight + 0 elseif room.maxPlayers > #room.plist then - weight = 0.5--weight + (10 - room.maxPlayers + #room.plist) + weight = 0.5 --weight + (10 - room.maxPlayers + #room.plist) elseif room.maxPlayers == #room.plist then weight = weight + 1 end room.weight = weight - -- printlog("aaaaaaaaaaaaaaaaaaaccccccccccccccccccccccc ",weight) + -- printlog("aaaaaaaaaaaaaaaaaaaccccccccccccccccccccccc ",weight) --pt(room) return weight end @@ -123,24 +123,24 @@ end -- 房间排序 local function SortRooms(a, b) - -- printlog("SortRooms====》》》》",currentSelectPlay) - if currentSelectPlay==0 then - local rwa = RoomWeight(a) - local rwb = RoomWeight(b) - if rwa ~= rwb then - return rwa > rwb - else - return a.pid rwb + else + return a.pid < b.pid + end + else + local rwa = RoomWeight1(a) + local rwb = RoomWeight1(b) + if rwa ~= rwb then + return rwa < rwb + else + return a.pid < b.pid + end + end end -- 填充房间对象 @@ -165,31 +165,31 @@ local function __fillRoomItem(self, index, item, room) local room_item = self.roomItems[item] local play = self.curGroup:getPlay(room.pid) if not room_item then - room_item = RoomItem.new(item, room.maxPlayers,self.isShowRoomItem) + room_item = RoomItem.new(item, room.maxPlayers, self.isShowRoomItem) self.roomItems[item] = room_item end - + room_item:SetPlay(play) - -- local str="(人数:".. room.maxPlayers - -- if room.limitInRoom then - -- str=str.." 限制积分:"..room.limitInRoom/1000 ..")" - -- else - -- str=str..")" - -- end - - + -- local str="(人数:".. room.maxPlayers + -- if room.limitInRoom then + -- str=str.." 限制积分:"..room.limitInRoom/1000 ..")" + -- else + -- str=str..")" + -- end + + local str = "" if room.limitInRoom then - str = str..room.limitInRoom/1000 + str = str .. room.limitInRoom / 1000 end - if room.round==nil then - room.round=0 - end - - - --printlog("wwwwwwwwwww1111111111111111 ",room.round," ",room.times) - room_item.tex_round.text = room.status >=-1 and string.format('%s/%s', room.round, room.times) or "" + if room.round == nil then + room.round = 0 + end + + + --printlog("wwwwwwwwwww1111111111111111 ",room.round," ",room.times) + room_item.tex_round.text = room.status >= -1 and string.format('%s/%s', room.round, room.times) or "" local name = __getLayerName(self, room.pid) room_item.tex_gamename.text = name room_item.tex_limit.text = str @@ -212,7 +212,7 @@ local function __fillRoomItem(self, index, item, room) if config.isHidden and config.isHidden == 1 then isHidden = 1 end - end + end play.isHidden = isHidden end room_item.ctr_color.selectedIndex = play and play.deskId or room.color or 0 @@ -230,15 +230,14 @@ local function __fillRoomItem(self, index, item, room) local p = plist[i] if isHidden == 0 then p_head.tex_name.text = ViewUtil.stringEllipsis(p.nick) - p_head.tex_id.text = "ID:"..p.aid + p_head.tex_id.text = "ID:" .. p.aid ImageLoad.Load(p.portrait, btn_head._iconObject, self.class) - - if p.hp then - local str1="积分:" - local hp=p.hp/1000 - p_head.text_score.text=str1..hp - end - + + if p.hp then + local str1 = "积分:" + local hp = p.hp / 1000 + p_head.text_score.text = str1 .. hp + end else p_head.tex_name.text = "智能" p_head.tex_id.text = "防作弊" @@ -266,13 +265,13 @@ local function __fillRoomItem(self, index, item, room) p_item.visible = false end end - -- desk.touchable = false + -- desk.touchable = false desk.onClick:Set( function() if room.default or self.curGroup.lev == 3 then -- 房间点击:假房间 匹配,真房间 加入 if room.default or isHidden == 1 then - self:__startGame(room.id,room.pid, true, isHidden) + self:__startGame(room.id, room.pid, true, isHidden) else self:__joinRoom(roomid) end @@ -291,7 +290,7 @@ local function __fillRoomItem(self, index, item, room) function() riv:Dispose() if room.default or isHidden == 1 then - self:__startGame(room.id,room.pid, true, isHidden) + self:__startGame(room.id, room.pid, true, isHidden) else self:__joinRoom(roomid) end @@ -301,15 +300,15 @@ local function __fillRoomItem(self, index, item, room) function() local _curren_msg = MsgWindow.new( - self._root_view, - '确定解散该桌子吗?\r(解散该桌子没有任何结算信息,请谨慎操作)', - MsgWindow.MsgMode.OkAndCancel - ) + self._root_view, + '确定解散该桌子吗?\r(解散该桌子没有任何结算信息,请谨慎操作)', + MsgWindow.MsgMode.OkAndCancel + ) _curren_msg.onOk:Add( function() ViewUtil.ShowModalWait(self._root_view) local fgCtr = ControllerManager.GetController(NewGroupController) - + fgCtr:FG_RemoveRoom( self.curGroup.id, roomid, @@ -339,14 +338,13 @@ local function __fillRoomItem(self, index, item, room) self._view:AddChild(riv) riv:Center() end - - - local key = tostring(self.curGroup.id) + + + local key = tostring(self.curGroup.id) self.fg_info[key] = room.pid local filename = 'fginfo_' .. DataManager.SelfUser.account_id Utils.SaveLocalFile(filename, json.encode(self.fg_info)) - - end + end ) end @@ -369,14 +367,14 @@ local function __fillRoomData(self) local currentPlayID = self:GetSelectedPlayID() local currentGameID = self:GetSelectedGameID() - -- self.lst_layer.visible = currentGameID > 0 + -- self.lst_layer.visible = currentGameID > 0 --self.line1.visible = currentGameID > 0 if currentPlayID > 0 then --printlog("aaaaaaaaaaaaaaaaa11111111111111111111111111111111") -- 单个玩法 local rooms = self.curGroup:getPlay(currentPlayID).rooms local trooms = {} - for i=1,#rooms do + for i = 1, #rooms do local room = rooms[i] local play = self.curGroup:getPlay(room.pid) local isvip = 0 @@ -398,24 +396,21 @@ local function __fillRoomData(self) isHidden = 1 end end - play.isHidden = isHidden + play.isHidden = isHidden play.isvip = isvip - - - ----------- - if isvip == self._showVipRooms then - if isHidden == 1 then - if #room.plist == room.maxPlayers or self.curGroup.lev < 3 then - table.insert( trooms,room ) - end - else - table.insert( trooms,room ) - end - end - - + + + ----------- + if isvip == self._showVipRooms then + if isHidden == 1 then + if #room.plist == room.maxPlayers or self.curGroup.lev < 3 then + table.insert(trooms, room) + end + else + table.insert(trooms, room) + end + end end - end self.curRooms = membe_clone(trooms) @@ -430,33 +425,31 @@ local function __fillRoomData(self) if config.isvip and config.isvip == 1 then isvip = 1 end - end + end play.isvip = isvip - - ------ - if isvip == self._showVipRooms then - local hp=json.decode(play.hpData) - if hp and hp.maxRound then - room.times=hp.maxRound - end - - if hp and hp.limitInRoom then - room.limitInRoom=hp.limitInRoom - end - - - table.insert( self.curRooms,room ) - - end - ----- + + ------ + if isvip == self._showVipRooms then + local hp = json.decode(play.hpData) + if hp and hp.maxRound then + room.times = hp.maxRound + end + + if hp and hp.limitInRoom then + room.limitInRoom = hp.limitInRoom + end + + + table.insert(self.curRooms, room) + end + ----- end - else if currentGameID == 0 then --printlog("aaaaaaaaaaaaaaaaa222222222222222222222222222") local rooms = curGroup.rooms local trooms = {} - for i=1,#rooms do + for i = 1, #rooms do local room = rooms[i] local play = self.curGroup:getPlay(room.pid) local isvip = 0 @@ -478,28 +471,26 @@ local function __fillRoomData(self) isHidden = 1 end end - play.isHidden = isHidden + play.isHidden = isHidden play.isvip = isvip - - ----- - if isvip == self._showVipRooms then - if play.isHidden == 1 then - if #room.plist == room.maxPlayers or self.curGroup.lev < 3 then - table.insert( trooms,room ) - end - else - table.insert( trooms,room ) - end - end - + + ----- + if isvip == self._showVipRooms then + if play.isHidden == 1 then + if #room.plist == room.maxPlayers or self.curGroup.lev < 3 then + table.insert(trooms, room) + end + else + table.insert(trooms, room) + end + end end - end self.curRooms = membe_clone(trooms) - + for i = 1, #self.curGroup.playList do local defaultRoom = self.curGroup.default_rooms[i] - + local play = self.curGroup:getPlay(defaultRoom.pid) local isvip = 0 if play then @@ -510,25 +501,24 @@ local function __fillRoomData(self) if config.isvip and config.isvip == 1 then isvip = 1 end - end + end play.isvip = isvip end if isvip == self._showVipRooms then - local hp=json.decode(self.curGroup.playList[i].hpData) - defaultRoom.limitInRoom=hp.limitInRoom - if hp.maxRound then - defaultRoom.times=hp.maxRound - end - local totalNum=1 - if hp.tex_times_room then - totalNum=hp.tex_times_room/1000 - end - - for i=1,totalNum do - self.curRooms[#self.curRooms + 1] = defaultRoom - end - - end + local hp = json.decode(self.curGroup.playList[i].hpData) + defaultRoom.limitInRoom = hp.limitInRoom + if hp.maxRound then + defaultRoom.times = hp.maxRound + end + local totalNum = 1 + if hp.tex_times_room then + totalNum = hp.tex_times_room / 1000 + end + + for i = 1, totalNum do + self.curRooms[#self.curRooms + 1] = defaultRoom + end + end end else --printlog("aaaaaaaaaaaaaaaaa33333333333333333333333333333333") @@ -552,7 +542,7 @@ local function __fillRoomData(self) if config.isHidden and config.isHidden == 1 then isHidden = 1 end - end + end p_data.isvip = isvip p_data.isHidden = isHidden @@ -569,44 +559,42 @@ local function __fillRoomData(self) self.curRooms[#self.curRooms + 1] = tempRoom end end - end - - local hp=json.decode(p_data.hpData) - if hp and hp.maxRound then - self.curGroup.default_rooms[i].times=hp.maxRound - end - - if hp and hp.limitInRoom then - self.curGroup.default_rooms[i].limitInRoom=hp.limitInRoom - end - - local totalNum=1 - if hp and hp.tex_times_room then - totalNum=hp.tex_times_room/1000 - end - for j=1,totalNum do - self.curRooms[#self.curRooms + 1] = self.curGroup.default_rooms[i] - end - + end + + local hp = json.decode(p_data.hpData) + if hp and hp.maxRound then + self.curGroup.default_rooms[i].times = hp.maxRound + end + + if hp and hp.limitInRoom then + self.curGroup.default_rooms[i].limitInRoom = hp.limitInRoom + end + + local totalNum = 1 + if hp and hp.tex_times_room then + totalNum = hp.tex_times_room / 1000 + end + for j = 1, totalNum do + self.curRooms[#self.curRooms + 1] = self.curGroup.default_rooms[i] + end end end end end - - currentSelectPlay=self:GetSelectedPlayID() - table.sort(self.curRooms,SortRooms ) + + currentSelectPlay = self:GetSelectedPlayID() + table.sort(self.curRooms, SortRooms) list_offline = {} if self.curGroup.lev < 3 then self.lst_room.numItems = #self.curRooms else if self.curGroup.show_num > 0 and #self.curRooms > self.curGroup.show_num then - local tr = {} for j = 1, #self.curRooms do if #tr < self.curGroup.show_num or self.curRooms[j].default == true then - table.insert(tr,self.curRooms[j]) + table.insert(tr, self.curRooms[j]) end end @@ -614,8 +602,8 @@ local function __fillRoomData(self) end self.lst_room.numItems = #self.curRooms end - - + + -- if self._ctr_search.selectedIndex == 1 then -- self.lst_room_search:RemoveChildrenToPool() @@ -650,7 +638,7 @@ end function M:InitRoomInfoView() local room = self.roominfo.room if not room.default then - printlog("wwwwwwwwwww22222222222222222 ",room.round," ",room.times) + printlog("wwwwwwwwwww22222222222222222 ", room.round, " ", room.times) self.roominfo.view:GetChild('tex_round').text = string.format('(%s/%s)', room.round, room.times) local lst_player = self.roominfo.view:GetChild('lst_player') lst_player:RemoveChildrenToPool() @@ -694,7 +682,6 @@ local function __fillPlayItem(self, index, item) if (index == 0) then tex_game.text = __getLayerName(self, 0) else - pipeijoin.onClick:Add( function() local currentPlayID = self:GetSelectedPlayID() @@ -717,7 +704,7 @@ local function __fillPlayItem(self, index, item) end end - self:__startGame("",currentPlayID, false) + self:__startGame("", currentPlayID, false) end ) tex_game.text = __getLayerName(self, self.playIdList[index]) @@ -726,7 +713,6 @@ end local _iconMap = {} local function __fillExtendIcon(id, callback) - local File = System.IO.File local path = Application.persistentDataPath .. '/UserData/Icon' if not System.IO.Directory.Exists(path) then @@ -760,7 +746,7 @@ local function __fillExtendIcon(id, callback) local texture = UnityEngine.Texture2D(128, 128) texture:LoadImage(bytes) local ntexture = FairyGUI.NTexture(texture) - _iconMap[id] = {texture = texture, ntexture = ntexture} + _iconMap[id] = { texture = texture, ntexture = ntexture } callback(ntexture) end ) @@ -771,65 +757,68 @@ local function __fillExtendIcon(id, callback) local texture = UnityEngine.Texture2D(128, 128) texture:LoadImage(bytes) local ntexture = FairyGUI.NTexture(texture) - _iconMap[id] = {texture = texture, ntexture = ntexture} + _iconMap[id] = { texture = texture, ntexture = ntexture } callback(ntexture) end end end local function GetGameName(index) - if index==0 then return "全 部" end - local list = DataManager.SelfUser.games - for k,v in ipairs(list) do - if v.game_id==index then - return v.name - end - end - return "" + if index == 0 then return "全 部" end + local list = DataManager.SelfUser.games + for k, v in ipairs(list) do + if v.game_id == index then + return v.name + end + end + return "" end -- 玩法名字显示 local function __fillGameItem(self, index, item) - local gameName="" + local gameName = "" if (index == 0) then item.icon = 'ui://NewGroup/quyxtb' - gameName=GetGameName(0) - item:GetChild("n11").text=gameName - if self.currentGameItemName==nil then - item.icon = 'ui://NewGroup/quyxtb-1' - end + gameName = GetGameName(0) + item:GetChild("n11").text = gameName + if self.currentGameItemName == nil then + item.icon = 'ui://NewGroup/quyxtb-1' + item:GetChild("n11").text = "" + end else local gameId = self.gameIdList[index] local config = ExtendManager.GetExtendConfig(gameId) local mode = config:GetGameInfo() - local iconName=mode:GetIconUrl1() + local iconName = mode:GetIconUrl1() item.icon = iconName - gameName=GetGameName(gameId) - item:GetChild("n11").text=gameName + gameName = GetGameName(gameId) + item:GetChild("n11").text = gameName end - - if item.icon==self.currentGameItemName then - item.icon=self.currentGameItemName.."-1" - item:GetChild("n11").text=gameName - end - item:GetChild("n22").text=index+1 - + + if item.icon == self.currentGameItemName then + item.icon = self.currentGameItemName .. "-1" + item:GetChild("n11").text = gameName + if (index == 0) then + item:GetChild("n11").text = "" + end + end + item:GetChild("n22").text = index + 1 end local function __analysePlayListData(self) self.playIdList = {} - DataManager.SelfUser.PlayLocalList={} - - local playName="playfaconfig"..self.curGroup.id - local json_data = Utils.LoadLocalFile(playName) + DataManager.SelfUser.PlayLocalList = {} + + local playName = "playfaconfig" .. self.curGroup.id + local json_data = Utils.LoadLocalFile(playName) if json_data then - local data = json.decode(json_data) - DataManager.SelfUser.PlayLocalList=data - end - - - + local data = json.decode(json_data) + DataManager.SelfUser.PlayLocalList = data + end + + + local count = 0 local curGroup = self.curGroup local gameid = self:GetSelectedGameID() @@ -843,25 +832,25 @@ local function __analysePlayListData(self) if config.isvip and config.isvip == 1 then isvip = 1 end - end + end p_data.isvip = isvip - - local isHasPlayC=true - --[[for k,v in pairs(DataManager.SelfUser.PlayLocalList) do + + local isHasPlayC = true + --[[for k,v in pairs(DataManager.SelfUser.PlayLocalList) do if tonumber(k)==p_data.id then isHasPlayC=v end end--]] - - if (gameid == 0 or p_data.gameId == gameid) and isHasPlayC and isvip == self._showVipRooms then + + if (gameid == 0 or p_data.gameId == gameid) and isHasPlayC and isvip == self._showVipRooms then count = count + 1 self.playIdList[count] = p_data.id end end local lst_layer = self.lst_layer - -- printlog("添加玩法====>>>>",count) - -- pt(curGroup.playList) + -- printlog("添加玩法====>>>>",count) + -- pt(curGroup.playList) lst_layer.numItems = count + 1 end @@ -881,7 +870,7 @@ local function __analyseGameListData(self) if config.isvip and config.isvip == 1 then isvip = 1 end - end + end p_data.isvip = isvip if isvip == self._showVipRooms then @@ -891,10 +880,10 @@ local function __analyseGameListData(self) existed = true end end - + if existed == false then self.gameIdList[#self.gameIdList + 1] = p_data.gameId - end + end end end @@ -934,11 +923,11 @@ function M:InitView(url) -- local btndel = self._view:GetChild("btn_del") -- local texroomid = self._view:GetChild('tex_roomid') - - - + + + -- btndel.onClick:Set( - + -- function() -- local delroomid -- delroomid = (texroomid.text) or 0 @@ -955,7 +944,7 @@ function M:InitView(url) -- ) -- _curren_msg.onOk:Add( -- function() - + -- ViewUtil.ShowModalWait(self._root_view) -- local fgCtr = ControllerManager.GetController(NewGroupController) -- fgCtr:FG_RemoveRoom( @@ -982,7 +971,7 @@ function M:InitView(url) - self._view:GetChild('tex_id').text = "ID:"..self.curGroup.id + self._view:GetChild('tex_id').text = "ID:" .. self.curGroup.id self._view:GetChild('tex_name').text = self.curGroup.name @@ -1019,14 +1008,14 @@ function M:InitView(url) end -- local btn_remit = self._view:GetChild('btn_remit') - -- btn_remit.visible = false + -- btn_remit.visible = false self.lst_game.onClickItem:Add( function(pas) - if self.currentSelectItem == pas.data then return end - local name=pas.data.icon + if self.currentSelectItem == pas.data then return end + local name = pas.data.icon self.currentSelectItem = pas.data - self.currentGameItemName=name + self.currentGameItemName = name self.lst_layer.selectedIndex = 0 self:__refreshPay() __analyseGameListData(self) @@ -1034,22 +1023,22 @@ function M:InitView(url) __fillRoomData(self) end ) - -- self.line1 = self._view:GetChild('line1') + -- self.line1 = self._view:GetChild('line1') --self.line1.visible = false self.lst_layer = self._view:GetChild('lst_layer') self.lst_layer:SetVirtual() self.lst_layer.itemRenderer = function(index, item) __fillPlayItem(self, index, item) --if index>0 then - -- __fillPlayItem(self, index, item) + -- __fillPlayItem(self, index, item) --else - -- item.width = 0 - -- item.height = 0 - -- item.visible = false - -- end + -- item.width = 0 + -- item.height = 0 + -- item.visible = false + -- end end - + self.lst_layer.onClickItem:Add( function() @@ -1060,10 +1049,10 @@ function M:InitView(url) local btn_quanbu = self._view:GetChild('btn_quanbu') btn_quanbu.onClick:Set( - function () - self.lst_layer.selectedIndex=0 + function() + self.lst_layer.selectedIndex = 0 self:__loadPlayData() - end + end ) @@ -1092,12 +1081,12 @@ function M:InitView(url) btn_start.onClick:Set( function() local pid = self.fg_info[tostring(self.curGroup.id)] - + if pid == 0 then ViewUtil.ErrorTip(nil, '没有选择玩法') return end - self:__startGame("",pid, false) + self:__startGame("", pid, false) end ) @@ -1105,7 +1094,6 @@ function M:InitView(url) local btn_start2 = self._view:GetChild('btn_start2') btn_start2.onClick:Set( function() - local currentPlayID = self:GetSelectedPlayID() if currentPlayID == 0 then if self.lst_layer.selectedIndex == 0 and self.lst_game.selectedIndex > 0 then @@ -1126,53 +1114,52 @@ function M:InitView(url) end end - self:__startGame("",currentPlayID, false) + self:__startGame("", currentPlayID, false) end ) -- 选择玩法按钮 local btn_choose = self._view:GetChild('btn_choose') btn_choose.onClick:Set( - function () - self.lstgameVisible = not self.lstgameVisible - if (self.lstgameVisible) then - self.lst_game:TweenMove(Vector2.New(3,100), 0.3) - else - self.lst_game:TweenMove(Vector2.New(3,760), 0.3) - end - - end - -- function() - -- local sgv = - -- GroupSetDefaultGameView.new( - -- self.curGroup.id, - -- self._root_view, - -- function(num) - -- if num == 0 then - -- return - -- end - -- local pid = 0 - -- pid = self.curGroup.playList[num].id - -- btn_choose:GetChild('tex_gamename').text = __getLayerName(self, pid) - -- btn_choose:GetController('null').selectedIndex = 0 - -- local key = tostring(self.curGroup.id) - -- self.fg_info[key] = pid - -- local filename = 'fginfo_' .. DataManager.SelfUser.account_id - -- Utils.SaveLocalFile(filename, json.encode(self.fg_info)) - -- end - -- ) - -- local tem = self.fg_info[tostring(self.curGroup.id)] - -- local play_index = self.curGroup:getPlayIndex(tem) - -- if play_index == -1 then - -- play_index = 1 - -- end - - -- local setCallBackFunc=function() - -- __analysePlayListData(self) - -- end - -- sgv:FillData(self.curGroup.playList, play_index,setCallBackFunc) - -- sgv:Show() - -- end + function() + self.lstgameVisible = not self.lstgameVisible + if (self.lstgameVisible) then + self.lst_game:TweenMove(Vector2.New(3, 100), 0.3) + else + self.lst_game:TweenMove(Vector2.New(3, 760), 0.3) + end + end + -- function() + -- local sgv = + -- GroupSetDefaultGameView.new( + -- self.curGroup.id, + -- self._root_view, + -- function(num) + -- if num == 0 then + -- return + -- end + -- local pid = 0 + -- pid = self.curGroup.playList[num].id + -- btn_choose:GetChild('tex_gamename').text = __getLayerName(self, pid) + -- btn_choose:GetController('null').selectedIndex = 0 + -- local key = tostring(self.curGroup.id) + -- self.fg_info[key] = pid + -- local filename = 'fginfo_' .. DataManager.SelfUser.account_id + -- Utils.SaveLocalFile(filename, json.encode(self.fg_info)) + -- end + -- ) + -- local tem = self.fg_info[tostring(self.curGroup.id)] + -- local play_index = self.curGroup:getPlayIndex(tem) + -- if play_index == -1 then + -- play_index = 1 + -- end + + -- local setCallBackFunc=function() + -- __analysePlayListData(self) + -- end + -- sgv:FillData(self.curGroup.playList, play_index,setCallBackFunc) + -- sgv:Show() + -- end ) local btn_close = self._view:GetChild('btn_close') @@ -1196,7 +1183,7 @@ function M:InitView(url) -- end -- ) -- return - -- end + -- end -- self._view:GetController('pipei').selectedIndex = 0 -- end -- ) @@ -1229,7 +1216,7 @@ function M:InitView(url) self:__loadGroupData() self:__refreshManager() UpdateBeat:Add(self.__onUpdate, self) - self._view.visible=false + self._view.visible = false end function M:__saveLastData() @@ -1251,7 +1238,7 @@ function M:__loadLastData() table.insert(self.gameIdList, t.gameId) end table.insert(self.playIdList, t.id) - local room = {maxPlayers = t.maxPlayers, status = 0, default = true, pid = t.id, color = t.deskId} + local room = { maxPlayers = t.maxPlayers, status = 0, default = true, pid = t.id, color = t.deskId } table.insert(self.curRooms, room) self.playNames[t.id] = t.name end @@ -1272,13 +1259,13 @@ function M:__onUpdate() if self._pipeiTime and self._pipeiTime > 0 then local deltaTime = Time.deltaTime self._pipeiTime = self._pipeiTime - deltaTime - self._pipeiTime = math.max( self._pipeiTime,0 ) + self._pipeiTime = math.max(self._pipeiTime, 0) if self._pipeiTime == 0 then - self._view:GetChild('node_matching'):GetChild('text_time').text = "当前排位时间较长,请耐心等待..." - self._view:GetChild('node_matching'):GetController('quxiao').selectedIndex = 1 + self._view:GetChild('node_matching'):GetChild('text_time').text = "当前排位时间较长,请耐心等待..." + self._view:GetChild('node_matching'):GetController('quxiao').selectedIndex = 1 else local time = math.floor(self._pipeiTime) - self._view:GetChild('node_matching'):GetChild('text_time').text = "玩家排位中,".. time .."秒后可退出..." + self._view:GetChild('node_matching'):GetChild('text_time').text = "玩家排位中," .. time .. "秒后可退出..." end end if self.__join_room then @@ -1346,7 +1333,7 @@ function M:__joinRoom(room_id) RestartGame() return end - + if response.ReturnCode == -2 then self:__joinRoom(room_id) return @@ -1368,7 +1355,7 @@ function M:__joinRoom(room_id) ) end ) - return + return end end roomCtr:PublicJoinRoom( @@ -1376,8 +1363,8 @@ function M:__joinRoom(room_id) room_id, false, function(response) - printlog("进入房间返回事件==========》》》") - pt(response) + printlog("进入房间返回事件==========》》》") + pt(response) if (response.ReturnCode == -1) then ViewUtil.CloseModalWait('join_room') RestartGame() @@ -1405,7 +1392,7 @@ function M:__joinRoom(room_id) ) end -function M:__joinRoom_match(roomid,pid, is_null, isHidden, callback) +function M:__joinRoom_match(roomid, pid, is_null, isHidden, callback) if isHidden == nil then isHidden = 0 local play = self.curGroup:getPlay(pid) @@ -1417,8 +1404,8 @@ function M:__joinRoom_match(roomid,pid, is_null, isHidden, callback) if config.isHidden and config.isHidden == 1 then isHidden = 1 end - end - play.isHidden = isHidden + end + play.isHidden = isHidden end end if isHidden == 1 then @@ -1427,7 +1414,7 @@ function M:__joinRoom_match(roomid,pid, is_null, isHidden, callback) DataManager.SelfUser.location = Location.new() end if DataManager.SelfUser.location:Location2String() == "" then - -- if DataManager.SelfUser.location:Location2String() == "" then + -- if DataManager.SelfUser.location:Location2String() == "" then ViewUtil.ErrorTip(nil, "没有打开GPS定位,不能参与该游戏") get_gps() return @@ -1452,7 +1439,7 @@ function M:__joinRoom_match(roomid,pid, is_null, isHidden, callback) RestartGame() return end - + if response.ReturnCode ~= 0 then self._view:GetController('pipei').selectedIndex = 0 callback(response.ReturnCode) @@ -1475,9 +1462,9 @@ function M:__joinRoom_match(roomid,pid, is_null, isHidden, callback) end, self.curGroup.id, pid - ) + ) end) - + return end @@ -1567,29 +1554,30 @@ function M:_evtUpdateMsg() self:_setHongDian(true) end end + function M:_setHongDian(isShow) --红点提示 local member_tips = self._view:GetChild('member_tips') member_tips.visible = isShow end + function M:_evtInvited(...) - local arg = {...} + local arg = { ... } local data = arg[1] local imv = FGInvitedMsgView.new( - self._root_view, - self.curGroup.id, - function(roomid) - self:__joinRoom(roomid) - end - ) + self._root_view, + self.curGroup.id, + function(roomid) + self:__joinRoom(roomid) + end + ) imv:FillData(data) imv:Show() end -- 更新牌友圈事件 function M:_evtUpdateGroup(...) - -- local btn_remit = self._view:GetChild('btn_remit') -- local option = self.curGroup.option or 0 @@ -1628,24 +1616,24 @@ function M:__refreshManager() end ) local btn_partner = self._view:GetChild('btn_partner') - btn_partner.onClick:Set( + btn_partner.onClick:Set( function() --print("成员..........................................") if not self.mng_view3 then self.mng_view3 = GroupManagerView.new(self._root_view, self.curGroup.id, 5) - self.mng_view3:SetCurrentGroupInfoViewIns(function () - self:OnclickMember() - end) + self.mng_view3:SetCurrentGroupInfoViewIns(function() + self:OnclickMember() + end) end self.mng_view3:Show() -- self:SetRoomListVisible(false) end ) - + local btn_play = self._view:GetChild('btn_play') btn_play.onClick:Set(function() - local gl_view =GroupMngGameListView.new(self.curGroup.id) + local gl_view = GroupMngGameListView.new(self.curGroup.id) gl_view:Show() -- self:SetRoomListVisible(false) end) @@ -1662,9 +1650,8 @@ function M:__refreshManager() ) end - function M:OnclickMember() - if not self.mng_view3 then + if not self.mng_view3 then self.mng_view3 = GroupManagerView.new(self._root_view, self.curGroup.id, 5) end self.mng_view3:Show() @@ -1689,18 +1676,18 @@ function M:__ShowNotice() end self._tw_notice = DSTween.To( - 0, - 1, - dur_time, - function(value) - tex_notice.x = start_x - speed_x * value * dur_time - end - ):OnComplete( - function() - self._tw_notice = nil - self:__ShowNotice() - end - ) + 0, + 1, + dur_time, + function(value) + tex_notice.x = start_x - speed_x * value * dur_time + end + ):OnComplete( + function() + self._tw_notice = nil + self:__ShowNotice() + end + ) end -- 显示玩法信息 @@ -1720,7 +1707,7 @@ function M:__loadGroupData() curGroup.update_room = false curGroup.update_info = false curGroup.update_joins = false - ViewUtil.ShowModalWait(self._root_view,"正在进入牌友圈,请稍等...") + ViewUtil.ShowModalWait(self._root_view, "正在进入牌友圈,请稍等...") local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_EnterGroup( curGroup.id, @@ -1728,13 +1715,13 @@ function M:__loadGroupData() -- if self._is_destroy then -- return -- end - ViewUtil.CloseModalWait() + ViewUtil.CloseModalWait() if res.ReturnCode ~= 0 then - --self._view.visible=false - --ViewUtil.ErrorTip(res.ReturnCode, "获取圈子数据失败") + --self._view.visible=false + --ViewUtil.ErrorTip(res.ReturnCode, "获取圈子数据失败") else - self._view.visible=true - self:Show() + self._view.visible = true + self:Show() self:__saveLastData() local mgr_ctr = ControllerManager.GetController(GroupMgrController) mgr_ctr:AddEventListener(GroupMgrEvent.AddPlay, handler(self, self._evtAddPlay)) @@ -1756,23 +1743,23 @@ function M:__loadGroupData() local ctr_msg = self._view:GetController('msg') ctr_msg.selectedIndex = 1 end - + local btn_vip = self._view:GetChild("btn_vip") if self.curGroup.isvip == 1 then - local vip = self.fg_info[tostring(self.curGroup.id).."vip"] or 0 + local vip = self.fg_info[tostring(self.curGroup.id) .. "vip"] or 0 self._showVipRooms = vip - btn_vip:GetController("vip").selectedIndex = math.abs( self._showVipRooms - 1) - btn_vip.onClick:Set(function () + btn_vip:GetController("vip").selectedIndex = math.abs(self._showVipRooms - 1) + btn_vip.onClick:Set(function() btn_vip:GetController("vip").selectedIndex = self._showVipRooms - self._showVipRooms = math.abs( self._showVipRooms - 1 ) + self._showVipRooms = math.abs(self._showVipRooms - 1) self:_evtUpdatePlay() local key = tostring(self.curGroup.id) .. "vip" self.fg_info[key] = self._showVipRooms local filename = 'fginfo_' .. DataManager.SelfUser.account_id - Utils.SaveLocalFile(filename, json.encode(self.fg_info)) - end) + Utils.SaveLocalFile(filename, json.encode(self.fg_info)) + end) end - + -- 玩法列表初始化 __analyseGameListData(self) __analysePlayListData(self) @@ -1800,14 +1787,14 @@ function M:__loadGroupData() end ) local btn_invite = self._view:GetChild('btn_invite') - btn_invite.displayObject.gameObject:SetActive(false) + btn_invite.displayObject.gameObject:SetActive(false) --[[btn_invite.onClick:Set(function() if not self.mng_view3 then self.mng_view3 = GroupManagerView.new(self._root_view, self.curGroup.id, 3) end self.mng_view3:Show(1) end)--]] - + -- local btn_rank = self._view:GetChild("btn_rank") -- btn_rank.onClick:Set(function() -- local rv = GroupRank.new(self._root_view, self.curGroup.id) @@ -1846,22 +1833,23 @@ function M:__loadGroupData() btn_mail.selected = false end ) - gmv:Show() + gmv:Show() end ) local btn_bxx = self._view:GetChild('btn_bxx') btn_bxx.onClick:Set( function() - local ctrNum=1 - -- if self.curGroup.lev==3 and self.curGroup.partnerLev>0 or self.curGroup.lev==1 or self.curGroup.lev==2 then - -- ctrNum=2 - -- end - if self.curGroup.lev==1 then - ctrNum=2 - end - ctrNum=2 - local gmv = GroupMngFagPackView.new(self.curGroup.id, self._root_view,ctrNum,DataManager.SelfUser.account_id) + local ctrNum = 1 + -- if self.curGroup.lev==3 and self.curGroup.partnerLev>0 or self.curGroup.lev==1 or self.curGroup.lev==2 then + -- ctrNum=2 + -- end + if self.curGroup.lev == 1 then + ctrNum = 2 + end + ctrNum = 2 + local gmv = GroupMngFagPackView.new(self.curGroup.id, self._root_view, ctrNum, + DataManager.SelfUser.account_id) gmv:SetCallback( function() btn_bxx.selected = false @@ -1876,7 +1864,7 @@ function M:__loadGroupData() end -- 匹配游戏 -function M:__startGame(roomid,pid, is_null,isHidden, callback) +function M:__startGame(roomid, pid, is_null, isHidden, callback) ViewUtil.ShowModalWait(self._root_view, '正在加入游戏...', 'join_room') local _gameCtrl = ControllerManager.GetController(GameController) local _currentCtrl = ControllerManager.GetCurrenController() @@ -1890,7 +1878,7 @@ function M:__startGame(roomid,pid, is_null,isHidden, callback) isHidden, function(code) if code == -2 then - self:__startGame(roomid,pid, is_null, isHidden, callback) + self:__startGame(roomid, pid, is_null, isHidden, callback) elseif code ~= 0 then ViewUtil.ErrorMsg(self._root_view, code, '进入房间失败') ViewUtil.CloseModalWait('join_room') @@ -1925,7 +1913,7 @@ end -- 显示各玩法体力值信息 function M:__refreshPay() - --printlog("1111111111111111111111111111",self.curGroup.hp) + --printlog("1111111111111111111111111111",self.curGroup.hp) self.tex_fag.text = '' .. d2ad(self.curGroup.hp or 0) -- self.tex_diamo.text = self.curGroup.diamo @@ -1955,11 +1943,11 @@ function M:__share() local str = string.format('【%s】 邀请您加入!', tem.name) local url = string.format( - '%s?type=t1&playerId=%s&groupId=%s', - GetGameInfo('share_group_link'), - DataManager.SelfUser.account_id, - tem.id - ) + '%s?type=t1&playerId=%s&groupId=%s', + GetGameInfo('share_group_link'), + DataManager.SelfUser.account_id, + tem.id + ) local json_data = {} json_data['title'] = string.format('大联盟号【%s】', tem.id) local mediaObject = {} @@ -1980,15 +1968,16 @@ function M:showPipei(play) end self._pipeiTime = 20 end + function M:hidePipei() - --print("hidePipei=============") - --print(self._view) - --print(self._view:GetController('pipei')) - if self._view:GetController('pipei') then - self._view:GetController('pipei').selectedIndex = 0 - end - + --print("hidePipei=============") + --print(self._view) + --print(self._view:GetController('pipei')) + if self._view:GetController('pipei') then + self._view:GetController('pipei').selectedIndex = 0 + end end + function M:SetCallBack(callback) self._callback = nil self._callback = callback @@ -2055,4 +2044,3 @@ function M:Destroy() end return M - diff --git a/fk101/wb_new_ui/.objs/metas/1hl55dqm/c4r115.info b/fk101/wb_new_ui/.objs/metas/1hl55dqm/c4r115.info index 01c113f5..8a78afcc 100644 --- a/fk101/wb_new_ui/.objs/metas/1hl55dqm/c4r115.info +++ b/fk101/wb_new_ui/.objs/metas/1hl55dqm/c4r115.info @@ -1,5 +1,11 @@ { "objectStatus": { + "n244_cpin": { + "hidden": true + }, + "n245_cpin": { + "hidden": true + }, "n141_c4r1": { "collapsed": true }, diff --git a/fk101/wb_new_ui/.objs/metas/442j0uep/ygxgd.info b/fk101/wb_new_ui/.objs/metas/442j0uep/ygxgd.info index 0b846d5b..5b13b0b9 100644 --- a/fk101/wb_new_ui/.objs/metas/442j0uep/ygxgd.info +++ b/fk101/wb_new_ui/.objs/metas/442j0uep/ygxgd.info @@ -1,5 +1,11 @@ { "objectStatus": { + "n363_u3z9": { + "hidden": true + }, + "n364_u3z9": { + "hidden": true + }, "n70_m25s": { "collapsed": true }, diff --git a/fk101/wb_new_ui/.objs/metas/4wmd3o8g/otx0h.info b/fk101/wb_new_ui/.objs/metas/4wmd3o8g/otx0h.info new file mode 100644 index 00000000..1c52ab0b --- /dev/null +++ b/fk101/wb_new_ui/.objs/metas/4wmd3o8g/otx0h.info @@ -0,0 +1,10 @@ +{ + "objectStatus": { + "n393_vlhj": { + "hidden": true + }, + "n394_vlhj": { + "hidden": true + } + } +} \ No newline at end of file diff --git a/fk101/wb_new_ui/.objs/metas/96mvx2ml/10kys6.info b/fk101/wb_new_ui/.objs/metas/96mvx2ml/10kys6.info index a25ebe79..4d01fc61 100644 --- a/fk101/wb_new_ui/.objs/metas/96mvx2ml/10kys6.info +++ b/fk101/wb_new_ui/.objs/metas/96mvx2ml/10kys6.info @@ -6,6 +6,12 @@ "n153_udgc": { "hidden": true }, + "n172_vlhj": { + "hidden": true + }, + "n171_vlhj": { + "hidden": true + }, "n149_udgc": { "hidden": true, "collapsed": true diff --git a/fk101/wb_new_ui/.objs/metas/boq0ohep/otx0h.info b/fk101/wb_new_ui/.objs/metas/boq0ohep/otx0h.info new file mode 100644 index 00000000..0a6c470b --- /dev/null +++ b/fk101/wb_new_ui/.objs/metas/boq0ohep/otx0h.info @@ -0,0 +1,10 @@ +{ + "objectStatus": { + "n383_vlhj": { + "hidden": true + }, + "n382_vlhj": { + "hidden": true + } + } +} \ No newline at end of file diff --git a/fk101/wb_new_ui/.objs/metas/d1qrzqpr/c4r116.info b/fk101/wb_new_ui/.objs/metas/d1qrzqpr/c4r116.info index eb6c1fea..468a3041 100644 --- a/fk101/wb_new_ui/.objs/metas/d1qrzqpr/c4r116.info +++ b/fk101/wb_new_ui/.objs/metas/d1qrzqpr/c4r116.info @@ -1,5 +1,11 @@ { "objectStatus": { + "n169_ec0j": { + "hidden": true + }, + "n168_ec0j": { + "hidden": true + }, "n146_piwz": { "collapsed": true }, diff --git a/fk101/wb_new_ui/.objs/metas/egnzysm7/ffp38j.info b/fk101/wb_new_ui/.objs/metas/egnzysm7/ffp38j.info index cedc4a8e..75e8fdad 100644 --- a/fk101/wb_new_ui/.objs/metas/egnzysm7/ffp38j.info +++ b/fk101/wb_new_ui/.objs/metas/egnzysm7/ffp38j.info @@ -9,6 +9,9 @@ "n133_r282": { "collapsed": true }, + "n324_gz8w": { + "hidden": true + }, "n294_fnpw": { "collapsed": true }, @@ -17,6 +20,9 @@ }, "n231_ey1o": { "collapsed": true + }, + "n322_gz8w": { + "hidden": true } } } \ No newline at end of file diff --git a/fk101/wb_new_ui/.objs/metas/m7iejg46/r0qx7i6v.info b/fk101/wb_new_ui/.objs/metas/m7iejg46/r0qx7i6v.info index 161bec00..8b6fe231 100644 --- a/fk101/wb_new_ui/.objs/metas/m7iejg46/r0qx7i6v.info +++ b/fk101/wb_new_ui/.objs/metas/m7iejg46/r0qx7i6v.info @@ -3,6 +3,9 @@ "n68_joap": { "hidden": true }, + "n51_r0qx": { + "hidden": true + }, "n67_joap": { "hidden": true } diff --git a/fk101/wb_new_ui/.objs/metas/qubt49z8/c4r116.info b/fk101/wb_new_ui/.objs/metas/qubt49z8/c4r116.info new file mode 100644 index 00000000..16a464cf --- /dev/null +++ b/fk101/wb_new_ui/.objs/metas/qubt49z8/c4r116.info @@ -0,0 +1,10 @@ +{ + "objectStatus": { + "n172_gz8w": { + "hidden": true + }, + "n173_gz8w": { + "hidden": true + } + } +} \ No newline at end of file diff --git a/fk101/wb_new_ui/.objs/metas/qubt49z8/mpncc1i.info b/fk101/wb_new_ui/.objs/metas/qubt49z8/mpncc1i.info index 52fe77fb..b3d0b746 100644 --- a/fk101/wb_new_ui/.objs/metas/qubt49z8/mpncc1i.info +++ b/fk101/wb_new_ui/.objs/metas/qubt49z8/mpncc1i.info @@ -1,19 +1,25 @@ { "objectStatus": { + "n185_vlhj": { + "hidden": true + }, + "n186_vlhj": { + "hidden": true + }, + "n162_mpnc": { + "collapsed": true + }, "n46_6cpq": { "collapsed": true }, + "n9_mw5l": { + "collapsed": true + }, "n82_e8zl": { "hidden": true }, - "n9_mw5l": { - "collapsed": true - }, "n112_i9b1": { "collapsed": true - }, - "n162_mpnc": { - "collapsed": true } } } \ No newline at end of file diff --git a/fk101/wb_new_ui/.objs/metas/z3z0ysur/ygxgd.info b/fk101/wb_new_ui/.objs/metas/z3z0ysur/ygxgd.info index 20616fc8..d61baf51 100644 --- a/fk101/wb_new_ui/.objs/metas/z3z0ysur/ygxgd.info +++ b/fk101/wb_new_ui/.objs/metas/z3z0ysur/ygxgd.info @@ -1,10 +1,16 @@ { "objectStatus": { - "n46_g92u": { - "collapsed": true + "n321_vlhj": { + "hidden": true + }, + "n319_vlhj": { + "hidden": true }, "n123_r282": { "collapsed": true + }, + "n46_g92u": { + "collapsed": true } } } \ No newline at end of file diff --git a/fk101/wb_new_ui/assets/Extend_Poker_ChangdeWHZ/component/create_room/Cgm_create_room.xml b/fk101/wb_new_ui/assets/Extend_Poker_ChangdeWHZ/component/create_room/Cgm_create_room.xml index c934caf5..582bc119 100644 --- a/fk101/wb_new_ui/assets/Extend_Poker_ChangdeWHZ/component/create_room/Cgm_create_room.xml +++ b/fk101/wb_new_ui/assets/Extend_Poker_ChangdeWHZ/component/create_room/Cgm_create_room.xml @@ -137,7 +137,7 @@ - + @@ -198,7 +198,7 @@