-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1286 from andy840119/refactor-gameplay-setting-ov…
…erlay Refactor the gameplay setting overlay.
- Loading branch information
Showing
7 changed files
with
76 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,31 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Game.Overlays; | ||
using osu.Game.Rulesets.Karaoke.UI.PlayerSettings; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.UI.HUD | ||
{ | ||
public class PracticeOverlay : SettingOverlay | ||
{ | ||
protected override OverlayColourScheme OverlayColourScheme => OverlayColourScheme.Purple; | ||
|
||
public PracticeOverlay() | ||
{ | ||
Add(new PracticeSettings | ||
Children = new[] | ||
{ | ||
Expanded = | ||
new PracticeSettings | ||
{ | ||
Value = true | ||
}, | ||
Width = 400 | ||
}); | ||
Expanded = | ||
{ | ||
Value = true | ||
}, | ||
Width = 400 | ||
} | ||
}; | ||
} | ||
|
||
public override SettingButton CreateToggleButton() => new() | ||
protected override SettingButton CreateButton() => new() | ||
{ | ||
Name = "Toggle Practice", | ||
Text = "Practice", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Framework.Allocation; | ||
using osu.Framework.Graphics.Cursor; | ||
using osu.Framework.Localisation; | ||
using osu.Game.Graphics; | ||
using osu.Game.Graphics.UserInterface; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.UI.HUD | ||
|
@@ -18,11 +16,5 @@ public SettingButton() | |
Width = 90; | ||
Height = 45; | ||
} | ||
|
||
[BackgroundDependencyLoader] | ||
private void load(OsuColour colours) | ||
{ | ||
BackgroundColour = colours.Blue; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System.Linq; | ||
|
@@ -25,13 +25,13 @@ public class LyricsPreview : CompositeDrawable | |
private readonly Bindable<double> bindablePreemptTime = new(); | ||
private readonly Bindable<Lyric[]> singingLyrics = new(); | ||
|
||
private readonly FillFlowContainer<ClickableLyric> lyricTable; | ||
|
||
[Resolved] | ||
private IBindable<WorkingBeatmap> beatmap { get; set; } | ||
|
||
public LyricsPreview() | ||
{ | ||
FillFlowContainer<ClickableLyric> lyricTable; | ||
|
||
InternalChild = new OsuScrollContainer | ||
{ | ||
RelativeSizeAxes = Axes.Both, | ||
|
@@ -40,6 +40,7 @@ public LyricsPreview() | |
AutoSizeAxes = Axes.Y, | ||
RelativeSizeAxes = Axes.X, | ||
Direction = FillDirection.Vertical, | ||
Spacing = new Vector2(15) | ||
} | ||
}; | ||
|
||
|
@@ -77,12 +78,6 @@ private void triggerLyric(Lyric lyric) | |
singingLyrics.Value = new[] { lyric }; | ||
} | ||
|
||
public Vector2 Spacing | ||
{ | ||
get => lyricTable.Spacing; | ||
set => lyricTable.Spacing = value; | ||
} | ||
|
||
[BackgroundDependencyLoader] | ||
private void load(KaraokeRulesetConfigManager config, KaraokeSessionStatics session) | ||
{ | ||
|
@@ -111,30 +106,28 @@ public ClickableLyric(Lyric lyric) | |
{ | ||
background = new Box | ||
{ | ||
RelativeSizeAxes = Axes.Both | ||
RelativeSizeAxes = Axes.Both, | ||
Alpha = 0, | ||
}, | ||
icon = new SpriteIcon | ||
{ | ||
Anchor = Anchor.CentreLeft, | ||
Origin = Anchor.CentreLeft, | ||
Size = new Vector2(15), | ||
Icon = FontAwesome.Solid.Play, | ||
Margin = new MarginPadding { Left = 5 }, | ||
Alpha = 0, | ||
}, | ||
previewLyric = new PreviewLyricSpriteText(lyric) | ||
{ | ||
Font = new FontUsage(size: 25), | ||
RubyFont = new FontUsage(size: 10), | ||
RomajiFont = new FontUsage(size: 10), | ||
Margin = new MarginPadding { Left = 25 } | ||
}, | ||
icon = createIcon(), | ||
previewLyric = createLyric(lyric), | ||
}; | ||
} | ||
|
||
private PreviewLyricSpriteText createLyric(Lyric lyric) => new(lyric) | ||
{ | ||
Font = new FontUsage(size: 25), | ||
RubyFont = new FontUsage(size: 10), | ||
RomajiFont = new FontUsage(size: 10), | ||
Margin = new MarginPadding { Left = 25 } | ||
}; | ||
|
||
private Drawable createIcon() => new SpriteIcon | ||
{ | ||
Anchor = Anchor.CentreLeft, | ||
Origin = Anchor.CentreLeft, | ||
Size = new Vector2(15), | ||
Icon = FontAwesome.Solid.Play, | ||
Margin = new MarginPadding { Left = 5 } | ||
}; | ||
|
||
private bool selected; | ||
|
||
public bool Selected | ||
|
@@ -162,9 +155,7 @@ private void load(OsuColour colours) | |
|
||
previewLyric.Colour = idolTextColour; | ||
background.Colour = colours.Blue; | ||
background.Alpha = 0; | ||
icon.Colour = hoverTextColour; | ||
icon.Alpha = 0; | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters