mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Merge branch 'master' into flag-fit
This commit is contained in:
@ -10,34 +10,34 @@ namespace osu.Game.Tournament.Components
|
||||
{
|
||||
public class DateTextBox : SettingsTextBox
|
||||
{
|
||||
public new Bindable<DateTimeOffset> Bindable
|
||||
public new Bindable<DateTimeOffset> Current
|
||||
{
|
||||
get => bindable;
|
||||
get => current;
|
||||
set
|
||||
{
|
||||
bindable = value.GetBoundCopy();
|
||||
bindable.BindValueChanged(dto =>
|
||||
base.Bindable.Value = dto.NewValue.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ"), true);
|
||||
current = value.GetBoundCopy();
|
||||
current.BindValueChanged(dto =>
|
||||
base.Current.Value = dto.NewValue.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ"), true);
|
||||
}
|
||||
}
|
||||
|
||||
// hold a reference to the provided bindable so we don't have to in every settings section.
|
||||
private Bindable<DateTimeOffset> bindable = new Bindable<DateTimeOffset>();
|
||||
private Bindable<DateTimeOffset> current = new Bindable<DateTimeOffset>();
|
||||
|
||||
public DateTextBox()
|
||||
{
|
||||
base.Bindable = new Bindable<string>();
|
||||
base.Current = new Bindable<string>();
|
||||
|
||||
((OsuTextBox)Control).OnCommit = (sender, newText) =>
|
||||
((OsuTextBox)Control).OnCommit += (sender, newText) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
bindable.Value = DateTimeOffset.Parse(sender.Text);
|
||||
current.Value = DateTimeOffset.Parse(sender.Text);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// reset textbox content to its last valid state on a parse failure.
|
||||
bindable.TriggerChange();
|
||||
current.TriggerChange();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Video;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Tournament.IO;
|
||||
|
||||
namespace osu.Game.Tournament.Components
|
||||
{
|
||||
@ -17,7 +18,6 @@ namespace osu.Game.Tournament.Components
|
||||
private readonly string filename;
|
||||
private readonly bool drawFallbackGradient;
|
||||
private Video video;
|
||||
|
||||
private ManualClock manualClock;
|
||||
|
||||
public TourneyVideo(string filename, bool drawFallbackGradient = false)
|
||||
@ -27,9 +27,9 @@ namespace osu.Game.Tournament.Components
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TournamentStorage storage)
|
||||
private void load(TournamentVideoResourceStore storage)
|
||||
{
|
||||
var stream = storage.GetStream($@"videos/{filename}");
|
||||
var stream = storage.GetStream(filename);
|
||||
|
||||
if (stream != null)
|
||||
{
|
||||
|
Reference in New Issue
Block a user