Esempio n. 1
0
        /* Change UI state to match a settings object. */
        private void CopySettingsToUI()
        {
            isLoading = true;                              // to supress validation

            BokuSettings settings = BokuSettings.Settings; // abbreviate for readability

            if (settings.PreferReach || !hwSupportsHiDef)
            {
                ShadMod2RB.Checked = true;
            }
            else
            {
                ShadMod3RB.Checked = true;
            }

            PostFXCk.Checked    = settings.PostEffects;
            AntiAliasCk.Checked = settings.AntiAlias;
            AnimationCk.Checked = settings.Animation;

            AudioCk.Checked     = settings.Audio;
            communityCk.Checked = siteOptions.CommunityEnabled;

            InitUserFolder(settings);

            VsyncCk.Checked      = settings.Vsync;
            SpriteFontCk.Checked = !settings.UseSystemFontRendering;

            isLoading = false;
        }
Esempio n. 2
0
        private void ConstrainToHardwareCapabilities()
        {
            // Determine is current hardware supports HiDef.
            foreach (GraphicsAdapter ga in GraphicsAdapter.Adapters)
            {
                if (ga.IsDefaultAdapter)
                {
                    if (ga.IsProfileSupported(GraphicsProfile.Reach))
                    {
                        hwSupportsHiDef = false;
                    }
                    if (ga.IsProfileSupported(GraphicsProfile.HiDef))
                    {
                        hwSupportsHiDef = true;
                    }

                    break;
                }
            }

            // Adjust UI to match.
            if (hwSupportsHiDef)
            {
                StatusTB.Text = @"This computer supports HiDef. All graphics options are available.";
            }
            else
            {
                StatusTB.Text      = @"This computer does not support HiDef; only Standard graphics options will be available, and Advanced features will be disabled.";
                ShadMod3RB.Enabled = false;
                // We don't actually set the checked / unchecked state of any UI; instead we constrain the
                // settings file, and it will set all the control values properly.
                BokuSettings.ConstrainToReach();
            }
        }   // end of ConstrainToHardwareCapabilities()
Esempio n. 3
0
        private void CopyUIToSettings()
        {
            BokuSettings settings = BokuSettings.Settings;

            settings.PreferReach = ShadMod2RB.Checked;

            settings.PostEffects = PostFXCk.Checked;
            settings.AntiAlias   = AntiAliasCk.Checked;
            settings.Animation   = AnimationCk.Checked;

            settings.PreferReach = ShadMod2RB.Checked;

            settings.Audio = AudioCk.Checked;
            siteOptions.CommunityEnabled = communityCk.Checked;

            settings.UserFolder = GetUserFolder();

            settings.Vsync = VsyncCk.Checked;
            settings.UseSystemFontRendering = !SpriteFontCk.Checked;
        }
Esempio n. 4
0
 /// <summary>
 /// Initialize user folder, either disabling or setting up.
 /// </summary>
 /// <param name="settings"></param>
 private void InitUserFolder(BokuSettings settings)
 {
     /*
      * if (!siteOptions.UserFolder)
      * {
      *  UserFolder.Visible = false;
      *  SavePath.Visible = false;
      * }
      * else
      */
     {
         folderDialog.ShowNewFolderButton = true;
         folderDialog.Description         = "Optional save folder override";
         if (settings.UserFolder == "")
         {
             folderDialog.SelectedPath = DefaultUserFolder();
         }
         else
         {
             folderDialog.SelectedPath = settings.UserFolder;
         }
         SavePath.Text = folderDialog.SelectedPath;
     }
 }
Esempio n. 5
0
 // Gather up the UI state and persist to the settings file
 private void SaveSettings()
 {
     CopyUIToSettings();
     BokuSettings.Save();
     siteOptions.Save();
 }