diff --git a/lua_probject/base_project/Game/View/Family/CreatePlayView.lua b/lua_probject/base_project/Game/View/Family/CreatePlayView.lua index f44113b0..ac371b26 100644 --- a/lua_probject/base_project/Game/View/Family/CreatePlayView.lua +++ b/lua_probject/base_project/Game/View/Family/CreatePlayView.lua @@ -99,15 +99,6 @@ function M:CreatePlay() end function M:initePlayInfo() - --------测试 - PlayInfo[1].playListInfo[10] = { - playeId = 10, - playName = "长沙麻将" - } - PlayInfo[1].playListInfo[86] = { - playeId = 86, - playName = "南城麻将" - } local games = DataManager.SelfUser.games for i = 1, #games do if PlayInfo[1].playListInfo[games[i].game_id] then diff --git a/lua_probject/base_project/Game/View/Family/PlayEditView.lua b/lua_probject/base_project/Game/View/Family/PlayEditView.lua index feb0d329..91c6e42f 100644 --- a/lua_probject/base_project/Game/View/Family/PlayEditView.lua +++ b/lua_probject/base_project/Game/View/Family/PlayEditView.lua @@ -5,6 +5,7 @@ function PlayEditView.New() setmetatable(PlayEditView, { __index = BaseWindow }) local inst = setmetatable({}, { __index = PlayEditView }) inst._animation = false + inst._full = true inst._full_offset = false inst._anim_pop = 0 BaseWindow.init(inst, "ui://Family/com_playEdit") @@ -25,7 +26,6 @@ function PlayEditView:Refalsh(groupId) end function PlayEditView:Init() - self.btn_quit = self._view:GetChild("btn_close") self.list_gamePlay = self._view:GetChild('list_gamePlay') @@ -70,22 +70,23 @@ function PlayEditView:Init() ViewUtil.ShowBannerOnScreenCenter(msg) return end - + --self:UpdateFamilyRoom(fgCtr, self.groupId) self:Refalsh(self.groupId) end) end) end) obj:GetChild("btn_edit").onClick:Set(function() - local tem = GroupGameSettingView.new(self.blur_view, self.groupId, pId, nil, function(play) - local group = DataManager.groups:get(self.groupId) - group:addPlay(play) - -- self:FillView() - --self:UpdateFamilyRoom(fgCtr, self.groupId) - self:Refalsh(self.groupId) - printlog("刷新玩法===>>>>") - group.update_play = true - end) + local tem = GroupGameSettingView.new(self.blur_view, self.groupId, pId, playList[index], + function(play) + local group = DataManager.groups:get(self.groupId) + group:addPlay(play) + -- self:FillView() + --self:UpdateFamilyRoom(fgCtr, self.groupId) + self:Refalsh(self.groupId) + printlog("刷新玩法===>>>>") + group.update_play = true + end) tem:Show() end) end diff --git a/lua_probject/base_project/Game/View/Lobby/GameListView.lua b/lua_probject/base_project/Game/View/Lobby/GameListView.lua index 37a7dfad..1cf77464 100644 --- a/lua_probject/base_project/Game/View/Lobby/GameListView.lua +++ b/lua_probject/base_project/Game/View/Lobby/GameListView.lua @@ -4,14 +4,14 @@ local GameListView = {} local M = GameListView -local liantiaoBool = false - -function GameListView.new(view, index, room_config, callback, isHall) +function GameListView.new(view, index, page, room_config, callback, isHall) local self = {} + pt("lingmeng GameListView", view, index, page, room_config, callback, isHall) setmetatable(self, { __index = M }) self._view = view self._modeMap = {} self.selectedIndex = index + self.selectedPage = page self.room_config = room_config self.IsHallGame = isHall or false self._callback = callback @@ -30,15 +30,24 @@ function M:init() end end) - if liantiaoBool then - self.create_panel = self._view:GetChild("create_panel") - self.lst_play = self._view:GetChild("lst_play") - self:__sysinit() - else - self.create_panel = self._view:GetChild("list_playPanel") - self.lst_play = self._view:GetChild("list_playName") - self:__sysinit() + self.tempGame = { {}, {}, {} } + local games = DataManager.SelfUser.games + for k, v in ipairs(games) do + if v.game_id == 201 and self.IsHallGame == true then + + else + table.insert(self.tempGame[v.gameType], v) + end end + + self.create_panel = self._view:GetChild("list_playPanel") + self.lst_play = self._view:GetChild("list_playName") + self._view:GetChild('list_gameName').selectedIndex = self.selectedPage - 1 + self._view:GetChild('list_gameName').onClickItem:Set(function(context) + self.selectedIndex = #self.tempGame[context.sender.selectedIndex + 1] + self:__sysinit(context.sender.selectedIndex + 1) + end) + self:__sysinit(self.selectedPage) end function M:__fill_panel() @@ -51,8 +60,8 @@ function M:__fill_panel() local mode = mode_data.data if mode and not mode._config then mode:FillData() - if self.room_config and self.room_config.game_id == mode.game_data.game_id then - mode:LoadConfigData(self.room_config) + if self.room_config and self.room_config.gameId == mode.game_data.game_id then + mode:LoadConfigData(json.decode(self.room_config.config)) end end --local ctr_play_list = mode._config:GetController("play_list") @@ -71,36 +80,26 @@ function M:__fill_panel() --mode._config:AddRelation(create_panel, RelationType.Size) end -function M:__sysinit() - local games = DataManager.SelfUser.games - - local tempGame = {} - for k, v in ipairs(games) do - if v.game_id == 201 and self.IsHallGame == true then - - else - table.insert(tempGame, v) - end - end - - +function M:__sysinit(typeNum) local create_panel = self.create_panel local lst_game = self.lst_play - for i = 1, #tempGame do - local tem = tempGame[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() + lst_game:RemoveChildren() + create_panel:RemoveChildren() + for i = 1, #self.tempGame[typeNum] do + local tem = self.tempGame[typeNum][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:GetChild('icon1').url, item:GetChild('icon2').url = mode:GetIconUrl() - local mode_data = {} - mode_data.type = 0 - mode_data.data = mode - mode.game_data = tem - self._modeMap[i] = mode_data + local mode_data = {} + mode_data.type = 0 + mode_data.data = mode + mode.game_data = tem + self._modeMap[i] = mode_data end lst_game.selectedIndex = self.selectedIndex - 1 @@ -147,8 +146,12 @@ end function M:GetModeData() local index = self.selectedIndex - local mode_data = self._modeMap[index] - return mode_data + if index == 0 then + return "没选选择游戏" + else + local mode_data = self._modeMap[index] + return mode_data + end end function M:__dispose_mode() diff --git a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView_jaingxi.lua b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView_jaingxi.lua index 15f9a601..ebdd6909 100644 --- a/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView_jaingxi.lua +++ b/lua_probject/base_project/Game/View/NewGroup/MngView/GroupGameSettingView_jaingxi.lua @@ -26,7 +26,8 @@ function GroupGameSettingView.new(blur_view, gid, pid, room_config, callback) self.play = DataManager.groups:get(gid):getPlay(pid) self.table_color = self.play and self.play.deskId or 0 if room_config then - self.room_config = json.decode(room_config) + self.room_config = room_config + self.room_config_config = json.decode(room_config.config) end @@ -51,7 +52,12 @@ function M:init(url) -- return end - local game_data = self.gl_view:GetModeData().data.game_data + local mod_data = self.gl_view:GetModeData() + if type(mod_data) == "string" then + ViewUtil.ErrorTip(nil, mod_data) + return + end + local game_data = mod_data.data.game_data if not game_data then ViewUtil.ErrorTip(nil, "请先下载游戏") return @@ -72,6 +78,7 @@ end -- 显示游戏列表 function M:FillGameData() local index = 1 + local page = 1 -- 显示所有游戏 local games = DataManager.SelfUser.games local lst_game = self._view:GetChild("lst_game") @@ -79,13 +86,19 @@ function M:FillGameData() printlog("jefe all games") pt(games) -- n65.visible = false - for i = 1, #games do - local game = games[i] - if (self.room_config and self.room_config.game_id == game.game_id) or i == 1 then - index = i + if self.room_config then + page = self.room_config.gameType + for k, v in ipairs(games) do + if self.room_config.gameType == v.gameType then + if self.room_config.gameId == v.game_id then + break + else + index = index + 1 + end + end end end - self.gl_view = GameListView.new(lst_game, index, self.room_config) + self.gl_view = GameListView.new(lst_game, index, page, self.room_config) local btn_close = lst_game:GetChild("btn_close") btn_close.onClick:Set(function() self:Destroy() diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua index d782b2c5..7f8e1fea 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua @@ -90,7 +90,7 @@ end local _icon_url = "ui://Info_MJ_FuZhou/icon" function M:GetIconUrl() - return _icon_url + return "ui://Lobby/fuzhoumajiang2", "ui://Lobby/fuzhoumajiang1" end local _icon_url1 = "ui://Info_MJ_FuZhou/icon1" diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua index 497e70ea..163bfe13 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua @@ -90,7 +90,7 @@ end local _icon_url = "ui://Info_MJ_JinXi/icon" function M:GetIconUrl() - return _icon_url + return "ui://Lobby/jinximajiang2", "ui://Lobby/jinximajiang1" end local _icon_url1 = "ui://Info_MJ_JinXi/icon1" diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua index ed2168ce..35396d86 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua @@ -85,7 +85,7 @@ end local _icon_url = "ui://Info_MJ_LiChuan/icon" function M:GetIconUrl() - return _icon_url + return "ui://Lobby/liquanmajiang2", "ui://Lobby/liquanmajiang1" end local _icon_url1 = "ui://Info_MJ_LiChuan/icon1" @@ -141,35 +141,14 @@ function M:SelectedConfigData() end function M:LoadConfigData(data) - --printlog("加载房间配置=========>>>") - --pt(data) + printlog("加载房间配置=========>>>") + pt(data) local _config = self._config _config:GetController("round").selectedIndex = data.opt - 1 - _config:GetController("play_list").selectedIndex = data.maxPlayers - 2 + _config:GetController("peopleNum").selectedIndex = data.maxPlayers - 2 - - _config:GetController("fengding").selectedIndex = data.fengding - - _config:GetController("wanfa").selectedIndex = data.wanfa - _config:GetChild("btn_qidui").selected = data.qiduijiafan - _config:GetChild("btn_shoudailong").selected = data.shoudailongjiafan - _config:GetChild("btn_loudilong").selected = data.loudilongjiafan - _config:GetChild("btn_bunengchi").selected = data.bunengchi - - _config:GetChild("btn_doudizhu").selected = data.doudizhu - _config:GetChild("btn_doudizhufanbei").selected = data.doudizhufanbei - - if _config:GetChild("xipai") then - _config:GetChild("xipai").selected = data.xi_pai - end - - if oldGameVersion == 2 then - self.xipaiValueText.text = data.xi_pai_score / 1000 - self.xipaiValue = data.xi_pai_score / 1000 - - self.anchouValueText.text = data.an_chou_score / 1000 - self.anchouValue = data.an_chou_score / 1000 - end + _config:GetController("ZiMo").selectedIndex = data.zimo + _config:GetController("jingbibo").selectedIndex = 1 - data.jingbibo end function M:LoadConfigToDetail(data) diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua index af66d9a5..bb29558b 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua @@ -355,7 +355,7 @@ function M:EventInit() local index = self:GetPos(win_seat) local info = self._player_card_info[index] self:RemoveCursor() - info:UpdateHandCard(false, true) + info:UpdateHandCard(false, false) local obj_win_card = UIPackage.CreateObjectFromURL("ui://Main_Majiang/Btn_Card_jiangxi") obj_win_card.icon = "ui://Main_Majiang/202_" .. win_card diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua index d13154c1..cf2f8599 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua @@ -89,7 +89,7 @@ end local _icon_url = "ui://Info_MJ_NanCheng/icon" function M:GetIconUrl() - return _icon_url + return "ui://Lobby/nanchengmajiang2", "ui://Lobby/nanchengmajiang1" end local _icon_url1 = "ui://Info_MJ_NanCheng/icon1" diff --git a/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua b/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua index 742a666f..669d81a9 100644 --- a/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua @@ -53,7 +53,7 @@ end local _icon_url = "ui://Info_Poker_RunFastNew/icon" function M:GetIconUrl() - return _icon_url + return "ui://Lobby/paodekuai2", "ui://Lobby/paodekuai1" end local _icon_url1 = "ui://Info_Poker_RunFastNew/icon1" @@ -68,7 +68,7 @@ end function M:LoadConfigData(data) local _config = self._config - _config:GetController("round").selectedIndex = data.opt - 1 + _config:GetController("rule").selectedIndex = data.rule == 2 and 0 or 1 _config:GetController("play_list").selectedIndex = data.leaf - 1 _config:GetController("willBeOut").selectedIndex = data.willBeOut - 1 @@ -81,6 +81,17 @@ function M:LoadConfigData(data) _config:GetController("demolition").selectedIndex = data.demolition _config:GetController("fangzuobi").selectedIndex = data.fangzuobi + _config:GetController("round").selectedIndex = data.opt - 1 + _config:GetController("handcard").selectedIndex = 2 - data.leaf + _config:GetController("peopleNum").selectedIndex = 3 - data.maxPlayers + local showCardNum = _config:GetController("showCardNum").selectedIndex + local wanfa1_1 = _config:GetController("wanfa1_1").selectedIndex + local wanfa1_2 = _config:GetController("wanfa1_2").selectedIndex + local wanfa1_3 = _config:GetController("wanfa1_3").selectedIndex + local wanfa1_4 = _config:GetController("wanfa1_4").selectedIndex + local wanfa1_5 = _config:GetController("wanfa1_5").selectedIndex + local wanfa2_1 = _config:GetController("wanfa2_1").selectedIndex + local sandaidan = data.sandaidan if sandaidan ~= nil and sandaidan == 1 then _config:GetChild("sandaidan").selected = true diff --git a/lua_probject/extend_project/extend/poker/runfast/ExtendConfig.lua b/lua_probject/extend_project/extend/poker/runfast/ExtendConfig.lua index a318fd67..888945bb 100644 --- a/lua_probject/extend_project/extend/poker/runfast/ExtendConfig.lua +++ b/lua_probject/extend_project/extend/poker/runfast/ExtendConfig.lua @@ -64,8 +64,7 @@ function M:GetGameRule() end function M:GetIconUrl() - return "ui://Extend_Poker_RunFastNew/icon" - -- + return "ui://Lobby/paodekuai2", "ui://Lobby/paodekuai1" end function M:FillRoomConfig(room, _config) diff --git a/wb_new_ui/assets/Family/Record/com_Record.xml b/wb_new_ui/assets/Family/Record/com_Record.xml index 6ec09f67..59a87319 100644 --- a/wb_new_ui/assets/Family/Record/com_Record.xml +++ b/wb_new_ui/assets/Family/Record/com_Record.xml @@ -36,26 +36,33 @@ - + + - + + - + + - + + - + + - + + - + + diff --git a/wb_new_ui/assets/Info_MJ_FuZhou/Label_Detail_83.xml b/wb_new_ui/assets/Info_MJ_FuZhou/Label_Detail_83.xml index 57290ac4..f5741322 100644 --- a/wb_new_ui/assets/Info_MJ_FuZhou/Label_Detail_83.xml +++ b/wb_new_ui/assets/Info_MJ_FuZhou/Label_Detail_83.xml @@ -18,10 +18,10 @@ - +