-
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.
Merge pull request #2265 from andy840119/add-grid-layout
Add grid layout in the lyric composer.
- Loading branch information
Showing
15 changed files
with
131 additions
and
24 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
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
1 change: 0 additions & 1 deletion
1
...dit/Beatmaps/Lyrics/CaretPosition/Algorithms/CreateRemoveTimeTagCaretPositionAlgorithm.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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
// 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.Graphics.Sprites; | ||
using osu.Game.Rulesets.Karaoke.Objects; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.CaretPosition.Algorithms; | ||
|
65 changes: 65 additions & 0 deletions
65
...Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Components/Lyrics/GridLayer.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,65 @@ | ||
// 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.Graphics; | ||
using osu.Game.Rulesets.Karaoke.Objects; | ||
using osu.Game.Screens.Edit.Compose.Components; | ||
using osuTK; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Content.Components.Lyrics; | ||
|
||
public partial class GridLayer : Layer | ||
{ | ||
private readonly RectangularPositionSnapGrid rectangularPositionSnapGrid; | ||
|
||
public GridLayer(Lyric lyric) | ||
: base(lyric) | ||
{ | ||
InternalChild = rectangularPositionSnapGrid = new RectangularPositionSnapGrid | ||
{ | ||
RelativeSizeAxes = Axes.Both, | ||
}; | ||
} | ||
|
||
public int Spacing | ||
{ | ||
get => rectangularPositionSnapGrid.Spacing; | ||
set => rectangularPositionSnapGrid.Spacing = value; | ||
} | ||
|
||
public override void UpdateDisableEditState(bool editable) | ||
{ | ||
this.FadeTo(editable ? 1 : 0.5f, 100); | ||
} | ||
|
||
private partial class RectangularPositionSnapGrid : LinedPositionSnapGrid | ||
{ | ||
protected override void CreateContent() | ||
{ | ||
GenerateGridLines(new Vector2(0, -Spacing), DrawSize); | ||
GenerateGridLines(new Vector2(0, Spacing), DrawSize); | ||
|
||
GenerateGridLines(new Vector2(-Spacing, 0), DrawSize); | ||
GenerateGridLines(new Vector2(Spacing, 0), DrawSize); | ||
|
||
GenerateOutline(DrawSize); | ||
} | ||
|
||
public override Vector2 GetSnappedPosition(Vector2 original) | ||
{ | ||
return StartPosition.Value + original; | ||
} | ||
|
||
private int spacing; | ||
|
||
public int Spacing | ||
{ | ||
get => spacing; | ||
set | ||
{ | ||
spacing = value; | ||
GridCache.Invalidate(); | ||
} | ||
} | ||
} | ||
} |
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
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
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
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
2 changes: 0 additions & 2 deletions
2
osu.Game.Rulesets.Karaoke/Screens/Edit/Import/Lyrics/LyricImporterSubScreenStack.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 |
---|---|---|
@@ -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 System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using osu.Framework.Extensions.IEnumerableExtensions; | ||
using osu.Framework.Screens; | ||
using osu.Game.Rulesets.Karaoke.Screens.Edit.Import.Lyrics.AssignLanguage; | ||
using osu.Game.Rulesets.Karaoke.Screens.Edit.Import.Lyrics.DragFile; | ||
|
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