From 04901d2a085300c259464365aca59a3d119179c9 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sat, 31 Oct 2020 15:52:11 +0900 Subject: [PATCH 1/3] Rename section name to separate note/lyric style section --- .../Edit/Style/{ColorSection.cs => LyricColorSection.cs} | 2 +- .../Edit/Style/{FontSection.cs => LyricFontSection.cs} | 2 +- .../Style/{ShadowSection.cs => LyricShadowSection.cs} | 2 +- .../Edit/Style/{StylePreview.cs => LyricStylePreview.cs} | 2 +- osu.Game.Rulesets.Karaoke/Edit/Style/StyleScreen.cs | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) rename osu.Game.Rulesets.Karaoke/Edit/Style/{ColorSection.cs => LyricColorSection.cs} (97%) rename osu.Game.Rulesets.Karaoke/Edit/Style/{FontSection.cs => LyricFontSection.cs} (97%) rename osu.Game.Rulesets.Karaoke/Edit/Style/{ShadowSection.cs => LyricShadowSection.cs} (97%) rename osu.Game.Rulesets.Karaoke/Edit/Style/{StylePreview.cs => LyricStylePreview.cs} (98%) diff --git a/osu.Game.Rulesets.Karaoke/Edit/Style/ColorSection.cs b/osu.Game.Rulesets.Karaoke/Edit/Style/LyricColorSection.cs similarity index 97% rename from osu.Game.Rulesets.Karaoke/Edit/Style/ColorSection.cs rename to osu.Game.Rulesets.Karaoke/Edit/Style/LyricColorSection.cs index 8405370e0..0ba52fc80 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Style/ColorSection.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Style/LyricColorSection.cs @@ -10,7 +10,7 @@ namespace osu.Game.Rulesets.Karaoke.Edit.Style { - internal class ColorSection : StyleSection + internal class LyricColorSection : StyleSection { private LabelledDropdown colorAreaDropdown; private LabelledDropdown brushTypeDropdown; diff --git a/osu.Game.Rulesets.Karaoke/Edit/Style/FontSection.cs b/osu.Game.Rulesets.Karaoke/Edit/Style/LyricFontSection.cs similarity index 97% rename from osu.Game.Rulesets.Karaoke/Edit/Style/FontSection.cs rename to osu.Game.Rulesets.Karaoke/Edit/Style/LyricFontSection.cs index 0741b82b5..4edcb9b87 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Style/FontSection.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Style/LyricFontSection.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Karaoke.Edit.Style { - internal class FontSection : StyleSection + internal class LyricFontSection : StyleSection { private LabelledDropdown fontDropdown; private LabelledSwitchButton boldSwitchButton; diff --git a/osu.Game.Rulesets.Karaoke/Edit/Style/ShadowSection.cs b/osu.Game.Rulesets.Karaoke/Edit/Style/LyricShadowSection.cs similarity index 97% rename from osu.Game.Rulesets.Karaoke/Edit/Style/ShadowSection.cs rename to osu.Game.Rulesets.Karaoke/Edit/Style/LyricShadowSection.cs index 26dd550dd..8d2b65fe0 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Style/ShadowSection.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Style/LyricShadowSection.cs @@ -10,7 +10,7 @@ namespace osu.Game.Rulesets.Karaoke.Edit.Style { - internal class ShadowSection : StyleSection + internal class LyricShadowSection : StyleSection { private LabelledSwitchButton displayShaderSwitchButton; private LabelledRealTimeSliderBar shadowXSliderBar; diff --git a/osu.Game.Rulesets.Karaoke/Edit/Style/StylePreview.cs b/osu.Game.Rulesets.Karaoke/Edit/Style/LyricStylePreview.cs similarity index 98% rename from osu.Game.Rulesets.Karaoke/Edit/Style/StylePreview.cs rename to osu.Game.Rulesets.Karaoke/Edit/Style/LyricStylePreview.cs index 67ceb64ac..bbfdcd50d 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Style/StylePreview.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Style/LyricStylePreview.cs @@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Karaoke.Edit.Style { - internal class StylePreview : Container + internal class LyricStylePreview : Container { [BackgroundDependencyLoader] private void load(OverlayColourProvider colourProvider, StyleManager manager) diff --git a/osu.Game.Rulesets.Karaoke/Edit/Style/StyleScreen.cs b/osu.Game.Rulesets.Karaoke/Edit/Style/StyleScreen.cs index a667415c2..a7b9e5e31 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Style/StyleScreen.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Style/StyleScreen.cs @@ -66,14 +66,14 @@ private void load() Size = new Vector2(1 / section_scale), Children = new StyleSection[] { - new ColorSection(), - new FontSection(), - new ShadowSection(), + new LyricColorSection(), + new LyricFontSection(), + new LyricShadowSection(), } } } }, - new StylePreview + new LyricStylePreview { Name = "Layout preview area", Anchor = Anchor.Centre, From e814583c0ebab5fe516b839f99e15b7e29e1410c Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sat, 31 Oct 2020 16:25:39 +0900 Subject: [PATCH 2/3] Implement switch lyric/note config --- .../Edit/Style/NoteColorSection.cs | 10 ++ .../Edit/Style/NoteFontSection.cs | 10 ++ .../Edit/Style/StyleScreen.cs | 95 +++++++++++++++---- 3 files changed, 96 insertions(+), 19 deletions(-) create mode 100644 osu.Game.Rulesets.Karaoke/Edit/Style/NoteColorSection.cs create mode 100644 osu.Game.Rulesets.Karaoke/Edit/Style/NoteFontSection.cs diff --git a/osu.Game.Rulesets.Karaoke/Edit/Style/NoteColorSection.cs b/osu.Game.Rulesets.Karaoke/Edit/Style/NoteColorSection.cs new file mode 100644 index 000000000..51119fad7 --- /dev/null +++ b/osu.Game.Rulesets.Karaoke/Edit/Style/NoteColorSection.cs @@ -0,0 +1,10 @@ +// Copyright (c) andy840119 . Licensed under the GPL Licence. +// See the LICENCE file in the repository root for full licence text. + +namespace osu.Game.Rulesets.Karaoke.Edit.Style +{ + internal class NoteColorSection : StyleSection + { + protected override string Title => "Color"; + } +} diff --git a/osu.Game.Rulesets.Karaoke/Edit/Style/NoteFontSection.cs b/osu.Game.Rulesets.Karaoke/Edit/Style/NoteFontSection.cs new file mode 100644 index 000000000..fbb32f58a --- /dev/null +++ b/osu.Game.Rulesets.Karaoke/Edit/Style/NoteFontSection.cs @@ -0,0 +1,10 @@ +// Copyright (c) andy840119 . Licensed under the GPL Licence. +// See the LICENCE file in the repository root for full licence text. + +namespace osu.Game.Rulesets.Karaoke.Edit.Style +{ + internal class NoteFontSection : StyleSection + { + protected override string Title => "Font"; + } +} diff --git a/osu.Game.Rulesets.Karaoke/Edit/Style/StyleScreen.cs b/osu.Game.Rulesets.Karaoke/Edit/Style/StyleScreen.cs index a7b9e5e31..1a6ba7945 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Style/StyleScreen.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Style/StyleScreen.cs @@ -2,10 +2,12 @@ // 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.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics.Containers; +using osu.Game.Graphics.UserInterface; using osu.Game.Overlays; using osu.Game.Screens.Edit; using osuTK; @@ -14,8 +16,6 @@ namespace osu.Game.Rulesets.Karaoke.Edit.Style { public class StyleScreen : EditorScreen { - private const float section_scale = 0.75f; - [Cached] protected readonly OverlayColourProvider ColourProvider; @@ -58,18 +58,9 @@ private void load() Colour = ColourProvider.Background2, RelativeSizeAxes = Axes.Both, }, - new SectionsContainer + new StyleSectionsContainer { - FixedHeader = new StyleScreenHeader(), RelativeSizeAxes = Axes.Both, - Scale = new Vector2(section_scale), - Size = new Vector2(1 / section_scale), - Children = new StyleSection[] - { - new LyricColorSection(), - new LyricFontSection(), - new LyricShadowSection(), - } } } }, @@ -86,19 +77,85 @@ private void load() }; } - internal class StyleScreenHeader : OverlayHeader + internal class StyleSectionsContainer : SectionsContainer { - protected override OverlayTitle CreateTitle() => new LayoutScreenTitle(); + private const float section_scale = 0.75f; - private class LayoutScreenTitle : OverlayTitle + public StyleSectionsContainer() { - public LayoutScreenTitle() + FixedHeader = new StyleScreenHeader(); + + Scale = new Vector2(section_scale); + Size = new Vector2(1 / section_scale); + + if (FixedHeader is StyleScreenHeader screenHeader) { - Title = "style"; - Description = "create style of your beatmap"; - IconTexture = "Icons/Hexacons/social"; + screenHeader.BindableStyle.BindValueChanged(e => + { + switch (e.NewValue) + { + case Style.Lyric: + Children = new StyleSection[] + { + new LyricColorSection(), + new LyricFontSection(), + new LyricShadowSection(), + }; + break; + case Style.Note: + Children = new StyleSection[] + { + new NoteColorSection(), + new NoteFontSection(), + }; + break; + } + }, true); + } + } + + internal class StyleScreenHeader : OverlayHeader + { + public Bindable