// Token: 0x06002604 RID: 9732 RVA: 0x000A5558 File Offset: 0x000A3758
        private void Update()
        {
            uint currentSeedCycle = WeeklyRun.GetCurrentSeedCycle();

            if (currentSeedCycle != this.currentCycle)
            {
                this.currentCycle = currentSeedCycle;
                this.UpdateLeaderboard();
            }
            TimeSpan t       = WeeklyRun.GetSeedCycleStartDateTime(this.currentCycle + 1U) - WeeklyRun.now;
            string   @string = Language.GetString("WEEKLY_RUN_NEXT_CYCLE_COUNTDOWN_FORMAT");

            this.countdownLabel.text = string.Format(@string, t.Hours + t.Days * 24, t.Minutes, t.Seconds);
            if (t != this.lastCountdown)
            {
                this.lastCountdown  = t;
                this.labelFadeValue = 0f;
            }
            this.labelFadeValue = Mathf.Max(this.labelFadeValue + Time.deltaTime * 1f, 0f);
            Color white = Color.white;

            if (t.Days == 0 && t.Hours == 0)
            {
                white.g = this.labelFadeValue;
                white.b = this.labelFadeValue;
            }
            this.countdownLabel.color = white;
        }
Exemple #2
0
        private static void SaveFile(RunReport report, WeeklyRun run)
        {
            String time = ((Int32)Math.Ceiling((Double)report.runStopwatchValue / 1000.0)).ToString();

            var    cycle      = WeeklyRun.GetCurrentSeedCycle();
            var    cycleStart = WeeklyRun.GetSeedCycleStartDateTime(WeeklyRun.GetCurrentSeedCycle());
            String cycleDate  = cycleStart.ToShortDateString();

            var body = BodyCatalog.GetBodyPrefab(NetworkUser.readOnlyLocalPlayersList[0].bodyIndexPreference);

            if (body == null)
            {
                instance.Logger.LogError("Invalid body selected");
                return;
            }
            var survivorDef = SurvivorCatalog.FindSurvivorDefFromBody(body);

            if (survivorDef == null)
            {
                instance.Logger.LogError("Selected body is not in survivorcatalog");
                return;
            }
            String character = Language.GetString(survivorDef.displayNameToken);

            instance.Logger.LogMessage("Your character was: " + character);
            instance.Logger.LogMessage("Your time was: " + time);
            instance.Logger.LogMessage("Score send aborted, saving run report to disk instead.");
            instance.Logger.LogMessage("In the future, there may be a leaderboard set up such that you can upload the file to submit a run");

            String directory       = "\\ModdedTrials\\" + cycleStart + "\\" + character + "\\";
            String directoryGlobal = getRunReportsFolder() + directory;

            System.IO.Directory.CreateDirectory(directoryGlobal);
            String fileBaseName = time;
            Int32  i            = 0;

            while (System.IO.File.Exists(directoryGlobal + fileBaseName + (i != 0 ? "(" + i + ")" : String.Empty)))
            {
                ++i;
            }

            RunReport.Save(report, directory + fileBaseName);
        }