From 4ccaca133e621255a5a17fe93a48b6d969995117 Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Fri, 15 Oct 2021 16:49:00 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E3=80=90=E7=89=9B=E6=B0=94=E5=86=B2?= =?UTF-8?q?=E5=A4=A9=E3=80=91=E4=BF=AE=E6=94=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DynamicActivity/ActivityMainPanel.lua | 4 +-- .../GlobalActTimeCtrl/ActTimeCtrlManager.lua | 2 +- .../NiuQiChongTian/NiuQiChongTianManager.lua | 33 ++++++++----------- .../NiuQiChongTian/NiuQiChongTianPanel.lua | 15 ++++----- 4 files changed, 23 insertions(+), 31 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/DynamicActivity/ActivityMainPanel.lua b/Assets/ManagedResources/~Lua/Modules/DynamicActivity/ActivityMainPanel.lua index 9a676970ee..8a2ba958d3 100644 --- a/Assets/ManagedResources/~Lua/Modules/DynamicActivity/ActivityMainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/DynamicActivity/ActivityMainPanel.lua @@ -71,7 +71,7 @@ function ActivityMainPanel:CheckActOpen(_index) local id = ActivityGiftManager.IsActivityTypeOpen(tabs[_index].ActiveType) if id and id > 0 and ActivityGiftManager.IsQualifiled(tabs[_index].ActiveType) then if GlobalActConfig[id].ShowArt and GlobalActConfig[id].ShowArt > 0 then - if tabs[_index].ActiveType == ActivityTypeDef.DynamicAct or tabs[_index].ActiveType == ActivityTypeDef.LimitUpHero or tabs[_index].ActiveType == ActivityTypeDef.DynamicActShop then + if tabs[_index].ActiveType == ActivityTypeDef.DynamicAct or tabs[_index].ActiveType == ActivityTypeDef.LimitUpHero or tabs[_index].ActiveType == ActivityTypeDef.DynamicActShop or tabs[_index].ActiveType == ActivityTypeDef.NiuQi then _CurPageIndex = _index elseif GlobalActConfig[id].ShowArt == this.activityType then _CurPageIndex = _index @@ -221,7 +221,7 @@ function this.PageTabAdapter(tab, index, status) local id = ActivityGiftManager.IsActivityTypeOpen(tabs[index].ActiveType) if id and id > 0 and ActivityGiftManager.IsQualifiled(tabs[index].ActiveType) then if GlobalActConfig[id].ShowArt and GlobalActConfig[id].ShowArt > 0 then - if tabs[index].ActiveType == ActivityTypeDef.DynamicAct or tabs[index].ActiveType == ActivityTypeDef.LimitUpHero or tabs[index].ActiveType == ActivityTypeDef.DynamicActShop then + if tabs[index].ActiveType == ActivityTypeDef.DynamicAct or tabs[index].ActiveType == ActivityTypeDef.LimitUpHero or tabs[index].ActiveType == ActivityTypeDef.DynamicActShop or tabs[index].ActiveType == ActivityTypeDef.NiuQi then isshow = true elseif GlobalActConfig[id].ShowArt == this.activityType then isshow = true diff --git a/Assets/ManagedResources/~Lua/Modules/GlobalActTimeCtrl/ActTimeCtrlManager.lua b/Assets/ManagedResources/~Lua/Modules/GlobalActTimeCtrl/ActTimeCtrlManager.lua index f300040202..8d560d09f4 100644 --- a/Assets/ManagedResources/~Lua/Modules/GlobalActTimeCtrl/ActTimeCtrlManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/GlobalActTimeCtrl/ActTimeCtrlManager.lua @@ -108,7 +108,7 @@ function this.InitMsg(msg) this.serData[id].restTime = restTime this.serData[id].switch = switch - LogGreen(string.format("--- 功能解锁数据 id = %s, startTime = %s, endTime = %s, switch = %s",id, startTime, endTime, switch)) + -- LogGreen(string.format("--- 功能解锁数据 id = %s, startTime = %s, endTime = %s, switch = %s",id, startTime, endTime, switch)) -- 用于标记是否解锁使用 local typeId = AllActSetConfig[id].IsIDdSame diff --git a/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianManager.lua b/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianManager.lua index 2419fcbd58..fdd663ac27 100644 --- a/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianManager.lua @@ -8,26 +8,17 @@ local itemId = 0 function this.Initialize() this.InitAllRewardData() Game.GlobalEvent:AddEvent(GameEvent.Mission.NiuQiChongTianTask,this.UpdateStatus) - this.isOldNiuQiActivity = true + this.IsNewActivity = false end --服务器发来的活动进度条数据 function this.GetActData() - if this.isOldNiuQiActivity then - return ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.NiuQi) - else - return ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.NiuQi) - end + return ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.NiuQi) end --牛气值 function this.GetScore() - local ActData = {} - if this.isOldNiuQiActivity then - ActData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.NiuQi) - else - ActData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.NiuQi) - end + local ActData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.NiuQi) if not (ActData and ActData.activityId) then return end if #this.configData == 0 then local config = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",ActData.activityId) @@ -94,7 +85,7 @@ end --需要显示的任务数据 function this.GetNeedRewardData(sort) local needData = {} - if this.isOldNiuQiActivity then--老的牛气冲天 + if not this.IsNewActivity then--老的牛气冲天 for i = 1, 2 do local tempdata = {} for k, v in pairs(this.rewardData) do @@ -157,12 +148,7 @@ function this.GetNeedRewardData(sort) end function this.CheckNiuQiChongTianRedPoint(index) - local id = 0 - if this.isOldNiuQiActivity then - id = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.NiuQi) - else - id = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.NiuQi) - end + local id = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.NiuQi) if not id or id < 1 then return false end @@ -203,4 +189,13 @@ function this.NiuQiCheckRedPoint4() return false end +--检查是否为新的牛气冲天 +function this.CheckIsNewActivity() + local id = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.NiuQi) + local data = ConfigManager.GetConfigData(ConfigName.GlobalActivity,id) + if data.ShowArt == 2 then + this.IsNewActivity = true + end +end + return this \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianPanel.lua b/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianPanel.lua index 7e8ee32b87..18aaa7f992 100644 --- a/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianPanel.lua @@ -11,9 +11,9 @@ function NiuQiChongTianPanel:New(gameObject) return b end local TabBox = require("Modules/Common/TabBox") -local _TabData={ [1] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = Language[12251] ,rpType = RedPointType.NiuQiChongTian_1}, - [2] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = Language[12252] ,rpType = RedPointType.NiuQiChongTian_2}, - [3] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = Language[12253] ,rpType = RedPointType.NiuQiChongTian_3},} +local _TabData={ [1] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = Language[12251] , nameNew = "极速探索" ,rpType = RedPointType.NiuQiChongTian_1}, + [2] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = Language[12252] , nameNew = "神将招募" ,rpType = RedPointType.NiuQiChongTian_2}, + [3] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = Language[12253] , nameNew = "神将升星" ,rpType = RedPointType.NiuQiChongTian_3},} local _TabFontColor = { default = Color.New(130 / 255, 128 / 255, 120 / 255, 1), select = Color.New(243 / 255, 235 / 255, 202 / 255, 1)} @@ -49,6 +49,7 @@ function NiuQiChongTianPanel:InitComponent() self.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.scrollItem.transform,self.itemPre, nil, Vector2.New(width, rootHight), 1, 1, Vector2.New(0,0)) self.ScrollView.moveTween.MomentumAmount = 1 self.ScrollView.moveTween.Strength = 2 + self.ScrollView.elastic = false self.effect5 = Util.GetGameObject(self.reward, "icon (5)/UI_Effect_jinkuang_Yuan") Util.SetParticleSortLayer(self.effect5, 1) @@ -77,11 +78,7 @@ end --界面打开时调用(用于子类重写) function NiuQiChongTianPanel:OnOpen(_activityConfig,_index,parent) self.actConfig = _activityConfig - if self.actConfig.ActiveType == ActivityTypeDef.NiuQi then - NiuQiChongTianManager.isOldNiuQiActivity = true - else - NiuQiChongTianManager.isOldNiuQiActivity = false - end + NiuQiChongTianManager.CheckIsNewActivity() self.pageIndex = _index self.parent = parent end @@ -117,7 +114,7 @@ function NiuQiChongTianPanel:OnShow(_sortingOrder) self.redPointList[_TabData[index].rpType] = redPoint end Util.GetGameObject(tab,"Image"):GetComponent("Image").sprite = self.spLoader:LoadSprite(_TabData[index][status]) - tabLab:GetComponent("Text").text = _TabData[index].name + tabLab:GetComponent("Text").text = NiuQiChongTianManager.IsNewActivity and _TabData[index].nameNew or _TabData[index].name tabLab:GetComponent("Text").color = _TabFontColor[status] end From 3dca94f9aaf3c2a591661e66e8276f3e0dd9ce1d Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Fri, 15 Oct 2021 17:14:27 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E3=80=90=E7=89=9B=E6=B0=94=E5=86=B2?= =?UTF-8?q?=E5=A4=A9=E3=80=91=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NiuQiChongTian/NiuQiChongTianManager.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianManager.lua b/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianManager.lua index fdd663ac27..79750cf87c 100644 --- a/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianManager.lua @@ -73,6 +73,7 @@ end function this.CreatSingleData(sData) local data = {} data.id = sData.Id + data.actId = sData.ActivityId data.Text = sData.Text data.Reward = sData.Reward data.Sort = sData.Sort @@ -136,11 +137,16 @@ function this.GetNeedRewardData(sort) table.insert(needData,v) end end + local STATE = { + [0] = 2, + [1] = 3, + [2] = 1, + } table.sort(needData,function (a,b) if a.state == b.state then return a.id < b.id else - return a.state < b.state + return STATE[a.state] > STATE[b.state] end end) end @@ -152,7 +158,11 @@ function this.CheckNiuQiChongTianRedPoint(index) if not id or id < 1 then return false end - + for k = #this.rewardData, 1 , -1 do + if this.rewardData[k].actId ~= id then + table.remove( this.rewardData,k) + end + end local isShow = false if index == RedPointType.NiuQiChongTian_4 then isShow = this.NiuQiCheckRedPoint4() From d76713abf2d2e0eee881bca6b9d86444d93eac57 Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Fri, 15 Oct 2021 17:39:04 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E3=80=90=E7=89=9B=E6=B0=94=E5=86=B2?= =?UTF-8?q?=E5=A4=A9=E3=80=91=E6=9B=B4=E6=94=B9=E6=A0=87=E7=AD=BE=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/NiuQiChongTian/NiuQiChongTianPanel.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianPanel.lua b/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianPanel.lua index 18aaa7f992..7e492509ea 100644 --- a/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianPanel.lua @@ -11,9 +11,9 @@ function NiuQiChongTianPanel:New(gameObject) return b end local TabBox = require("Modules/Common/TabBox") -local _TabData={ [1] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = Language[12251] , nameNew = "极速探索" ,rpType = RedPointType.NiuQiChongTian_1}, - [2] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = Language[12252] , nameNew = "神将招募" ,rpType = RedPointType.NiuQiChongTian_2}, - [3] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = Language[12253] , nameNew = "神将升星" ,rpType = RedPointType.NiuQiChongTian_3},} +local _TabData={ [1] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = Language[12251] , nameNew = "神将招募" ,rpType = RedPointType.NiuQiChongTian_1}, + [2] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = Language[12252] , nameNew = "神将升星" ,rpType = RedPointType.NiuQiChongTian_2}, + [3] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = Language[12253] , nameNew = "极速探索" ,rpType = RedPointType.NiuQiChongTian_3},} local _TabFontColor = { default = Color.New(130 / 255, 128 / 255, 120 / 255, 1), select = Color.New(243 / 255, 235 / 255, 202 / 255, 1)} @@ -220,6 +220,7 @@ function NiuQiChongTianPanel:SingleDataShow(go, index,data) local grid = Util.GetGameObject(go, "rewardList") local shadow = Util.GetGameObject(go, "shadow") + LogGreen("data.Reward:"..tostring(#data.Reward)) local shows = data.Reward title.text = GetLanguageStrById(data.Text) redPoint:SetActive(data.state == 1) From 550ae985be3a49fdc239138d601bc533e699f071 Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Fri, 15 Oct 2021 17:52:05 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E3=80=90=E7=89=9B=E6=B0=94=E5=86=B2?= =?UTF-8?q?=E5=A4=A9=E3=80=91=E8=B7=B3=E8=BD=AC=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/NiuQiChongTian/NiuQiChongTianManager.lua | 1 + .../~Lua/Modules/NiuQiChongTian/NiuQiChongTianPanel.lua | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianManager.lua b/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianManager.lua index 79750cf87c..2b8e76a4b2 100644 --- a/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianManager.lua @@ -79,6 +79,7 @@ function this.CreatSingleData(sData) data.Sort = sData.Sort data.Type = sData.Type data.state = 0 + data.jumpId = sData.JumpID return data end diff --git a/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianPanel.lua b/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianPanel.lua index 7e492509ea..41e6c72b33 100644 --- a/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianPanel.lua @@ -220,7 +220,6 @@ function NiuQiChongTianPanel:SingleDataShow(go, index,data) local grid = Util.GetGameObject(go, "rewardList") local shadow = Util.GetGameObject(go, "shadow") - LogGreen("data.Reward:"..tostring(#data.Reward)) local shows = data.Reward title.text = GetLanguageStrById(data.Text) redPoint:SetActive(data.state == 1) @@ -258,7 +257,7 @@ function NiuQiChongTianPanel:SingleDataShow(go, index,data) Util.AddOnceClick(btn.gameObject,function () if data.state == 0 then - JumpManager.GoJump(1023) + JumpManager.GoJump(data.jumpId) elseif data.state == 1 then NetManager.TakeMissionRewardRequest(TaskTypeDef.NiuQiChongTian,data.id,function (msg) UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function ()