diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index de9a019a..32e6fca8 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -588,39 +588,20 @@ function M:UpdateFamilyRoom(fgCtr, id) --list_gamePlay:SetVirtual() self._view:GetChild('n364').text = string.format("已开启%s桌游戏", self._group.room_num) local playList = self._group.playList - --初始化玩法列表,用于房间使用 - local playGameInfoTable = {} - for i = 1, #playList do - playGameInfoTable[playList[i].id] = { - gameId = playList[i].gameId, - config = playList[i].config, - name = playList[i].name, - gameName = playList[i].game_name, - } - end local roomList = self._group.rooms local roomCtr = ControllerManager.GetController(RoomController) + --先对房间进行一波分类 + local readyRoom = {} + local startRoom = {} + for k, v in pairs(roomList) do + table.insert(v.status == 0 and readyRoom or startRoom, v) + end + local all_num = #playList + #roomList list_room.itemRenderer = function(index, obj) - if index < #roomList then + if index < #readyRoom then local newIndex = index + 1 - local playInfo = playGameInfoTable[roomList[newIndex].pid] - local gameId = playInfo.gameId - local config = ExtendManager.GetExtendConfig(gameId) - local mode = config:GetGameInfo() - local gamePlay = mode:LoadConfigToDetail(playInfo.config, playInfo.hpData) - obj:GetChild('Label_gameRule').title = gamePlay - local roomName = playGameInfoTable[roomList[newIndex].pid].name - roomName = Utils.TextOmit(roomName, 6, "") - obj:GetChild('game_type').emojies = EmojiDitc.EmojiesDitc - obj:GetChild('game_type').text = string.format("(%s)%s", playGameInfoTable[roomList[newIndex].pid].gameName, - roomName, - roomList[newIndex].id) - obj:GetChild('btn_joinGame'):GetController('type').selectedIndex = 1 - obj:GetController('num').selectedIndex = roomList[newIndex].maxPlayers - 2 - -- if self._group.isWatch == 1 then - -- 允许观战 - obj:GetController('type').selectedIndex = self._group.isWatch or 1 - -- end + local playInfo = self._group:getPlay(roomList[newIndex].pid) + local plist = roomList[newIndex].plist local insertName = "" for i = 1, #plist do @@ -682,8 +663,10 @@ function M:UpdateFamilyRoom(fgCtr, id) -- self._gamectr = ControllerManager.GetController(GameController) -- self._gamectr:WitnessGame(DataManager.SelfUser.account_id, id, roomList[newIndex].id) end) + elseif index >= all_num - #startRoom then + else - local newIndex = index - #roomList + 1 + local newIndex = index - #readyRoom + 1 local config = ExtendManager.GetExtendConfig(playList[newIndex].gameId) local mode = config:GetGameInfo() local gamePlay = mode:LoadConfigToDetail(playList[newIndex].config, playList[newIndex].hpData) @@ -730,59 +713,6 @@ function M:UpdateFamilyRoom(fgCtr, id) end) end end - --[[ - list_gamePlay.itemRenderer = function(index, obj) - if index == 0 then - obj:GetController('type').selectedIndex = 0 - obj:GetChild('num').text = string.format("%d/7", #playList) - obj:GetChild('btn_addPlay').onClick:Set(function() - local tem = GroupGameSettingView.new(self.blur_view, id, 0, nil, function(play) - local group = DataManager.groups:get(id) - group:addPlay(play) - -- self:FillView() - self:UpdateFamilyRoom(fgCtr, id) - printlog("刷新玩法===>>>>") - group.update_play = true - end) - tem:Show() - end) - return - end - obj:GetChild('text_title').text = playList[index].game_name - local mode = ExtendManager.GetExtendConfig(playList[index].gameId):GetGameInfo() - local pId = playList[index].id - obj:GetChild('Label_details'):GetChild('title').text = mode:LoadConfigToDetail(playList[index].config) - obj:GetChild('text_playName').text = playList[index].name - obj:GetController('type').selectedIndex = 1 - obj:GetChild('btn_del').onClick:Set(function() - ViewUtil.ShowTwoChooose("是否要删除该玩法", function() - fgCtr:FG_DelPlay(id, playList[index].id, function(res) - if res.ReturnCode ~= 0 then - local msg = Table_Error_code_Map[res.ReturnCode] or {} - msg = msg.note or "操作失败" - ViewUtil.ShowBannerOnScreenCenter(msg) - return - end - - self:UpdateFamilyRoom(fgCtr, id) - end) - end) - end) - obj:GetChild("btn_edit").onClick:Set(function() - local tem = GroupGameSettingView.new(self.blur_view, id, pId, nil, function(play) - local group = DataManager.groups:get(id) - group:addPlay(play) - -- self:FillView() - self:UpdateFamilyRoom(fgCtr, id) - printlog("刷新玩法===>>>>") - group.update_play = true - end) - tem:Show() - end) - end - list_gamePlay.numItems = #playList + 1 - ]] - local all_num = #playList + #roomList -- print("=================================================list_room", list_room, list_room.numItems, all_num) print("游戏中的房间") pt(roomList) @@ -795,6 +725,24 @@ function M:UpdateFamilyRoom(fgCtr, id) end end +function M:FillSameRoomInfo(newIndex, obj, playInfo) + local gameId = playInfo.gameId + local config = ExtendManager.GetExtendConfig(gameId) + local mode = config:GetGameInfo() + local gamePlay = mode:LoadConfigToDetail(playInfo.config, playInfo.hpData) + obj:GetChild('Label_gameRule').title = gamePlay + local roomName = playInfo.name + roomName = Utils.TextOmit(roomName, 6, "") + obj:GetChild('game_type').emojies = EmojiDitc.EmojiesDitc + obj:GetChild('game_type').text = string.format("(%s)%s", playInfo.game_name, roomName, roomList[newIndex].id) + obj:GetChild('btn_joinGame'):GetController('type').selectedIndex = 1 + obj:GetController('num').selectedIndex = roomList[newIndex].maxPlayers - 2 + -- if self._group.isWatch == 1 then + -- 允许观战 + obj:GetController('type').selectedIndex = self._group.isWatch or 1 + -- end +end + function M:ReflashFamilyList() local list_family = self._view:GetChild('list_family') list_family.numItems = #DataManager.groups.groupList diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/PlayerHead_2.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/PlayerHead_2.xml index 4c2b6d1c..3493446f 100644 --- a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/PlayerHead_2.xml +++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/PlayerHead_2.xml @@ -39,7 +39,7 @@ - + diff --git a/wb_unity_pro/Assets/ART/extend/poker/runfast/ui/Extend_Poker_RunFastNew_fui.bytes b/wb_unity_pro/Assets/ART/extend/poker/runfast/ui/Extend_Poker_RunFastNew_fui.bytes index 5c1648a8..ab16416c 100644 Binary files a/wb_unity_pro/Assets/ART/extend/poker/runfast/ui/Extend_Poker_RunFastNew_fui.bytes and b/wb_unity_pro/Assets/ART/extend/poker/runfast/ui/Extend_Poker_RunFastNew_fui.bytes differ