Exemple #1
0
        private void UpdateFullScreenStatus(bool to)
        {
            if (Application.isMobilePlatform)
            {
                return;
            }

            // Debug.LogFormat("Full screen status changing from {0} (logical {1}) to {2}", Screen.fullScreen, isLogicalFullScreen, to);
            if (isLogicalFullScreen == to)
            {
                return;
            }

            isLogicalFullScreen = to;
            if (to)
            {
                configManager.SetInt(LastWindowedWidthKey, Screen.width);
                configManager.SetInt(LastWindowedHeightKey, Screen.height);
                Screen.SetResolution(
                    Screen.currentResolution.width,
                    Screen.currentResolution.height,
                    FullScreenMode.FullScreenWindow
                    );
            }
            else
            {
                var targetW = configManager.GetInt(LastWindowedWidthKey);
                var targetH = configManager.GetInt(LastWindowedHeightKey);
                if (targetW == 0 || targetH == 0)
                {
                    if (Screen.resolutions.Length == 0)
                    {
                        targetW = 1280;
                        targetH = 720;
                    }
                    else
                    {
                        var defaultResolution = Screen.resolutions[Screen.resolutions.Length / 2];
                        targetW = defaultResolution.width;
                        targetH = defaultResolution.height;
                    }
                }

                Screen.SetResolution(targetW, targetH, FullScreenMode.Windowed);

                if (configManager.GetInt(ChangeWindowSizeFirstShownKey) == 0)
                {
                    Alert.Show(I18n.__("config.changewindowsize"));
                    configManager.SetInt(ChangeWindowSizeFirstShownKey, 1);
                }
            }
        }
Exemple #2
0
        public override void Show(Action onFinish)
        {
            base.Show(() =>
            {
                viewManager.dialoguePanel.SetActive(false);
                viewManager.StopAllAnimations();
                gameState.ResetGameState();

                if (bgmController != null && !string.IsNullOrEmpty(bgmName))
                {
                    bgmController.scriptVolume = bgmVolume;
                    bgmController.Play(bgmName);
                }

                var reachedChapterCount = gameState.GetAllStartupNodeNames()
                                          .Count(name => checkpointManager.IsReachedForAnyVariables(name, 0) != null);
                if (reachedChapterCount > 1 && configManager.GetInt(ChapterFirstUnlockedKey) == 0)
                {
                    Alert.Show(I18n.__("title.first.selectchapter"));
                    configManager.SetInt(ChapterFirstUnlockedKey, 1);
                }

                onFinish?.Invoke();
            });
        }
Exemple #3
0
        private void Awake()
        {
            configManager = Utils.FindNovaGameController().ConfigManager;
            var localeInt = configManager.GetInt(configKeyName);

            if (localeInt < 0)
            {
                configManager.SetInt(configKeyName, (int)I18n.CurrentLocale);
            }
            else
            {
                I18n.CurrentLocale = (SystemLanguage)localeInt;
            }

            this.RuntimeAssert(localeTogglePairs.Length > 0, "Empty language toggle list");
            foreach (var pair in localeTogglePairs)
            {
                pair.toggle.isOn = pair.locale == I18n.CurrentLocale;
            }

            foreach (var pair in localeTogglePairs)
            {
                pair.toggle.onValueChanged.AddListener(value => SetLocale(value, pair.locale));
            }
        }
Exemple #4
0
        protected override void Start()
        {
            base.Start();

            if (configManager.GetInt(GameFirstShownKey) == 0)
            {
                configManager.SetInt(GameFirstShownKey, 1);
                Show();
            }
        }
Exemple #5
0
        private void UpdateValue()
        {
            var value = configManager.GetInt(configKeyName) > 0;

            if (toggle.isOn == value)
            {
                // Eliminate infinite recursion
                return;
            }

            toggle.isOn = value;
        }
Exemple #6
0
        private void UpdateValue()
        {
            var value = configManager.GetInt(configKeyName);

            if (toggles.Count > value && value >= 0 && toggles[value].isOn)
            {
                // Eliminate infinite recursion
                return;
            }

            toggles[value].isOn = true;
        }
Exemple #7
0
        /// <summary>
        /// Show log panel
        /// </summary>
        public override void Show(Action onFinish)
        {
            if (configManager.GetInt(LogViewFirstShownKey) == 0)
            {
                Alert.Show(I18n.__("log.first.hint"));
                configManager.SetInt(LogViewFirstShownKey, 1);
            }

            scrollRect.verticalNormalizedPosition = 0.0f;
            base.Show(onFinish);
            scrollRect.verticalNormalizedPosition = 0.0f;
            lastClickedLogIndex = -1;
        }
Exemple #8
0
        private IEnumerator DoAlert(AlertParameters param)
        {
            yield return(3);

            this.param = param;

            if (param.ignoreKey != "" && configManager.GetInt(param.ignoreKey) == 0)
            {
                param.onConfirm?.Invoke();
                yield break;
            }

            titleText.gameObject.SetActive(param.title != null);
            titleText.text = param.title;
            bodyContentText.gameObject.SetActive(param.bodyContent != null);
            bodyContentText.text = param.bodyContent;
            cancelButton.gameObject.SetActive(param.onConfirm != null || param.onCancel != null);
            ignoreToggle.gameObject.SetActive(param.ignoreKey != "");

            confirmButton.onClick.RemoveAllListeners();
            confirmButton.onClick.AddListener(() => Hide(param.onConfirm));

            cancelButton.onClick.RemoveAllListeners();
            cancelButton.onClick.AddListener(() =>
            {
                if (param.ignoreKey != "")
                {
                    configManager.SetInt(param.ignoreKey, 1);
                }

                Hide(param.onCancel);
            });

            ignoreToggle.onValueChanged.RemoveAllListeners();
            ignoreToggle.isOn = false;
            if (param.ignoreKey != "")
            {
                // 0: ignore alert, 1: show alert
                ignoreToggle.onValueChanged.AddListener(value =>
                {
                    configManager.SetInt(param.ignoreKey, value ? 0 : 1);
                    configManager.Apply();
                });
            }

            Show();
        }
 private void UpdateValue()
 {
     dialogueBoxController.canAbortAnimation = configManager.GetInt(configKeyName) > 0;
 }
Exemple #10
0
 private void UpdateValue()
 {
     controller.abortAnimationAbility = configManager.GetInt(configKeyName) > 0;
 }
 private void UpdateValue()
 {
     dialogueBoxController.rightButtonAction = (RightButtonAction)configManager.GetInt(configKeyName);
 }
Exemple #12
0
 private void UpdateValue()
 {
     dialogueBoxController.onlyFastForwardRead = configManager.GetInt(configKeyName) > 0;
 }
Exemple #13
0
 private void UpdateValue()
 {
     controller.onlySkipRead = configManager.GetInt(configKeyName) > 0;
 }
 private void UpdateValue()
 {
     characterController.stopVoiceWhenDialogueWillChange = configManager.GetInt(configKeyName) > 0;
 }
Exemple #15
0
 private void LoadConfig()
 {
     mode = (MusicListMode)config.GetInt(configKey, (int)controller.mode);
 }