コード例 #1
0
 public static void AddFatal(ErrorParams parms)
 {
     Debug.LogError(string.Format("Error.AddFatal() - message={0}", parms.m_message));
     if (UniversalInputManager.Get() != null)
     {
         UniversalInputManager.Get().CancelTextInput(null, true);
     }
     if (ShouldUseWarningDialogForFatalError())
     {
         if (string.IsNullOrEmpty(parms.m_header))
         {
             parms.m_header = "Fatal Error as Warning";
         }
         ShowWarningDialog(parms);
     }
     else
     {
         parms.m_type = ErrorType.FATAL;
         FatalErrorMessage message = new FatalErrorMessage();
         if (parms.m_header == null)
         {
         }
         message.m_id                   = string.Empty + parms.m_message;
         message.m_text                 = parms.m_message;
         message.m_ackCallback          = parms.m_ackCallback;
         message.m_ackUserData          = parms.m_ackUserData;
         message.m_allowClick           = parms.m_allowClick;
         message.m_redirectToStore      = parms.m_redirectToStore;
         message.m_delayBeforeNextReset = parms.m_delayBeforeNextReset;
         FatalErrorMgr.Get().Add(message);
     }
 }
コード例 #2
0
    private void BuildText()
    {
        List <FatalErrorMessage> messages = FatalErrorMgr.Get().GetMessages();

        if (messages.Count == 0)
        {
            this.m_text = string.Empty;
        }
        else
        {
            List <string> list2 = new List <string>();
            for (int i = 0; i < messages.Count; i++)
            {
                FatalErrorMessage message = messages[i];
                string            text    = message.m_text;
                if (!list2.Contains(text))
                {
                    list2.Add(text);
                }
            }
            StringBuilder builder = new StringBuilder();
            for (int j = 0; j < list2.Count; j++)
            {
                string str2 = list2[j];
                builder.Append(str2);
                builder.Append("\n");
            }
            builder.Remove(builder.Length - 1, 1);
            this.m_text = builder.ToString();
        }
    }
コード例 #3
0
 private void Awake()
 {
     s_instance = this;
     if (UniversalInputManager.UsePhoneUI != null)
     {
         Transform transform = this.m_menuButton.transform;
         transform.localScale = (Vector3)(transform.localScale * 2f);
         Transform transform2 = this.m_friendButton.transform;
         transform2.localScale = (Vector3)(transform2.localScale * 2f);
     }
     else
     {
         this.m_connectionIndicator.gameObject.SetActive(false);
     }
     this.m_initialWidth = base.GetComponent <Renderer>().bounds.size.x;
     this.m_initialFriendButtonScaleX = this.m_friendButton.transform.localScale.x;
     this.m_initialMenuButtonScaleX   = this.m_menuButton.transform.localScale.x;
     this.m_menuButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnMenuButtonReleased));
     this.m_friendButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnFriendButtonReleased));
     this.ToggleEnableButtons(false);
     this.m_batteryLevel.gameObject.SetActive(false);
     FatalErrorMgr.Get().AddErrorListener(new FatalErrorMgr.ErrorCallback(this.OnFatalError));
     SceneMgr.Get().RegisterSceneLoadedEvent(new SceneMgr.SceneLoadedCallback(this.OnSceneLoaded));
     SpectatorManager.Get().OnInviteReceived       += new SpectatorManager.InviteReceivedHandler(this.SpectatorManager_OnInviteReceived);
     SpectatorManager.Get().OnSpectatorToMyGame    += new SpectatorManager.SpectatorToMyGameHandler(this.SpectatorManager_OnSpectatorToMyGame);
     SpectatorManager.Get().OnSpectatorModeChanged += new SpectatorManager.SpectatorModeChangedHandler(this.SpectatorManager_OnSpectatorModeChanged);
     ApplicationMgr.Get().WillReset += new System.Action(this.WillReset);
     this.m_lightingBlend = this.m_menuButtonMesh.GetComponent <Renderer>().material.GetFloat("_LightingBlend");
     if (UniversalInputManager.UsePhoneUI != null)
     {
         this.m_batteryLevel = this.m_batteryLevelPhone;
         this.m_currentTime.gameObject.SetActive(false);
     }
     this.m_menuButton.SetPhoneStatusBarState(0);
 }
コード例 #4
0
 private void ResetImmediately(bool forceLogin, bool forceNoAccountTutorial = false)
 {
     Log.Reset.Print(string.Concat(new object[] { "ApplicationMgr.ResetImmediately - forceLogin? ", forceLogin, "  Stack trace: ", Environment.StackTrace }), new object[0]);
     BIReport.Get().Report_Telemetry(Telemetry.Level.LEVEL_INFO, !forceLogin ? BIReport.TelemetryEvent.EVENT_ON_RESET : BIReport.TelemetryEvent.EVENT_ON_RESET_WITH_LOGIN);
     if (this.WillReset != null)
     {
         this.WillReset();
     }
     this.m_resetting     = true;
     this.m_lastResetTime = UnityEngine.Time.realtimeSinceStartup;
     if (DialogManager.Get() != null)
     {
         DialogManager.Get().Suppress(true);
         DialogManager.Get().Suppress(false);
     }
     if (Network.TUTORIALS_WITHOUT_ACCOUNT != null)
     {
         Network.SetShouldBeConnectedToAurora(forceLogin || Options.Get().GetBool(Option.CONNECT_TO_AURORA));
     }
     FatalErrorMgr.Get().ClearAllErrors();
     this.m_hasResetSinceLastResume = true;
     if (forceNoAccountTutorial)
     {
         Options.Get().SetBool(Option.CONNECT_TO_AURORA, false);
         Network.SetShouldBeConnectedToAurora(false);
     }
     if (this.Resetting != null)
     {
         this.Resetting();
     }
     Network.Reset();
     Navigation.Clear();
     this.m_resetting = false;
     Log.Reset.Print("\tApplicationMgr.ResetImmediately completed", new object[0]);
 }
コード例 #5
0
 public void OnDestroy()
 {
     if (FatalErrorMgr.Get() != null)
     {
         FatalErrorMgr.Get().RemoveErrorListener(new FatalErrorMgr.ErrorCallback(this.OnFatalError));
     }
     s_instance = null;
 }
コード例 #6
0
 private void Awake()
 {
     s_instance = this;
     UnityEngine.Object.DontDestroyOnLoad(base.gameObject);
     FatalErrorMgr.Get().AddErrorListener(new FatalErrorMgr.ErrorCallback(this.OnFatalError));
     this.m_transitioning = true;
     ApplicationMgr.Get().WillReset += new System.Action(this.WillReset);
 }
コード例 #7
0
 private void OnDestroy()
 {
     if (this.Active)
     {
         this.Deactivate();
     }
     FatalErrorMgr.Get().RemoveErrorListener(new FatalErrorMgr.ErrorCallback(this.OnFatalError));
 }
コード例 #8
0
 protected override void Awake()
 {
     base.Awake();
     base.gameObject.name = string.Format("TextField_{0:000}", nextId++);
     if (base.gameObject.GetComponent <BoxCollider>() == null)
     {
         base.gameObject.AddComponent <BoxCollider>();
     }
     this.UpdateCollider();
     FatalErrorMgr.Get().AddErrorListener(new FatalErrorMgr.ErrorCallback(this.OnFatalError));
 }
コード例 #9
0
    protected virtual void Awake()
    {
        GameObject obj2 = (GameObject)GameUtils.InstantiateGameObject(this.m_menuDefPrefab, null, false);

        this.m_menu = obj2.GetComponent <ButtonListMenuDef>();
        OverlayUI.Get().AddGameObject(base.gameObject, CanvasAnchor.CENTER, false, CanvasScaleMode.HEIGHT);
        this.SetTransform();
        this.m_blocker = CameraUtils.CreateInputBlocker(CameraUtils.FindFirstByLayer(obj2.layer), "GameMenuInputBlocker", this, obj2.transform, 10f).AddComponent <PegUIElement>();
        FatalErrorMgr.Get().AddErrorListener(new FatalErrorMgr.ErrorCallback(this.OnFatalError));
        this.m_blocker.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnBlockerRelease));
    }
コード例 #10
0
 private void OnGUI()
 {
     this.InitGUIStyles();
     GUI.Box(this.DialogRect, string.Empty, this.m_dialogStyle);
     GUI.Box(this.DialogRect, this.m_text, this.m_dialogStyle);
     if (GUI.Button(this.ButtonRect, GameStrings.Get("GLOBAL_EXIT")))
     {
         Log.Mike.Print("FatalErrorDialog.OnGUI() - calling FatalErrorMgr.Get().NotifyExitPressed()", new object[0]);
         FatalErrorMgr.Get().NotifyExitPressed();
         Log.Mike.Print("FatalErrorDialog.OnGUI() - called FatalErrorMgr.Get().NotifyExitPressed()", new object[0]);
     }
 }
コード例 #11
0
    public void Close()
    {
        Debug.Log("Close");
        SplashScreen screen = SplashScreen.Get();

        if (screen != null)
        {
            screen.HideWebLoginCanvas();
        }
        CloseWebView();
        FatalErrorMgr.Get().RemoveErrorListener(new FatalErrorMgr.ErrorCallback(this.OnFatalError));
    }
コード例 #12
0
 private void Awake()
 {
     s_Instance = this;
     if (Options.Get().GetBool(Option.HEALTHY_GAMING_DEBUG, false))
     {
         this.m_DebugMode = true;
     }
     this.m_NextCheckTime = UnityEngine.Time.realtimeSinceStartup + 45f;
     ApplicationMgr.Get().WillReset += new System.Action(this.WillReset);
     ApplicationMgr.Get().Resetting += new System.Action(this.OnReset);
     FatalErrorMgr.Get().AddErrorListener(new FatalErrorMgr.ErrorCallback(this.OnFatalError));
     base.StartCoroutine(this.InitNetworkData());
 }
コード例 #13
0
    private void Awake()
    {
        SplashScreen screen = SplashScreen.Get();

        if (screen != null)
        {
            screen.HideLogo();
        }
        List <FatalErrorMessage> messages = FatalErrorMgr.Get().GetMessages();

        Log.JMac.Print(LogLevel.Warning, string.Format("Showing Fatal Error Screen with {0} messages", messages.Count), new object[0]);
        this.m_closedSignText.Text  = messages[0].m_text;
        this.m_closedSignTitle.Text = GameStrings.Get("GLOBAL_SPLASH_CLOSED_SIGN_TITLE");
        this.m_allowClick           = messages[0].m_allowClick;
        this.m_redirectToStore      = messages[0].m_redirectToStore;
        this.m_delayBeforeNextReset = messages[0].m_delayBeforeNextReset;
    }
コード例 #14
0
 private void OnFatalError(FatalErrorMessage message, object userData)
 {
     FatalErrorMgr.Get().RemoveErrorListener(new FatalErrorMgr.ErrorCallback(this.OnFatalError));
     this.BuildText();
 }
コード例 #15
0
 protected virtual void OnDestroy()
 {
     FatalErrorMgr.Get().RemoveErrorListener(new FatalErrorMgr.ErrorCallback(this.OnFatalError));
 }
コード例 #16
0
 private void Awake()
 {
     s_instance        = this;
     this.NORMAL_SCALE = base.transform.localScale;
     this.HIDDEN_SCALE = (Vector3)(0.01f * this.NORMAL_SCALE);
     FatalErrorMgr.Get().AddErrorListener(new FatalErrorMgr.ErrorCallback(this.OnFatalError));
     OverlayUI.Get().AddGameObject(base.gameObject, CanvasAnchor.CENTER, false, CanvasScaleMode.HEIGHT);
     if (UniversalInputManager.UsePhoneUI == null)
     {
         this.m_graphicsRes.setItemTextCallback(new DropdownControl.itemTextCallback(this.OnGraphicsResolutionDropdownText));
         this.m_graphicsRes.setItemChosenCallback(new DropdownControl.itemChosenCallback(this.OnNewGraphicsResolution));
         foreach (GraphicsResolution resolution in this.GetGoodGraphicsResolution())
         {
             this.m_graphicsRes.addItem(resolution);
         }
         this.m_graphicsRes.setSelection(this.GetCurrentGraphicsResolution());
         this.m_fullScreenCheckbox.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnToggleFullScreenCheckbox));
         this.m_fullScreenCheckbox.SetChecked(Options.Get().GetBool(Option.GFX_FULLSCREEN, Screen.fullScreen));
         this.m_graphicsQuality.addItem(GameStrings.Get("GLOBAL_OPTIONS_GRAPHICS_QUALITY_LOW"));
         this.m_graphicsQuality.addItem(GameStrings.Get("GLOBAL_OPTIONS_GRAPHICS_QUALITY_MEDIUM"));
         this.m_graphicsQuality.addItem(GameStrings.Get("GLOBAL_OPTIONS_GRAPHICS_QUALITY_HIGH"));
         this.m_graphicsQuality.setSelection(this.GetCurrentGraphicsQuality());
         this.m_graphicsQuality.setItemChosenCallback(new DropdownControl.itemChosenCallback(this.OnNewGraphicsQuality));
     }
     this.m_masterVolume.SetValue(Options.Get().GetFloat(Option.SOUND_VOLUME));
     this.m_masterVolume.SetUpdateHandler(new ScrollbarControl.UpdateHandler(this.OnNewMasterVolume));
     this.m_masterVolume.SetFinishHandler(new ScrollbarControl.FinishHandler(this.OnMasterVolumeRelease));
     this.m_musicVolume.SetValue(Options.Get().GetFloat(Option.MUSIC_VOLUME));
     this.m_musicVolume.SetUpdateHandler(new ScrollbarControl.UpdateHandler(this.OnNewMusicVolume));
     if (this.m_backgroundSound != null)
     {
         this.m_backgroundSound.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.ToggleBackgroundSound));
         this.m_backgroundSound.SetChecked(Options.Get().GetBool(Option.BACKGROUND_SOUND));
     }
     this.UpdateCreditsUI();
     this.m_nearbyPlayers.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.ToggleNearbyPlayers));
     this.m_nearbyPlayers.SetChecked(Options.Get().GetBool(Option.NEARBY_PLAYERS));
     this.m_spectatorOpenJoinCheckbox.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.ToggleSpectatorOpenJoin));
     this.m_spectatorOpenJoinCheckbox.SetChecked(Options.Get().GetBool(Option.SPECTATOR_OPEN_JOIN));
     this.m_languageGroup.gameObject.SetActive((bool)this.LANGUAGE_SELECTION);
     if (this.LANGUAGE_SELECTION != null)
     {
         if (Localization.GetLocale() == Locale.jaJP)
         {
             this.m_languageDropdown.setFontWithoutLocalization(this.m_languageDropdownFont);
         }
         else
         {
             this.m_languageDropdown.setFont(this.m_languageDropdownFont.m_Font);
         }
         IEnumerator enumerator = Enum.GetValues(typeof(Locale)).GetEnumerator();
         try
         {
             while (enumerator.MoveNext())
             {
                 Locale current = (Locale)((int)enumerator.Current);
                 switch (current)
                 {
                 case Locale.UNKNOWN:
                 case Locale.enGB:
                 {
                     continue;
                 }
                 }
                 this.m_languageDropdown.addItem(GameStrings.Get(this.StringNameFromLocale(current)));
             }
         }
         finally
         {
             IDisposable disposable = enumerator as IDisposable;
             if (disposable == null)
             {
             }
             disposable.Dispose();
         }
         this.m_languageDropdown.setSelection(this.GetCurrentLanguage());
         this.m_languageDropdown.setItemChosenCallback(new DropdownControl.itemChosenCallback(this.OnNewLanguage));
     }
     if ((AssetLoader.DOWNLOADABLE_LANGUAGE_PACKS != null) && ApplicationMgr.IsInternal())
     {
         this.m_languagePackCheckbox.gameObject.SetActive(true);
         this.m_languagePackCheckbox.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.ToggleLanguagePackCheckbox));
         this.m_languagePackCheckbox.SetChecked(Downloader.Get().AllLocalizedAudioBundlesDownloaded());
     }
     this.m_creditsButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnCreditsButtonReleased));
     this.m_cinematicButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnCinematicButtonReleased));
     this.m_inputBlocker.AddEventListener(UIEventType.RELEASE, e => this.Hide(true));
     this.ShowOrHide(false);
     this.m_leftPane.UpdateSlices();
     this.m_rightPane.UpdateSlices();
     this.m_middlePane.UpdateSlices();
 }
コード例 #17
0
 private void Awake()
 {
     s_instance = this;
     FatalErrorMgr.Get().AddErrorListener(new FatalErrorMgr.ErrorCallback(this.OnFatalError));
     GameMgr.Get().RegisterFindGameEvent(new GameMgr.FindGameCallback(this.OnFindGameEvent));
 }
コード例 #18
0
 public void Load()
 {
     Debug.Log("Load");
     LoadWebView(this.m_url, this.m_window.x, this.m_window.y, this.m_window.width, this.m_window.height, SystemInfo.deviceUniqueIdentifier, this.m_callbackGameObject);
     FatalErrorMgr.Get().AddErrorListener(new FatalErrorMgr.ErrorCallback(this.OnFatalError));
 }
コード例 #19
0
 private void Awake()
 {
     this.BuildText();
     FatalErrorMgr.Get().AddErrorListener(new FatalErrorMgr.ErrorCallback(this.OnFatalError));
 }