Lua/Gen/SnxxzUIEquipStarModelWrap.cs
@@ -365,10 +365,6 @@ { System.Collections.Generic.List<int> gen_ret = gen_to_be_invoked.GetCandidatePlaces( ); translator.Push(L, gen_ret); return 1; } System/EquipStar/EquipStar.cs
@@ -8,11 +8,19 @@ public class EquipSetStar { public readonly int level = 0; public Redpoint redpoint; Dictionary<int, int> equipStars = new Dictionary<int, int>(); Dictionary<int, Redpoint> equipStarPoints = new Dictionary<int, Redpoint>(); public EquipSetStar(int level) { this.level = level; this.redpoint = new Redpoint(1720000, 1720000 + level * 100); for (var i = 1; i <= 12; i++) { equipStarPoints[i] = new Redpoint(1720000 + level * 100, 1720000 + level * 100 + i); } } public int GetTotalStarLevel() @@ -47,6 +55,26 @@ return count; } public void UpdateRedpoint(int place, RedPointState state) { if (equipStarPoints.ContainsKey(place)) { equipStarPoints[place].state = state; } } public RedPointState GetRedpointState(int place) { if (equipStarPoints.ContainsKey(place)) { return equipStarPoints[place].state; } else { return RedPointState.None; } } } public enum EquipSuitType System/EquipStar/EquipStarLevelSelectBehaviour.cs
@@ -15,6 +15,7 @@ [SerializeField] Image m_BackGround; [SerializeField] Image m_Arrow; [SerializeField] Text m_Title; [SerializeField] RedpointBehaviour m_Redpoint; readonly List<EquipStarUpgradeCandidateSlot> slotBehaviours = new List<EquipStarUpgradeCandidateSlot>(); @@ -24,11 +25,13 @@ public int level { get; private set; } public void Init(int level) { this.level = level; this.m_Redpoint.redpointId = 1720000 + this.level * 100; var equipSet = equipModel.GetEquipSet(level); var realmConfig = RealmConfig.Get(equipSet.realm); this.m_Title.text = Language.Get("RealmEquipName", realmConfig.Name); this.level = level; m_Select.SetListener(Select); } @@ -43,11 +46,10 @@ public void Display() { var siblingIndex = this.transform.GetSiblingIndex(); var candidates = this.model.GetCandidatePlaces(); for (var i = candidates.Count - 1; i >= 0; i--) for (var i = 12; i >=1; i--) { var behaviour = EquipStarUpgradeCandidateSlotPool.Get(); behaviour.Display(candidates[i]); behaviour.Display(i); behaviour.transform.SetParentEx(this.transform.parent, Vector3.zero, Quaternion.identity, Vector3.one); behaviour.transform.SetSiblingIndex(siblingIndex + 1); slotBehaviours.Add(behaviour); System/EquipStar/EquipStarModel.cs
@@ -28,7 +28,11 @@ public readonly LogicInt starResultEffect = new LogicInt(); Dictionary<int, EquipSetStar> equipStars = new Dictionary<int, EquipSetStar>(); Dictionary<int, EquipStarUpgradeCandidate> candidatePlaces = new Dictionary<int, EquipStarUpgradeCandidate>(); List<EquipStarUpgradeCandidate> candidatePlaces = new List<EquipStarUpgradeCandidate>(); Redpoint redpoint = new Redpoint(1720000); bool redpointDirty = false; LogicUpdate logicUpdate = new LogicUpdate(1); PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } } EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } } @@ -36,12 +40,16 @@ public override void Init() { ParseConfig(); logicUpdate.Start(OnUpdate); packModel.refreshItemCountEvent += OnItemCountRefresh; DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent += OnGetUpgradeStarResult; } public override void UnInit() { DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent += OnGetUpgradeStarResult; packModel.refreshItemCountEvent -= OnItemCountRefresh; DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent -= OnGetUpgradeStarResult; } public void OnBeforePlayerDataInitialize() @@ -72,7 +80,7 @@ var maxStarLevel = GetMaxStarLevel(selectedLevel.value); UpdateSelelctedEquipStars(selectedEquipOldStar, starLevel, maxStarLevel); foreach (var candidate in candidatePlaces.Values) foreach (var candidate in candidatePlaces) { candidate.starLevel.value = GetEquipStarLevel(candidate.equipPosition); } @@ -185,30 +193,67 @@ stars.Clear(); } public Int2 GetRecommendEquipPosition() { foreach (var starSet in equipStars.Values) { var level = starSet.level; for (var place = 1; place <= 12; place++) { var isRedpoint = starSet.GetRedpointState(place) != RedPointState.None; if (isRedpoint) { return new Int2(level, place); } } } foreach (var starSet in equipStars.Values) { var level = starSet.level; for (var i = 1; i <= 12; i++) { var equipPosition = new Int2(level, i); var item = packModel.GetItemByGuid(equipModel.GetEquip(equipPosition)); if (item == null) { continue; } var starLevel = GetStarLevel(equipPosition); var maxStarLevel = GetMaxStarLevel(item.config.ItemColor, item.config.LV); if (starLevel >= maxStarLevel) { continue; } } } return new Int2(1, 1); } public void SelectLevel(int level) { selectedLevel.value = level; candidatePlaces.Clear(); var places = GetStarUpgradablePlaces(level); if (places.IsNullOrEmpty()) if (level > 0) { SelectPlace(new Int2(level, 0)); } else { for (var i = 0; i < places.Count; i++) for (var i = 1; i <= 12; i++) { var place = places[i]; var place = i; var equipPosition = new Int2(level, place); var candidate = new EquipStarUpgradeCandidate(equipPosition); candidate.starLevel.value = GetEquipStarLevel(equipPosition); candidatePlaces[place] = candidate; if (i == 0) { SelectPlace(equipPosition); } candidatePlaces.Add(candidate); candidatePlaces.Sort(EquipStarUpgradeCandidateCompare); } SelectPlace(candidatePlaces[0].equipPosition); } else { SelectPlace(Int2.zero); } } @@ -216,62 +261,27 @@ { selectedPlace.value = equipPosition.y; selectedPlace.dirty = true; foreach (var candidate in candidatePlaces.Values) if (equipPosition.x > 0 && equipPosition.y >= 1 && equipPosition.y <= 12) { candidate.selected.value = candidate.equipPosition == equipPosition; } var starLevel = GetEquipStarLevel(equipPosition); var maxStarLevel = GetMaxStarLevel(equipPosition.x); equipStarLevel.value = starLevel; equipMaxStarLevel.value = maxStarLevel; UpdateSelelctedEquipStars(starLevel, starLevel, maxStarLevel); AutoAddMaterials(equipPosition); CalculateStarUpgradeProbability(equipPosition); } private List<int> GetStarUpgradablePlaces(int level) { if (level <= 0) { return null; } var equipSet = equipModel.GetEquipSet(level); if (equipSet == null) { return null; } var places = new List<int>(); for (var i = 1; i <= 12; i++) { var unLocked = equipSet.IsSlotUnLocked(i); if (unLocked) foreach (var candidate in candidatePlaces) { places.Add(i); candidate.selected.value = candidate.equipPosition == equipPosition; } var starLevel = GetEquipStarLevel(equipPosition); var maxStarLevel = GetMaxStarLevel(equipPosition.x); equipStarLevel.value = starLevel; equipMaxStarLevel.value = maxStarLevel; UpdateSelelctedEquipStars(starLevel, starLevel, maxStarLevel); AutoAddMaterials(equipPosition); CalculateStarUpgradeProbability(equipPosition); } return places; } public List<int> GetCandidatePlaces() { return new List<int>(candidatePlaces.Keys); } public EquipStarUpgradeCandidate GetCandidatePlace(int index) { if (candidatePlaces.ContainsKey(index)) { return candidatePlaces[index]; } else { return null; } return candidatePlaces.Find(x => { return x.equipPosition.y == index; }); } public bool IsEquipPlaceUpgradable(string equipGuid) @@ -418,23 +428,12 @@ return null; } var expcetMaterials = packModel.GetItems(PackType.Item, new SinglePack.FilterParams() { }); for (var i = expcetMaterials.Count - 1; i >= 0; i--) var expcetMaterials = packModel.GetItems(PackType.Item, new SinglePack.FilterParams() { var item = expcetMaterials[i]; if (item.config.RealmLimit != equip.config.RealmLimit) { expcetMaterials.RemoveAt(i); } else if (!config.CostEquipPlace.Contains(item.config.EquipPlace)) { expcetMaterials.RemoveAt(i); } else if (!config.CostEquipColor.Contains(item.config.ItemColor)) { expcetMaterials.RemoveAt(i); } } qualitys = new List<int>(config.CostEquipColor), equipTypes = new List<int>(config.CostEquipPlace), realmLimit = equip.config.RealmLimit, }); for (var i = 1; i <= 5; i++) { @@ -583,6 +582,159 @@ } } private void OnItemCountRefresh(PackType type, int index, int itemId) { switch (type) { case PackType.Item: if (ItemLogicUtility.Instance.IsEquip(itemId)) { redpointDirty = true; } var itemConfig = ItemConfig.Get(itemId); if (itemConfig.Type == 34) { redpointDirty = true; } break; case PackType.Equip: var clientEquipPosition = EquipSet.ServerPlaceToClientPlace(index); if (clientEquipPosition.x > 0) { redpointDirty = true; } break; } } private void UpdateStarRedpoint() { var targetEquipPosition = Int2.zero; var minStarLevel = 999; foreach (var trainSet in equipStars.Values) { var level = trainSet.level; for (var place = 1; place <= 12; place++) { var equipPosition = new Int2(level, place); var item = packModel.GetItemByGuid(equipModel.GetEquip(equipPosition)); if (item == null) { continue; } //达到最大星级 var maxStarLevel = GetMaxStarLevel(item.config.ItemColor, item.config.LV); var starLevel = GetStarLevel(new Int2(level, place)); if (starLevel >= maxStarLevel) { continue; } //不是候选者中星级最小的 if (starLevel > minStarLevel) { continue; } var config = EquipStarConfig.Get(level, place, starLevel + 1); if (config == null) { continue; } //固定材料不足 if (config.CostItemDict.x > 0 && packModel.GetItemCountByID(PackType.Item, config.CostItemDict.x) < config.CostItemDict.y) { continue; } var materials = packModel.GetItems(PackType.Item, new SinglePack.FilterParams() { qualitys = new List<int>(config.CostEquipColor), equipTypes = new List<int>(config.CostEquipPlace), realmLimit = item.config.RealmLimit, }); for (int j = materials.Count - 1; j >= 0; j--) { var material = materials[j]; if (ItemLogicUtility.Instance.IsFightUp(material.itemId, material.score) == 1) { materials.RemoveAt(j); } } if (materials.Count < config.CostEquipCnt) { continue; } minStarLevel = starLevel; targetEquipPosition = new Int2(level, place); } } foreach (var starSet in equipStars.Values) { var level = starSet.level; if (!equipModel.IsLevelUnLocked(level)) { continue; } for (var place = 1; place <= 12; place++) { var isRedpoint = level == targetEquipPosition.x && place == targetEquipPosition.y; starSet.UpdateRedpoint(place, isRedpoint ? RedPointState.Simple : RedPointState.None); } } } private void OnUpdate() { if (redpointDirty) { redpointDirty = false; UpdateStarRedpoint(); } } private int EquipStarUpgradeCandidateCompare(EquipStarUpgradeCandidate x, EquipStarUpgradeCandidate y) { var guidX = equipModel.GetEquip(x.equipPosition); var guidY = equipModel.GetEquip(y.equipPosition); if (!string.IsNullOrEmpty(guidX) && string.IsNullOrEmpty(guidY)) { return -1; } if (string.IsNullOrEmpty(guidX) && !string.IsNullOrEmpty(guidY)) { return -1; } if (string.IsNullOrEmpty(guidX) && string.IsNullOrEmpty(guidY)) { return x.equipPosition.y.CompareTo(y.equipPosition.y); } var equipX = packModel.GetItemByGuid(guidX); var equipY = packModel.GetItemByGuid(guidY); var canUpgradeStarLevelX = GetMaxStarLevel(equipX.config.ItemColor, equipX.config.LV) - GetStarLevel(x.equipPosition); var canUpgradeStarLevelY = GetMaxStarLevel(equipY.config.ItemColor, equipY.config.LV) - GetStarLevel(y.equipPosition); var compareResult = canUpgradeStarLevelX.CompareTo(canUpgradeStarLevelY); if (compareResult == 0) { return x.equipPosition.y.CompareTo(y.equipPosition.y); } return -compareResult; } private void ParseConfig() { var configs = EquipStarConfig.GetValues(); System/EquipStar/EquipStarUpgradeCandidate.cs
@@ -19,7 +19,6 @@ { this.equipPosition = equipPosition; } } } System/EquipStar/EquipStarUpgradeCandidateSlot.cs
@@ -18,6 +18,7 @@ [SerializeField] Text m_Description1; [SerializeField] Text m_Description2; [SerializeField] Button m_Select; [SerializeField] RedpointBehaviour m_Redpoint; EquipStarModel model { get { return ModelCenter.Instance.GetModel<EquipStarModel>(); } } EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } } @@ -30,7 +31,7 @@ { this.place = place; this.candidate = model.GetCandidatePlace(this.place); this.m_Redpoint.redpointId = 1720000 + this.candidate.equipPosition.x * 100 + this.candidate.equipPosition.y; DisplayBaseInfo(); DisplayDynamicInfo(true); System/EquipStar/EquipStarWin.cs
@@ -54,7 +54,8 @@ { if (model.selectedLevel.value == 0) { model.SelectLevel(equipModel.GetLastestUnLockEquipSet()); var equipPosition = model.GetRecommendEquipPosition(); model.SelectLevel(equipPosition.x); } DisplayBaseInfo(); System/EquipTrain/EquipTrainModel.cs
@@ -246,16 +246,11 @@ selectedLevel.value = level; candidatePlaces.Clear(); var places = GetTrainablePlaces(level); if (places.IsNullOrEmpty()) if (level > 0) { SelectPlace(new Int2(level, 0)); } else { for (var i = 0; i < places.Count; i++) for (var i = 1; i <= 12; i++) { var place = places[i]; var place = i; var equipPosition = new Int2(level, place); var trainCandidate = new EquipTrainCandidate(equipPosition); @@ -265,63 +260,12 @@ candidatePlaces.Add(trainCandidate); } candidatePlaces.Sort((EquipTrainCandidate x, EquipTrainCandidate y) => { var stateX = GetEquipPlaceTrainState(x.equipPosition); var stateY = GetEquipPlaceTrainState(y.equipPosition); if (stateX == TrainState.Allowable && stateY != TrainState.Allowable) { return -1; } if (stateX != TrainState.Allowable && stateY == TrainState.Allowable) { return 1; } if (stateX == TrainState.Allowable && stateY == TrainState.Allowable) { var compareResult = x.trainLevel.value.CompareTo(y.trainLevel.value); if (compareResult == 0) { compareResult = x.equipPosition.y.CompareTo(y.equipPosition.y); } return compareResult; } if (stateX == TrainState.StarLimit && stateY != TrainState.StarLimit) { return -1; } else if (stateX != TrainState.StarLimit && stateY == TrainState.StarLimit) { return 1; } else if (stateX == TrainState.MaxLevel && stateY != TrainState.MaxLevel) { return -1; } else if (stateX != TrainState.MaxLevel && stateY == TrainState.MaxLevel) { return 1; } else if (stateX == TrainState.Empty && stateY != TrainState.Empty) { return -1; } else if (stateX != TrainState.Empty && stateY == TrainState.Empty) { return 1; } else { return x.equipPosition.y.CompareTo(y.equipPosition.y); } }); candidatePlaces.Sort(EquipTrainCandidateCompare); SelectPlace(candidatePlaces[0].equipPosition); } else { SelectPlace(Int2.zero); } } @@ -329,21 +273,25 @@ { selectedPlace.value = equipPosition.y; selectedPlace.dirty = true; for (int i = 0; i < candidatePlaces.Count; i++) if (equipPosition.x > 0 && equipPosition.y >= 1 && equipPosition.y <= 12) { var candidate = candidatePlaces[i]; candidate.selected.value = candidate.equipPosition == equipPosition; for (int i = 0; i < candidatePlaces.Count; i++) { var candidate = candidatePlaces[i]; candidate.selected.value = candidate.equipPosition == equipPosition; } var trainState = GetEquipPlaceTrainState(equipPosition); equipTrainLevel.value = GetTrainLevel(equipPosition); equipTrainMaxLevel.value = trainState == TrainState.Empty ? -1 : GetMaxTrainLevel(equipPosition); equipTrainMaxLevel.dirty = true; material.value = GetTrainMaterial(equipPosition); operateType.value = CalculateTrainOperateType(equipPosition); InitTrainableProperties(equipPosition, operateType.value); UpdateTrainLimitState(equipPosition); } var trainState = GetEquipPlaceTrainState(equipPosition); equipTrainLevel.value = GetTrainLevel(equipPosition); equipTrainMaxLevel.value = trainState == TrainState.Empty ? -1 : GetMaxTrainLevel(equipPosition); equipTrainMaxLevel.dirty = true; material.value = GetTrainMaterial(equipPosition); operateType.value = CalculateTrainOperateType(equipPosition); InitTrainableProperties(equipPosition, operateType.value); UpdateTrainLimitState(equipPosition); } public void SetInevitable(int index, bool invevitable) @@ -578,32 +526,6 @@ return new Int3(property1, property2, property3); } private List<int> GetTrainablePlaces(int level) { if (level <= 0) { return null; } var equipSet = equipModel.GetEquipSet(level); if (equipSet == null) { return null; } var places = new List<int>(); for (var i = 1; i <= 12; i++) { var unLocked = equipSet.IsSlotUnLocked(i); if (unLocked) { places.Add(i); } } return places; } private void InitTrainableProperties(Int2 equipPosition, TrainOperateType operateType) { propertyBars.Clear(); @@ -745,14 +667,21 @@ private void OnItemCountRefresh(PackType type, int index, int itemId) { if (type != PackType.Item) switch (type) { return; } if (itemId == 5303) { redpointDirty = true; case PackType.Item: if (itemId == 5303) { redpointDirty = true; } break; case PackType.Equip: var clientEquipPosition = EquipSet.ServerPlaceToClientPlace(index); if (clientEquipPosition.x > 0) { redpointDirty = true; } break; } } @@ -811,6 +740,62 @@ } } private int EquipTrainCandidateCompare(EquipTrainCandidate x, EquipTrainCandidate y) { var stateX = GetEquipPlaceTrainState(x.equipPosition); var stateY = GetEquipPlaceTrainState(y.equipPosition); if (stateX == TrainState.Allowable && stateY != TrainState.Allowable) { return -1; } if (stateX != TrainState.Allowable && stateY == TrainState.Allowable) { return 1; } if (stateX == TrainState.Allowable && stateY == TrainState.Allowable) { var compareResult = x.trainLevel.value.CompareTo(y.trainLevel.value); if (compareResult == 0) { compareResult = x.equipPosition.y.CompareTo(y.equipPosition.y); } return compareResult; } if (stateX == TrainState.StarLimit && stateY != TrainState.StarLimit) { return -1; } else if (stateX != TrainState.StarLimit && stateY == TrainState.StarLimit) { return 1; } else if (stateX == TrainState.MaxLevel && stateY != TrainState.MaxLevel) { return -1; } else if (stateX != TrainState.MaxLevel && stateY == TrainState.MaxLevel) { return 1; } else if (stateX == TrainState.Empty && stateY != TrainState.Empty) { return -1; } else if (stateX != TrainState.Empty && stateY == TrainState.Empty) { return 1; } else { return x.equipPosition.y.CompareTo(y.equipPosition.y); } } private void ParseConfig() { var config = FuncConfigConfig.Get("EquipWashGroup"); System/EquipTrain/EquipTrainWin.cs
@@ -68,7 +68,6 @@ { var equipPosition = model.GetRecommendEquipPosition(); model.SelectLevel(equipPosition.x); model.SelectPlace(equipPosition); } } System/KnapSack/Logic/SinglePack.cs
@@ -101,16 +101,48 @@ foreach (var item in items.Values) { var levelValid = filterParams.levels == null || filterParams.levels.Contains(item.config.LV); var qualityValid = filterParams.qualitys == null || filterParams.qualitys.Contains(item.config.ItemColor); var typeValid = filterParams.itemTypes == null || filterParams.itemTypes.Contains(item.config.Type); var equipTypeValid = filterParams.equipTypes == null || filterParams.equipTypes.Contains(item.config.EquipPlace); var jobValid = filterParams.jobs == null || filterParams.jobs.Contains(item.config.JobLimit); var auctionValid = filterParams.isAuction == item.isAuction; if (levelValid && qualityValid && typeValid && equipTypeValid && jobValid && auctionValid) if (!levelValid) { list.Add(item); continue; } var qualityValid = filterParams.qualitys == null || filterParams.qualitys.Contains(item.config.ItemColor); if (!qualityValid) { continue; } var typeValid = filterParams.itemTypes == null || filterParams.itemTypes.Contains(item.config.Type); if (!typeValid) { continue; } var equipTypeValid = filterParams.equipTypes == null || filterParams.equipTypes.Contains(item.config.EquipPlace); if (!equipTypeValid) { continue; } var jobValid = filterParams.jobs == null || filterParams.jobs.Contains(item.config.JobLimit); if (!jobValid) { continue; } var auctionValid = filterParams.isAuction == item.isAuction; if (!auctionValid) { continue; } var realmValid = filterParams.realmLimit == 0 || filterParams.realmLimit == item.config.RealmLimit; if (!realmValid) { continue; } list.Add(item); } return list; @@ -206,6 +238,7 @@ public List<int> qualitys; public List<int> itemTypes; public List<int> equipTypes; public int realmLimit; public bool isAuction; public List<int> jobs; } System/MainInterfacePanel/HeadPortraitTip.cs
@@ -338,6 +338,7 @@ if (PlayerDatas.Instance.baseData.LV > GetLv) { GetLv = PlayerDatas.Instance.baseData.LV; ModelCenter.Instance.GetModel<TaskModel>().taskWait.Push(TaskModel.TaskWaitType.LevelUp); WindowCenter.Instance.Open<UpgradeWin>(); } break; System/MainInterfacePanel/InGamePushContainer.cs
@@ -152,6 +152,7 @@ { if (betterEquipGetModel.ShowBetterEquipAble()) { ModelCenter.Instance.GetModel<TaskModel>().taskWait.Push(TaskModel.TaskWaitType.BetterEquip); m_BetterEquipPusher.gameObject.SetActive(true); m_BetterEquipPusher.ShowBetterEquip(); } System/MainInterfacePanel/TaskModel.cs
@@ -138,6 +138,7 @@ private int NeedWaitTime = 4; private float mainTaskAutoWaitTime = 0f; public readonly TaskWait taskWait = new TaskWait(); PackModel _playerPack; PackModel playerPack @@ -254,6 +255,7 @@ if (allMissionDict[MissionID].MissionState != MissionState && MissionState == 3 && AutomaticityBool) { TaskOverBool = true; taskWait.Push(TaskWaitType.TaskComplete); if (CompletionOfTaskEvent != null) { CompletionOfTaskEvent(MissionID); @@ -1361,7 +1363,10 @@ if (MainTaskDic.ContainsKey(_taskID))//主线等待表现 { yield return WaitingForSecondConst.GetWaitForSeconds(mainTaskAutoWaitTime); if (taskWait.wait) { yield return WaitingForSecondConst.GetWaitForSeconds(mainTaskAutoWaitTime); } } if (GA_Hero.s_MapSwitching) @@ -1682,4 +1687,37 @@ TaskAllocation.Instance.TaskTime = TimeUtility.ServerNow; } } public class TaskWait { public bool wait { get { foreach (var key in taskWaits.Keys) { if ((TimeUtility.ServerNow - taskWaits[key]).TotalSeconds < 1f) { return true; } } return false; } } Dictionary<TaskWaitType, DateTime> taskWaits = new Dictionary<TaskWaitType, DateTime>(); public void Push(TaskWaitType type) { taskWaits[type] = TimeUtility.ServerNow; } } public enum TaskWaitType { TaskComplete, LevelUp, TreasureProgress, BetterEquip, } } System/Realm/RealmWin.cs
@@ -519,7 +519,8 @@ if (window is RealmPromoteWin) { var equipLevel = 0; if (model.IsUnlockEquipRealm(RealmPromoteWin.realmLevel, out equipLevel)) if (RealmPromoteWin.realmLevel >= model.realmEquipDisplayLevel && model.IsUnlockEquipRealm(RealmPromoteWin.realmLevel, out equipLevel)) { RealmNewEquipWin.realmLevel = RealmPromoteWin.realmLevel; WindowCenter.Instance.Open<RealmNewEquipWin>(); System/Treasure/TreasureCollectBriefInfoBehaviour.cs
@@ -26,7 +26,7 @@ [SerializeField] Transform m_ContainerCollecting; [SerializeField] Text m_Progress; [SerializeField] Slider m_TaskSlider; [SerializeField] SmoothSlider m_TaskSlider; [SerializeField] Transform m_ContainerChallenge; [SerializeField] UIEffect m_ChallengeEffect; @@ -45,6 +45,20 @@ { m_DisplayId = value; dirty = true; } } } bool m_FullProgress = false; bool fullProgress { get { return m_FullProgress; } set { if (m_FullProgress != value) { m_FullProgress = value; DisplayProgress(); } } } @@ -98,6 +112,7 @@ } if (gameObject.activeInHierarchy) { taskModel.taskWait.Push(TaskModel.TaskWaitType.TreasureProgress); m_CacheCoroutine = StartCoroutine(Co_StopEffect()); } } @@ -107,7 +122,7 @@ { yield return WaitingForSecondConst.WaitMS1500; m_ProgressEffect.StopImediatly(); DisplayProgress(); DisplayProgress(true); } void DisplayBase() @@ -147,28 +162,31 @@ } } void DisplayProgress() void DisplayProgress(bool animationStep = false) { m_ChallengeEffect.StopImediatly(); if (displayId != 0) { var satisfyChallenge = model.SatisfyChallenge(displayId); var progress = 1f; Dictionary<int, List<int>> clues; if (model.TryGetTreasureClues(displayId, out clues)) { var count = model.GetCompleteTaskCount(displayId); progress = Mathf.Clamp01((float)count / clues.Count); } m_TaskSlider.value = progress; if (!animationStep) { m_TaskSlider.ResetValue(progress); } var satisfyChallenge = model.SatisfyChallenge(displayId) && m_TaskSlider.slider.value >= 1f; m_ContainerChallenge.gameObject.SetActive(satisfyChallenge); m_ContainerCollecting.gameObject.SetActive(!satisfyChallenge); if (!satisfyChallenge) { var progress = 1f; Dictionary<int, List<int>> clues; if (model.TryGetTreasureClues(displayId, out clues)) { var count = model.GetCompleteTaskCount(displayId); progress = Mathf.Clamp01((float)count / clues.Count); } m_TaskSlider.value = progress; m_Progress.text = StringUtility.Contact((int)(progress * 100), "%"); } else @@ -240,6 +258,8 @@ dirty = false; DisplayBase(); } fullProgress = m_TaskSlider.slider.value >= 1f; } public void Dispose()