-
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 #312 from andy840119/lyric-editor/able-to-split-lyric
Able to split lyric.
- Loading branch information
Showing
15 changed files
with
441 additions
and
232 deletions.
There are no files selected for viewing
172 changes: 0 additions & 172 deletions
172
osu.Game.Rulesets.Karaoke/Edit/Lyrics/Components/LyricControl.cs
This file was deleted.
Oops, something went wrong.
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
79 changes: 79 additions & 0 deletions
79
osu.Game.Rulesets.Karaoke/Edit/Lyrics/Infos/InfoControl.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,79 @@ | ||
// 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.Containers; | ||
using osu.Framework.Graphics.Shapes; | ||
using osu.Game.Graphics; | ||
using osu.Game.Rulesets.Karaoke.Edit.Lyrics.Infos.Badges; | ||
using osu.Game.Rulesets.Karaoke.Edit.Lyrics.Infos.TimeInfo; | ||
using osu.Game.Rulesets.Karaoke.Objects; | ||
using osuTK; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Edit.Lyrics.Infos | ||
{ | ||
public class InfoControl : Container | ||
{ | ||
private const int max_height = 120; | ||
|
||
private readonly Box headerBackground; | ||
|
||
public Lyric Lyric { get; } | ||
|
||
public InfoControl(Lyric lyric) | ||
{ | ||
Lyric = lyric; | ||
|
||
Children = new Drawable[] | ||
{ | ||
headerBackground = new Box | ||
{ | ||
RelativeSizeAxes = Axes.X, | ||
Height = max_height, | ||
Alpha = 0.7f | ||
}, | ||
new BadgeFillFlowContainer | ||
{ | ||
Direction = FillDirection.Vertical, | ||
RelativeSizeAxes = Axes.X, | ||
AutoSizeAxes = Axes.Y, | ||
Anchor = Anchor.TopRight, | ||
Origin = Anchor.TopRight, | ||
Spacing = new Vector2(5), | ||
Children = new Drawable[] | ||
{ | ||
new TimeInfoContainer(Lyric) | ||
{ | ||
RelativeSizeAxes = Axes.X, | ||
Height = 36, | ||
}, | ||
|
||
// todo : in small display size use badge. | ||
// in larger size should use real icon. | ||
new LanguageInfoBadge(Lyric) | ||
{ | ||
Margin = new MarginPadding { Right = 5 } | ||
} | ||
} | ||
}, | ||
}; | ||
} | ||
|
||
[BackgroundDependencyLoader] | ||
private void load(OsuColour colours) | ||
{ | ||
headerBackground.Colour = colours.Gray2; | ||
} | ||
|
||
public class BadgeFillFlowContainer : FillFlowContainer | ||
{ | ||
public override void Add(Drawable drawable) | ||
{ | ||
drawable.Anchor = Anchor.TopRight; | ||
drawable.Origin = Anchor.TopRight; | ||
base.Add(drawable); | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.