-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0d9c29
commit a7979a8
Showing
5 changed files
with
100 additions
and
2 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
91 changes: 91 additions & 0 deletions
91
osu.Game.Rulesets.Karaoke/Edit/ImportLyric/EditLyric/EditLyricSubScreen.cs
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 |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// 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; | ||
using osu.Framework.Graphics.Sprites; | ||
using osu.Framework.Timing; | ||
using osu.Game.Rulesets.Karaoke.Edit.Lyrics; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Edit.ImportLyric.EditLyric | ||
{ | ||
public class EditLyricSubScreen : ImportLyricSubScreenWithTopNavigation | ||
{ | ||
public override string Title => "Edit lyric"; | ||
|
||
public override string ShortTitle => "Edit"; | ||
|
||
public override ImportLyricStep Step => ImportLyricStep.EditLyric; | ||
|
||
public override IconUsage Icon => FontAwesome.Solid.Globe; | ||
|
||
[Cached] | ||
protected readonly LyricManager LyricManager; | ||
|
||
public EditLyricSubScreen() | ||
{ | ||
AddInternal(LyricManager = new LyricManager()); | ||
} | ||
|
||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) | ||
{ | ||
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); | ||
var clock = new DecoupleableInterpolatingFramedClock { IsCoupled = false }; | ||
dependencies.CacheAs<IAdjustableClock>(clock); | ||
dependencies.CacheAs<IFrameBasedClock>(clock); | ||
|
||
return dependencies; | ||
} | ||
|
||
protected override TopNavigation CreateNavigation() | ||
=> new EditLyricNavigation(this); | ||
|
||
protected override Drawable CreateContent() | ||
=> new LyricEditor | ||
{ | ||
RelativeSizeAxes = Axes.Both, | ||
Mode = Mode.EditMode, | ||
LyricFastEditMode = LyricFastEditMode.None, | ||
}; | ||
|
||
protected override void LoadComplete() | ||
{ | ||
base.LoadComplete(); | ||
Navigation.State = NavigationState.Initial; | ||
} | ||
|
||
public override void Complete() | ||
{ | ||
ScreenStack.Push(ImportLyricStep.AssignLanguage); | ||
} | ||
|
||
public class EditLyricNavigation : TopNavigation | ||
{ | ||
public EditLyricNavigation(EditLyricSubScreen screen) | ||
: base(screen) | ||
{ | ||
} | ||
|
||
protected override void UpdateState(NavigationState value) | ||
{ | ||
base.UpdateState(value); | ||
|
||
switch (value) | ||
{ | ||
case NavigationState.Initial: | ||
NavigationText = "Check and edit lyric if needed."; | ||
break; | ||
|
||
case NavigationState.Working: | ||
case NavigationState.Done: | ||
NavigationText = "Cool!"; | ||
break; | ||
|
||
case NavigationState.Error: | ||
NavigationText = "Oops, seems cause some error in here."; | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -7,6 +7,8 @@ public enum ImportLyricStep | |
{ | ||
ImportLyric, | ||
|
||
EditLyric, | ||
|
||
AssignLanguage, | ||
|
||
GenerateRuby, | ||
|
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