예제 #1
0
        void ModInit()
        {
            if (Settings != null)
            {
                return;
            }

            IsLegacyVersion = CheckIfLegacy();
            Settings        = new Settings();
            if (!Settings.Load())
            {
                Debug.Log("Failed to load Speedrun Timer Mod settings.");
            }

            if (Settings.ModDisabled)
            {
                _disabled = true;
                return;
            }

            Application.targetFrameRate = Settings.TargetFramerate;
            Application.runInBackground = Settings.RunInBackground;
            QualitySettings.vSyncCount  = Settings.Vsync ? 1 : 0;

            RunLogFile.OpenFileAsync();
        }
예제 #2
0
        public static void TriggerCriticalError(string exceptionMsg, string displayMsg = null)
        {
            if (displayMsg == null)
            {
                displayMsg = "Speedrun Timer Mod encountered a critical error, check output_log.txt";
            }

            ShowErrorMessage(displayMsg);
            _disabled = true;
            DestroyModObjects();
            RunLogFile.CloseFile();
            throw new Exception("Speedrun Timer Mod Critical Error\n" + exceptionMsg);
        }