コード例 #1
0
 public LayoutOptions()
 {
     Children = new Drawable[]
     {
         new SpriteText {
             Text = "Resolution: TODO dropdown"
         },
         fullscreen = new CheckBoxOption {
             LabelText = "Fullscreen mode"
         },
         letterboxing = new CheckBoxOption {
             LabelText = "Letterboxing"
         },
         new SpriteText {
             Text = "Horizontal position"
         },
         new SpriteText {
             Text = "TODO: slider"
         },
         new SpriteText {
             Text = "Vertical position"
         },
         new SpriteText {
             Text = "TODO: slider"
         },
     };
 }
コード例 #2
0
ファイル: DetailOptions.cs プロジェクト: Jonasrems/osu
 public DetailOptions()
 {
     Children = new Drawable[]
     {
         snakingSliders = new CheckBoxOption {
             LabelText = "Snaking sliders"
         },
         backgroundVideo = new CheckBoxOption {
             LabelText = "Background video"
         },
         storyboards = new CheckBoxOption {
             LabelText = "Storyboards"
         },
         comboBursts = new CheckBoxOption {
             LabelText = "Combo bursts"
         },
         hitLighting = new CheckBoxOption {
             LabelText = "Hit lighting"
         },
         shaders = new CheckBoxOption {
             LabelText = "Shaders"
         },
         softeningFilter = new CheckBoxOption {
             LabelText = "Softening filter"
         },
         new SpriteText {
             Text = "Screenshot format TODO: dropdown"
         }
     };
 }
コード例 #3
0
 public InGameChatOptions()
 {
     Children = new Drawable[]
     {
         filterWords = new CheckBoxOption {
             LabelText = "Filter offensive words"
         },
         filterForeign = new CheckBoxOption {
             LabelText = "Filter foreign characters"
         },
         logPMs = new CheckBoxOption {
             LabelText = "Log private messages"
         },
         blockPMs = new CheckBoxOption {
             LabelText = "Block private messages from non-friends"
         },
         new SpriteText {
             Text = "Chat ignore list (space-seperated list)"
         },
         new TextBox {
             Height = 20, RelativeSizeAxes = Axes.X
         },
         new SpriteText {
             Text = "Chat highlight words (space-seperated list)"
         },
         new TextBox {
             Height = 20, RelativeSizeAxes = Axes.X
         },
     };
 }
コード例 #4
0
 public GeneralGameplayOptions()
 {
     Children = new Drawable[]
     {
         new SpriteText {
             Text = "Background dim: TODO slider"
         },
         new SpriteText {
             Text = "Progress display: TODO dropdown"
         },
         new SpriteText {
             Text = "Score meter type: TODO dropdown"
         },
         new SpriteText {
             Text = "Score meter size: TODO slider"
         },
         keyOverlay = new CheckBoxOption {
             LabelText = "Always show key overlay"
         },
         hiddenApproachCircle = new CheckBoxOption {
             LabelText = "Show approach circle on first \"Hidden\" object"
         },
         scaleManiaScroll = new CheckBoxOption {
             LabelText = "Scale osu!mania scroll speed with BPM"
         },
         rememberManiaScroll = new CheckBoxOption {
             LabelText = "Remember osu!mania scroll speed per beatmap"
         },
     };
 }
コード例 #5
0
ファイル: MouseOptions.cs プロジェクト: Jonasrems/osu
 public MouseOptions()
 {
     Children = new Drawable[]
     {
         new SpriteText {
             Text = "Sensitivity: TODO slider"
         },
         rawInput = new CheckBoxOption {
             LabelText = "Raw input"
         },
         mapRawInput = new CheckBoxOption {
             LabelText = "Map absolute raw input to the osu! window"
         },
         new SpriteText {
             Text = "Confine mouse cursor: TODO dropdown"
         },
         disableWheel = new CheckBoxOption {
             LabelText = "Disable mouse wheel in play mode"
         },
         disableButtons = new CheckBoxOption {
             LabelText = "Disable mouse buttons in play mode"
         },
         enableRipples = new CheckBoxOption {
             LabelText = "Cursor ripples"
         },
     };
 }
コード例 #6
0
 public SongSelectGraphicsOptions()
 {
     Children = new[]
     {
         showThumbs = new CheckBoxOption {
             LabelText = "Show thumbnails"
         }
     };
 }
コード例 #7
0
 public LanguageOptions()
 {
     Children = new Drawable[]
     {
         new SpriteText {
             Text = "TODO: Dropdown"
         },
         showUnicode = new CheckBoxOption {
             LabelText = "Prefer metadata in original language"
         },
         altChatFont = new CheckBoxOption {
             LabelText = "Use alternative font for chat display"
         },
     };
 }
コード例 #8
0
ファイル: VolumeOptions.cs プロジェクト: Jonasrems/osu
 public VolumeOptions()
 {
     Children = new Drawable[]
     {
         new SpriteText {
             Text = "Master: TODO slider"
         },
         new SpriteText {
             Text = "Music: TODO slider"
         },
         new SpriteText {
             Text = "Effect: TODO slider"
         },
         ignoreHitsounds = new CheckBoxOption {
             LabelText = "Ignore beatmap hitsounds"
         }
     };
 }
コード例 #9
0
 public RendererOptions()
 {
     // NOTE: Compatability mode omitted
     Children = new Drawable[]
     {
         new SpriteText {
             Text = "Frame limiter: TODO dropdown"
         },
         fpsCounter = new CheckBoxOption {
             LabelText = "Show FPS counter"
         },
         reduceDroppedFrames = new CheckBoxOption {
             LabelText = "Reduce dropped frames"
         },
         detectPerformanceIssues = new CheckBoxOption {
             LabelText = "Detect performance issues"
         },
     };
 }
コード例 #10
0
ファイル: VolumeOptions.cs プロジェクト: fystir/osu
 private void load(OsuConfigManager config)
 {
     Children = new Drawable[]
     {
         new SpriteText {
             Text = "Master: TODO slider"
         },
         new SpriteText {
             Text = "Music: TODO slider"
         },
         new SpriteText {
             Text = "Effect: TODO slider"
         },
         ignoreHitsounds = new CheckBoxOption
         {
             LabelText = "Ignore beatmap hitsounds",
             Bindable  = config.GetBindable <bool>(OsuConfig.IgnoreBeatmapSamples)
         }
     };
 }
コード例 #11
0
 public MainMenuOptions()
 {
     Children = new[]
     {
         snow = new CheckBoxOption {
             LabelText = "Snow"
         },
         parallax = new CheckBoxOption {
             LabelText = "Parallax"
         },
         tips = new CheckBoxOption {
             LabelText = "Menu tips"
         },
         voices = new CheckBoxOption {
             LabelText = "Interface voices"
         },
         musicTheme = new CheckBoxOption {
             LabelText = "osu! music theme"
         },
     };
 }
コード例 #12
0
 private void load(OsuConfigManager config)
 {
     Children = new Drawable[]
     {
         new SpriteText {
             Text = "Sensitivity: TODO slider"
         },
         rawInput = new CheckBoxOption
         {
             LabelText = "Raw input",
             Bindable  = config.GetBindable <bool>(OsuConfig.RawInput)
         },
         mapRawInput = new CheckBoxOption
         {
             LabelText = "Map absolute raw input to the osu! window",
             Bindable  = config.GetBindable <bool>(OsuConfig.AbsoluteToOsuWindow)
         },
         new SpriteText {
             Text = "Confine mouse cursor: TODO dropdown"
         },
         disableWheel = new CheckBoxOption
         {
             LabelText = "Disable mouse wheel in play mode",
             Bindable  = config.GetBindable <bool>(OsuConfig.MouseDisableWheel)
         },
         disableButtons = new CheckBoxOption
         {
             LabelText = "Disable mouse buttons in play mode",
             Bindable  = config.GetBindable <bool>(OsuConfig.MouseDisableButtons)
         },
         enableRipples = new CheckBoxOption
         {
             LabelText = "Cursor ripples",
             Bindable  = config.GetBindable <bool>(OsuConfig.CursorRipple)
         },
     };
 }
コード例 #13
0
        public List <CheckBoxOption> DrawCheckBox(List <CheckBoxOption> options, ColorSchema schema = ColorSchema.Regular, bool onlyChecked = true)
        {
            Draw(schema);
            setColorSchema(schema);
            int Line      = LastBodyHeight + MarginTop;
            int tmpCursor = 0;
            List <CheckBoxOption> TmpOptions = options;

            //Continue Here
            foreach (CheckBoxOption o in TmpOptions)
            {
                char tmpSelected = o.IsSelected ? SelectedChar : EmptyChar;
                Console.SetCursorPosition(MarginLeft + PosLeft, Line);
                System.Console.Write($" [{tmpSelected}] {o.Name} - {o.Description}");
                Line++;
            }

            Line -= options.Count;

            ConsoleKeyInfo keypress;

            do
            {
                Console.SetCursorPosition(MarginLeft + PosLeft, Line + tmpCursor);
                Console.Write(AnswerChar);
                keypress = Console.ReadKey(true);
                if (keypress.Key == ConsoleKey.UpArrow)
                {
                    if (tmpCursor > 0)
                    {
                        Console.SetCursorPosition(MarginLeft + PosLeft, Line + tmpCursor);
                        Console.Write(EmptyChar);
                        tmpCursor--;
                    }
                }
                if (keypress.Key == ConsoleKey.DownArrow)
                {
                    if (tmpCursor < TmpOptions.Count - 1)
                    {
                        Console.SetCursorPosition(MarginLeft + PosLeft, Line + tmpCursor);
                        Console.Write(EmptyChar);
                        tmpCursor++;
                    }
                }
                if (keypress.Key == ConsoleKey.Spacebar)
                {
                    CheckBoxOption c = TmpOptions[tmpCursor];
                    c.IsSelected = !c.IsSelected;
                    char ch = c.IsSelected ? SelectedChar : EmptyChar;
                    Console.SetCursorPosition(MarginLeft + 2 + PosLeft, Line + tmpCursor);
                    TmpOptions[tmpCursor] = c;
                    Console.Write(ch);
                }
            } while (keypress.Key != ConsoleKey.Enter);

            if (onlyChecked)
            {
                TmpOptions = (from t in TmpOptions where t.IsSelected select t).ToList();
            }

            setColorSchema(ColorSchema.Regular);
            return(TmpOptions);
        }
コード例 #14
0
        internal void LoadOptionListFromCategory(string modGuid, int categoryIndex, int headerCount)
        {
            UnloadExistingOptionButtons();

            _panel.CategoryHeader.transform.Find("Scroll View").Find("Scrollbar Horizontal").gameObject.GetComponent <CustomScrollbar>().value = (1f / ((float)headerCount) - 1) * ((float)categoryIndex);

            _panel.ModOptionsDescriptionPanel.GetComponentInChildren <HGTextMeshProUGUI>().SetText("");

            Category category = ModSettingsManager.OptionCollection[modGuid][categoryIndex];

            var verticalLayoutTransform = _panel.ModOptionsPanel.transform.Find("Scroll View").Find("Viewport").Find("VerticalLayout");

            Selectable lastSelectable = null;

            _modSettings = new ModSetting[category.OptionCount];

            for (int i = 0; i < category.OptionCount; i++)
            {
                var option = category[i];

                GameObject button = option switch
                {
                    CheckBoxOption checkBoxOption => option.CreateOptionGameObject(_checkBoxPrefab, verticalLayoutTransform),
                    SliderOption sliderOption => option.CreateOptionGameObject(_sliderPrefab, verticalLayoutTransform),
                    StepSliderOption stepSliderOption => option.CreateOptionGameObject(_stepSliderPrefab, verticalLayoutTransform),
                    KeyBindOption keyBindOption => option.CreateOptionGameObject(_keyBindPrefab, verticalLayoutTransform),
                    StringInputFieldOption inputFieldOption => option.CreateOptionGameObject(_inputFieldPrefab, verticalLayoutTransform),
                    GenericButtonOption genericButton => option.CreateOptionGameObject(_genericButtonPrefab, verticalLayoutTransform),
                    // DropDownOption dropDownOption => option.CreateOptionGameObject(option, _dropDownPrefab, verticalLayoutTransform),
                    _ => throw new ArgumentOutOfRangeException(option.Name)
                };

                _modSettings[i] = button.GetComponentInChildren <ModSetting>();
                _modSettings[i].optionController = this;

                CanvasGroup canvasGroup = button.AddComponent <CanvasGroup>();

                var buttonComponent = button.GetComponentInChildren <HGButton>();
                if (buttonComponent)
                {
                    button.GetComponentInChildren <HGButton>().hoverToken = option.GetDescriptionToken();

                    button.GetComponentInChildren <HGButton>().onSelect.AddListener(delegate
                    {
                        _panel.ModOptionsDescriptionPanel.GetComponentInChildren <HGTextMeshProUGUI>().SetText(option.Description);
                    });
                }

                var selectable = button.GetComponentInChildren <Selectable>();

                if (selectable)
                {
                    var selectableNavigation = selectable.navigation;
                    selectableNavigation.mode = Navigation.Mode.Explicit;

                    if (i == 0 || i > category.OptionCount)
                    {
                        // Todo if at top of list, select category.
                    }
                    else if (lastSelectable)
                    {
                        var lastSelectableNavigation = lastSelectable.navigation;
                        lastSelectableNavigation.selectOnDown = selectable;
                        lastSelectable.navigation             = lastSelectableNavigation;

                        selectableNavigation.selectOnUp = lastSelectable;
                    }

                    selectable.navigation = selectableNavigation;
                    lastSelectable        = selectable;
                }
                else
                {
                    lastSelectable = null;
                }

                // if (!option.Visibility)
                // {
                //     canvasGroup.alpha = 1;
                //     canvasGroup.blocksRaycasts = false;
                //     button.GetComponent<LayoutElement>().ignoreLayout = true;
                //     continue;
                // }

                button.SetActive(true);
            }
        }