private void load(OsuConfigManager config, IAPIProvider api) { user = api.LocalUser.GetBoundCopy(); Children = new Drawable[] { new SettingsCheckbox { LabelText = "Interface voices", Current = config.GetBindable <bool>(OsuSetting.MenuVoice) }, new SettingsCheckbox { LabelText = "osu! music theme", Current = config.GetBindable <bool>(OsuSetting.MenuMusic) }, new SettingsEnumDropdown <IntroSequence> { LabelText = "Intro sequence", Current = config.GetBindable <IntroSequence>(OsuSetting.IntroSequence), }, backgroundSourceDropdown = new SettingsEnumDropdown <BackgroundSource> { LabelText = "Background source", Current = config.GetBindable <BackgroundSource>(OsuSetting.MenuBackgroundSource), }, new SettingsEnumDropdown <SeasonalBackgroundMode> { LabelText = "Seasonal backgrounds", Current = config.GetBindable <SeasonalBackgroundMode>(OsuSetting.SeasonalBackgroundMode), } }; }
private void load(OsuConfigManager osuConfig, FrameworkConfigManager config) { // use local bindable to avoid changing enabled state of game host's bindable. configSensitivity = config.GetBindable <double>(FrameworkSetting.CursorSensitivity); localSensitivity = configSensitivity.GetUnboundCopy(); windowMode = config.GetBindable <WindowMode>(FrameworkSetting.WindowMode); ignoredInputHandlers = config.GetBindable <string>(FrameworkSetting.IgnoredInputHandlers); Children = new Drawable[] { new SettingsCheckbox { LabelText = "Raw input", Current = rawInputToggle }, new SensitivitySetting { LabelText = "Cursor sensitivity", Current = localSensitivity }, new SettingsCheckbox { LabelText = "Map absolute input to window", Current = config.GetBindable <bool>(FrameworkSetting.MapAbsoluteInputToWindow) }, confineMouseModeSetting = new SettingsEnumDropdown <OsuConfineMouseMode> { LabelText = "Confine mouse cursor to window", Current = osuConfig.GetBindable <OsuConfineMouseMode>(OsuSetting.ConfineMouseMode) }, new SettingsCheckbox { LabelText = "Disable mouse wheel during gameplay", Current = osuConfig.GetBindable <bool>(OsuSetting.MouseDisableWheel) }, new SettingsCheckbox { LabelText = "Disable mouse buttons during gameplay", Current = osuConfig.GetBindable <bool>(OsuSetting.MouseDisableButtons) }, }; }
private void load(OsuConfigManager osuConfig, FrameworkConfigManager config) { // use local bindable to avoid changing enabled state of game host's bindable. handlerSensitivity = mouseHandler.Sensitivity.GetBoundCopy(); localSensitivity = handlerSensitivity.GetUnboundCopy(); relativeMode = mouseHandler.UseRelativeMode.GetBoundCopy(); windowMode = config.GetBindable <WindowMode>(FrameworkSetting.WindowMode); Children = new Drawable[] { highPrecisionMouse = new SettingsCheckbox { LabelText = MouseSettingsStrings.HighPrecisionMouse, TooltipText = MouseSettingsStrings.HighPrecisionMouseTooltip, Current = relativeMode, Keywords = new[] { @"raw", @"input", @"relative", @"cursor" } }, new SensitivitySetting { LabelText = MouseSettingsStrings.CursorSensitivity, Current = localSensitivity }, confineMouseModeSetting = new SettingsEnumDropdown <OsuConfineMouseMode> { LabelText = MouseSettingsStrings.ConfineMouseMode, Current = osuConfig.GetBindable <OsuConfineMouseMode>(OsuSetting.ConfineMouseMode) }, new SettingsCheckbox { LabelText = MouseSettingsStrings.DisableMouseWheelVolumeAdjust, TooltipText = MouseSettingsStrings.DisableMouseWheelVolumeAdjustTooltip, Current = osuConfig.GetBindable <bool>(OsuSetting.MouseDisableWheel) }, new SettingsCheckbox { LabelText = MouseSettingsStrings.DisableMouseButtons, Current = osuConfig.GetBindable <bool>(OsuSetting.MouseDisableButtons) }, }; }
private void load(OsuConfigManager osuConfig, FrameworkConfigManager config) { // use local bindable to avoid changing enabled state of game host's bindable. handlerSensitivity = mouseHandler.Sensitivity.GetBoundCopy(); localSensitivity = handlerSensitivity.GetUnboundCopy(); relativeMode = mouseHandler.UseRelativeMode.GetBoundCopy(); windowMode = config.GetBindable <WindowMode>(FrameworkSetting.WindowMode); Children = new Drawable[] { new SettingsCheckbox { LabelText = "High precision mouse", Current = relativeMode }, new SensitivitySetting { LabelText = "Cursor sensitivity", Current = localSensitivity }, confineMouseModeSetting = new SettingsEnumDropdown <OsuConfineMouseMode> { LabelText = "Confine mouse cursor to window", Current = osuConfig.GetBindable <OsuConfineMouseMode>(OsuSetting.ConfineMouseMode) }, new SettingsCheckbox { LabelText = "Disable mouse wheel during gameplay", Current = osuConfig.GetBindable <bool>(OsuSetting.MouseDisableWheel) }, new SettingsCheckbox { LabelText = "Disable mouse buttons during gameplay", Current = osuConfig.GetBindable <bool>(OsuSetting.MouseDisableButtons) }, }; }
private void load(FrameworkConfigManager config, OsuConfigManager osuConfig) { // NOTE: Compatability mode omitted Children = new Drawable[] { // TODO: this needs to be a custom dropdown at some point frameLimiterDropdown = new SettingsEnumDropdown <FrameSync> { LabelText = GraphicsSettingsStrings.FrameLimiter, Current = config.GetBindable <FrameSync>(FrameworkSetting.FrameSync) }, new SettingsEnumDropdown <ExecutionMode> { LabelText = GraphicsSettingsStrings.ThreadingMode, Current = config.GetBindable <ExecutionMode>(FrameworkSetting.ExecutionMode) }, new SettingsCheckbox { LabelText = GraphicsSettingsStrings.ShowFPS, Current = osuConfig.GetBindable <bool>(OsuSetting.ShowFpsDisplay) }, }; }
private void load(FrameworkConfigManager config, OsuConfigManager osuConfig, OsuGameBase game) { this.game = game; scalingMode = osuConfig.GetBindable <ScalingMode>(OsuSetting.Scaling); sizeFullscreen = config.GetBindable <Size>(FrameworkSetting.SizeFullscreen); scalingSizeX = osuConfig.GetBindable <float>(OsuSetting.ScalingSizeX); scalingSizeY = osuConfig.GetBindable <float>(OsuSetting.ScalingSizeY); scalingPositionX = osuConfig.GetBindable <float>(OsuSetting.ScalingPositionX); scalingPositionY = osuConfig.GetBindable <float>(OsuSetting.ScalingPositionY); Container resolutionSettingsContainer; Children = new Drawable[] { windowModeDropdown = new SettingsEnumDropdown <WindowMode> { LabelText = "Screen mode", Bindable = config.GetBindable <WindowMode>(FrameworkSetting.WindowMode), }, resolutionSettingsContainer = new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y }, new SettingsSlider <float, UIScaleSlider> { LabelText = "UI Scaling", TransferValueOnCommit = true, Bindable = osuConfig.GetBindable <float>(OsuSetting.UIScale), KeyboardStep = 0.01f }, new SettingsEnumDropdown <ScalingMode> { LabelText = "Screen Scaling", Bindable = osuConfig.GetBindable <ScalingMode>(OsuSetting.Scaling), }, scalingSettings = new FillFlowContainer <SettingsSlider <float> > { Direction = FillDirection.Vertical, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, AutoSizeDuration = transition_duration, AutoSizeEasing = Easing.OutQuint, Masking = true, Children = new [] { new SettingsSlider <float> { LabelText = "Horizontal position", Bindable = scalingPositionX, KeyboardStep = 0.01f }, new SettingsSlider <float> { LabelText = "Vertical position", Bindable = scalingPositionY, KeyboardStep = 0.01f }, new SettingsSlider <float> { LabelText = "Horizontal scale", Bindable = scalingSizeX, KeyboardStep = 0.01f }, new SettingsSlider <float> { LabelText = "Vertical scale", Bindable = scalingSizeY, KeyboardStep = 0.01f }, } }, }; scalingSettings.ForEach(s => bindPreviewEvent(s.Bindable)); var resolutions = getResolutions(); if (resolutions.Count > 1) { resolutionSettingsContainer.Child = resolutionDropdown = new ResolutionSettingsDropdown { LabelText = "Resolution", ShowsDefaultIndicator = false, Items = resolutions, Bindable = sizeFullscreen }; windowModeDropdown.Bindable.BindValueChanged(windowMode => { if (windowMode == WindowMode.Fullscreen) { resolutionDropdown.Show(); sizeFullscreen.TriggerChange(); } else { resolutionDropdown.Hide(); } }, true); } scalingMode.BindValueChanged(mode => { scalingSettings.ClearTransforms(); scalingSettings.AutoSizeAxes = mode != ScalingMode.Off ? Axes.Y : Axes.None; if (mode == ScalingMode.Off) { scalingSettings.ResizeHeightTo(0, transition_duration, Easing.OutQuint); } scalingSettings.ForEach(s => s.TransferValueOnCommit = mode == ScalingMode.Everything); }, true); }
private void load(OsuConfigManager osuConfig, FrameworkConfigManager config) { var configSensitivity = config.GetBindable <double>(FrameworkSetting.CursorSensitivity); // use local bindable to avoid changing enabled state of game host's bindable. sensitivityBindable = configSensitivity.GetUnboundCopy(); configSensitivity.BindValueChanged(val => sensitivityBindable.Value = val.NewValue); sensitivityBindable.BindValueChanged(val => configSensitivity.Value = val.NewValue); Children = new Drawable[] { new SettingsCheckbox { LabelText = "Raw input", Current = rawInputToggle }, new SensitivitySetting { LabelText = "Cursor sensitivity", Current = sensitivityBindable }, new SettingsCheckbox { LabelText = "Map absolute input to window", Current = config.GetBindable <bool>(FrameworkSetting.MapAbsoluteInputToWindow) }, confineMouseModeSetting = new SettingsEnumDropdown <OsuConfineMouseMode> { LabelText = "Confine mouse cursor to window", Current = osuConfig.GetBindable <OsuConfineMouseMode>(OsuSetting.ConfineMouseMode) }, new SettingsCheckbox { LabelText = "Disable mouse wheel during gameplay", Current = osuConfig.GetBindable <bool>(OsuSetting.MouseDisableWheel) }, new SettingsCheckbox { LabelText = "Disable mouse buttons during gameplay", Current = osuConfig.GetBindable <bool>(OsuSetting.MouseDisableButtons) }, }; windowMode = config.GetBindable <WindowMode>(FrameworkSetting.WindowMode); windowMode.BindValueChanged(mode => confineMouseModeSetting.Alpha = mode.NewValue == WindowMode.Fullscreen ? 0 : 1, true); if (RuntimeInfo.OS != RuntimeInfo.Platform.Windows) { rawInputToggle.Disabled = true; sensitivityBindable.Disabled = true; } else { rawInputToggle.ValueChanged += enabled => { // this is temporary until we support per-handler settings. const string raw_mouse_handler = @"OsuTKRawMouseHandler"; const string standard_mouse_handlers = @"OsuTKMouseHandler MouseHandler"; ignoredInputHandlers.Value = enabled.NewValue ? standard_mouse_handlers : raw_mouse_handler; }; ignoredInputHandlers = config.GetBindable <string>(FrameworkSetting.IgnoredInputHandlers); ignoredInputHandlers.ValueChanged += handler => { bool raw = !handler.NewValue.Contains("Raw"); rawInputToggle.Value = raw; sensitivityBindable.Disabled = !raw; }; ignoredInputHandlers.TriggerChange(); } }
private void load(FrameworkConfigManager config, OsuGameBase game) { this.game = game; letterboxing = config.GetBindable <bool>(FrameworkSetting.Letterboxing); sizeFullscreen = config.GetBindable <Size>(FrameworkSetting.SizeFullscreen); Container resolutionSettingsContainer; Children = new Drawable[] { windowModeDropdown = new SettingsEnumDropdown <WindowMode> { LabelText = "Screen mode", Bindable = config.GetBindable <WindowMode>(FrameworkSetting.WindowMode), }, resolutionSettingsContainer = new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y }, new SettingsCheckbox { LabelText = "Letterboxing", Bindable = letterboxing, }, letterboxSettings = new FillFlowContainer { Direction = FillDirection.Vertical, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, AutoSizeDuration = transition_duration, AutoSizeEasing = Easing.OutQuint, Masking = true, Children = new Drawable[] { new SettingsSlider <double> { LabelText = "Horizontal position", Bindable = config.GetBindable <double>(FrameworkSetting.LetterboxPositionX), KeyboardStep = 0.01f }, new SettingsSlider <double> { LabelText = "Vertical position", Bindable = config.GetBindable <double>(FrameworkSetting.LetterboxPositionY), KeyboardStep = 0.01f }, } }, }; var resolutions = getResolutions(); if (resolutions.Count > 1) { resolutionSettingsContainer.Child = resolutionDropdown = new SettingsDropdown <Size> { LabelText = "Resolution", ShowsDefaultIndicator = false, Entries = resolutions, Bindable = sizeFullscreen }; windowModeDropdown.Bindable.BindValueChanged(windowMode => { if (windowMode == WindowMode.Fullscreen) { resolutionDropdown.Show(); sizeFullscreen.TriggerChange(); } else { resolutionDropdown.Hide(); } }, true); } letterboxing.BindValueChanged(isVisible => { letterboxSettings.ClearTransforms(); letterboxSettings.AutoSizeAxes = isVisible ? Axes.Y : Axes.None; if (!isVisible) { letterboxSettings.ResizeHeightTo(0, transition_duration, Easing.OutQuint); } }, true); }