Пример #1
0
 private static void OverwriteNonEmptyFields(ErrorScreenData configFrom, ErrorScreenData configTo)
 {
     if (!string.IsNullOrEmpty(configFrom.HeaderText))
     {
         configTo.HeaderText = configFrom.HeaderText;
     }
     if (!string.IsNullOrEmpty(configFrom.ErrorText))
     {
         configTo.ErrorText = configFrom.ErrorText;
     }
     if (!string.IsNullOrEmpty(configFrom.RestartButtonLabel))
     {
         configTo.RestartButtonLabel = configFrom.RestartButtonLabel;
     }
     if (!string.IsNullOrEmpty(configFrom.ExitButtonLabel))
     {
         configTo.ExitButtonLabel = configFrom.ExitButtonLabel;
     }
     if (!string.IsNullOrEmpty(configFrom.ReportButtonLabel))
     {
         configTo.ReportButtonLabel = configFrom.ReportButtonLabel;
     }
     if (!string.IsNullOrEmpty(configFrom.ReportUrl))
     {
         configTo.ReportUrl = configFrom.ReportUrl;
     }
     configTo.ReConnectTime = configFrom.ReConnectTime;
 }
Пример #2
0
 public static void ShowFatalErrorScreen(string configPath = "clientlocal/ui/screen/error/unexpected")
 {
     if (!IsErrorScreenWasShown)
     {
         IsErrorScreenWasShown = true;
         if (ConfiguratorService.HasConfig("clientlocal/ui/screen/error/common"))
         {
             ErrorScreenData configTo = LoadStringsFromConfig("clientlocal/ui/screen/error/common");
             if (ConfiguratorService.HasConfig(configPath))
             {
                 OverwriteNonEmptyFields(LoadStringsFromConfig(configPath), configTo);
             }
             ErrorScreenData.data = configTo;
         }
         SceneSwitcher.CleanAndSwitch(SceneNames.FATAL_ERROR);
     }
 }
Пример #3
0
 public static void ShowBrokenConfigsErrorScreen()
 {
     if (!IsErrorScreenWasShown)
     {
         IsErrorScreenWasShown = true;
         ErrorScreenData data = new ErrorScreenData {
             HeaderText        = "ERROR",
             ErrorText         = "Required resources are corrupted or missing",
             ReportButtonLabel = "REPORT",
             ReportUrl         = "https://help.tankix.com/en/tanki-x/articles/issues/initialization-issue",
             ReConnectTime     = 0xf423f,
             ExitButtonLabel   = "EXIT"
         };
         ErrorScreenData.data = data;
         SceneSwitcher.CleanAndSwitch(SceneNames.FATAL_ERROR);
     }
 }