Skip to content

Commit

Permalink
Merge pull request #2109 from andy840119/move-create-time-tag-caret-m…
Browse files Browse the repository at this point in the history
…ode-out-of-config

Move create time tag caret mode out of config.
  • Loading branch information
andy840119 authored Aug 30, 2023
2 parents 4a6ffdc + 038834e commit 911f959
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using osu.Game.Rulesets.Karaoke.Objects.Types;
using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics;
using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.CaretPosition.Algorithms;
using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.States;
using osu.Game.Rulesets.Karaoke.Utils;

namespace osu.Game.Rulesets.Karaoke.Configuration;
Expand All @@ -30,7 +29,6 @@ protected override void InitialiseDefaults()
SetDefault(KaraokeRulesetLyricEditorSetting.FontSizeInComposer, FontUtils.DEFAULT_FONT_SIZE_IN_COMPOSER);

// Create time-tag.
SetDefault(KaraokeRulesetLyricEditorSetting.CreateTimeTagEditMode, CreateTimeTagEditMode.Create);
SetDefault(KaraokeRulesetLyricEditorSetting.CreateTimeTagMovingCaretMode, MovingTimeTagCaretMode.None);

// Recording
Expand Down Expand Up @@ -70,7 +68,6 @@ public enum KaraokeRulesetLyricEditorSetting
FontSizeInComposer,

// Create time-tag.
CreateTimeTagEditMode,
CreateTimeTagMovingCaretMode,

// Recording
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private void load(IEditNoteModeState editNoteModeState)
{
Label = "Edit property",
Description = "Batch edit text, ruby(alternative) text or display from notes",
Current = editNoteModeState.NoteEditPropertyMode,
Current = editNoteModeState.BindableNoteEditPropertyMode,
},
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public NotePropertiesEditor()
[BackgroundDependencyLoader]
private void load(IEditNoteModeState editNoteModeState)
{
bindableNoteEditPropertyMode.BindTo(editNoteModeState.NoteEditPropertyMode);
bindableNoteEditPropertyMode.BindTo(editNoteModeState.BindableNoteEditPropertyMode);
}

protected override Drawable CreateDrawable(Note item)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.Rulesets.Karaoke.Configuration;
using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.CaretPosition.Algorithms;
using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.States;
using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.States.Modes;

namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Settings.TimeTags;

Expand All @@ -16,13 +16,13 @@ public partial class TimeTagCreateConfigSection : EditorSection
protected override LocalisableString Title => "Config Tool";

[BackgroundDependencyLoader]
private void load(KaraokeRulesetLyricEditorConfigManager lyricEditorConfigManager)
private void load(ITimeTagModeState timeTagModeState, KaraokeRulesetLyricEditorConfigManager lyricEditorConfigManager)
{
Children = new Drawable[]
{
new TimeTagCreateConfigSubsection
{
Current = lyricEditorConfigManager.GetBindable<CreateTimeTagEditMode>(KaraokeRulesetLyricEditorSetting.CreateTimeTagEditMode),
Current = timeTagModeState.BindableCreateTimeTagEditMode,
},
new LabelledEnumDropdown<MovingTimeTagCaretMode>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using osu.Framework.Localisation;
using osu.Game.Graphics;
using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Settings.Components.Markdown;
using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.States;
using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.States.Modes;
using osu.Game.Rulesets.Karaoke.Screens.Edit.Components.Markdown;
using osuTK;
using osuTK.Graphics;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ static ICaretPositionAlgorithm getCreateTimeTagEditModeAlgorithm(Lyric[] lyrics,
}

[BackgroundDependencyLoader]
private void load(EditorBeatmap beatmap, ILyricsProvider lyricsProvider, ILyricEditorState state, KaraokeRulesetLyricEditorConfigManager lyricEditorConfigManager)
private void load(EditorBeatmap beatmap, ILyricsProvider lyricsProvider, ILyricEditorState state, KaraokeRulesetLyricEditorConfigManager lyricEditorConfigManager, ITimeTagModeState timeTagModeState)
{
selectedHitObjects.BindTo(beatmap.SelectedHitObjects);

bindableLyrics.BindTo(lyricsProvider.BindableLyrics);

bindableModeWithEditStep.BindTo(state.BindableModeWithEditStep);

lyricEditorConfigManager.BindWith(KaraokeRulesetLyricEditorSetting.CreateTimeTagEditMode, bindableCreateTimeTagEditMode);
bindableCreateTimeTagEditMode.BindTo(timeTagModeState.BindableCreateTimeTagEditMode);
lyricEditorConfigManager.BindWith(KaraokeRulesetLyricEditorSetting.CreateTimeTagMovingCaretMode, bindableCreateMovingCaretMode);
lyricEditorConfigManager.BindWith(KaraokeRulesetLyricEditorSetting.RecordingTimeTagMovingCaretMode, bindableRecordingMovingCaretMode);
lyricEditorConfigManager.BindWith(KaraokeRulesetLyricEditorSetting.RecordingChangeTimeWhileMovingTheCaret, bindableRecordingChangeTimeWhileMovingTheCaret);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence.
// See the LICENCE file in the repository root for full licence text.

namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.States;
namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.States.Modes;

public enum CreateTimeTagEditMode
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void ChangeEditStep(NoteEditStep step)

public Bindable<NoteEditModeSpecialAction> BindableSpecialAction { get; } = new();

public Bindable<NoteEditPropertyMode> NoteEditPropertyMode { get; } = new();
public Bindable<NoteEditPropertyMode> BindableNoteEditPropertyMode { get; } = new();

[BackgroundDependencyLoader]
private void load()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.States.Modes;

public interface IEditNoteModeState : IHasEditStep<NoteEditStep>, IHasSpecialAction<NoteEditModeSpecialAction>, IHasBlueprintSelection<Note>
{
Bindable<NoteEditPropertyMode> NoteEditPropertyMode { get; }
Bindable<NoteEditPropertyMode> BindableNoteEditPropertyMode { get; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@

namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.States.Modes;

public interface ITimeTagModeState : IHasBlueprintSelection<TimeTag>, IHasEditStep<TimeTagEditStep>
public interface ITimeTagModeState : IHasEditStep<TimeTagEditStep>, IHasBlueprintSelection<TimeTag>
{
BindableFloat BindableRecordZoom { get; }

BindableFloat BindableAdjustZoom { get; }

Bindable<CreateTimeTagEditMode> BindableCreateTimeTagEditMode { get; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public partial class TimeTagModeState : ModeStateWithBlueprintContainer<TimeTag>

public BindableFloat BindableAdjustZoom { get; } = new();

public Bindable<CreateTimeTagEditMode> BindableCreateTimeTagEditMode { get; } = new();

[BackgroundDependencyLoader]
private void load(EditorClock editorClock)
{
Expand Down

0 comments on commit 911f959

Please sign in to comment.