public static bool Invoke(CM_ExpeditionWindow __instance, bool visible, bool inMenuBar)
        {
            __instance.gameObject.SetActive(visible);
            __instance.m_joinWindow.SetVisible(!inMenuBar && !SNetwork.SNet.IsInLobby);
            __instance.m_hostButton.SetVisible(!inMenuBar && !SNetwork.SNet.IsInLobby && (__instance.m_status != eExpeditionIconStatus.TierLocked && __instance.m_status != eExpeditionIconStatus.LockedAndScrambled) && __instance.m_status != eExpeditionIconStatus.TierLockedFinishedAnyway);
            __instance.m_changeExpeditionButton.SetVisible(SNetwork.SNet.IsMaster && !__instance.m_hostButton.IsVisible && (!inMenuBar && SNetwork.SNet.IsInLobby) && (RundownManager.ActiveExpedition != null && __instance.m_status != eExpeditionIconStatus.TierLocked && __instance.m_status != eExpeditionIconStatus.LockedAndScrambled) && __instance.m_status != eExpeditionIconStatus.TierLockedFinishedAnyway);
            __instance.m_matchButton.SetVisible(!inMenuBar && !SNetwork.SNet.IsInLobby && (__instance.m_status != eExpeditionIconStatus.TierLocked && __instance.m_status != eExpeditionIconStatus.LockedAndScrambled) && __instance.m_status != eExpeditionIconStatus.TierLockedFinishedAnyway);
            __instance.m_bottomStripes.SetActive(!__instance.m_hostButton.IsVisible && !__instance.m_changeExpeditionButton.IsVisible);
            if (visible)
            {
                var allCompletionData = CompletionData.LoadFromCache();
                var completionData    = allCompletionData.GetData(__instance.m_tier, __instance.m_expIndex);

                __instance.m_title.gameObject.SetActive(false);
                __instance.m_wardenObjective.gameObject.SetActive(false);
                __instance.m_wardenIntel.gameObject.SetActive(false);
                __instance.m_depth.gameObject.SetActive(false);
                CoroutineManager.BlinkIn(__instance.m_title.gameObject, 0.3f);
                CoroutineManager.BlinkIn(__instance.m_wardenObjective.gameObject, 1.1f);
                CoroutineManager.BlinkIn(__instance.m_wardenIntel.gameObject, 2.5f);
                CoroutineManager.BlinkIn(__instance.m_depth.gameObject, 3f);
                float delay1 = 1.8f;
                float num1   = 0.4f;
                __instance.UpdateProgression();
                SetupIcon(__instance.m_sectorIconMain, completionData.highCompletes > 0, LG_LayerType.MainLayer);
                __instance.m_sectorIconMain.SetVisible(false);
                __instance.m_sectorIconSecond.SetVisible(false);
                __instance.m_sectorIconThird.SetVisible(false);
                __instance.m_sectorIconAllCompleted.SetVisible(false);
                __instance.m_sectorIconMain.StopBlink();
                __instance.m_sectorIconSecond.StopBlink();
                __instance.m_sectorIconThird.StopBlink();
                __instance.m_sectorIconAllCompleted.StopBlink();
                __instance.m_sectorIconMain.BlinkIn(delay1);
                float delay2 = delay1 + num1;
                if (RundownManager.HasSecondaryLayer(__instance.m_data))
                {
                    SetupIcon(__instance.m_sectorIconSecond, completionData.extremeCompletes > 0, LG_LayerType.SecondaryLayer);
                    __instance.m_sectorIconSecond.BlinkIn(delay2);
                    delay2 += num1;
                }
                if (RundownManager.HasThirdLayer(__instance.m_data))
                {
                    SetupIcon(__instance.m_sectorIconThird, completionData.overloadCompletes > 0, LG_LayerType.ThirdLayer);
                    __instance.m_sectorIconThird.BlinkIn(delay2);
                    delay2 += num1;
                }
                if (completionData.highCompletes > 0 && RundownManager.HasSecondaryLayer(__instance.m_data) && completionData.extremeCompletes > 0 && RundownManager.HasThirdLayer(__instance.m_data) && completionData.overloadCompletes > 0 && completionData.peCompletes > 0)
                {
                    __instance.m_sectorIconAllCompleted.BlinkIn(delay2);
                    float num2 = delay2 + num1;
                }
            }
            __instance.IsVisible = visible;

            return(false);
        }
Ejemplo n.º 2
0
        public static void Invoke(CM_ExpeditionIcon_New __instance, ref eExpeditionIconStatus status, ref string mainFinishCount, ref string secondFinishCount, ref string thirdFinishCount, ref string allFinishedCount)
        {
            if (status == eExpeditionIconStatus.NotPlayed)
            {
                var allCompletionData = CompletionData.LoadFromCache();
                var completionData    = allCompletionData.GetData(__instance.Tier, __instance.ExpIndex);

                var expDataBlock = __instance.DataBlock;

                if (completionData.highCompletes > 0 || completionData.extremeCompletes > 0 || completionData.overloadCompletes > 0 || completionData.peCompletes > 0)
                {
                    status = eExpeditionIconStatus.PlayedAndFinished;
                }

                mainFinishCount   = completionData.highCompletes.ToString();
                secondFinishCount = RundownManager.HasSecondaryLayer(expDataBlock) ? completionData.extremeCompletes.ToString() : "-";
                thirdFinishCount  = RundownManager.HasThirdLayer(expDataBlock) ? completionData.overloadCompletes.ToString() : "-";
                allFinishedCount  = RundownManager.HasAllCompletetionPossibility(expDataBlock) ? completionData.peCompletes.ToString() : "-";
            }
        }
        public static void Invoke()
        {
            var state          = WardenObjectiveManager.CurrentState;
            var exp            = RundownManager.GetActiveExpeditionData();
            var completionData = CompletionData.LoadFromCache();
            var data           = completionData.GetData(exp.tier, exp.expeditionIndex);

            bool pe = true;

            if (state.main_status == eWardenObjectiveStatus.WardenObjectiveItemSolved)
            {
                data.highCompletes++;
            }
            else
            {
                pe = false;
            }

            if (state.second_status == eWardenObjectiveStatus.WardenObjectiveItemSolved)
            {
                data.extremeCompletes++;
            }
            else
            {
                pe = false;
            }

            if (state.third_status == eWardenObjectiveStatus.WardenObjectiveItemSolved)
            {
                data.overloadCompletes++;
            }
            else
            {
                pe = false;
            }

            if (pe)
            {
                data.peCompletes++;
            }

            completionData.Save();

            bool highSolved     = WardenObjectiveManager.CurrentState.main_status == eWardenObjectiveStatus.WardenObjectiveItemSolved;
            bool extremeSolved  = RundownManager.HasSecondaryLayer(RundownManager.ActiveExpedition) && WardenObjectiveManager.CurrentState.second_status == eWardenObjectiveStatus.WardenObjectiveItemSolved;
            bool overloadSolved = RundownManager.HasThirdLayer(RundownManager.ActiveExpedition) && WardenObjectiveManager.CurrentState.third_status == eWardenObjectiveStatus.WardenObjectiveItemSolved;

            var progressionData          = ExtendedPlayerAgent.LocalPlayer.ProgressionData;
            var expeditionSettingsBlocks = ExpeditionSettingsDataBlock.GetAllBlocks();

            foreach (var expeditionSettingsBlock in expeditionSettingsBlocks)
            {
                if (expeditionSettingsBlock.Expedition.ExpeditionIndex == exp.expeditionIndex && expeditionSettingsBlock.Expedition.Tier == exp.tier)
                {
                    var completionSettings = expeditionSettingsBlock.CompletionSettings;
                    foreach (var progressionUpdate in completionSettings.ProgressionUpdates)
                    {
                        if (GameInfo.MeetsProgressionRequirements(progressionUpdate.ProgressionRequirements))
                        {
                            if (progressionUpdate.HighCompleted == highSolved && progressionUpdate.ExtremeCompleted == extremeSolved && progressionUpdate.OverloadCompleted == overloadSolved)
                            {
                                progressionData.SetProgressionValue(exp.tier, exp.expeditionIndex, progressionUpdate.Value);
                            }
                        }
                    }
                }
            }

            progressionData.Save();
        }
        public static bool Invoke(CM_PageRundown_New __instance)
        {
            var completionData = CompletionData.LoadFromCache();

            Utilities.Log.Message("Load completion data");

            Debug.Log("CM_PageRundown_New.UpdateRundownExpeditionProgression, RundownManager.RundownProgressionReady: " + RundownManager.RundownProgressionReady.ToString());

            int totalMain   = 0;
            int totalSecond = 0;
            int totalThird  = 0;
            int totalPE     = 0;

            int totalCompletesMain   = 0;
            int totalCompletesSecond = 0;
            int totalCompletesThird  = 0;
            int totalCompletesPE     = 0;

            if (__instance.m_expIconsAll != null)
            {
                for (int index = 0; index < __instance.m_expIconsAll.Count; index++)
                {
                    var    icon          = __instance.m_expIconsAll[index];
                    string expeditionKey = RundownManager.GetRundownProgressionExpeditionKey(icon.Tier, icon.ExpIndex);

                    var completes = completionData.GetData(icon.Tier, icon.ExpIndex);

                    if (completes.highCompletes > 0)
                    {
                        totalCompletesMain++;
                    }
                    if (completes.extremeCompletes > 0)
                    {
                        totalCompletesSecond++;
                    }
                    if (completes.overloadCompletes > 0)
                    {
                        totalCompletesThird++;
                    }
                    if (completes.peCompletes > 0)
                    {
                        totalCompletesPE++;
                    }

                    totalMain++;
                    if (RundownManager.HasSecondaryLayer(icon.DataBlock))
                    {
                        totalSecond++;
                    }
                    if (RundownManager.HasThirdLayer(icon.DataBlock))
                    {
                        totalThird++;
                    }
                    if (RundownManager.HasAllCompletetionPossibility(icon.DataBlock))
                    {
                        totalPE++;
                    }
                }
            }

            if (__instance.m_tierMarkerSectorSummary != null)
            {
                __instance.m_tierMarkerSectorSummary.SetSectorIconTextForMain(totalCompletesMain.ToString() + "<size=50%><color=#FFFFFF33><size=55%>/" + totalMain + "</color></size>");
                __instance.m_tierMarkerSectorSummary.SetSectorIconTextForSecondary(totalCompletesSecond.ToString() + "<size=50%><color=#FFFFFF33><size=55%>/" + totalSecond + "</color></size>");
                __instance.m_tierMarkerSectorSummary.SetSectorIconTextForThird(totalCompletesThird.ToString() + "<size=50%><color=#FFFFFF33><size=55%>/" + totalThird + "</color></size>");
                __instance.m_tierMarkerSectorSummary.SetSectorIconTextForAllCleared(totalCompletesPE.ToString() + "<size=50%><color=#FFFFFF33><size=55%>/" + totalPE + "</color></size>");
            }
            if (__instance.m_tierMarker1 == null)
            {
                return(false);
            }

            var tierBReq = __instance.m_currentRundownData.ReqToReachTierB;
            var tierCReq = __instance.m_currentRundownData.ReqToReachTierC;
            var tierDReq = __instance.m_currentRundownData.ReqToReachTierD;
            var tierEReq = __instance.m_currentRundownData.ReqToReachTierE;

            var progressionData = new RundownManager.RundownProgData()
            {
                totalMain      = totalMain,
                totalSecondary = totalSecond,
                totalThird     = totalThird,
                totalAllClear  = totalPE,

                clearedMain      = totalCompletesMain,
                clearedSecondary = totalCompletesSecond,
                clearedThird     = totalCompletesThird,
                clearedAllClear  = totalCompletesPE,

                tierBUnlocked = totalCompletesMain >= tierBReq.MainSectors && totalCompletesSecond >= tierBReq.SecondarySectors && totalCompletesThird >= tierBReq.ThirdSectors && totalCompletesPE >= tierBReq.AllClearedSectors,
                tierCUnlocked = totalCompletesMain >= tierCReq.MainSectors && totalCompletesSecond >= tierCReq.SecondarySectors && totalCompletesThird >= tierCReq.ThirdSectors && totalCompletesPE >= tierCReq.AllClearedSectors,
                tierDUnlocked = totalCompletesMain >= tierDReq.MainSectors && totalCompletesSecond >= tierDReq.SecondarySectors && totalCompletesThird >= tierDReq.ThirdSectors && totalCompletesPE >= tierDReq.AllClearedSectors,
                tierEUnlocked = totalCompletesMain >= tierEReq.MainSectors && totalCompletesSecond >= tierEReq.SecondarySectors && totalCompletesThird >= tierEReq.ThirdSectors && totalCompletesPE >= tierEReq.AllClearedSectors
            };

            __instance.m_tierMarker1.SetProgression(progressionData, new RundownTierProgressionData());
            __instance.UpdateTierIconsWithProgression(null, __instance.m_expIconsTier1, __instance.m_tierMarker1, true);

            __instance.m_tierMarker2.SetProgression(progressionData, tierBReq);
            __instance.UpdateTierIconsWithProgression(null, __instance.m_expIconsTier2, __instance.m_tierMarker2, progressionData.tierBUnlocked);

            __instance.m_tierMarker3.SetProgression(progressionData, tierCReq);
            __instance.UpdateTierIconsWithProgression(null, __instance.m_expIconsTier3, __instance.m_tierMarker3, progressionData.tierCUnlocked);

            __instance.m_tierMarker4.SetProgression(progressionData, tierDReq);
            __instance.UpdateTierIconsWithProgression(null, __instance.m_expIconsTier4, __instance.m_tierMarker4, progressionData.tierDUnlocked);

            __instance.m_tierMarker5.SetProgression(progressionData, tierEReq);
            __instance.UpdateTierIconsWithProgression(null, __instance.m_expIconsTier5, __instance.m_tierMarker5, progressionData.tierEUnlocked);

            return(false);
        }