diff --git a/lua_probject/base_project/Game/Controller/Broadcast.lua b/lua_probject/base_project/Game/Controller/Broadcast.lua index a3631193..4e27209e 100644 --- a/lua_probject/base_project/Game/Controller/Broadcast.lua +++ b/lua_probject/base_project/Game/Controller/Broadcast.lua @@ -39,6 +39,8 @@ end BroadcastEvent = { - OnJoinsChange = 'OnJoinsChange' + OnJoinsChange = 'OnJoinsChange', + OnMemberChange = "OnMemberChange", + OnOutFamily = "OnOutFamily", } diff --git a/lua_probject/base_project/Game/Controller/GroupMgrController.lua b/lua_probject/base_project/Game/Controller/GroupMgrController.lua index de9d5996..b4707a16 100644 --- a/lua_probject/base_project/Game/Controller/GroupMgrController.lua +++ b/lua_probject/base_project/Game/Controller/GroupMgrController.lua @@ -562,7 +562,12 @@ end function M:OnMemberOut(evt_data) print("收到成员退出推送") pt(evt_data) + local uid = evt_data.uid + local groupId = evt_data.groupId + local group = DataManager.groups:get(groupId) + group:delMember(uid) DispatchEvent(self._dispatcher, GroupMgrEvent.OnFamilyMemberOut, evt_data) + Broadcast.Send(BroadcastEvent.OnMemberChange) end function M:OnMemberOnline(evt_data) diff --git a/lua_probject/base_project/Game/View/DismissRoomWindow.lua b/lua_probject/base_project/Game/View/DismissRoomWindow.lua index f93b8ad4..ccfcd016 100644 --- a/lua_probject/base_project/Game/View/DismissRoomWindow.lua +++ b/lua_probject/base_project/Game/View/DismissRoomWindow.lua @@ -22,6 +22,7 @@ function M:init(url) BaseWindow.init(self,url) local view = self._view self.tex_time = view:GetChild("tex_time") + self.tex_time2 = view:GetChild("tex_time2") local _btn_aggree = view:GetChild("btn_aggree") @@ -50,9 +51,11 @@ function M:FillData(data) isHidden = true end if isHidden then - self._view:GetChild("tex_tip").text = string.format("[color=#ff9d02]【%s】[/color]发起了解散房间申请,是否同意?","玩家" .. data.req_p.seat) + --self._view:GetChild("tex_tip").text = string.format("[color=#ff9d02]【%s】[/color]发起了解散房间申请,是否同意?","玩家" .. data.req_p.seat) + self._view:GetChild("tex_tip").text = string.format("玩家\\[[color=#70401C]%s[/color]]申请解散房间", data.req_p.seat) else - self._view:GetChild("tex_tip").text = string.format("[color=#ff9d02]【%s】[/color]发起了解散房间申请,是否同意?",data.req_p.self_user.nick_name) + --self._view:GetChild("tex_tip").text = string.format("[color=#ff9d02]【%s】[/color]发起了解散房间申请,是否同意?",data.req_p.self_user.nick_name) + self._view:GetChild("tex_tip").text = string.format("玩家\\[[color=#70401C]%s[/color]]申请解散房间", data.req_p.self_user.nick_name) end local ctr_falg = self._view:GetController("falg") local lst_player = self._view:GetChild("lst_player") @@ -66,9 +69,9 @@ function M:FillData(data) -- elseif tem.player ~= data.req_p then local item = lst_player:AddItemFromPool() if isHidden then - item:GetChild("tex_name").text = "玩家"..tem.player.seat + item:GetChild("tex_name").text = "玩家\\[[color=#70401C]" .. tem.player.seat .. "[/color]]" else - item:GetChild("tex_name").text = tem.player.self_user.nick_name + item:GetChild("tex_name").text = "玩家\\[[color=#70401C]" .. tem.player.self_user.nick_name .. "[/color]]" end local ctr_item_falg = item:GetController("falg") ctr_item_falg.selectedIndex = tem.result @@ -81,7 +84,8 @@ function M:OnUpdate(deltaTime) self.time = self.time - deltaTime self.time = math.max(0, self.time) end - self.tex_time.text = tostring(math.floor(self.time)) + self.tex_time.text = tostring(math.floor(self.time)) .. "s" + self.tex_time2.text = tostring(math.floor(self.time)) end diff --git a/lua_probject/base_project/Game/View/Family/FamilyEventView.lua b/lua_probject/base_project/Game/View/Family/FamilyEventView.lua index a51007dd..a74b456f 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyEventView.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyEventView.lua @@ -139,7 +139,6 @@ function M:_evtNewMailTip(...) print("family event _evtNewMailTip") end - function M:_evtOnNewApply(...) print("_evtOnNewApply") local arg = { ... } @@ -158,7 +157,6 @@ function M:_evtOnNewApply(...) end end - function M:_evtInviteResponse(...) local arg = { ... } local invite_id = arg[1] @@ -286,6 +284,9 @@ function M:_evtOnFamilyReflash(...) return end + local gMgr = ControllerManager.GetController(GroupMgrController) + local group = DataManager.groups:get(gMgr.groupId) + local arg = { ... } local reflashType = arg[1].reflashType @@ -294,7 +295,12 @@ function M:_evtOnFamilyReflash(...) if DataManager.SelfUser.account_id == uid then view:Reflash() + return end + + group:addMember(arg[1].usersDetail) + + Broadcast.Send(Broadcast.OnMemberChange) end if reflashType == "outFamily" then @@ -310,9 +316,6 @@ function M:_evtOnFamilyReflash(...) local uid = arg[1].uid local joins = arg[1].joins - local gMgr = ControllerManager.GetController(GroupMgrController) - local group = DataManager.groups:get(gMgr.groupId) - group.joins = joins for _, data in pairs(group.joinsData) do diff --git a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua index 69d09c7a..b4cfe5b6 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua @@ -36,11 +36,48 @@ local function ChangeFamilyConfig(data, self) ) end +local function QuitFamily(self) + local uid = DataManager.SelfUser.account_id + local group = DataManager.groups:get(self.groupId) + local player = group.memberMap[uid] + + local tips = "确定退出该亲友圈?" + if player.lev == 1 then + tips = "确定解散该亲友圈?" + end + + local tipsWin = MsgWindow.new(self._view, tips, MsgWindow.MsgMode.OkAndCancel) + tipsWin.onOk:Add(function() + if self.networkSending then + ViewUtil.ShowBannerOnScreenCenter("操作中,请稍后。。") + return + end + + self.networkSending = true + local fgCtr = ControllerManager.GetController(NewGroupController) + print("发送了退出协议 familyid = ", self.family.id) + fgCtr:FG_ExitGroup(self.family.id, function(res) + if res.ReturnCode ~= 0 then + return + end + self.networkSending = false + Broadcast.Send(BroadcastEvent.OnOutFamily) + self:Close() + end) + end) + tipsWin:Show() +end + function FamilyMyFamily:ReflashJoinsRedPoint() local cRedPoint = self.btn_applyMsg:GetController("cRedPoint") local tex_redPoint = self.btn_applyMsg:GetChild("tex_redPoint") local group = DataManager.groups.groupMap[self.groupId] + local player = group.memberMap[DataManager.SelfUser.account_id] + + if player.lev == 3 then + return + end cRedPoint.selectedIndex = 0 if group.joins > 0 then @@ -232,7 +269,7 @@ function FamilyMyFamily:Init() end) self.btn_quitFamily.onClick:Set(function() - self.cTips.selectedIndex = 1 + QuitFamily(self) end) self.btn_quitNotice.onClick:Set(function() diff --git a/lua_probject/base_project/Game/View/Family/FamilyMyfamilyList.lua b/lua_probject/base_project/Game/View/Family/FamilyMyfamilyList.lua index 0a9110b7..b1fe56bf 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyMyfamilyList.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyMyfamilyList.lua @@ -15,9 +15,18 @@ end local function RefalshJoinsRedPoint(self) for i = 0, self.list_familys.numItems - 1 do - local groups = DataManager.groups.groupList local group = groups[i + 1] + local player = group.memberMap[DataManager.SelfUser.account_id] + + if player.lev == 3 then + return + end + + local redPointNum = self._group.joins + if redPointNum > 99 then + redPointNum = "99+" + end local obj = self.list_familys:GetChildAt(i) @@ -69,6 +78,7 @@ end function FamilyMyfamilyList:Show() Broadcast.AddListener(BroadcastEvent.OnJoinsChange, RefalshJoinsRedPoint, self) + Broadcast.AddListener(BroadcastEvent.OnOutFamily, self.Refalsh, self) HideMainView(self) self:Refalsh() @@ -77,6 +87,7 @@ end function FamilyMyfamilyList:Close() Broadcast.RemoveListener(BroadcastEvent.OnJoinsChange, RefalshJoinsRedPoint) + Broadcast.RemoveListener(BroadcastEvent.OnOutFamily, self.Refalsh) ShowMainView(self) BaseView.Close(self) diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index 8b8b2069..00c58911 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -45,15 +45,24 @@ local function ReflashJoinsRedPoint(self) local btn_myfamilycRedPoint = btn_myfamily:GetController("cRedPoint") local btn_myfamilyRedPointText = btn_myfamily:GetChild("tex_redPoint") - local group = DataManager.groups:get(self._group.id) + local _joins = 0 + + for _, group in pairs(DataManager.groups.groupList) do + local player = group.memberMap[DataManager.SelfUser.account_id] + + if player.lev ~= 3 then + _joins = _joins + group.joins + return + end + end btn_myfamilycRedPoint.selectedIndex = 0 - if group.joins > 0 then + if _joins > 0 then btn_myfamilycRedPoint.selectedIndex = 1 end - local RpTex = group.joins - if group.joins > 99 then + local RpTex = _joins + if _joins > 99 then RpTex = "99+" end @@ -228,8 +237,6 @@ function M:Reflash() self:JoinFamily(true) self.btn_chatRoom.visible = false end - - --Broadcast.Send(BroadcastEvent.OnJoinsChange) end) end @@ -376,6 +383,12 @@ function M:UpdataRedPointAuditNumber(obj) return end + local player = self._group.memberMap[DataManager.SelfUser.account_id] + + if player.lev == 3 then + return + end + local redPointNum = self._group.joins if redPointNum > 99 then redPointNum = "99+" @@ -1107,12 +1120,16 @@ end function M:Show() Broadcast.AddListener(BroadcastEvent.OnJoinsChange, ReflashJoinsRedPoint, self) + Broadcast.AddListener(BroadcastEvent.OnMemberChange, self.ReflashMember, self) + Broadcast.AddListener(BroadcastEvent.OnOutFamily, self.Reflash, self) BaseView.Show(self) end function M:Close() Broadcast.RemoveListener(BroadcastEvent.OnJoinsChange, ReflashJoinsRedPoint) + Broadcast.RemoveListener(BroadcastEvent.OnMemberChange, self.ReflashMember) + Broadcast.RemoveListener(BroadcastEvent.OnOutFamily, self.Reflash) print("家族界面退出") self._familyEventView:RemoveAll() diff --git a/lua_probject/base_project/Game/View/LobbyView.lua b/lua_probject/base_project/Game/View/LobbyView.lua index 21a2120f..a43517de 100644 --- a/lua_probject/base_project/Game/View/LobbyView.lua +++ b/lua_probject/base_project/Game/View/LobbyView.lua @@ -452,12 +452,15 @@ function M:Show() local user = DataManager.SelfUser local tem = user.notices if user.group_id ~= 0 then + self:ReconnectRoom(user.group_id) + --[[ local msg_tip = MsgWindow.new(self._root_view, "还在圈子的房间中,现在重连吗?", MsgWindow.MsgMode.OkAndCancel) msg_tip.onOk:Add(function() self:ReconnectRoom(user.group_id) end) msg_tip:Show() tem.auto_show = false + ]] else local lobbyCtr1 = ControllerManager.GetController(LoddyController) lobbyCtr1:UpdateNotice(DataManager.SelfUser.account_id, function(result, data) diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua index 4a36dea5..b0a7b9ae 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua @@ -230,6 +230,7 @@ function M:EventInit() info:MarkBank(p.seat == _room.banker_seat) info:Ready(false) local card_info = self._player_card_info[self:GetPos(p.seat)] + card_info:Clear() card_info:UpdateHandCard() end end) @@ -436,6 +437,7 @@ function M:EventInit() if _room.curren_round ~= _room.room_config.round then -- if #niao == 0 then self._view:GetChild("n13").visible = false end self._clearingView:InitData(0, _room, result, nil, function(...) + --[[ for i = 1, #data do local p = _room:GetPlayerBySeat(data[i].seat) p.total_score = data[i].total_score @@ -464,7 +466,9 @@ function M:EventInit() DataManager.CurrenRoom.self_player.card_list = {} self._state.selectedIndex = 2 self._clearingView = nil + ]] end) + end -- self._player_card_info[1]:ShowHuTip() end) diff --git a/wb_new_ui/assets/Common/component/dismiss_room/dismiss_room.xml b/wb_new_ui/assets/Common/component/dismiss_room/dismiss_room.xml index 64b8bb27..8a1c75fc 100644 --- a/wb_new_ui/assets/Common/component/dismiss_room/dismiss_room.xml +++ b/wb_new_ui/assets/Common/component/dismiss_room/dismiss_room.xml @@ -1,35 +1,28 @@ - + - - - - - - - - - - - - - - - - + + + + + + + - -