From 0fe9c27acb502b988cc3705244705fb0a29f1b82 Mon Sep 17 00:00:00 2001 From: "DESKTOP-7R8JEQQ\\k" <1076390229@qq.com> Date: Mon, 30 Jun 2025 17:48:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AD=97=E4=BD=93=E3=80=81?= =?UTF-8?q?=E8=A7=A3=E6=94=BE=E6=88=BF=E9=97=B4=E4=BF=AE=E5=A4=8D=E3=80=81?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Game/Controller/GroupMgrController.lua | 9 ++ .../Game/Controller/NewGroupController.lua | 4 +- lua_probject/base_project/Game/Protocol.lua | 10 ++- .../Game/View/Family/FamilyMyFamily.lua | 77 +++++++++++------- .../base_project/Game/View/FamilyView.lua | 6 +- lua_probject/base_project/Main.lua | 1 + .../extend/majiang/lichuan/EXMainView.lua | 5 +- wb_new_ui/assets/Family/Main.xml | 48 +++++------ .../Family/Main/Component/btn_joinGame.xml | 5 +- .../Family/Main/Component/btn_watch.xml | 5 +- .../Family/Main/Component/c_otherChild.xml | 2 +- .../Family/Main/Component/c_roomChild.xml | 32 +++++--- wb_new_ui/assets/Family/Main/Image/look.png | Bin 0 -> 10894 bytes .../MyFamily/Component/btn_confirmNotice.xml | 8 +- .../MyFamily/Component/btn_quitNotice.xml | 8 +- .../assets/Family/MyFamily/com_myFamily.xml | 2 +- wb_new_ui/assets/Family/package.xml | 1 + .../ART/base/Family/ui/Family_atlas0.png | Bin 3469707 -> 3463956 bytes .../ART/base/Family/ui/Family_fui.bytes | Bin 106333 -> 106520 bytes .../base/static/fonts/方正粗圆_GBK.ttf | Bin 0 -> 9720284 bytes .../static/fonts/方正粗圆_GBK.ttf.meta | 23 ++++++ 21 files changed, 164 insertions(+), 82 deletions(-) create mode 100644 wb_new_ui/assets/Family/Main/Image/look.png create mode 100644 wb_unity_pro/Assets/ART/base/static/fonts/方正粗圆_GBK.ttf create mode 100644 wb_unity_pro/Assets/ART/base/static/fonts/方正粗圆_GBK.ttf.meta diff --git a/lua_probject/base_project/Game/Controller/GroupMgrController.lua b/lua_probject/base_project/Game/Controller/GroupMgrController.lua index cef03abd..95f862df 100644 --- a/lua_probject/base_project/Game/Controller/GroupMgrController.lua +++ b/lua_probject/base_project/Game/Controller/GroupMgrController.lua @@ -290,6 +290,15 @@ function M:FG_GetOnlinePlayers(callback) end) end +--设置允许成员可以查看聊天室 +function M:FG_OPEN_ISOPEN_CHATROOM(callback) + self._mgr_client:send(Protocol.WEB_FG_OPEN_ISOPEN_CHATROOM, nil, function(res) + print("允许成员可以查看聊天室") + pt(res) + callback(res) + end) +end + -- 邀请在线玩家 function M:FG_InvitePlayer(group_id, tag, player_id, roomid, pid, game_name, callback) local _data = {} diff --git a/lua_probject/base_project/Game/Controller/NewGroupController.lua b/lua_probject/base_project/Game/Controller/NewGroupController.lua index b7b2b99a..f3c03571 100644 --- a/lua_probject/base_project/Game/Controller/NewGroupController.lua +++ b/lua_probject/base_project/Game/Controller/NewGroupController.lua @@ -147,6 +147,8 @@ function M:FG_UpdateGroupInfo(id, name, notice, ban, dissolve_opt, kick_opt, app data.ban_chat2 = ban_chat2 data.option = option data.show_num = showNum + print("FG_UpdateGroupInfo") + pt(data) _client:send(Protocol.WEB_FG_UPDATE_GROUP_INFO, data, function(res) callback(res) end) @@ -1600,7 +1602,7 @@ function M:SetIsOpenChatRoom(groupId, value, callback) local _data = {} _data.id = groupId _data.isOpenChatRoom = value - _client:send(Protocol.WEB_FG_SET_ISOPEN_CHATROOM, _data, function(res) + _client:send(Protocol.WEB_FG_OPEN_ISOPEN_CHATROOM, _data, function(res) callback(res) end) end diff --git a/lua_probject/base_project/Game/Protocol.lua b/lua_probject/base_project/Game/Protocol.lua index ab0d4d09..5969647a 100644 --- a/lua_probject/base_project/Game/Protocol.lua +++ b/lua_probject/base_project/Game/Protocol.lua @@ -274,10 +274,6 @@ Protocol = { -- 亲友圈聊天室 WEB_FG_GETCHATROOM = "group/get_chat_rooms", - -- 设置是否允许成员查看聊天室 - WEB_FG_SET_ISOPEN_CHATROOM = "group/set_open_chatroom", - -- 设置是否允许观战 - WEB_FG_SET_CANWATCH = "group/set_group_guest", -------------- group-log--------------------- -- 获取奖励日志 @@ -385,6 +381,12 @@ Protocol = { FGMGR_EVT_INVITED = "12010", -- 未读邮件提示事件 FGMGR_EVT_NEW_MAIL = "update_mail_tip", + -- 设置允许成员查看聊天室 + WEB_FG_OPEN_ISOPEN_CHATROOM = "13001", + -- 设置不允许成员查看聊天室 + WEB_FG_CLOSE_ISOPEN_CHATROOM = "13002", + -- 设置是否允许观战 + WEB_FG_SET_CANWATCH = "set_group_guest", --end::::::::::::::牌友圈协议:::::::::::::::::::: diff --git a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua index 00072363..24f68a9c 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua @@ -16,26 +16,36 @@ local function ShowMainView() root.familyType.selectedIndex = rootLastIndex or 1 end -local function ChangeNotice(self) +local function ChangeFamilyConfig(data, self) local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:FG_UpdateGroupInfo( - self.family.id, - self.family.name, - self.input_notice.text, - not self.family.ban, - self.family.dissolve_opt, - self.family.kick_opt, - self.family.apply, - self.family.ban_chat1, - self.family.ban_chat2, - self.family.option, + data.id or self.family.id, + data.name or self.family.name, + data.notice or self.family.text, + data.ban or not self.family.ban, + data.dissolve_opt or self.family.dissolve_opt, + data.kick_opt or self.family.kick_opt, + data.apply or self.family.apply, + data.ban_chat1 or self.family.ban_chat1, + data.ban_chat2 or self.family.ban_chat2, + data.option or self.family.option, 0, function(res) if res.ReturnCode ~= 0 then - ViewUtil.ErrorTip(res.ReturnCode, "更改公告失败,请稍后再试") + ViewUtil.ErrorTip(res.ReturnCode, "更改失败,请稍后再试") else ViewUtil.ErrorTip(res.ReturnCode, "修改成功!") - self.family.notice = self.input_notice.text + self.family.id = data.id or self.family.id + self.family.name = data.name or self.family.name + self.family.text = data.notice or self.family.text + self.family.ban = data.ban or not self.family.ban + self.family.dissolve_opt = data.dissolve_opt or self.family.dissolve_opt + self.family.kick_opt = data.kick_opt or self.family.kick_opt + self.family.apply = data.apply or self.family.apply + self.family.ban_chat1 = data.ban_chat1 or self.family.ban_chat1 + self.family.ban_chat2 = data.ban_chat2 or self.family.ban_chat2 + self.family.option = data.option or self.family.option + self:Refalsh() self.cWindow.selectedIndex = 0 end @@ -54,7 +64,6 @@ function FamilyMyFamily:TryShow(groupId, r) end function FamilyMyFamily:Show() - self:Refalsh() HideMainView() @@ -67,7 +76,6 @@ function FamilyMyFamily:Close() end function FamilyMyFamily:Refalsh() - self.family = DataManager.groups.groupMap[self.groupId] self.tex_fName.text = self.family.name @@ -77,7 +85,7 @@ function FamilyMyFamily:Refalsh() self.tex_nocice.text = self.family.notice ImageLoad.Load(self.family.o_portrait, self.loader_icon) - self.cStyle.selectedIndex = self.family.lev -1 + self.cStyle.selectedIndex = self.family.lev - 1 -- index = 0 是显示隐藏按钮 self.showNumber = self.family.isShow @@ -121,6 +129,7 @@ function FamilyMyFamily:Init() self.btn_applyMsg = self._view:GetChild("btn_applyMsg") self.btn_buyCrad = self._view:GetChild("btn_buyCrad") self.btn_checkNumber = self._view:GetChild("btn_checkNumber") + self.btn_editName = self._view:GetChild("btn_editName") self.btn_editNotice = self._view:GetChild("btn_editNotice") self.btn_quitNotice = self._view:GetChild("btn_quitNotice") self.btn_bgNotice = self._view:GetChild("btn_bgNotice") @@ -128,7 +137,7 @@ function FamilyMyFamily:Init() self.btn_hideNumber = self._view:GetChild("btn_hideNumber") self.btn_showNumber = self._view:GetChild("btn_showNumber") - self.input_notice = self._view:GetChild("input_notice") + self.input_text = self._view:GetChild("input_text") self.cStyle = self._view:GetController("cStyle") self.cWindow = self._view:GetController("cWindow") @@ -168,9 +177,9 @@ function FamilyMyFamily:Init() self.btn_quitFamily.onClick:Set(function() local fgCtr = ControllerManager.GetController(NewGroupController) - print("发送了退出协议 familyid = ",self.family.id) + print("发送了退出协议 familyid = ", self.family.id) fgCtr:FG_ExitGroup(self.family.id, function(res) - if res.ReturnCode ~= 0 then + if res.ReturnCode ~= 0 then return end self:Close() @@ -188,14 +197,22 @@ function FamilyMyFamily:Init() end) self.btn_editNotice.onClick:Set(function() + self.changeCallback = function() ChangeFamilyConfig({ notice = self.input_text.text }, self) end self.cWindow.selectedIndex = 1 end) - self.btn_confirmNotice.onClick:Set(ChangeNotice) + self.btn_editName.onClick:Set(function() + self.changeCallback = function() ChangeFamilyConfig({ name = self.input_text.text }, self) end + self.cWindow.selectedIndex = 1 + end) + + self.btn_confirmNotice.onClick:Set(function() + self.changeCallback() + self.cWindow.selectedIndex = 0 + end) self.btn_hideNumber.onClick:Set(function() - - if self.isShowContenting == true then + if self.isShowContenting == true then ViewUtil.ShowBannerOnScreenCenter("设置中,请稍后再试。。") return end @@ -203,12 +220,12 @@ function FamilyMyFamily:Init() print("点击了") local fgCtr = ControllerManager.GetController(NewGroupController) - self.isShowContenting = true - fgCtr:FG_SetGroupShow(0, self.family.id, function (res) + self.isShowContenting = true + fgCtr:FG_SetGroupShow(0, self.family.id, function(res) print("收到协议M:FG_SetGroupShow") pt(res) self.isShowContenting = false - if res.ReturnCode ~= 0 then + if res.ReturnCode ~= 0 then ViewUtil.ShowBannerOnScreenCenter("设置失败,请稍后再试。。") return end @@ -219,7 +236,7 @@ function FamilyMyFamily:Init() end) self.btn_showNumber.onClick:Set(function() - if self.isShowContenting == true then + if self.isShowContenting == true then ViewUtil.ShowBannerOnScreenCenter("设置中,请稍后再试。。") return end @@ -227,12 +244,12 @@ function FamilyMyFamily:Init() print("点击了") local fgCtr = ControllerManager.GetController(NewGroupController) - self.isShowContenting = true - fgCtr:FG_SetGroupShow(1, self.family.id, function (res) + self.isShowContenting = true + fgCtr:FG_SetGroupShow(1, self.family.id, function(res) print("收到协议M:FG_SetGroupShow") pt(res) self.isShowContenting = false - if res.ReturnCode ~= 0 then + if res.ReturnCode ~= 0 then ViewUtil.ShowBannerOnScreenCenter("设置失败,请稍后再试。。") return end @@ -245,4 +262,4 @@ function FamilyMyFamily:Init() return self end -return FamilyMyFamily \ No newline at end of file +return FamilyMyFamily diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index ccb56570..d3e8231c 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -144,6 +144,10 @@ function M:SetIsOpenChatRoom() value = 1 end + local mgr_ctr = ControllerManager.GetController(GroupMgrController) + mgr_ctr:FG_OPEN_ISOPEN_CHATROOM() + + --[[ local fgCtr = ControllerManager.GetController(NewGroupController) fgCtr:SetIsOpenChatRoom(self._group.id, value, function(res) print("设置开启聊天室协议") @@ -154,7 +158,7 @@ function M:SetIsOpenChatRoom() end self._group.isOpenChatRoom = value self:RefalshMoreBtn() - end) + end)]] end function M:SetCanWatch() diff --git a/lua_probject/base_project/Main.lua b/lua_probject/base_project/Main.lua index 9d51de01..25f511ba 100644 --- a/lua_probject/base_project/Main.lua +++ b/lua_probject/base_project/Main.lua @@ -58,6 +58,7 @@ function Main() FairyGUI.UIConfig.defaultFont = "FZDaBiaoSong-B06S" FairyGUI.FontManager.RegisterFont(FairyGUI.DynamicFont.New("SIYUAN", "base/static/fonts/SIYUAN.TTF"), null) FairyGUI.FontManager.RegisterFont(FairyGUI.DynamicFont.New("方正胖娃_GBK", "base/static/fonts/方正胖娃_GBK.TTF"), null) + FairyGUI.FontManager.RegisterFont(FairyGUI.DynamicFont.New("方正粗圆_GBK", "base/static/fonts/方正粗圆_GBK.TTF"), null) --FairyGUI.FontManager.RegisterFont(FairyGUI.DynamicFont.New("FZCuYuan-M03","base/static/fonts/FZCuYuan-M03.TTF"),null) --FairyGUI.FontManager.RegisterFont(FairyGUI.DynamicFont.New("HYFangLiJ","base/static/fonts/HYFangLiJ.ttf"),null) _game_info = json.decode(GameApplication.Instance.GameInfo) diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua index e5d4dbf2..af66d9a5 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua @@ -103,6 +103,9 @@ function M:InitView(url) if self._state.selectedIndex > 0 and self._state.selectedIndex < 3 then ViewUtil.ErrorTip(nil, '房间已开始,无法退出游戏。') else + local _gamectr = ControllerManager.GetController(GameController) + _gamectr:AskDismissRoom() + --[[ ViewUtil.ShowModalWait(self._root_view) self._gamectr:LevelRoom( function(res) @@ -113,7 +116,7 @@ function M:InitView(url) ViewUtil.ErrorTip(res.ReturnCode) end end - ) + )]] end end ) diff --git a/wb_new_ui/assets/Family/Main.xml b/wb_new_ui/assets/Family/Main.xml index a527487d..0f3cb564 100644 --- a/wb_new_ui/assets/Family/Main.xml +++ b/wb_new_ui/assets/Family/Main.xml @@ -9,7 +9,7 @@ - + @@ -23,13 +23,13 @@ - + - - + + @@ -39,28 +39,28 @@ - + - + - + - + - - - + + + - + - - + + @@ -85,7 +85,7 @@ - + @@ -93,14 +93,14 @@ - + - + @@ -110,12 +110,14 @@ - + + + - + @@ -185,10 +187,10 @@ - - - - + + + + diff --git a/wb_new_ui/assets/Family/Main/Component/btn_joinGame.xml b/wb_new_ui/assets/Family/Main/Component/btn_joinGame.xml index 4667878d..abdc7b51 100644 --- a/wb_new_ui/assets/Family/Main/Component/btn_joinGame.xml +++ b/wb_new_ui/assets/Family/Main/Component/btn_joinGame.xml @@ -1,16 +1,19 @@ - + + + +