mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 09:02:58 +08:00
Visual settings initial commit
This commit is contained in:
parent
96226e1f27
commit
c48c7b085c
@ -17,6 +17,7 @@ namespace osu.Game.Screens.Play.HUD
|
||||
public bool ReplayLoaded;
|
||||
|
||||
public readonly PlaybackSettings PlaybackSettings;
|
||||
public readonly VisualSettings VisualSettings;
|
||||
//public readonly CollectionSettings CollectionSettings;
|
||||
//public readonly DiscussionSettings DiscussionSettings;
|
||||
|
||||
@ -33,11 +34,12 @@ namespace osu.Game.Screens.Play.HUD
|
||||
Direction = FillDirection.Vertical,
|
||||
Spacing = new Vector2(0, 20),
|
||||
Margin = new MarginPadding { Top = 100, Right = 10 },
|
||||
Children = new[]
|
||||
Children = new ReplayGroup[]
|
||||
{
|
||||
//CollectionSettings = new CollectionSettings(),
|
||||
//DiscussionSettings = new DiscussionSettings(),
|
||||
PlaybackSettings = new PlaybackSettings(),
|
||||
VisualSettings = new VisualSettings()
|
||||
}
|
||||
};
|
||||
|
||||
|
59
osu.Game/Screens/Play/HUD/VisualSettings.cs
Normal file
59
osu.Game/Screens/Play/HUD/VisualSettings.cs
Normal file
@ -0,0 +1,59 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Screens.Play.ReplaySettings;
|
||||
|
||||
namespace osu.Game.Screens.Play.HUD
|
||||
{
|
||||
public class VisualSettings : ReplayGroup
|
||||
{
|
||||
protected override string Title => "Visual settings";
|
||||
public IAdjustableClock AdjustableClock { get; set; }
|
||||
|
||||
private readonly ReplaySliderBar<double> dimSliderBar;
|
||||
private readonly ReplayCheckbox showStoryboardToggle;
|
||||
private readonly ReplayCheckbox mouseWheelDisabledToggle;
|
||||
|
||||
public VisualSettings()
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = "Background dim:"
|
||||
},
|
||||
dimSliderBar = new ReplaySliderBar<double>(),
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = "Toggles:"
|
||||
},
|
||||
showStoryboardToggle = new ReplayCheckbox {LabelText = "Storyboards" },
|
||||
mouseWheelDisabledToggle = new ReplayCheckbox { LabelText = "Disable mouse wheel" }
|
||||
};
|
||||
ToggleContentVisibility();
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config)
|
||||
{
|
||||
dimSliderBar.Bindable = config.GetBindable<double>(OsuSetting.DimLevel);
|
||||
showStoryboardToggle.Bindable = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
||||
mouseWheelDisabledToggle.Bindable = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
|
||||
}
|
||||
|
||||
protected override void ToggleContentVisibility()
|
||||
{
|
||||
base.ToggleContentVisibility();
|
||||
if (Expanded)
|
||||
AdjustableClock?.Stop();
|
||||
else
|
||||
AdjustableClock?.Start();
|
||||
}
|
||||
}
|
||||
}
|
@ -102,7 +102,8 @@ namespace osu.Game.Screens.Play
|
||||
// in the case a replay isn't loaded, we want some elements to only appear briefly.
|
||||
if (!replayLoaded)
|
||||
{
|
||||
ReplaySettingsOverlay.Hide();
|
||||
ReplaySettingsOverlay.PlaybackSettings.Hide();
|
||||
ReplaySettingsOverlay.Delay(5000).FadeOut(200);
|
||||
ModDisplay.Delay(2000).FadeOut(200);
|
||||
}
|
||||
}
|
||||
|
@ -228,7 +228,8 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
breakOverlay.BindProcessor(scoreProcessor);
|
||||
|
||||
hudOverlay.ReplaySettingsOverlay.PlaybackSettings.AdjustableClock = adjustableSourceClock;
|
||||
hudOverlay.ReplaySettingsOverlay.PlaybackSettings.AdjustableClock =
|
||||
hudOverlay.ReplaySettingsOverlay.VisualSettings.AdjustableClock = adjustableSourceClock;
|
||||
|
||||
// Bind ScoreProcessor to ourselves
|
||||
scoreProcessor.AllJudged += onCompletion;
|
||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
||||
private readonly FillFlowContainer content;
|
||||
private readonly IconButton button;
|
||||
|
||||
private bool expanded = true;
|
||||
protected bool Expanded = true;
|
||||
|
||||
private Color4 buttonActiveColour;
|
||||
|
||||
@ -82,7 +82,7 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
||||
Position = new Vector2(-15, 0),
|
||||
Icon = FontAwesome.fa_bars,
|
||||
Scale = new Vector2(0.75f),
|
||||
Action = toggleContentVisibility,
|
||||
Action = ToggleContentVisibility,
|
||||
},
|
||||
}
|
||||
},
|
||||
@ -112,13 +112,13 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
||||
|
||||
protected override Container<Drawable> Content => content;
|
||||
|
||||
private void toggleContentVisibility()
|
||||
protected virtual void ToggleContentVisibility()
|
||||
{
|
||||
content.ClearTransforms();
|
||||
|
||||
expanded = !expanded;
|
||||
Expanded = !Expanded;
|
||||
|
||||
if (expanded)
|
||||
if (Expanded)
|
||||
content.AutoSizeAxes = Axes.Y;
|
||||
else
|
||||
{
|
||||
@ -126,7 +126,7 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
||||
content.ResizeHeightTo(0, transition_duration, Easing.OutQuint);
|
||||
}
|
||||
|
||||
button.FadeColour(expanded ? buttonActiveColour : Color4.White, 200, Easing.OutQuint);
|
||||
button.FadeColour(Expanded ? buttonActiveColour : Color4.White, 200, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -315,6 +315,7 @@
|
||||
<Compile Include="Rulesets\Mods\IApplicableMod.cs" />
|
||||
<Compile Include="Rulesets\Mods\IApplicableToBeatmapConverter.cs" />
|
||||
<Compile Include="Rulesets\Mods\IApplicableToDrawableHitObject.cs" />
|
||||
<Compile Include="Screens\Play\HUD\VisualSettings.cs" />
|
||||
<Compile Include="Screens\Select\ImportFromStablePopup.cs" />
|
||||
<Compile Include="Overlays\Settings\SettingsButton.cs" />
|
||||
<Compile Include="Rulesets\Edit\Layers\Selection\OriginHandle.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user