From 4b6079d4e8f48c494cf90277447c7503f288cbb9 Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Thu, 14 Oct 2021 17:10:40 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=BE=A1=E5=89=91=E8=A1=8C=E3=80=91?= =?UTF-8?q?=E6=8F=90=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/GeneralBigPopup_YuJianBet.lua | 6 ++++- .../View/GeneralBigPopup_YuJianLastResult.lua | 6 ++--- .../~Lua/Modules/Net/NetManager.lua | 3 --- .../~Lua/Modules/Player/RedpotManager.lua | 6 +---- .../View/GeneralPopup_YuJianXingRecord.lua | 5 ++-- .../Modules/YuJianXing/YuJianXingManager.lua | 27 ++++++++++++++----- .../Modules/YuJianXing/YuJianXingPanel.lua | 10 ++++--- 7 files changed, 40 insertions(+), 23 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_YuJianBet.lua b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_YuJianBet.lua index a435fbea6d..3cd6d2fac9 100644 --- a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_YuJianBet.lua +++ b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_YuJianBet.lua @@ -76,7 +76,11 @@ function this:Refresh(func) end Util.AddOnceClick(btnBet,function () if BagManager.GetTotalItemNum(configData.JoinCost[1]) < configData.JoinCost[2] then - PopupTipPanel.ShowTip("御剑令不足,无法开示竞猜!") + PopupTipPanel.ShowTip("御剑令不足,无法开始竞猜!") + return + end + if configData.JoinCount - YuJianXingManager.joinCount <= 0 then + PopupTipPanel.ShowTip("竞猜次数不足,无法开始竞猜!") return end UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.YuJianXingBetSelectNum,i) diff --git a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_YuJianLastResult.lua b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_YuJianLastResult.lua index 1291a1a631..4cdfc85e91 100644 --- a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_YuJianLastResult.lua +++ b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_YuJianLastResult.lua @@ -1,9 +1,9 @@ ----- --御剑行上轮排名 ----- local this = {} local rankImg = { - [1] = "d_dianfrngsai_guanjun_zh", - [2] = "d_dianfrngsai_yajun_zh", - [3] = "d_dianfrngsai_ji_zh", + [1] = "r_Dungeon_001", + [2] = "r_Dungeon_002", + [3] = "r_Dungeon_003", [4] = "y_yujianxing_paimingsi", } local SwordImg = { diff --git a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua index 8bfb4453d9..76679ccf68 100644 --- a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua @@ -5935,9 +5935,6 @@ function this.RidingSwardRewardRequest(_time,_swardId,func) local data = buffer:DataByte() local msg = ActivityProto_pb.RidingSwardRewardResponse() msg:ParseFromString(data) - for i = 1, #msg.drop.itemlist do - LogPink(tostring(msg.drop.itemlist[i].itemId).." "..tostring(msg.drop.itemlist[i].itemNum)) - end if func then func(msg) end diff --git a/Assets/ManagedResources/~Lua/Modules/Player/RedpotManager.lua b/Assets/ManagedResources/~Lua/Modules/Player/RedpotManager.lua index 122e8c75e2..cbc3709e84 100644 --- a/Assets/ManagedResources/~Lua/Modules/Player/RedpotManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Player/RedpotManager.lua @@ -305,9 +305,6 @@ function this.InitRedPointAllRelate() RPData:SetParent(RedPointType.DailyRecharge,RedPointType.RightUp2) --七界试炼 RPData:SetParent(RedPointType.QiJieShiLian, RedPointType.JumpServer_MainCity) - --御剑行 - RPData:SetParent(RedPointType.YuJianXingRecord, RedPointType.YuJianXingMian) - RPData:SetParent(RedPointType.YuJianXingTime, RedPointType.YuJianXingMian) for k,v in ConfigPairs(ConfigManager.GetConfig(ConfigName.ActivityGroups)) do if v.RpType > 0 and v.RpTypeParent > 0 then @@ -577,8 +574,7 @@ function this.RegisterRedCheckFunc() RPData:AddCheckFunc(RedPointType.QiJieShiLian,QiJieShiLianManager.CheckQiJieRedPoint,FUNCTION_OPEN_TYPE.QIJIESHILIAN) RPData:AddCheckFunc(RedPointType.LikeabilityRed,LikabilityManager.CheckRedPot) --御剑行 - RPData:AddCheckFunc(RedPointType.YuJianXingRecord,YuJianXingManager.CheckBetRecord) - RPData:AddCheckFunc(RedPointType.YuJianXingTime,YuJianXingManager.CheckBetTime) + RPData:AddCheckFunc(RedPointType.YuJianXingMian,YuJianXingManager.CheckRedPoint) end -- 向红点绑定物体 diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_YuJianXingRecord.lua b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_YuJianXingRecord.lua index 3cd7d1a104..e02d9b8315 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_YuJianXingRecord.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_YuJianXingRecord.lua @@ -86,8 +86,9 @@ function this:SingleDataShow(go,data) -- LogPink("时间:"..tostring(TimeStampToDateStr4(data.time/1000)).." 结果:"..tostring(data.result).." 状态:"..tostring(data.state)) Util.AddOnceClick(btnGet,function () NetManager.RidingSwardRewardRequest(data.time,data.betSwardId,function (msg) - UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1) - self:Refresh(false,false) + UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1,function () + self:Refresh(false,false) + end) end) end) end diff --git a/Assets/ManagedResources/~Lua/Modules/YuJianXing/YuJianXingManager.lua b/Assets/ManagedResources/~Lua/Modules/YuJianXing/YuJianXingManager.lua index af7443dc77..7576f68b31 100644 --- a/Assets/ManagedResources/~Lua/Modules/YuJianXing/YuJianXingManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/YuJianXing/YuJianXingManager.lua @@ -128,12 +128,18 @@ function this.ResetPlayerPosVertical() this.riceCtrl:ResetPlayerPosVertical() end -function this.CheckBetTime() - local id = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.YuJianXing) - NetManager.RidingSwardActivityRequest(id,function () - LogGreen("御剑行:"..tostring(configData.JoinCount - this.joinCount )) - return configData.JoinCount - this.joinCount > 0 - end) +function this.CheckRedPoint() + local state1 = false + local state2 = false + if configData.JoinCount - this.joinCount > 0 then + state1 = true + end + for i = 1, #this.curRecordList do + if this.curRecordList[i].state == 0 then + state2 = true + end + end + return state1 or state2 end function this.CheckBetRecord() NetManager.RidingSwardInfoRequest(function () @@ -148,4 +154,13 @@ function this.CheckBetRecord() end) end +function this.CheckRecordList() + for i = 1, #this.curRecordList do + if this.curRecordList[i].state == 0 then + return true + end + end + return false +end + return YuJianXingManager \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/YuJianXing/YuJianXingPanel.lua b/Assets/ManagedResources/~Lua/Modules/YuJianXing/YuJianXingPanel.lua index 7099261ab2..d65dfaf527 100644 --- a/Assets/ManagedResources/~Lua/Modules/YuJianXing/YuJianXingPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/YuJianXing/YuJianXingPanel.lua @@ -57,6 +57,10 @@ function YuJianXingPanel:BindEvent() end) Util.AddOnceClick(self.btnRecord,function () + if #YuJianXingManager.curRecordList <= 0 then + PopupTipPanel.ShowTip("暂无竞猜纪录!") + return + end UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.YuJianXingRecord) end) @@ -71,7 +75,6 @@ function YuJianXingPanel:BindEvent() end JumpManager.GoJump(20003) end) - BindRedPointObject(RedPointType.YuJianXingRecord,self.redPoint) end --添加事件监听(用于子类重写) @@ -91,6 +94,7 @@ end --界面打开时调用(用于子类重写) function YuJianXingPanel:OnOpen() + NetManager.RidingSwardInfoRequest() end -- 打开,重新打开时回调 @@ -107,7 +111,6 @@ end function YuJianXingPanel:Refresh() YuJianXingManager.HideAllPlayers(not YuJianXingManager.InWaiting) self.waiting:SetActive(YuJianXingManager.InWaiting) - CheckRedPointStatus(RedPointType.YuJianXingRecord) --为小人在地图上下移动做处理 self.count = 0 self:SetTime() @@ -166,7 +169,9 @@ function YuJianXingPanel:SetTime() elseif YuJianXingManager.curState == 2 then self.nextRoundTime.text = string.format("比赛进行中···") end + self.redPoint:SetActive(YuJianXingManager.CheckRecordList()) self.timer = Timer.New(function () + self.redPoint:SetActive(YuJianXingManager.CheckRecordList()) --设置人物上下飘动2s重置一次 if self.count % 2 == 0 then YuJianXingManager.ResetPlayerPosVertical() @@ -218,7 +223,6 @@ end --界面销毁时调用(用于子类重写) function YuJianXingPanel:OnDestroy() SubUIManager.Close(self.UpView) - ClearRedPointObject(RedPointType.YuJianXingRecord,self.redPoint) end return YuJianXingPanel \ No newline at end of file