mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Add ability to adjust all control point attributes
This commit is contained in:
@ -2,21 +2,27 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Overlays.Settings;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Timing
|
||||
{
|
||||
internal class DifficultySection : Section<DifficultyControlPoint>
|
||||
{
|
||||
private OsuSpriteText multiplier;
|
||||
private SettingsSlider<double> multiplier;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Flow.AddRange(new[]
|
||||
{
|
||||
multiplier = new OsuSpriteText(),
|
||||
multiplier = new SettingsSlider<double>
|
||||
{
|
||||
LabelText = "Speed Multiplier",
|
||||
Bindable = new DifficultyControlPoint().SpeedMultiplierBindable,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -24,7 +30,13 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
ControlPoint.BindValueChanged(point => { multiplier.Text = $"Multiplier: {point.NewValue?.SpeedMultiplier::0.##}x"; });
|
||||
ControlPoint.BindValueChanged(point =>
|
||||
{
|
||||
if (point.NewValue != null)
|
||||
{
|
||||
multiplier.Bindable = point.NewValue.SpeedMultiplierBindable;
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
protected override DifficultyControlPoint CreatePoint()
|
||||
|
@ -3,22 +3,22 @@
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterfaceV2;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Timing
|
||||
{
|
||||
internal class EffectSection : Section<EffectControlPoint>
|
||||
{
|
||||
private OsuSpriteText kiai;
|
||||
private OsuSpriteText omitBarLine;
|
||||
private LabelledSwitchButton kiai;
|
||||
private LabelledSwitchButton omitBarLine;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Flow.AddRange(new[]
|
||||
{
|
||||
kiai = new OsuSpriteText(),
|
||||
omitBarLine = new OsuSpriteText(),
|
||||
kiai = new LabelledSwitchButton { Label = "Kiai Time" },
|
||||
omitBarLine = new LabelledSwitchButton { Label = "Skip Bar Line" },
|
||||
});
|
||||
}
|
||||
|
||||
@ -28,8 +28,11 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
|
||||
ControlPoint.BindValueChanged(point =>
|
||||
{
|
||||
kiai.Text = $"Kiai: {(point.NewValue?.KiaiMode == true ? "on" : "off")}";
|
||||
omitBarLine.Text = $"Skip Bar Line: {(point.NewValue?.OmitFirstBarLine == true ? "on" : "off")}";
|
||||
if (point.NewValue != null)
|
||||
{
|
||||
kiai.Current = point.NewValue.KiaiModeBindable;
|
||||
omitBarLine.Current = point.NewValue.OmitFirstBarLineBindable;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -2,23 +2,32 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterfaceV2;
|
||||
using osu.Game.Overlays.Settings;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Timing
|
||||
{
|
||||
internal class SampleSection : Section<SampleControlPoint>
|
||||
{
|
||||
private OsuSpriteText bank;
|
||||
private OsuSpriteText volume;
|
||||
private LabelledTextBox bank;
|
||||
private SettingsSlider<int> volume;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Flow.AddRange(new[]
|
||||
Flow.AddRange(new Drawable[]
|
||||
{
|
||||
bank = new OsuSpriteText(),
|
||||
volume = new OsuSpriteText(),
|
||||
bank = new LabelledTextBox
|
||||
{
|
||||
Label = "Bank Name",
|
||||
},
|
||||
volume = new SettingsSlider<int>
|
||||
{
|
||||
Bindable = new SampleControlPoint().SampleVolumeBindable,
|
||||
LabelText = "Volume",
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -39,8 +48,11 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
|
||||
ControlPoint.BindValueChanged(point =>
|
||||
{
|
||||
bank.Text = $"Bank: {point.NewValue?.SampleBank}";
|
||||
volume.Text = $"Volume: {point.NewValue?.SampleVolume}%";
|
||||
if (point.NewValue != null)
|
||||
{
|
||||
bank.Current = point.NewValue.SampleBankBindable;
|
||||
volume.Bindable = point.NewValue.SampleVolumeBindable;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -2,23 +2,33 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Beatmaps.Timing;
|
||||
using osu.Game.Overlays.Settings;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Timing
|
||||
{
|
||||
internal class TimingSection : Section<TimingControlPoint>
|
||||
{
|
||||
private OsuSpriteText bpm;
|
||||
private OsuSpriteText timeSignature;
|
||||
private SettingsSlider<double> bpm;
|
||||
private SettingsEnumDropdown<TimeSignatures> timeSignature;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Flow.AddRange(new[]
|
||||
Flow.AddRange(new Drawable[]
|
||||
{
|
||||
bpm = new OsuSpriteText(),
|
||||
timeSignature = new OsuSpriteText(),
|
||||
bpm = new BPMSlider
|
||||
{
|
||||
Bindable = new TimingControlPoint().BeatLengthBindable,
|
||||
LabelText = "BPM",
|
||||
},
|
||||
timeSignature = new SettingsEnumDropdown<TimeSignatures>
|
||||
{
|
||||
LabelText = "Time Signature"
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@ -28,8 +38,11 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
|
||||
ControlPoint.BindValueChanged(point =>
|
||||
{
|
||||
bpm.Text = $"BPM: {point.NewValue?.BPM:0.##}";
|
||||
timeSignature.Text = $"Signature: {point.NewValue?.TimeSignature}";
|
||||
if (point.NewValue != null)
|
||||
{
|
||||
bpm.Bindable = point.NewValue.BeatLengthBindable;
|
||||
timeSignature.Bindable = point.NewValue.TimeSignatureBindable;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -43,5 +56,35 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
TimeSignature = reference.TimeSignature
|
||||
};
|
||||
}
|
||||
|
||||
private class BPMSlider : SettingsSlider<double>
|
||||
{
|
||||
private readonly BindableDouble beatLengthBindable = new BindableDouble();
|
||||
|
||||
private BindableDouble bpmBindable;
|
||||
|
||||
public override Bindable<double> Bindable
|
||||
{
|
||||
get => base.Bindable;
|
||||
set
|
||||
{
|
||||
// incoming will be beatlength
|
||||
|
||||
beatLengthBindable.UnbindBindings();
|
||||
beatLengthBindable.BindTo(value);
|
||||
|
||||
base.Bindable = bpmBindable = new BindableDouble(beatLengthToBpm(beatLengthBindable.Value))
|
||||
{
|
||||
MinValue = beatLengthToBpm(beatLengthBindable.MaxValue),
|
||||
MaxValue = beatLengthToBpm(beatLengthBindable.MinValue),
|
||||
Default = beatLengthToBpm(beatLengthBindable.Default),
|
||||
};
|
||||
|
||||
bpmBindable.BindValueChanged(bpm => beatLengthBindable.Value = beatLengthToBpm(bpm.NewValue));
|
||||
}
|
||||
}
|
||||
|
||||
private double beatLengthToBpm(double beatLength) => 60000 / beatLength;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user