diff --git a/Assets/ManagedResources/Prefabs/UI/Expert/ExpertPanel.prefab b/Assets/ManagedResources/Prefabs/UI/Expert/ExpertPanel.prefab index bb3dfd806c..ca439fa532 100644 --- a/Assets/ManagedResources/Prefabs/UI/Expert/ExpertPanel.prefab +++ b/Assets/ManagedResources/Prefabs/UI/Expert/ExpertPanel.prefab @@ -235823,6 +235823,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 4634750098992866008} + - {fileID: 5327371165321792776} m_Father: {fileID: 2064019409711115706} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -268831,6 +268832,80 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 +--- !u!1 &7722401667177702549 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5327371165321792776} + - component: {fileID: 6299052435539417828} + - component: {fileID: 4922296225559610778} + m_Layer: 5 + m_Name: redpot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5327371165321792776 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7722401667177702549} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 153316246201902331} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 107, y: 26} + m_SizeDelta: {x: 30, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6299052435539417828 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7722401667177702549} + m_CullTransparentMesh: 0 +--- !u!114 &4922296225559610778 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7722401667177702549} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: f9ea4c4aff328ff4abcc21aae0a4fa10, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 --- !u!1 &7741201776707222630 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua index 399318ba80..3ef0d8d03e 100644 --- a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua +++ b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua @@ -784,6 +784,7 @@ RedPointType = { --- 限时达人红点 ---- Expert_FastExplore=3110,--极速达人 Expert_AreaExper = 3111,--竞技达人 + Expert_LimitExchange = 3108,--限时兑换 Expert_UpStarExper = 3109,--进阶达人 Expert_EquipExper = 3112,--装备达人 Expert_GoldExper = 3113,--点金达人 @@ -867,6 +868,9 @@ RedPointType = { HongMeng_Evory = 8011, -- 鸿蒙使者格子 HongMeng_UpTower = 8012, -- 升级鸿蒙塔 按钮 HongMeng_OpenBox = 8013, -- 格子开启 + + -- 限时兑换活动 + LimitExchange_GoExchange = 31081, } RedPointStatus = { diff --git a/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua b/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua index 7509277aa6..cd0027930f 100644 --- a/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua @@ -35,6 +35,10 @@ function this.Initialize() this.chapterGetRewardState = {} this.isOpenWeekCard = false--今天是否打开过周卡 + + -- 每次登录显示兑换红点 + this.SetExchangeRedStatus(true) + Game.GlobalEvent:AddEvent(GameEvent.Player.OnLevelChange, function() CheckRedPointStatus(RedPointType.Expert_UpLv) end) @@ -171,6 +175,7 @@ function this.InitActivityServerData(msg, isUpdate) TreasureOfSomebodyManagerV2.SetTreasureLocalData() this.OnlineStartCountDown() FindFairyManager.SetActivityData() + end --倒计时逻辑处理 @@ -1128,4 +1133,26 @@ function this.GetTimeShow(data) return time end +-- 限时兑换红点显示逻辑 +function this.IsExchangeRedShow() + if not this.isExchangeRedShow then + return false + end + + local isOpen = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.LimitExchange) + if isOpen then + return false + end + + local LimitExchange = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.LimitExchange) + local exChangeConFig = ConfigManager.GetConfigDataByKey(ConfigName.ExchangeActivityConfig, "ActivityId", LimitExchange.activityId) + if BagManager.GetItemCountById(exChangeConFig.ActivityItem) > 0 then + return true + end + return false +end +function this.SetExchangeRedStatus(isShow) + this.isExchangeRedShow = isShow +end + return this \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Expert/ExChange.lua b/Assets/ManagedResources/~Lua/Modules/Expert/ExChange.lua index 66ff0f714c..060d4a5049 100644 --- a/Assets/ManagedResources/~Lua/Modules/Expert/ExChange.lua +++ b/Assets/ManagedResources/~Lua/Modules/Expert/ExChange.lua @@ -28,6 +28,7 @@ function ExChange:InitComponent(gameObject) exChangeInfoGrid[i] = Util.GetGameObject(gameObject, "downbg1/info/infoTextGrid/infoText ("..i..")") end this.exChangeGoBtn = Util.GetGameObject(gameObject, "downbg2/goBtn") + this.goBtnRedpot = Util.GetGameObject(gameObject, "downbg2/goBtn/redpot") this.click = Util.GetGameObject(gameObject, "leftUpGO/click") this.live2dRoot = Util.GetGameObject(gameObject, "bg/live") @@ -43,6 +44,9 @@ function ExChange:BindEvent() Util.AddClick(this.click, function() UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, heroConfig.Id, heroConfig.Star) end) + + -- 前往兑换红点 + BindRedPointObject(RedPointType.LimitExchange_GoExchange, this.goBtnRedpot) end --添加事件监听(用于子类重写) @@ -137,6 +141,9 @@ function ExChange:ExChangeShow() return end UIManager.OpenPanel(UIName.MainShopPanel,exChangeConFig.ShopId) + -- 关闭红点儿显示 + ActivityGiftManager.SetExchangeRedStatus(false) + CheckRedPointStatus(RedPointType.LimitExchange_GoExchange) end) end --界面关闭时调用(用于子类重写) @@ -159,6 +166,8 @@ end --界面销毁时调用(用于子类重写) function ExChange:OnDestroy() itemList = {} + + ClearRedPointObject(RedPointType.LimitExchange_GoExchange, this.goBtnRedpot) end return ExChange \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Expert/ExpertPanel.lua b/Assets/ManagedResources/~Lua/Modules/Expert/ExpertPanel.lua index 5780665d74..721de3654f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Expert/ExpertPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Expert/ExpertPanel.lua @@ -125,6 +125,7 @@ function ExpertPanel:BindEvent() BindRedPointObject(RedPointType.LuckyCat, expertRedPointGrid[5]) --BindRedPointObject(RedPointType.Expert_LuckyTurn, expertRedPointGrid[6]) BindRedPointObject(RedPointType.Expert_AccumulativeRecharge, expertRedPointGrid[7]) + BindRedPointObject(RedPointType.Expert_LimitExchange, expertRedPointGrid[8]) BindRedPointObject(RedPointType.Expert_UpStarExper, expertRedPointGrid[9]) BindRedPointObject(RedPointType.Expert_FastExplore, expertRedPointGrid[10]) BindRedPointObject(RedPointType.Expert_AreaExper, expertRedPointGrid[11]) @@ -490,6 +491,7 @@ function ExpertPanel:OnDestroy() ClearRedPointObject(RedPointType.LuckyCat) --ClearRedPointObject(RedPointType.Expert_LuckyTurn) ClearRedPointObject(RedPointType.Expert_AccumulativeRecharge) + ClearRedPointObject(RedPointType.Expert_LimitExchange) ClearRedPointObject(RedPointType.Expert_UpStarExper) ClearRedPointObject(RedPointType.Expert_FastExplore) ClearRedPointObject(RedPointType.Expert_AreaExper) diff --git a/Assets/ManagedResources/~Lua/Modules/Player/RedPointData.lua b/Assets/ManagedResources/~Lua/Modules/Player/RedPointData.lua index d5208e6e75..d89813d7aa 100644 --- a/Assets/ManagedResources/~Lua/Modules/Player/RedPointData.lua +++ b/Assets/ManagedResources/~Lua/Modules/Player/RedPointData.lua @@ -1,4 +1,4 @@ -local isLog = false +local isLog = true local function __DebugLog(str) if isLog then Log("" .. str .. "") diff --git a/Assets/ManagedResources/~Lua/Modules/Player/RedpotManager.lua b/Assets/ManagedResources/~Lua/Modules/Player/RedpotManager.lua index e616e09ae4..997c5b32c2 100644 --- a/Assets/ManagedResources/~Lua/Modules/Player/RedpotManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Player/RedpotManager.lua @@ -233,6 +233,7 @@ function this.InitRedPointAllRelate() RPData:SetParent(RedPointType.ContinuityRecharge, RedPointType.Expert) RPData:SetParent(RedPointType.Expert_Expedition, RedPointType.Expert) RPData:SetParent(RedPointType.Expert_Slhj, RedPointType.Expert) + RPData:SetParent(RedPointType.Expert_LimitExchange, RedPointType.Expert) --战力排行 RPData:SetParent(RedPointType.WarPowerSort_Sort, RedPointType.WarPowerSort) --背包 @@ -279,6 +280,9 @@ function this.InitRedPointAllRelate() RPData:SetParent(RedPointType.NiuQiChongTian_2,RedPointType.NiuQiChongTian) RPData:SetParent(RedPointType.NiuQiChongTian_3,RedPointType.NiuQiChongTian) RPData:SetParent(RedPointType.NiuQiChongTian_4,RedPointType.NiuQiChongTian) + + -- 限时兑换 + RPData:SetParent(RedPointType.LimitExchange_GoExchange,RedPointType.Expert_LimitExchange) end -- 注册红点检测方法 @@ -473,6 +477,10 @@ function this.RegisterRedCheckFunc() RPData:AddCheckFunc(RedPointType.NiuQiChongTian_2,NiuQiChongTianManager.NiuQiCheckRedPoint2) RPData:AddCheckFunc(RedPointType.NiuQiChongTian_3,NiuQiChongTianManager.NiuQiCheckRedPoint3) RPData:AddCheckFunc(RedPointType.NiuQiChongTian_4,NiuQiChongTianManager.NiuQiCheckRedPoint4) + + -- 限时兑换 + RPData:AddCheckFunc(RedPointType.LimitExchange_GoExchange,ActivityGiftManager.IsExchangeRedShow) + end