示例#1
0
 public void ApplyParameters(MulticaretTextBox textBox, SettingsMode settingsMode, Buffer buffer)
 {
     textBox.WordWrap             = settingsMode != SettingsMode.FileTree && settingsMode != SettingsMode.Help && wordWrap.Value;
     textBox.ShowLineNumbers      = showLineNumbers.Value && settingsMode != SettingsMode.FileTree;
     textBox.ShowLineBreaks       = showLineBreaks.Value;
     textBox.ShowSpaceCharacters  = showSpaceCharacters.Value;
     textBox.HighlightCurrentLine = highlightCurrentLine.Value;
     textBox.TabSize           = tabSize.GetValue(buffer);
     textBox.SpacesInsteadTabs = spacesInsteadTabs.GetValue(buffer);
     textBox.Autoindent        = autoindent.GetValue(buffer);
     textBox.LineBreak         = lineBreak.Value;
     textBox.FontFamily        = font.Value;
     textBox.SetFontSize(fontSize.Value, lineNumberFontSize.Value);
     textBox.ScrollingIndent   = scrollingIndent.Value;
     textBox.ScrollingStep     = scrollingStep.Value;
     textBox.ShowColorAtCursor = showColorAtCursor.Value;
     textBox.KeyMap.main.SetAltChars(altCharsSource.Value, altCharsResult.Value);
     textBox.SetViMap(viMapSource.Value, viMapResult.Value);
     textBox.Map             = settingsMode != SettingsMode.FileTree && miniMap.Value;
     textBox.MapScale        = miniMapScale.Value;
     textBox.PrintMargin     = settingsMode == SettingsMode.Normal && printMargin.Value;
     textBox.PrintMarginSize = printMarginSize.Value;
     textBox.MarkWord        = markWord.Value;
     textBox.MarkBracket     = markBracket.Value;
 }
        // ReSharper restore FunctionNeverReturns

        #endregion

        #region MAIN WINDOW CONSTRUCTOR

        public MainWindow(SettingsMode sm = SettingsMode.UseConfig)
        {
            switch (sm)
            {
            case SettingsMode.UseConfig:
                //Getting data from the configuration file (app.config)
                _name = ConfigurationManager.AppSettings["ClientName"] + System.Net.Dns.GetHostName() +
                        Guid.NewGuid();
                _serverName = ConfigurationManager.AppSettings["DeviceServerName"];
                _airList    = Convert.ToInt32(ConfigurationManager.AppSettings["AirList"]);
                break;

            case SettingsMode.UseDefaults:
                _name       = "default";
                _serverName = "default";
                _airList    = 1;
                break;

            default:
                return;
            }
            _loginSession = new LoginSession();
            _materialServiceLoginSession = new MaterialServiceReference.LoginSession();
            _asrunServiceLoginSession    = new AsRunServiceReference.LoginSession();
            _callbackProcessor           = new Thread(CallbackProcessor);
            _callbackProcessor.Start();
            InitializeComponent();
            Application.Current.MainWindow.Closing += MainWindowClosing;
            //LoggerServiceInit
            _loggerService = new LoggerService();
            CreateOperationLoggerInfo();
            _loggerService.OperationLoggerInit(_operationLogInfo);
            _updateStates = new Thread(UpdateOperationLOggerInfo);
            _updateStates.Start();
        }
示例#3
0
 public Buffer(string fullPath, string name, SettingsMode settingsMode)
 {
     this.settingsMode           = settingsMode;
     controller                  = new Controller(new LineArray());
     controller.Lines.viFullPath = fullPath;
     this.fullPath               = fullPath;
     this.name = name;
     controller.Lines.hook2 = !string.IsNullOrEmpty(fullPath) ? new PositionHook(controller) : null;
 }
        private DocumentProcessingParams GetProcessingParameters(string language, SettingsMode mode, List <string> dictionary, int languageWeight, int dictionaryWeight)
        {
            engine.LoadPredefinedProfile(DocumentConversionAccuracyProfile);

            DocumentProcessingParams processingParams = engine.CreateDocumentProcessingParams();

            SetPageProcessingParameters(processingParams, language, dictionary, languageWeight, dictionaryWeight);

            SetSplittingParameters(processingParams, mode);

            SetDocumentSynthesisParameters(processingParams, mode);

            return(processingParams);
        }
示例#5
0
        private void Apply(SettingsMode settingsMode)
        {
            switch (settingsMode)
            {
            case SettingsMode.Default:
                Apply(ScreenSpaceReflection.SSRSettings.defaultSettings);
                break;

            case SettingsMode.HighQuality:
                Apply(ScreenSpaceReflection.SSRSettings.highQualitySettings);
                break;

            case SettingsMode.Performance:
                Apply(ScreenSpaceReflection.SSRSettings.performanceSettings);
                break;
            }
        }
    //The Toolbar at the Top
    private void ShaderSelectionToolbar()
    {
        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        //Toolbar height is 40 = 48 - 8
        if (!_isUnlit)
        {
            _toolbarSelected = GUILayout.Toolbar(_toolbarSelected, _panelIcons, GUILayout.MaxWidth(Screen.width - 42f),
                                                 GUILayout.Height(48f));
            _setPanel = (SettingsMode)_toolbarSelected;
        }
        else
        {
            _toolbarSelectedUnlit = GUILayout.Toolbar(_toolbarSelectedUnlit, _panelIcons,
                                                      GUILayout.MaxWidth(Screen.width - 42f), GUILayout.Height(48f));

            //For Unlit we need to use a different index and a switch as workaround
            switch (_toolbarSelectedUnlit)
            {
            case 4:
                _setPanel = SettingsMode.Extras;
                break;

            case 3:
                _setPanel = SettingsMode.Dissolve;
                break;

            case 2:
                _setPanel = SettingsMode.Reflection;
                break;

            case 1:
                _setPanel = SettingsMode.Curvature;
                break;

            default:
                _setPanel = SettingsMode.Sprites;
                break;
            }
        }

        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();
        GUILayout.Space(1f);
    }
示例#7
0
        private void Init(DTE applicationObject, SettingsMode mode, Solution sol, Project p)
        {
            m_applicationObject = applicationObject;
            m_mode = mode;
            switch (mode)
            {
            case SettingsMode.UserSettings:
                m_globals = m_applicationObject.Globals;
                break;

            case SettingsMode.SolutionSettings:
                m_globals = sol.Globals;
                break;

            case SettingsMode.ProjectSettings:
                m_globals = p.Globals;
                break;
            }
        }
        // If the settings object is a string determine wheter it is one of the settings preset or a file path and resolve the setting in the former case.
        private static bool TryResolveSettingForStringType(object settingsObject, ref SettingsMode settingsMode, ref object resolvedSettingValue)
        {
            if (settingsObject is string settingsString)
            {
                if (IsBuiltinSettingPreset(settingsString))
                {
                    settingsMode         = SettingsMode.Preset;
                    resolvedSettingValue = GetSettingPresetFilePath(settingsString);
                }
                else
                {
                    settingsMode         = SettingsMode.File;
                    resolvedSettingValue = settingsString;
                }
                return(true);
            }

            return(false);
        }
        public void LoadSettings()
        {
            string filePath = ToolboxHelper.GetPrefFilePath(ToolboxHelper.ToolboxPrefsSettings);

            if (File.Exists(filePath))
            {
                string settingsData = File.ReadAllText(filePath);
                JsonUtility.FromJsonOverwrite(settingsData, m_Settings);
            }

            if (m_Settings.PresetPath == string.Empty)
            {
                m_SelectedPreset = null;
            }
            else
            {
                m_SelectedPreset = AssetDatabase.LoadAssetAtPath(m_Settings.PresetPath, typeof(TerrainSettings)) as TerrainSettings;
            }

            m_SettingsMode = (SettingsMode)m_Settings.PresetMode;
        }
        private void SetSplittingParameters(DocumentProcessingParams processingParams, SettingsMode mode)
        {
            PageSplittingParams pageSplittingParams = processingParams.SplittingParams ?? engine.CreatePageSplittingParams();

            processingParams.SplittingParams = pageSplittingParams;
        }
示例#11
0
        public MenuScreen(Bindings activeBindings)
        {
            DrawPreviousScreen = true;
            mode = MenuScreenMode.TransitioningIn;
            TransitionOutEnabled = true;

            bindings = activeBindings;

            settingsOptions = new MenuOptions("Settings",
                new Dictionary<string, Action<MenuOptionAction>>()
                {
                    {"<P1 Bindings>", bindingsMenuOptionDelegate},
                    {"Sound", delegate{ settingsMode = SettingsMode.Sound; SetMenuOptions(soundOptions); }},
                    {"Screen Size", delegate { settingsMode = SettingsMode.ScreenSize; SetMenuOptions(screenSizeOptions); }},
                    {"Reset Scores", delegate{ DisplayConfirmationDialog("Reset Scores?", delegate { RetroGame.ResetScores(); SetMenuOptions(settingsOptions); }); } },
                    {"Back", null }, //set dynamically
                }
                , "Back");

            soundOptions = new MenuOptions("Sound",
                new Dictionary<string, Action<MenuOptionAction>>()
                {
                    {"<Master>", delegate(MenuOptionAction action)
                        {
                            switch (action)
                            {
                                case MenuOptionAction.Click:
                                    if(SoundManager.MasterVolume != 0)
                                    {
                                        previousMasterVolume = SoundManager.MasterVolume;
                                        SoundManager.SetMasterVolume(0);
                                    }
                                    else
                                        SoundManager.SetMasterVolume(previousMasterVolume);
                                    break;
                                case MenuOptionAction.Left:
                                    SoundManager.SetMasterVolume(SoundManager.MasterVolume - VOLUME_SETTINGS_STEP);
                                    break;
                                case MenuOptionAction.Right:
                                    SoundManager.SetMasterVolume(SoundManager.MasterVolume + VOLUME_SETTINGS_STEP);
                                    break;
                            }
                            RetroGame.SaveConfig();
                        }},
                    {"<Music>", delegate(MenuOptionAction action)
                        {
                            switch (action)
                            {
                                case MenuOptionAction.Click:
                                    if (SoundManager.MusicMasterVolume != 0)
                                    {
                                        previousMusicVolume = SoundManager.MusicMasterVolume;
                                        SoundManager.SetMusicMasterVolume(0);
                                    }
                                    else
                                        SoundManager.SetMusicMasterVolume(previousMusicVolume);
                                    break;
                                case MenuOptionAction.Left:
                                    SoundManager.SetMusicMasterVolume(SoundManager.MusicMasterVolume - VOLUME_SETTINGS_STEP);
                                    break;
                                case MenuOptionAction.Right:
                                    SoundManager.SetMusicMasterVolume(SoundManager.MusicMasterVolume + VOLUME_SETTINGS_STEP);
                                    break;
                            }
                            RetroGame.SaveConfig();
                        }},
                    {"<Sounds>", delegate(MenuOptionAction action)
                        {
                            switch (action)
                            {
                                case MenuOptionAction.Click:
                                    if (SoundManager.SoundMasterVolume != 0)
                                    {
                                        previousSoundVolume = SoundManager.SoundMasterVolume;
                                        SoundManager.SetSoundMasterVolume(0);
                                    }
                                    else
                                        SoundManager.SetSoundMasterVolume(previousSoundVolume);
                                    break;
                                case MenuOptionAction.Left:
                                    SoundManager.SetSoundMasterVolume(SoundManager.SoundMasterVolume - VOLUME_SETTINGS_STEP);
                                    break;
                                case MenuOptionAction.Right:
                                    SoundManager.SetSoundMasterVolume(SoundManager.SoundMasterVolume + VOLUME_SETTINGS_STEP);
                                    break;
                            }
                            RetroGame.SaveConfig();
                        }},
                    {"Back", delegate{ settingsMode = SettingsMode.Menu; SetMenuOptions(settingsOptions); }},
                }
                , "Back");
            screenSizeOptions = new MenuOptions("Screen Size",
                new Dictionary<string, Action<MenuOptionAction>>()
                {
                    {"Small", delegate{ RetroGame.SetScreenSize(ScreenSize.Small); RetroGame.SaveConfig(); }},
                    {"Medium", delegate{ RetroGame.SetScreenSize(ScreenSize.Medium); RetroGame.SaveConfig(); }},
                    {"Large", delegate{ RetroGame.SetScreenSize(ScreenSize.Large); RetroGame.SaveConfig(); }},
                    {"Huge", delegate{ RetroGame.SetScreenSize(ScreenSize.Huge); RetroGame.SaveConfig(); }},
                    {"Back", delegate{ settingsMode = SettingsMode.Menu;  SetMenuOptions(settingsOptions); }},
                }
                , 4);
        }
        private void SetFontFormatDetectionParameters(SynthesisParamsForDocument documentSynthesisParams, SettingsMode mode)
        {
            FontFormattingDetectionParams fontFormattingDetectionParams = documentSynthesisParams.FontFormattingDetectionParams;

            switch (mode)
            {
            case SettingsMode.None:
                fontFormattingDetectionParams.DetectBold               = true;
                fontFormattingDetectionParams.DetectFontFamily         = true;
                fontFormattingDetectionParams.DetectItalic             = true;
                fontFormattingDetectionParams.DetectFontSize           = true;
                fontFormattingDetectionParams.DetectUnderlineStrikeout = true;
                break;

            case SettingsMode.LineByLine:
                fontFormattingDetectionParams.DetectBold               = true;
                fontFormattingDetectionParams.DetectFontFamily         = true;
                fontFormattingDetectionParams.DetectItalic             = true;
                fontFormattingDetectionParams.DetectFontSize           = true;
                fontFormattingDetectionParams.DetectUnderlineStrikeout = true;
                break;

            default:
                break;
            }
        }
        private void SetDocumentStructureDetectionParameters(SynthesisParamsForDocument documentSynthesisParams, SettingsMode mode)
        {
            DocumentStructureDetectionParams documentStructureDetectionParams = documentSynthesisParams.DocumentStructureDetectionParams;

            switch (mode)
            {
            case SettingsMode.None:
                break;

            case SettingsMode.LineByLine:
                documentStructureDetectionParams.ClassifySeparators          = true;
                documentStructureDetectionParams.DetectCaptions              = false;
                documentStructureDetectionParams.DetectColumns               = false;
                documentStructureDetectionParams.DetectFootnotes             = false;
                documentStructureDetectionParams.DetectHeadlines             = false;
                documentStructureDetectionParams.DetectLists                 = false;
                documentStructureDetectionParams.DetectOverflowingParagraphs = false;
                documentStructureDetectionParams.DetectRunningTitles         = false;
                documentStructureDetectionParams.DetectTableOfContents       = false;
                break;

            default:
                break;
            }
        }
示例#14
0
 public SettingsManager(DTE applicationObject, SettingsMode mode, Solution sol)
 {
     Init(applicationObject, mode, sol, null);
 }
        private void SetDocumentSynthesisParameters(DocumentProcessingParams processingParams, SettingsMode mode)
        {
            SynthesisParamsForDocument documentSynthesisParams = processingParams.SynthesisParamsForDocument ?? engine.CreateSynthesisParamsForDocument();

            switch (mode)
            {
            case SettingsMode.None:
                documentSynthesisParams.DetectFontFormatting    = true;
                documentSynthesisParams.DetectDocumentStructure = true;
                break;

            case SettingsMode.LineByLine:
                documentSynthesisParams.DetectFontFormatting    = true;
                documentSynthesisParams.DetectDocumentStructure = false;
                break;

            default:
                break;
            }

            SetDocumentStructureDetectionParameters(documentSynthesisParams, mode);
            SetFontFormatDetectionParameters(documentSynthesisParams, mode);
        }
示例#16
0
 public SettingsManager(DTE applicationObject, SettingsMode mode, Solution sol, Project p)
 {
     Init(applicationObject, mode, sol, p);
 }
        public void ProcessDocument(FineReaderDocument document, List <int> pageIndices, string language, int languageWeight, int dictionaryWeight, List <string> dictionary = null, SettingsMode mode = SettingsMode.None)
        {
            document.Document.Preprocess();
            if (pageIndices == null)
            {
                document.Document.Process(GetProcessingParameters(language, mode, dictionary, languageWeight, dictionaryWeight));
            }
            else
            {
                IntsCollection indices = engine.CreateIntsCollection();
                foreach (int i in pageIndices)
                {
                    indices.Add(i);
                }

                document.Document.ProcessPages(indices, GetProcessingParameters(language, mode, dictionary, languageWeight, dictionaryWeight));
            }
            document.InitializeCustomDocument();
        }
示例#18
0
 private void Init(DTE applicationObject, SettingsMode mode, Solution sol, Project p)
 {
     m_applicationObject = applicationObject;
     m_mode = mode;
     switch (mode)
     {
         case SettingsMode.UserSettings:
             m_globals = m_applicationObject.Globals;
             break;
         case SettingsMode.SolutionSettings:
             m_globals = sol.Globals;
             break;
         case SettingsMode.ProjectSettings:
             m_globals = p.Globals;
             break;
     }
 }
        public void OnGUI()
        {
            // scroll view of settings
            EditorGUIUtility.hierarchyMode = true;
            TerrainToolboxUtilities.DrawSeperatorLine();
            m_ScrollPosition = EditorGUILayout.BeginScrollView(m_ScrollPosition);

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Load Settings From: ");
            m_SettingsMode = (SettingsMode)GUILayout.Toolbar((int)m_SettingsMode, Styles.SettingsModeToggles, Styles.ToggleButtonStyle, GUI.ToolbarButtonSize.Fixed);

            if (GUILayout.Button("Load"))
            {
                if (m_SettingsMode == SettingsMode.Default)
                {
                    ResetToDefaultSettings();
                }

                if (m_SettingsMode == SettingsMode.SelectedTerrain)
                {
                    LoadSettingsFromSelectedTerrain();
                }

                if (m_SettingsMode == SettingsMode.Preset)
                {
                    LoadPresetToSettings();
                }
            }
            EditorGUILayout.EndHorizontal();

            // Presets
            TerrainToolboxUtilities.DrawSeperatorLine();
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField(Styles.Preset, EditorStyles.boldLabel);
            EditorGUI.BeginChangeCheck();
            m_SelectedPreset = (TerrainSettings)EditorGUILayout.ObjectField(m_SelectedPreset, typeof(TerrainSettings), false);
            if (EditorGUI.EndChangeCheck() && m_SelectedPreset != null)
            {
                if (EditorUtility.DisplayDialog("Confirm", "Load terrain settings from selected preset?", "OK", "Cancel"))
                {
                    m_Settings = m_SelectedPreset;
                }
            }
            if (GUILayout.Button(Styles.SavePreset))
            {
                if (m_SelectedPreset == null)
                {
                    if (EditorUtility.DisplayDialog("Confirm", "No preset selected. Create a new preset?", "Continue", "Cancel"))
                    {
                        CreateNewPreset();
                    }
                }
                else
                {
                    SavePresetSettings();
                }
            }
            if (GUILayout.Button(Styles.SaveAsPreset))
            {
                CreateNewPreset();
            }
            if (GUILayout.Button(Styles.RefreshPreset))
            {
                LoadPresetToSettings();
            }
            EditorGUILayout.EndHorizontal();

            // basic settings
            TerrainToolboxUtilities.DrawSeperatorLine();
            bool basicSettingToggled = m_Settings.EnableBasicSettings;

            m_Settings.ShowBasicTerrainSettings = TerrainToolGUIHelper.DrawToggleHeaderFoldout(Styles.BasicTerrainSettings, m_Settings.ShowBasicTerrainSettings, ref basicSettingToggled, 0f);
            ++EditorGUI.indentLevel;
            if (m_Settings.ShowBasicTerrainSettings)
            {
                EditorGUI.BeginDisabledGroup(!m_Settings.EnableBasicSettings);
                ShowBasicSettings();
                EditorGUI.EndDisabledGroup();
            }
            --EditorGUI.indentLevel;
            m_Settings.EnableBasicSettings = basicSettingToggled;

            // mesh resolution settings
            TerrainToolboxUtilities.DrawSeperatorLine();
            bool meshSettingToggled = m_Settings.EnableMeshResSettings;

            m_Settings.ShowMeshResolutionSettings = TerrainToolGUIHelper.DrawToggleHeaderFoldout(Styles.MeshResolutionSettings, m_Settings.ShowMeshResolutionSettings, ref meshSettingToggled, 0f);
            ++EditorGUI.indentLevel;
            if (m_Settings.ShowMeshResolutionSettings)
            {
                EditorGUI.BeginDisabledGroup(!m_Settings.EnableMeshResSettings);
                ShowMeshResolutionSettings();
                EditorGUI.EndDisabledGroup();
            }
            --EditorGUI.indentLevel;
            m_Settings.EnableMeshResSettings = meshSettingToggled;

            // texture resolution settings
            TerrainToolboxUtilities.DrawSeperatorLine();
            bool textureSettingToggled = m_Settings.EnableTextureResSettings;

            m_Settings.ShowTextureResolutionSettings = TerrainToolGUIHelper.DrawToggleHeaderFoldout(Styles.TextureResolutionSettings, m_Settings.ShowTextureResolutionSettings, ref textureSettingToggled, 0f);
            ++EditorGUI.indentLevel;
            if (m_Settings.ShowTextureResolutionSettings)
            {
                EditorGUI.BeginDisabledGroup(!m_Settings.EnableTextureResSettings);
                ShowTextureResolutionSettings();
                EditorGUI.EndDisabledGroup();
            }
            --EditorGUI.indentLevel;
            m_Settings.EnableTextureResSettings = textureSettingToggled;

            // trees and details
            TerrainToolboxUtilities.DrawSeperatorLine();
            bool treeSettingToggled = m_Settings.EnableTreeSettings;

            m_Settings.ShowTreeAndDetailSettings = TerrainToolGUIHelper.DrawToggleHeaderFoldout(Styles.TreeAndDetailSettings, m_Settings.ShowTreeAndDetailSettings, ref treeSettingToggled, 0f);
            ++EditorGUI.indentLevel;
            if (m_Settings.ShowTreeAndDetailSettings)
            {
                EditorGUI.BeginDisabledGroup(!m_Settings.EnableTreeSettings);
                ShowTreeAndDetailSettings();
                EditorGUI.EndDisabledGroup();
            }
            --EditorGUI.indentLevel;
            m_Settings.EnableTreeSettings = treeSettingToggled;

            // grass wind
            TerrainToolboxUtilities.DrawSeperatorLine();
            bool grassSettingToggled = m_Settings.EnableWindSettings;

            m_Settings.ShowGrassWindSettings = TerrainToolGUIHelper.DrawToggleHeaderFoldout(Styles.GrassWindSettings, m_Settings.ShowGrassWindSettings, ref grassSettingToggled, 0f);
            ++EditorGUI.indentLevel;
            if (m_Settings.ShowGrassWindSettings)
            {
                EditorGUI.BeginDisabledGroup(!m_Settings.EnableWindSettings);
                ShowGrassWindSettings();
                EditorGUI.EndDisabledGroup();
            }
            --EditorGUI.indentLevel;
            m_Settings.EnableWindSettings = grassSettingToggled;

            --EditorGUI.indentLevel;
            EditorGUILayout.Space();
            EditorGUILayout.EndScrollView();

            // buttons
            TerrainToolboxUtilities.DrawSeperatorLine();

            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button(Styles.ApplySettingsBtn, GUILayout.Height(40)))
            {
                ApplySettingsToSelectedTerrains();
            }
            if (GUILayout.Button(Styles.ApplySettingsToAllBtn, GUILayout.Height(40)))
            {
                if (EditorUtility.DisplayDialog("Confirm", "This operation will apply settings to all terrains in scene. Are you sure you want to continue?", "Continue", "Cancel"))
                {
                    ApplySettingsToAllTerrains();
                }
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();
        }
示例#20
0
 public SettingsManager(DTE applicationObject, SettingsMode mode, Solution sol)
 {
     Init(applicationObject, mode, sol, null);
 }
示例#21
0
        /// <summary>
        ///     Binds the current settings instance to the UI controls.
        /// </summary>
        private void BindUiSettings()
        {
            // Form Title //
            FormHeader.Text = string.Format("Paws {0} [{1}] Settings: {2}",
                                            Main.Product == Product.Community ? "Community" : "Premium",
                                            SettingsMode.ToString().Replace("Druid", string.Empty), aboutProfilesPesetsComboBox.SelectedItem);

            // General Tab //
            generalMarkOfTheWildEnabledCheckBox.Checked = SettingsManager.Instance.MarkOfTheWildEnabled;
            generalMarkOfTheWildEnabledCheckBox_CheckedChanged(generalMarkOfTheWildEnabledCheckBox, EventArgs.Empty);
            generalMarkOfTheWildDoNotApplyStealthedCheckBox.Checked =
                SettingsManager.Instance.MarkOfTheWildDoNotApplyIfStealthed;
            generalSootheEnabledCheckBox.Checked = SettingsManager.Instance.SootheEnabled;
            generalSootheEnabledCheckBox_CheckedChanged(generalSootheEnabledCheckBox, EventArgs.Empty);
            generalSootheReactionTimeTextBox.Text = SettingsManager.Instance.SootheReactionTimeInMs.ToString();
            generalTargetHeightCheckBox.Checked   = SettingsManager.Instance.TargetHeightEnabled;
            generalTargetHeightCheckBox_CheckedChanged(generalTargetHeightCheckBox, EventArgs.Empty);
            generalTargetHeightTextBox.Text = SettingsManager.Instance.TargetHeightMinDistance.ToString("0.##");
            generalReleaseSpiritOnDeathEnabledCheckBox.Checked = SettingsManager.Instance.ReleaseSpiritOnDeathEnabled;
            generalReleaseSpiritOnDeathEnabledCheckBox_CheckedChanged(generalReleaseSpiritOnDeathEnabledCheckBox,
                                                                      EventArgs.Empty);
            generalReleaseSpiritOnDeathTimerTextBox.Text =
                SettingsManager.Instance.ReleaseSpiritOnDeathIntervalInMs.ToString();
            generalInterruptTimingMinMSTextBox.Text       = SettingsManager.Instance.InterruptMinMilliseconds.ToString();
            generalInterruptTimingMaxMSTextBox.Text       = SettingsManager.Instance.InterruptMaxMilliseconds.ToString();
            generalInterruptTimingSuccessRateTextBox.Text =
                SettingsManager.Instance.InterruptSuccessRate.ToString("0.##");
            mobilityGeneralMovementCheckBox.Checked     = SettingsManager.Instance.AllowMovement;
            mobilityGeneralTargetFacingCheckBox.Checked = SettingsManager.Instance.AllowTargetFacing;
            mobilityAutoTargetCheckBox.Checked          = SettingsManager.Instance.AllowTargeting;
            mobilityForceCombatCheckBox.Checked         = SettingsManager.Instance.ForceCombat;

            // Mobility Tab //
            BindUiSettingsToControlCollection(mobilityTab.Controls);

            // Offesnive Tab //
            BindUiSettingsToControlCollection(offensiveTab.Controls);

            // Defensive Tab //
            BindUiSettingsToControlCollection(defensiveTab.Controls);

            // Healing Tab //
            BindUiSettingsToControlCollection(healingTab.Controls);

            // Trinkets/Racials Tab //
            miscTrinket1EnabledCheckBox.Checked = SettingsManager.Instance.Trinket1Enabled;
            miscTrinket1EnabledCheckBox_CheckedChanged(miscTrinket1EnabledCheckBox, EventArgs.Empty);
            miscTrinket1UseOnMe.Checked                    = SettingsManager.Instance.Trinket1UseOnMe;
            miscTrinket1UseOnEnemy.Checked                 = SettingsManager.Instance.Trinket1UseOnEnemy;
            miscTrinket1OnCooldownRadioButton.Checked      = SettingsManager.Instance.Trinket1OnCoolDown;
            miscTrinket1LossOfControlRadioButton.Checked   = SettingsManager.Instance.Trinket1LossOfControl;
            miscTrinket1TheseConditionsRadioButton.Checked = SettingsManager.Instance.Trinket1AdditionalConditions;
            miscTrinket1HealthMinCheckBox.Checked          = SettingsManager.Instance.Trinket1HealthMinEnabled;
            miscTrinket1HealthMinTextBox.Text              = SettingsManager.Instance.Trinket1HealthMin.ToString("0.##");
            miscTrinket1ManaMinCheckBox.Checked            = SettingsManager.Instance.Trinket1ManaMinEnabled;
            miscTrinket1ManaMinTextBox.Text                = SettingsManager.Instance.Trinket1ManaMin.ToString("0.##");
            miscTrinket2EnabledCheckBox.Checked            = SettingsManager.Instance.Trinket2Enabled;
            miscTrinket2EnabledCheckBox_CheckedChanged(miscTrinket2EnabledCheckBox, EventArgs.Empty);
            miscTrinket2UseOnMe.Checked                    = SettingsManager.Instance.Trinket2UseOnMe;
            miscTrinket2UseOnEnemy.Checked                 = SettingsManager.Instance.Trinket2UseOnEnemy;
            miscTrinket2OnCooldownRadioButton.Checked      = SettingsManager.Instance.Trinket2OnCoolDown;
            miscTrinket2LossOfControlRadioButton.Checked   = SettingsManager.Instance.Trinket2LossOfControl;
            miscTrinket2TheseConditionsRadioButton.Checked = SettingsManager.Instance.Trinket2AdditionalConditions;
            miscTrinket2HealthMinCheckBox.Checked          = SettingsManager.Instance.Trinket2HealthMinEnabled;
            miscTrinket2HealthMinTextBox.Text              = SettingsManager.Instance.Trinket2HealthMin.ToString("0.##");
            miscTrinket2ManaMinCheckBox.Checked            = SettingsManager.Instance.Trinket2ManaMinEnabled;
            miscTrinket2ManaMinTextBox.Text                = SettingsManager.Instance.Trinket2ManaMin.ToString("0.##");

            miscTrinket1EnabledCheckBox.Text = Me.Inventory.Equipped.Trinket1 != null
                ? string.Format("Trinket: ({0})", Me.Inventory.Equipped.Trinket1.SafeName)
                : "Trinket #1 (Not Equipped)";

            miscTrinket2EnabledCheckBox.Text = Me.Inventory.Equipped.Trinket2 != null
                ? string.Format("Trinket: ({0})", Me.Inventory.Equipped.Trinket2.SafeName)
                : "Trinket #2 (Not Equipped)";

            // Trinkets/Racials Tab //
            miscRacialAbilityTaurenWarStompCheckBox.Checked = SettingsManager.Instance.TaurenWarStompEnabled;
            miscRacialAbilityTaurenWarStompCheckBox_CheckedChanged(miscRacialAbilityTaurenWarStompCheckBox,
                                                                   EventArgs.Empty);
            miscRacialAbilityTaurenWarStompMinEnemies.Text =
                SettingsManager.Instance.TaurenWarStompMinEnemies.ToString();
            miscRacialAbilityTrollBerserkingCheckBox.Checked = SettingsManager.Instance.TrollBerserkingEnabled;
            miscRacialAbilityTrollBerserkingCheckBox_CheckedChanged(miscRacialAbilityTrollBerserkingCheckBox,
                                                                    EventArgs.Empty);
            miscRacialAbilityTrollBerserkingOnCooldownRadioButton.Checked =
                SettingsManager.Instance.TrollBerserkingOnCooldown;
            miscRacialAbilityTrollBerserkingEnemyHealthRadioButton.Checked =
                SettingsManager.Instance.TrollBerserkingEnemyHealthCheck;
            miscRacialAbilityTrollBerserkingEnemyHealthMultiplierTextBox.Text =
                SettingsManager.Instance.TrollBerserkingEnemyHealthMultiplier.ToString("0.##");
            miscRacialAbilityTrollBerserkingSurroundedByEnemiesCheckBox.Checked =
                SettingsManager.Instance.TrollBerserkingSurroundedByEnemiesEnabled;
            miscRacialAbilityTrollBerserkingSurroundedByEnemiesTextBox.Text =
                SettingsManager.Instance.TrollBerserkingSurroundedByMinEnemies.ToString();
        }
示例#22
0
 public SettingsManager(DTE applicationObject, SettingsMode mode, Solution sol, Project p)
 {
     Init(applicationObject, mode, sol, p);
 }
 private void Apply(SettingsMode settingsMode)
 {
     switch (settingsMode)
     {
         case SettingsMode.Default:
             Apply(ScreenSpaceReflection.SSRSettings.defaultSettings);
             break;
         case SettingsMode.HighQuality:
             Apply(ScreenSpaceReflection.SSRSettings.highQualitySettings);
             break;
         case SettingsMode.Performance:
             Apply(ScreenSpaceReflection.SSRSettings.performanceSettings);
             break;
     }
 }
示例#24
0
 public void bindingsMenuOptionDelegate(MenuOptionAction action)
 {
     switch (action)
     {
         case MenuOptionAction.Click:
             settingsMode = SettingsMode.Bindings;
             bool p1 = options[0].Key == "<P1 Bindings>";
             bindingsMenuInstructions = "Select an action to modify\nbindings for that action";
             usesCustomBindings = Bindings.USE_CUSTOM_BINDINGS[p1 ? PlayerIndex.One : PlayerIndex.Two];
             customBindingsToModify = Bindings.CUSTOM_BINDINGS[p1 ? PlayerIndex.One : PlayerIndex.Two];
             currentPlayerBindingsMenu = p1 ? PlayerIndex.One : PlayerIndex.Two;
             MenuOptions bindingsMenu = new MenuOptions(p1 ? "P1 Bindings" : "P2 Bindings",
                 new Dictionary<string, Action<MenuOptionAction>>()
                 {
                     { usesCustomBindings ? "<Custom>" : "<Default>",
                         delegate(MenuOptionAction action2)
                         {
                             switch (action2)
                             {
                                 case MenuOptionAction.Click:
                                 case MenuOptionAction.Left:
                                 case MenuOptionAction.Right:
                                     if(usesCustomBindings)
                                     {
                                         options[0] = new KeyValuePair<string, Action<MenuOptionAction>>("<Default>", options[0].Value);
                                         options.SetEnabled(false, 1, 9);
                                         usesCustomBindings = false;
                                     }
                                     else
                                     {
                                         options[0] = new KeyValuePair<string, Action<MenuOptionAction>>("<Custom>", options[0].Value);
                                         options.SetEnabled(true, 1, 9);
                                         usesCustomBindings = true;
                                     }
                                     break;
                             }
                         }
                     },
                     {"  Up", getSetBindingDelegate(InputAction.Up)},
                     {"  Down", getSetBindingDelegate(InputAction.Down)},
                     {"  Left", getSetBindingDelegate(InputAction.Left)},
                     {"  Right", getSetBindingDelegate(InputAction.Right)},
                     {"  Action1", getSetBindingDelegate(InputAction.Action1)},
                     {"  Action2", getSetBindingDelegate(InputAction.Action2)},
                     {"  Action3", getSetBindingDelegate(InputAction.Action3)},
                     {"  Action4", getSetBindingDelegate(InputAction.Action4)},
                     {"  Start", getSetBindingDelegate(InputAction.Start)},
                     {"Apply",
                         delegate
                         {
                             Bindings.USE_CUSTOM_BINDINGS[p1 ? PlayerIndex.One : PlayerIndex.Two] = usesCustomBindings;
                             Bindings.CUSTOM_BINDINGS[p1? PlayerIndex.One : PlayerIndex.Two] = customBindingsToModify;
                             if (p1 && RetroGame.getHeroes().Length > 0)
                             {
                                 if (usesCustomBindings)
                                     RetroGame.getHeroes()[0].bindings.setToCustom();
                                 else
                                     RetroGame.getHeroes()[0].bindings.setToDefault();
                             }
                             else if (RetroGame.getHeroes().Length > 1)
                             {
                                 if (usesCustomBindings)
                                     RetroGame.getHeroes()[1].bindings.setToCustom();
                                 else
                                     RetroGame.getHeroes()[1].bindings.setToDefault();
                             }
                             RetroGame.SaveConfig();
                             settingsMode = SettingsMode.Menu;
                             SetMenuOptions(settingsOptions);
                         }
                     },
                     {"Cancel",
                         delegate
                         {
                             customBindingsToModify = null;
                             settingsMode = SettingsMode.Menu;
                             SetMenuOptions(settingsOptions);
                         }
                     },
                 },
                 "Cancel");
             SetMenuOptions(bindingsMenu);
             options.SetEnabled(usesCustomBindings, 1, 9);
             break;
         case MenuOptionAction.Left:
         case MenuOptionAction.Right:
             if (options[0].Key == "<P1 Bindings>")
                 options[0] = new KeyValuePair<string, Action<MenuOptionAction>>("<P2 Bindings>", options[0].Value);
             else
                 options[0] = new KeyValuePair<string, Action<MenuOptionAction>>("<P1 Bindings>", options[0].Value);
             break;
     }
 }
示例#25
0
 public MenuOptions GetSettingsOptions()
 {
     preSettingsOptionsOptions = options;
     settingsOptions["Back"] = delegate { settingsMode = SettingsMode.None; SetMenuOptions(preSettingsOptionsOptions); };
     return settingsOptions;
 }
    //The Toolbar at the Top
    private void ShaderSelectionToolbar()
    {
        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        //Toolbar height is 40 = 48 - 8
        if (!_isUnlit)
        {
            _toolbarSelected = GUILayout.Toolbar(_toolbarSelected, _panelIcons, GUILayout.MaxWidth(Screen.width - 42f),
                GUILayout.Height(40f));
            _setPanel = (SettingsMode)_toolbarSelected;

        }
        else
        {
            _toolbarSelectedUnlit = GUILayout.Toolbar(_toolbarSelectedUnlit, _panelIcons,
                GUILayout.MaxWidth(Screen.width - 42f), GUILayout.Height(40f));

            //For Unlit we need to use a different index and a switch as workaround
            switch (_toolbarSelectedUnlit)
            {
                case 3:
                    _setPanel = SettingsMode.Extras;
                    break;
                case 2:
                    _setPanel = SettingsMode.Dissolve;
                    break;
                case 1:
                    _setPanel = SettingsMode.Reflection;
                    break;
                default:
                    _setPanel = SettingsMode.Sprites;
                    break;
            }
        }

        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();
        GUILayout.Space(1f);
    }