From 5bcfe869990fabbd2bbe32e6d7728d0ab37dcb65 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Tue, 1 Jun 2021 16:59:27 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=85=AC=E4=BC=9A=E7=BA=A2=E5=8C=85?= =?UTF-8?q?=E3=80=91=3D=3D=3D=3D=E7=BA=A2=E5=8C=85=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Chat/ChatManager.lua | 16 +++++--- .../~Lua/Modules/Guild/GuildMainCityPanel.lua | 3 -- .../~Lua/Modules/Guild/MyGuildManager.lua | 5 ++- .../RedPacketView/GuildRedPacketManager.lua | 39 +++++++++++++++---- .../Guild/RedPacketView/RedPacketPanel.lua | 4 +- .../Guild/RedPacketView/RedPacketPopup.lua | 10 +++-- .../Guild/RedPacketView/RedPacket_GetView.lua | 31 +++++++-------- .../RedPacketView/RedPacket_SendView.lua | 3 +- .../RedPacketView/RedPacket_SendWealView.lua | 6 +-- 9 files changed, 71 insertions(+), 46 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Chat/ChatManager.lua b/Assets/ManagedResources/~Lua/Modules/Chat/ChatManager.lua index fd7ad94dca..35a2bea213 100644 --- a/Assets/ManagedResources/~Lua/Modules/Chat/ChatManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Chat/ChatManager.lua @@ -260,12 +260,16 @@ function this.ChatDataAdapter(channel, data) -- newChat.messageType = 8 -- 公会红包的类型 -- newChat.speed = this.horseRunSpeed -- newChat.multiple = 1 - - GuildRedPacketManager.isCheck = true - MyGuildManager.PackageNum=MyGuildManager.PackageNum+1 - --CheckRedPointStatus(RedPointType.Guild_RedPacket) - --CheckRedPointStatus(RedPointType.Guid_GetPackage) - --CheckRedPointStatus(RedPointType.Guild_RedPacket) + if PlayerManager.uid~=tonumber(msgs[2]) then + LogError("处理聊天数据") + GuildRedPacketManager.isCheck = true + MyGuildManager.PackageNum=MyGuildManager.PackageNum+1 + --CheckRedPointStatus(RedPointType.Guild_RedPacket) + CheckRedPointStatus(RedPointType.Guid_GetPackage) + end + + LogError("聊天推过来的红包num:"..MyGuildManager.PackageNum) + end end end diff --git a/Assets/ManagedResources/~Lua/Modules/Guild/GuildMainCityPanel.lua b/Assets/ManagedResources/~Lua/Modules/Guild/GuildMainCityPanel.lua index 6ba97c8446..f552214652 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guild/GuildMainCityPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guild/GuildMainCityPanel.lua @@ -536,7 +536,6 @@ end --界面销毁时调用(用于子类重写) function GuildMainCityPanel:OnDestroy() this.spLoader:Destroy() - LogError("11111111111111111") SubUIManager.Close(this.ChatTipView) SubUIManager.Close(this.UpView) SubUIManager.Close(this.BtView) @@ -550,10 +549,8 @@ function GuildMainCityPanel:OnDestroy() end end end - -- 清除红点 ClearRedPointObject(RedPointType.Guild_RedPacket, this.btnRedPacketRedPoint) - LogError("22222222222222222222") -- this.playerHead = nil if this.LiveGO then diff --git a/Assets/ManagedResources/~Lua/Modules/Guild/MyGuildManager.lua b/Assets/ManagedResources/~Lua/Modules/Guild/MyGuildManager.lua index d0e5634589..d1ad7b4c18 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guild/MyGuildManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guild/MyGuildManager.lua @@ -177,6 +177,7 @@ function MyGuildManager.ReuqsetRedPackage(func) NetManager.GetAllRedPacketResponse(function(msg) local num=0 local SpecialConfig=ConfigManager.GetConfigData(ConfigName.SpecialConfig,115) + LogError("--------------------") for i = 1, #msg.info do local config=ConfigManager.GetConfigData(ConfigName.GuildRedPackConfig,msg.info[i].redType) if config and msg.info[i].isGet==0 and (config.Num-msg.info[i].getCount)>0 then @@ -185,10 +186,12 @@ function MyGuildManager.ReuqsetRedPackage(func) end end end + LogError("*************************") this.PackageNum=num CheckRedPointStatus(RedPointType.Guid_GetPackage) CheckRedPointStatus(RedPointType.Guid_SendPackage) - CheckRedPointStatus(RedPointType.Guild_RedPacket) + --CheckRedPointStatus(RedPointType.Guild_RedPacket) + LogError("///////////////////") if func then func(msg) end diff --git a/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/GuildRedPacketManager.lua b/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/GuildRedPacketManager.lua index 44e05e00b6..5631673e34 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/GuildRedPacketManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/GuildRedPacketManager.lua @@ -17,16 +17,17 @@ function this.CheckGuildRedPacketRedPoint() -- return false -- end local list=MyGuildManager.GetMyGuidRedPackage() - if list then - -- LogRed("检测发红包红点") + LogError("检测发红包红点111") + if list and LengthOfTable(list)>0 then + LogError("检测发红包红点") for key, value in pairs(list) do if value and value.num and value.num>0 then - -- LogError("444444444444") + LogError("444444444444") return true end end end - -- LogError("5555555555") + LogError("5555555555") return false end function this.CheckIsCanGetPackage() @@ -46,14 +47,36 @@ function this.CheckIsCanGetPackage() -- return false -- end) - if MyGuildManager.PackageNum>0 then - Game.GlobalEvent:DispatchEvent(GameEvent.Chat.OnRedPackageNumChanged) + LogError("现在红包得数量:"..MyGuildManager.GetRedPackageNum()) + if MyGuildManager.GetRedPackageNum()>0 then + --Game.GlobalEvent:DispatchEvent(GameEvent.Chat.OnRedPackageNumChanged,true) + local aaa=Util.GetGameObject(UIManager.uiNode,"GuildMainCityPanel/ChatTipView/Image") + local bbb=Util.GetGameObject(UIManager.uiNode,"MainPanel/ChatTipView/Image") + if aaa then + LogError("显示红包") + aaa.gameObject:SetActive(true) + end + if bbb then + LogError("显示红包") + bbb.gameObject:SetActive(true) + end return true else - Game.GlobalEvent:DispatchEvent(GameEvent.Chat.OnRedPackageNumChanged) + -- Game.GlobalEvent:DispatchEvent(GameEvent.Chat.OnRedPackageNumChanged,false) + local aaa=Util.GetGameObject(UIManager.uiNode,"GuildMainCityPanel/ChatTipView/Image") + local bbb=Util.GetGameObject(UIManager.uiNode,"MainPanel/ChatTipView/Image") + if aaa then + LogError("不显示红包") + aaa.gameObject:SetActive(false) + end + if bbb then + LogError("bu显示红包") + bbb.gameObject:SetActive(false) + end return false end - + +return false end diff --git a/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacketPanel.lua b/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacketPanel.lua index a634f1ba28..f084ca8122 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacketPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacketPanel.lua @@ -101,8 +101,8 @@ function RedPacketPanel:OnShow() BindRedPointObject(RedPointType.Guid_SendPackage, redPointList[2]) BindRedPointObject(RedPointType.Guid_GetPackage, redPointList[3]) end - CheckRedPointStatus(RedPointType.Guid_SendPackage) - CheckRedPointStatus(RedPointType.Guid_GetPackage) + --CheckRedPointStatus(RedPointType.Guid_SendPackage) + --CheckRedPointStatus(RedPointType.Guid_GetPackage) end diff --git a/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacketPopup.lua b/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacketPopup.lua index 2e594bd1a7..af65b64211 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacketPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacketPopup.lua @@ -46,11 +46,12 @@ end function RedPacketPopup:RemoveListener() end - +local func=nil function RedPacketPopup:OnOpen(...) local args={...} this.redId=args[1] this.id=args[2] + func=args[3] end function RedPacketPopup:OnShow() @@ -58,7 +59,9 @@ function RedPacketPopup:OnShow() end function RedPacketPopup:OnClose() - + if func then + func() + end end function RedPacketPopup:OnDestroy() @@ -72,13 +75,13 @@ end --初始化面板 function this.InitView(redId,id) + LogError("ffffff") local config=ConfigManager.GetConfigData(ConfigName.GuildRedPackConfig,id) local index=id if index>3 then index=4 end this.title.sprite = this.spLoader:LoadSprite(RedPacketName[index]) - LogError("BaseType=="..config.BaseType) if config.BaseType==1 then this.titleTip.text=GetLanguageStrById(config.SendWord) elseif config.BaseType==2 then @@ -106,7 +109,6 @@ function this.InitView(redId,id) table.sort(data,function(a,b) return a.count>b.count end) - this.scrollView:SetData(data,function(index,root) this.SetShow(root,data[index],index) end) diff --git a/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacket_GetView.lua b/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacket_GetView.lua index bd6887943c..ee357d9d06 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacket_GetView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacket_GetView.lua @@ -63,11 +63,6 @@ function this:InitGetView() local dataLength=0 isAuto=false NetManager.GetAllRedPacketResponse(function(msg) - -- logWarnTrance(#msg.info) - -- for index, value in ipairs(msg.info) do - -- Log(tostring(value)) - -- end - local data={} for i,v in ipairs(msg.info) do table.insert(data,v) @@ -78,7 +73,7 @@ function this:InitGetView() this.noInfo:SetActive(dataLength==0) this.scrollView:SetData(data,function(index,root) this:SetView(root,data[index]) - end) + end,true,true) --this.scrollView:SetIndex(1) if isAuto then local SpecialConfig=ConfigManager.GetConfigData(ConfigName.SpecialConfig,115) @@ -93,12 +88,16 @@ function this:InitGetView() local count=msg.count if success==1 then--红包抢成功 local itemName=GetLanguageStrById(ConfigManager.GetConfigData(ConfigName.ItemConfig,itemId).Name) - UIManager.OpenPanel(UIName.RedPacketPopup,value.redId,value.redType) + UIManager.OpenPanel(UIName.RedPacketPopup,value.redId,value.redType,function () + + this.InitGetView() + MyGuildManager.ReuqsetRedPackage() + end) --红包类型大于3的是福利红包 if value.redType>3 then PlayerManager.SettDailyRedPackageTime(PlayerManager.dailyRedPack+1) end - MyGuildManager.ReuqsetRedPackage() + PopupTipPanel.ShowTip(string.format(Language[11046],itemName,count)) else--抢红包失败 LogError(Language[11047]) @@ -151,7 +150,6 @@ function this:SetView(root,data) numOrRecordText.text=Language[11043] getBtnImage.sprite=this.spLoader:LoadSprite(BtnStateImage[2]) --Language[10101] else - LogError("redid"..redId) numOrRecordText.text=Language[10580]..(config.Num-data.getCount).."/"..config.Num getBtnImage.sprite=this.spLoader:LoadSprite(BtnStateImage[1]) --Language[11044] end @@ -172,26 +170,25 @@ function this:SetView(root,data) local count=msg.count if success==1 then--红包抢成功 local itemName=GetLanguageStrById(ConfigManager.GetConfigData(ConfigName.ItemConfig,itemId).Name) - UIManager.OpenPanel(UIName.RedPacketPopup,redId,data.redType) + UIManager.OpenPanel(UIName.RedPacketPopup,redId,data.redType,function() + this:InitGetView() + MyGuildManager.ReuqsetRedPackage() + end) if data.redType>3 then PlayerManager.SettDailyRedPackageTime(PlayerManager.dailyRedPack+1) end PopupTipPanel.ShowTip(string.format(Language[11046],itemName,count)) - MyGuildManager.ReuqsetRedPackage(function() - CheckRedPointStatus(RedPointType.Guid_GetPackage) - CheckRedPointStatus(RedPointType.Guild_RedPacket) - end) + else--抢红包失败 PopupTipPanel.ShowTip(Language[11047]) end - this:InitGetView() end) - + end) Util.AddOnceClick(numOrRecordBtn,function()--查看记录 NetManager.GetRedPackageDetailRequest(redId,function(msg) UIManager.OpenPanel(UIName.RedPacketPopup,redId,data.redType) - this:InitGetView() + --this:InitGetView() end) end) end diff --git a/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacket_SendView.lua b/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacket_SendView.lua index 8d996f448b..16fe805c0a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacket_SendView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacket_SendView.lua @@ -260,9 +260,10 @@ function this.RechargeSuccessFunc(id) OperatingManager.RefreshGiftGoodsBuyTimes(GoodsTypeDef.DirectPurchaseGift, id) local redpack=ConfigManager.GetConfigData(ConfigName.GuildRedPackConfig,curIndex) this.SetInfo(curIndex) + MyGuildManager.ReuqsetRedPackage() --PopupTipPanel.ShowTip(string.format( Language[11051],GetLanguageStrById(redpack.Name))) ChatManager.RequestSendRedPacket(curIndex) - MyGuildManager.ReuqsetRedPackage() + -- CheckRedPointStatus(RedPointType.Guid_GetPackage) end diff --git a/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacket_SendWealView.lua b/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacket_SendWealView.lua index d44f5392eb..cd9927e748 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacket_SendWealView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guild/RedPacketView/RedPacket_SendWealView.lua @@ -116,10 +116,8 @@ function this:ShowItemInfo(go,data) PopupTipPanel.ShowTip("成功发送福利红包!") this:InitView() --刷新发送福利红包按钮红点 - CheckRedPointStatus(RedPointType.Guid_GetPackage) - MyGuildManager.ReuqsetRedPackage(function() - CheckRedPointStatus(RedPointType.Guid_GetPackage) - end) + --CheckRedPointStatus(RedPointType.Guid_GetPackage) + MyGuildManager.ReuqsetRedPackage() --发送公会信息 local redpack=ConfigManager.GetConfigData(ConfigName.GuildRedPackConfig,data.config.Id)