Beispiel #1
0
 public static bool Prefix(MainMenuLoadButton __instance)
 {
     if (!__instance.IsEmpty())
     {
         DeathRunUtils.HideHighScores(true);
     }
     return(true);
 }
 public static bool Load_Prefix(MainMenuLoadButton __instance)
 {
     // Load added notifications if needed.
     if (!__instance.IsEmpty())
     {
         KnownTechFixer.LoadAddedNotifications(__instance.saveGame);
     }
     // Give back execution to original function.
     return(true);
 }
Beispiel #3
0
            static void Postfix(MainMenuLoadButton lb)
            {
                var textGO = lb.load.getChild(textPath);

                if (!textGO)
                {
                    "MainMenuLoadPanel_UpdateLoadButtonState_Patch: text not found".logError();
                    return;
                }
#if GAME_BZ
                var rt = textGO.transform as RectTransform;
                RectTransformExtensions.SetSize(rt, 190f, rt.rect.height);
#endif
                if (textGO.TryGetComponent <Text>(out var text))
                {
                    text.text += $" | {lb.saveGame}";
                }
            }
Beispiel #4
0
        public static void Postfix(MainMenuLoadPanel __instance, MainMenuLoadButton lb)
        {
            SaveLoadManager.GameInfo gameInfo = SaveLoadManager.main.GetGameInfo(lb.saveGame);

            if ((gameInfo == null) || !gameInfo.IsValid() || gameInfo.isFallback)
            {
                return;
            }

            DeathRunSaveData slotData = DeathRunUtils.FindSave(lb.saveGame);

            if (slotData == null)
            {
                return;
            }

            if (!"".Equals(slotData.startSave.message))
            {
                lb.load.FindChild("SaveGameMode").GetComponent <Text>().text = slotData.startSave.message;

                slotData.runData.updateFromSave(slotData);

                string duration = Utils.PrettifyTime((int)slotData.playerSave.allLives);

                if (slotData.playerSave.allLives >= 60 * 60 * 24)
                {
                    int total = (int)slotData.playerSave.allLives;
                    int days  = total / (60 * 60 * 24);
                    total -= (days * 60 * 60 * 24);

                    int hours = total / (60 * 60);
                    total -= hours * 60 * 60;

                    int minutes = total / 60;
                    total -= minutes;

                    duration = "" + days + " " + ((days == 1) ? "day" : "days") + ", " + hours + ":" + ((minutes < 10) ? "0" : "") + minutes;
                }

                duration += ". Score: " + slotData.runData.Score;

                lb.load.FindChild("SaveGameLength").GetComponent <Text>().text = duration;
            }
        }