diff --git a/.gitignore b/.gitignore index bd813321..5932a6e5 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ !wb_new_ui/** !.gitignore lua_probject/.emmyrc.json +lua_probject/base_project/Game/View/Common/FguiEmojiDict.lua diff --git a/lua_probject/base_project/Game/Controller/GroupMgrController.lua b/lua_probject/base_project/Game/Controller/GroupMgrController.lua index 95f862df..f32e2f58 100644 --- a/lua_probject/base_project/Game/Controller/GroupMgrController.lua +++ b/lua_probject/base_project/Game/Controller/GroupMgrController.lua @@ -291,10 +291,21 @@ function M:FG_GetOnlinePlayers(callback) end --设置允许成员可以查看聊天室 -function M:FG_OPEN_ISOPEN_CHATROOM(callback) - self._mgr_client:send(Protocol.WEB_FG_OPEN_ISOPEN_CHATROOM, nil, function(res) - print("允许成员可以查看聊天室") - pt(res) +function M:FG_OPEN_ISOPEN_CHATROOM(groupId, callback) + local _data = {} + _data.groupId = groupId + _data.uid = DataManager.SelfUser.account_id + self._mgr_client:send(Protocol.WEB_FG_OPEN_ISOPEN_CHATROOM, _data, function(res) + callback(res) + end) +end + +-- +function M:FG_CLOSE_ISOPEN_CHATROOM(groupId, callback) + local _data = {} + _data.groupId = groupId + _data.uid = DataManager.SelfUser.account_id + self._mgr_client:send(Protocol.WEB_FG_CLOSE_ISOPEN_CHATROOM, _data, function(res) callback(res) end) end diff --git a/lua_probject/base_project/Game/Controller/NewGroupController.lua b/lua_probject/base_project/Game/Controller/NewGroupController.lua index f3c03571..245ccedf 100644 --- a/lua_probject/base_project/Game/Controller/NewGroupController.lua +++ b/lua_probject/base_project/Game/Controller/NewGroupController.lua @@ -44,6 +44,7 @@ function M:FG_GroupList(callback) group.isShow = tem.isShow group.isOpenChatRoom = tem.isOpenChatRoom group.isWatch = tem.isWatch + group.wechatId = tem.wechatId l_groups:add(group) end end @@ -132,7 +133,7 @@ function M:FG_TopGroup(group_id, top, callback) end) end -function M:FG_UpdateGroupInfo(id, name, notice, ban, dissolve_opt, kick_opt, apply, ban_chat1, ban_chat2, option, showNum, +function M:FG_UpdateGroupInfo(id, name, notice, ban, dissolve_opt, kick_opt, apply, ban_chat1, ban_chat2, option, showNum, wechatId, callback) local _client = ControllerManager.GroupClient local data = {} @@ -147,6 +148,7 @@ 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 + data.wechatId = wechatId print("FG_UpdateGroupInfo") pt(data) _client:send(Protocol.WEB_FG_UPDATE_GROUP_INFO, data, function(res) @@ -1596,6 +1598,7 @@ function M:GetChatRoom(groupId, callback) end --禁止&允许成员查看聊天室 +--[[ function M:SetIsOpenChatRoom(groupId, value, callback) print("能否查看聊天室 groupId = ", groupId) local _client = ControllerManager.GroupClient @@ -1606,6 +1609,7 @@ function M:SetIsOpenChatRoom(groupId, value, callback) callback(res) end) end +]] -- 设置是否允许观战 function M:SetCanWatch(groupId, value, callback) diff --git a/lua_probject/base_project/Game/View/Family/FamilyInviteFamilyView.lua b/lua_probject/base_project/Game/View/Family/FamilyInviteFamilyView.lua index b335f1b4..0590fc6c 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyInviteFamilyView.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyInviteFamilyView.lua @@ -9,6 +9,7 @@ function FamilyInviteFamilyView.new() local self = setmetatable({}, { __index = M }) self.class = 'FamilyInviteFamilyView' self._close_destroy = true + self._new_hide = false self:init('ui://Family/InviteFamily') return self end diff --git a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua index 24f68a9c..afa0f226 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua @@ -1,5 +1,7 @@ +--local SuoHa_PlayerSelfPokerInfoView = require("extend_project.extend.poker.suoha.SuoHa_PlayerSelfPokerInfoView") local FamilyRoomCardRecord = import(".FamilyRoomCardRecord") local RoomCardRecord = import(".RoomCardRecord") +local FamilyInviteFamilyView = import('.FamilyInviteFamilyView') --region LOCAL @@ -29,7 +31,8 @@ local function ChangeFamilyConfig(data, self) data.ban_chat1 or self.family.ban_chat1, data.ban_chat2 or self.family.ban_chat2, data.option or self.family.option, - 0, + data.show_num or self.family.show_num, + data.wechatId or self.family.wechatId, function(res) if res.ReturnCode ~= 0 then ViewUtil.ErrorTip(res.ReturnCode, "更改失败,请稍后再试") @@ -45,7 +48,8 @@ local function ChangeFamilyConfig(data, self) 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.family.show_num = data.show_num + self.family.wechatId = data.wechatId self:Refalsh() self.cWindow.selectedIndex = 0 end @@ -63,16 +67,32 @@ function FamilyMyFamily:TryShow(groupId, r) self:Show() end +function FamilyMyFamily.New(groupId) + setmetatable(FamilyMyFamily, { __index = BaseWindow }) + local inst = setmetatable({}, { __index = FamilyMyFamily }) + inst._close_destroy = true + inst._full = true + inst._animation = false + inst._full_offset = false + inst._anim_pop = 0 + BaseWindow.init(inst, 'ui://Family/com_myFamily') + -- 隐藏背景图 + inst._root_view:GetChild("win_mode").visible = false + inst:Init() + inst.groupId = groupId + return inst +end + function FamilyMyFamily:Show() self:Refalsh() - HideMainView() + --HideMainView() BaseWindow.Show(self) end function FamilyMyFamily:Close() BaseWindow.Close(self) - ShowMainView() + --ShowMainView() end function FamilyMyFamily:Refalsh() @@ -83,6 +103,7 @@ function FamilyMyFamily:Refalsh() self.tex_fNumber.text = self.family.member_num self.tex_cradNum.text = self.family.diamo self.tex_nocice.text = self.family.notice + self.tex_wxId.text = self.family.wechatId ImageLoad.Load(self.family.o_portrait, self.loader_icon) self.cStyle.selectedIndex = self.family.lev - 1 @@ -98,17 +119,6 @@ function FamilyMyFamily:Refalsh() end function FamilyMyFamily:Init() - setmetatable(FamilyMyFamily, { __index = BaseWindow }) - - self._close_destroy = true - self._full = true - self._animation = false - self._full_offset = false - self._anim_pop = 0 - BaseWindow.init(self, 'ui://Family/com_myFamily') - -- 隐藏背景图 - self._root_view:GetChild("win_mode").visible = false - self._view:GetChild("btn_close").onClick:Set(function() self:Close() end) @@ -136,6 +146,7 @@ function FamilyMyFamily:Init() self.btn_confirmNotice = self._view:GetChild("btn_confirmNotice") self.btn_hideNumber = self._view:GetChild("btn_hideNumber") self.btn_showNumber = self._view:GetChild("btn_showNumber") + self.btn_editWx = self._view:GetChild("btn_editWx") self.input_text = self._view:GetChild("input_text") @@ -143,36 +154,73 @@ function FamilyMyFamily:Init() self.cWindow = self._view:GetController("cWindow") self.cDisplayNumber = self._view:GetController("cDisplayNumber") + --pt(FairyGUI) + --pt(System) + --self.input_text.emojies = FguiEmojiDict.EmojiesDict + self.btn_playSet.onClick:Set(function() - self:Close() - root:PlayEdit() + --self:Close() + --BaseWindow.DestroyAll() + local curView = ViewManager.GetCurrenView() + if curView.class == "FamilyMainView" then + curView:PlayEdit() + else + local view = ViewManager.ChangeView(ViewManager.View_Family, function() + view:PlayEdit() + end) + end end) self.btn_invite.onClick:Set(function() - self:Close() - root:ShareWx() + local familyInviteFamilyView = FamilyInviteFamilyView.new() + familyInviteFamilyView:Show() end) self.btn_buyCrad.onClick:Set(function() - self:Close() - root:ShowShop() + --BaseWindow.DestroyAll() + local curView = ViewManager.GetCurrenView() + if curView.class == "FamilyMainView" then + curView:ShowShop() + else + local view = ViewManager.ChangeView(ViewManager.View_Family, function() + view:ShowShop() + end) + end end) self.btn_czRecord.onClick:Set(function() - --local view = FamilyRoomCardRecord.New() - --view:Show() local view = RoomCardRecord.New() view:Show() end) self.btn_checkNumber.onClick:Set(function() - self:Close() - root:OpenAllNumber(self.family) + --self:Close() + --root:OpenAllNumber(self.family) + + --BaseWindow.DestroyAll() + local curView = ViewManager.GetCurrenView() + if curView.class == "FamilyMainView" then + curView:OpenAllNumber(self.family) + else + local view = ViewManager.ChangeView(ViewManager.View_Family, function() + view:OpenAllNumber(self.family) + end) + end end) self.btn_applyMsg.onClick:Set(function() - self:Close() - root:AuditNumber() + --self:Close() + --root:AuditNumber() + + --BaseWindow.DestroyAll() + local curView = ViewManager.GetCurrenView() + if curView.class == "FamilyMainView" then + curView:AuditNumber() + else + local view = ViewManager.ChangeView(ViewManager.View_Family, function() + view:AuditNumber() + end) + end end) self.btn_quitFamily.onClick:Set(function() @@ -206,6 +254,11 @@ function FamilyMyFamily:Init() self.cWindow.selectedIndex = 1 end) + self.btn_editWx.onClick:Set(function() + self.changeCallback = function() ChangeFamilyConfig({ wechatId = self.input_text.text }, self) end + self.cWindow.selectedIndex = 1 + end) + self.btn_confirmNotice.onClick:Set(function() self.changeCallback() self.cWindow.selectedIndex = 0 @@ -217,8 +270,6 @@ function FamilyMyFamily:Init() return end - print("点击了") - local fgCtr = ControllerManager.GetController(NewGroupController) self.isShowContenting = true fgCtr:FG_SetGroupShow(0, self.family.id, function(res) diff --git a/lua_probject/base_project/Game/View/Family/FamilyMyfamilyList.lua b/lua_probject/base_project/Game/View/Family/FamilyMyfamilyList.lua index 54232cfe..10ad6ec8 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyMyfamilyList.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyMyfamilyList.lua @@ -76,8 +76,10 @@ function FamilyMyfamilyList:Init() ImageLoad.Load(group.o_portrait, loader_icon) btn_familyManage.onClick:Set(function() - self:Close() - self.FamilyView:OpenMyFamily(group.id) + --self:Close() + --self.FamilyView:OpenMyFamily(group.id) + local view = FamilyMyFamily.New(group.id) + view:Show() end) btn_record.onClick:Set(function() diff --git a/lua_probject/base_project/Game/View/Family/FamilyNumberDetail.lua b/lua_probject/base_project/Game/View/Family/FamilyNumberDetail.lua index d394ba40..92944515 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyNumberDetail.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyNumberDetail.lua @@ -109,6 +109,9 @@ function M:init(url, lev, res) flag_assistant == 1 and "助理身份" or "设置为助理"), function() fgCtr:FG_SetManager(self.groupId, info.uid, flag_assistant + 1, function(res) if res.ReturnCode == 0 then + local g = DataManager.groups.groupMap[self.groupId] + local player = g.memberMap[info.uid] + flag_assistant = 1 - flag_assistant self._view:GetChild('btn_assistant'):GetController('isAssistant').selectedIndex = flag_assistant else diff --git a/lua_probject/base_project/Game/View/Family/PlayEditView.lua b/lua_probject/base_project/Game/View/Family/PlayEditView.lua new file mode 100644 index 00000000..feb0d329 --- /dev/null +++ b/lua_probject/base_project/Game/View/Family/PlayEditView.lua @@ -0,0 +1,94 @@ +local PlayEditView = {} +local GroupGameSettingView = import("..NewGroup.MngView.GroupGameSettingView_jaingxi") + +function PlayEditView.New() + setmetatable(PlayEditView, { __index = BaseWindow }) + local inst = setmetatable({}, { __index = PlayEditView }) + inst._animation = false + inst._full_offset = false + inst._anim_pop = 0 + BaseWindow.init(inst, "ui://Family/com_playEdit") + inst:Init() + return inst +end + +function PlayEditView:Show(groupId) + self:Refalsh(groupId) + BaseWindow.Show(self) +end + +function PlayEditView:Refalsh(groupId) + self.groupId = groupId + self.group = DataManager.groups:get(self.groupId) + local playList = self.group.playList + self.list_gamePlay.numItems = #playList + 1 +end + +function PlayEditView:Init() + + self.btn_quit = self._view:GetChild("btn_close") + + self.list_gamePlay = self._view:GetChild('list_gamePlay') + + self.btn_quit.onClick:Set(function() + self:Close() + end) + + self.list_gamePlay:SetVirtual() + self.list_gamePlay.itemRenderer = function(index, obj) + local playList = self.group.playList + 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, self.groupId, 0, 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) + 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() + local fgCtr = ControllerManager.GetController(NewGroupController) + fgCtr:FG_DelPlay(self.groupId, 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, 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) + tem:Show() + end) + end +end + +return PlayEditView diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index d3e8231c..79c5b8b3 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -17,6 +17,7 @@ local FamilyRoomCard = import(".Family.FamilyRoomCard") local FamilyMyfamilyList = import(".Family.FamilyMyfamilyList") local FamilyChatRoom = import(".Family.FamilyChatRoom") local FamilyMsgRecord = import(".Family.FamilyMsgRecord") +local PlayEditView = import(".Family.PlayEditView") --- FamilyView = {} @@ -63,6 +64,7 @@ function M:init(url) self:ConnetFamily(1, groups, true) else self:JoinFamily(true) + self.btn_chatRoom.visible = false end end) -------绑定成员战绩按钮 @@ -137,28 +139,31 @@ function M:MsgView() end function M:SetIsOpenChatRoom() - local value = 1 - if self._group.isOpenChatRoom == 1 then - value = 0 - elseif self._group.isOpenChatRoom == 0 then - 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("设置开启聊天室协议") - pt(res) - - if res.ReturnCode ~= 0 then - return - end - self._group.isOpenChatRoom = value - self:RefalshMoreBtn() - end)]] + if self._group.isOpenChatRoom == 1 then + mgr_ctr:FG_CLOSE_ISOPEN_CHATROOM(self._group.id, function(res) + print("不允许成员可以查看聊天室") + pt(res) + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode) + return + end + self._group.isOpenChatRoom = 0 + self:RefalshMoreBtn() + end) + elseif self._group.isOpenChatRoom == 0 then + mgr_ctr:FG_OPEN_ISOPEN_CHATROOM(self._group.id, function(res) + print("允许成员可以查看聊天室") + pt(res) + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode) + return + end + self._group.isOpenChatRoom = 1 + self:RefalshMoreBtn() + end) + end end function M:SetCanWatch() @@ -209,8 +214,10 @@ function M:JoinFamily(frist) end function M:PlayEdit() - self.familyType.selectedIndex = 2 - self.lastType = 1 + --self.familyType.selectedIndex = 2 + --self.lastType = 1 + local view = PlayEditView.New() + view:Show(self._group.id) end function M:OpenMyFamily(groupId) @@ -313,8 +320,8 @@ end function M:UpdateFamilyRoom(fgCtr, id) local list_room = self._view:GetChild('list_room') list_room:SetVirtual() - local list_gamePlay = self._view:GetChild('list_gamePlay') - list_gamePlay:SetVirtual() + --local list_gamePlay = self._view:GetChild('list_gamePlay') + --list_gamePlay:SetVirtual() self._view:GetChild('n364').text = string.format("已开启%s桌游戏", self._group.room_num) local playList = self._group.playList --初始化玩法列表,用于房间使用 @@ -445,6 +452,7 @@ function M:UpdateFamilyRoom(fgCtr, id) end) end end + --[[ list_gamePlay.itemRenderer = function(index, obj) if index == 0 then obj:GetController('type').selectedIndex = 0 @@ -494,11 +502,12 @@ function M:UpdateFamilyRoom(fgCtr, id) tem:Show() end) end + list_gamePlay.numItems = #playList + 1 + ]] local all_num = #playList + #roomList -- print("=================================================list_room", list_room, list_room.numItems, all_num) pt(list_room) list_room.numItems = all_num - list_gamePlay.numItems = #playList + 1 end function M:ConnetFamily(index, groups, isCreate) @@ -542,6 +551,12 @@ function M:ConnetFamily(index, groups, isCreate) allLoad = allLoad + self:ConnetFamilyRoom(fgCtr, self._group.id) UpdateBeat:Add(self.OnUpdate, self) + + if self._group.isOpenChatRoom == 1 then + self.btn_chatRoom.visible = true + else + self.btn_chatRoom.visible = false + end end -- function M:Destroy() diff --git a/wb_new_ui/assets/Common/images/Emojies/1f600.png b/wb_new_ui/assets/Common/images/Emojies/1f600.png new file mode 100644 index 00000000..0ef00d79 Binary files /dev/null and b/wb_new_ui/assets/Common/images/Emojies/1f600.png differ diff --git a/wb_new_ui/assets/Common/package.xml b/wb_new_ui/assets/Common/package.xml index 4e3af7a1..02af4c7c 100644 --- a/wb_new_ui/assets/Common/package.xml +++ b/wb_new_ui/assets/Common/package.xml @@ -1236,6 +1236,7 @@ + diff --git a/wb_new_ui/assets/Family/Main.xml b/wb_new_ui/assets/Family/Main.xml index 0f3cb564..03dc300b 100644 --- a/wb_new_ui/assets/Family/Main.xml +++ b/wb_new_ui/assets/Family/Main.xml @@ -9,7 +9,7 @@ - + @@ -120,17 +120,6 @@ - - - - - - - - - - - diff --git a/wb_new_ui/assets/Family/MyFamily/Component/btn_quitFamily.xml b/wb_new_ui/assets/Family/MyFamily/Component/btn_quitFamily.xml index cdc3c148..6b4ff0e6 100644 --- a/wb_new_ui/assets/Family/MyFamily/Component/btn_quitFamily.xml +++ b/wb_new_ui/assets/Family/MyFamily/Component/btn_quitFamily.xml @@ -1,10 +1,10 @@ - + -