예제 #1
0
        public override T GetPanel <T>(params object[] parameters)
        {
            try
            {
                var toReturn = new WindowsPanel();
                var context  = toReturn.DataContext as WindowsContext;
                if (context != null)
                {
                    Settings.ApplyToProperties(context, "Screenshot-Directory", "Wallpaper-Directory");

                    context.BrowseScreenshotAction = () =>
                    {
                        try
                        {
                            var dialog = new FolderBrowserDialog();
                            if (dialog.ShowDialog() == DialogResult.OK)
                            {
                                Settings["Screenshot-Directory"].Value = context.ScreenshotDirectory = dialog.SelectedPath;
                                VA.SettingsManager.Save(Settings);
                            }
                        }
                        catch (Exception exception)
                        {
                            VA.Logger.Error(exception);
                        }
                    };

                    context.BrowseWallpaperAction = () =>
                    {
                        try
                        {
                            var dialog = new FolderBrowserDialog();
                            if (dialog.ShowDialog() == DialogResult.OK)
                            {
                                Settings["Wallpaper-Directory"].Value = context.WallpaperDirectory = dialog.SelectedPath;
                                VA.SettingsManager.Save(Settings);
                            }
                        }
                        catch (Exception exception)
                        {
                            VA.Logger.Error(exception);
                        }
                    };
                }
                return(toReturn as T);
            }
            catch (Exception exception)
            {
                VA.Logger.Error(exception);
            }

            return(null);
        }
예제 #2
0
        // Use this for initialization
        void Start()
        {
            if (Application.platform.Equals(RuntimePlatform.WindowsPlayer))
            {
                WindowsPanel.SetActive(true);
            }
            else if (Application.platform.Equals(RuntimePlatform.Android))
            {
                AndroidPanel.SetActive(true);
            }
            else if (Application.platform.Equals(RuntimePlatform.IPhonePlayer))
            {
                iOSPanel.SetActive(true);
            }

            KeyInputWaiting = false;
            selectedLine    = 0;
            for (int i = 1; i <= 6; i++)
            {
                if (PlayerPrefs.HasKey("key" + i.ToString()).Equals(true))
                {
                    gameKeys[i - 1] = (KeyCode)PlayerPrefs.GetInt("key" + i.ToString());
                    btn[i - 1].GetComponentInChildren <Text>().text = gameKeys[i - 1].ToString();
                }
            }
#if UNITY_STANDALONE || UNITY_EDITOR
            screenSelector.value = PlayerPrefs.GetInt("screenselect");
            if (PlayerPrefs.GetInt("fullscreen").Equals(0))
            {
                fullScreen.isOn = true;
            }
            else
            {
                fullScreen.isOn = false;
            }
            fullScreen.interactable = true;
#endif
            if (PlayerPrefs.HasKey("hitsound").Equals(false))
            {
                PlayerPrefs.SetString("hitsound", "true"); hitSound = "true";
            }
            else
            {
                hitSound = PlayerPrefs.GetString("hitsound");
            }
            if (hitSound.Equals("true"))
            {
                hitSoundTog.isOn = true;
            }

            if (PlayerPrefs.HasKey("tempestic").Equals(false))
            {
                PlayerPrefs.SetString("tempestic", "true"); tempestic = "true";
            }
            else
            {
                tempestic = PlayerPrefs.GetString("tempestic");
            }
            if (tempestic.Equals("true"))
            {
                tpstTog.isOn = true;
            }

            if (PlayerPrefs.HasKey("flickmode").Equals(false))
            {
                PlayerPrefs.SetInt("flickmode", 1); flickValue = 1;
            }
            else
            {
                flickValue = PlayerPrefs.GetInt("flickmode");
            }
            if (flickValue.Equals(0))
            {
                flickLoose.isOn = true;
            }
            else if (flickValue.Equals(1))
            {
                flickNormal.isOn = true;
            }
            else if (flickValue.Equals(2))
            {
                flickStrict.isOn = true;
            }
            else if (flickValue.Equals(3))
            {
                flickDynamic.isOn = true;
            }

            if (PlayerPrefs.HasKey("canvasnote") && PlayerPrefs.GetInt("canvasnote").Equals(0))
            {
                canvasNote.isOn = true; canvasVal = 0;
            }
            else
            {
                canvasNote.isOn = false; canvasVal = 1;
            }

            if (PlayerPrefs.HasKey("sdcard"))
            {
                SDval.text = PlayerPrefs.GetString("sdcard");
            }

            if (PlayerPrefs.HasKey("theater2") && PlayerPrefs.GetInt("theater2").Equals(0))
            {
                T2Portrait.isOn = true; T2ScreenVal = 0;
            }
            else
            {
                T2Landscape.isOn = true; T2ScreenVal = 1;
            }

            langCode = PlayerPrefs.GetInt("locale");
            if (PlayerPrefs.HasKey("tinytip").Equals(true) && PlayerPrefs.GetInt("tinytip").Equals(1))
            {
                tinyTipTog.isOn = false; tinyTipVal = 1;
            }
            else
            {
                tinyTipTog.isOn = true; tinyTipVal = 0;
            }
            if (PlayerPrefs.HasKey("720p").Equals(true) && PlayerPrefs.GetInt("720p").Equals(0))
            {
                fixResTog.isOn = true; fixResVal = 0;
            }
            else
            {
                fixResTog.isOn = false; fixResVal = 1;
            }

            themeVal = 0;
            if (PlayerPrefs.HasKey("theme"))
            {
                themeVal = PlayerPrefs.GetInt("theme");
            }
            themeToggle[themeVal].isOn = true;
            SetTheme();


#if UNITY_ANDROID
            if (!Social.localUser.authenticated)
            {
                socialTextAnd.text  = LocaleManager.instance.GetLocaleText("setting_notloggedin");
                socialTextAnd.color = Color.white;
            }
            else
            {
                socialTextAnd.text  = LocaleManager.instance.GetLocaleText("setting_playgameslogged");
                socialTextAnd.color = GlobalTheme.ThemeColor(RuntimePlatform.Android);
            }
#elif UNITY_IOS
            if (!Social.localUser.authenticated)
            {
                socialTextiOS.text  = LocaleManager.instance.GetLocaleText("setting_notloggedin");
                socialTextiOS.color = Color.white;
            }
            else
            {
                socialTextiOS.text  = LocaleManager.instance.GetLocaleText("setting_gamecenterlogged");
                socialTextiOS.color = GlobalTheme.ThemeColor(RuntimePlatform.IPhonePlayer);
            }
#endif
        }