-
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 #286 from andy840119/lyric-editor/implement-time-d…
…isplay-and-language-selection Implement time and language display.
- Loading branch information
Showing
7 changed files
with
142 additions
and
60 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
osu.Game.Rulesets.Karaoke/Edit/Lyrics/Components/Badges/LanguageInfoBadge.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,32 @@ | ||
// 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.Game.Graphics; | ||
using osu.Game.Rulesets.Karaoke.Objects; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Edit.Lyrics.Components.Badges | ||
{ | ||
public class LanguageInfoBadge : Badge | ||
{ | ||
public LanguageInfoBadge(Lyric lyric) | ||
: base(lyric) | ||
{ | ||
lyric.LanguageBindable.BindValueChanged(value => | ||
{ | ||
var language = value.NewValue; | ||
|
||
if (language == null) | ||
BadgeText = "None"; | ||
else | ||
BadgeText = language.DisplayName; | ||
}, true); | ||
} | ||
|
||
[BackgroundDependencyLoader] | ||
private void load(OsuColour colours) | ||
{ | ||
BadgeColour = colours.BlueDarker; | ||
} | ||
} | ||
} |
43 changes: 0 additions & 43 deletions
43
osu.Game.Rulesets.Karaoke/Edit/Lyrics/Components/Badges/TimeInfoBadge.cs
This file was deleted.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
osu.Game.Rulesets.Karaoke/Edit/Lyrics/Components/Infos/TimeInfoContainer.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,49 @@ | ||
// 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.Extensions; | ||
using osu.Game.Graphics; | ||
using osu.Game.Graphics.Sprites; | ||
using osu.Game.Rulesets.Karaoke.Objects; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Edit.Lyrics.Components.Infos | ||
{ | ||
public class TimeInfoContainer : Container | ||
{ | ||
private readonly Box background; | ||
private readonly OsuSpriteText timeRange; | ||
|
||
public TimeInfoContainer(Lyric lyric) | ||
{ | ||
Children = new Drawable[] | ||
{ | ||
background = new Box | ||
{ | ||
RelativeSizeAxes = Axes.Both | ||
}, | ||
timeRange = new OsuSpriteText | ||
{ | ||
Anchor = Anchor.CentreRight, | ||
Origin = Anchor.CentreRight, | ||
Font = OsuFont.GetFont(size: 16, fixedWidth: true), | ||
Padding = new MarginPadding(10), | ||
} | ||
}; | ||
|
||
// todo : might move to another function for updating time. | ||
var startTime = lyric.StartTime.ToEditorFormattedString(); | ||
var endTime = lyric.EndTime.ToEditorFormattedString(); | ||
timeRange.Text = startTime + " - " + endTime; | ||
} | ||
|
||
[BackgroundDependencyLoader] | ||
private void load(OsuColour colours) | ||
{ | ||
background.Colour = colours.Gray4; | ||
} | ||
} | ||
} |
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