mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 09:27:18 +09:00
Add date entry for pairings
This commit is contained in:
parent
2ee77670ee
commit
87243a72d3
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
@ -11,6 +12,7 @@ using osu.Game.Graphics.Sprites;
|
|||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Overlays.Settings;
|
using osu.Game.Overlays.Settings;
|
||||||
using osu.Game.Screens.Play.PlayerSettings;
|
using osu.Game.Screens.Play.PlayerSettings;
|
||||||
|
using osu.Game.Tournament.Screens.Groupings;
|
||||||
|
|
||||||
namespace osu.Game.Tournament.Screens.Ladder.Components
|
namespace osu.Game.Tournament.Screens.Ladder.Components
|
||||||
{
|
{
|
||||||
@ -24,6 +26,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
|
|||||||
private OsuTextBox textboxTeam2;
|
private OsuTextBox textboxTeam2;
|
||||||
private SettingsDropdown<TournamentGrouping> groupingDropdown;
|
private SettingsDropdown<TournamentGrouping> groupingDropdown;
|
||||||
private PlayerCheckbox losersCheckbox;
|
private PlayerCheckbox losersCheckbox;
|
||||||
|
private DateTextBox dateTimeBox;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private LadderEditorInfo editorInfo { get; set; }
|
private LadderEditorInfo editorInfo { get; set; }
|
||||||
@ -81,6 +84,10 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
|
|||||||
{
|
{
|
||||||
LabelText = "Losers Bracket",
|
LabelText = "Losers Bracket",
|
||||||
Bindable = new Bindable<bool>()
|
Bindable = new Bindable<bool>()
|
||||||
|
},
|
||||||
|
dateTimeBox = new DateTextBox
|
||||||
|
{
|
||||||
|
Bindable = new Bindable<DateTimeOffset>()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -90,6 +97,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
|
|||||||
textboxTeam2.Text = selection?.Team2.Value?.Acronym;
|
textboxTeam2.Text = selection?.Team2.Value?.Acronym;
|
||||||
groupingDropdown.Bindable.Value = selection?.Grouping.Value ?? groupingOptions.First();
|
groupingDropdown.Bindable.Value = selection?.Grouping.Value ?? groupingOptions.First();
|
||||||
losersCheckbox.Current.Value = selection?.Losers.Value ?? false;
|
losersCheckbox.Current.Value = selection?.Losers.Value ?? false;
|
||||||
|
dateTimeBox.Bindable.Value = selection?.Date.Value ?? DateTimeOffset.UtcNow;
|
||||||
};
|
};
|
||||||
|
|
||||||
textboxTeam1.OnCommit = (val, newText) =>
|
textboxTeam1.OnCommit = (val, newText) =>
|
||||||
@ -107,7 +115,14 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
|
|||||||
groupingDropdown.Bindable.ValueChanged += grouping =>
|
groupingDropdown.Bindable.ValueChanged += grouping =>
|
||||||
{
|
{
|
||||||
if (editorInfo.Selected.Value != null)
|
if (editorInfo.Selected.Value != null)
|
||||||
|
{
|
||||||
editorInfo.Selected.Value.Grouping.Value = grouping;
|
editorInfo.Selected.Value.Grouping.Value = grouping;
|
||||||
|
if (editorInfo.Selected.Value.Date.Value < grouping.StartDate.Value)
|
||||||
|
{
|
||||||
|
editorInfo.Selected.Value.Date.Value = grouping.StartDate.Value;
|
||||||
|
editorInfo.Selected.TriggerChange();
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
losersCheckbox.Current.ValueChanged += losers =>
|
losersCheckbox.Current.ValueChanged += losers =>
|
||||||
@ -115,6 +130,18 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
|
|||||||
if (editorInfo.Selected.Value != null)
|
if (editorInfo.Selected.Value != null)
|
||||||
editorInfo.Selected.Value.Losers.Value = losers;
|
editorInfo.Selected.Value.Losers.Value = losers;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dateTimeBox.Bindable.ValueChanged += date =>
|
||||||
|
{
|
||||||
|
if (editorInfo.Selected.Value != null)
|
||||||
|
editorInfo.Selected.Value.Date.Value = date;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
this.FadeIn();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnHover(HoverEvent e)
|
protected override bool OnHover(HoverEvent e)
|
||||||
@ -125,6 +152,5 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
|
|||||||
protected override void OnHoverLost(HoverLostEvent e)
|
protected override void OnHoverLost(HoverLostEvent e)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user