mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Apply review changes
This commit is contained in:
@ -39,7 +39,6 @@ namespace osu.Game.Tournament.Components
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
|
|
||||||
Text = "Control Panel",
|
Text = "Control Panel",
|
||||||
Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 22)
|
Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 22)
|
||||||
},
|
},
|
||||||
@ -47,13 +46,10 @@ namespace osu.Game.Tournament.Components
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Width = 0.75f,
|
Width = 0.75f,
|
||||||
|
|
||||||
Position = new Vector2(0, 35f),
|
Position = new Vector2(0, 35f),
|
||||||
|
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
Spacing = new Vector2(0, 5f),
|
Spacing = new Vector2(0, 5f),
|
||||||
},
|
},
|
||||||
|
@ -15,7 +15,7 @@ namespace osu.Game.Tournament.Components
|
|||||||
get => bindable;
|
get => bindable;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
bindable = value;
|
bindable = value.GetBoundCopy();
|
||||||
bindable.BindValueChanged(dto =>
|
bindable.BindValueChanged(dto =>
|
||||||
base.Bindable.Value = dto.NewValue.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ"), true);
|
base.Bindable.Value = dto.NewValue.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ"), true);
|
||||||
}
|
}
|
||||||
@ -35,6 +35,7 @@ namespace osu.Game.Tournament.Components
|
|||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
// reset textbox content to its last valid state on a parse failure.
|
||||||
bindable.TriggerChange();
|
bindable.TriggerChange();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -15,8 +15,6 @@ namespace osu.Game.Tournament.Components
|
|||||||
{
|
{
|
||||||
private readonly Bindable<string> chatChannel = new Bindable<string>();
|
private readonly Bindable<string> chatChannel = new Bindable<string>();
|
||||||
|
|
||||||
protected override ChatLine CreateMessage(Message message) => new MatchMessage(message);
|
|
||||||
|
|
||||||
private ChannelManager manager;
|
private ChannelManager manager;
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
@ -55,6 +53,8 @@ namespace osu.Game.Tournament.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override ChatLine CreateMessage(Message message) => new MatchMessage(message);
|
||||||
|
|
||||||
protected class MatchMessage : StandAloneMessage
|
protected class MatchMessage : StandAloneMessage
|
||||||
{
|
{
|
||||||
public MatchMessage(Message message)
|
public MatchMessage(Message message)
|
||||||
|
@ -228,21 +228,22 @@ namespace osu.Game.Tournament.Components
|
|||||||
s.Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 15);
|
s.Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool first = true;
|
for (var i = 0; i < tuples.Length; i++)
|
||||||
|
|
||||||
foreach (var t in tuples)
|
|
||||||
{
|
{
|
||||||
if (!first)
|
var tuple = tuples[i];
|
||||||
|
|
||||||
|
if (i > 0)
|
||||||
|
{
|
||||||
AddText(" / ", s =>
|
AddText(" / ", s =>
|
||||||
{
|
{
|
||||||
cp(s, OsuColour.Gray(0.33f));
|
cp(s, OsuColour.Gray(0.33f));
|
||||||
s.Spacing = new Vector2(-2, 0);
|
s.Spacing = new Vector2(-2, 0);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
AddText(new OsuSpriteText { Text = t.heading }, s => cp(s, OsuColour.Gray(0.33f)));
|
AddText(new OsuSpriteText { Text = tuple.heading }, s => cp(s, OsuColour.Gray(0.33f)));
|
||||||
AddText(" ", s => cp(s, OsuColour.Gray(0.33f)));
|
AddText(" ", s => cp(s, OsuColour.Gray(0.33f)));
|
||||||
AddText(new OsuSpriteText { Text = t.content }, s => cp(s, OsuColour.Gray(0.5f)));
|
AddText(new OsuSpriteText { Text = tuple.content }, s => cp(s, OsuColour.Gray(0.5f)));
|
||||||
first = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,9 +11,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Framework.IO.Stores;
|
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Platform;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
@ -48,7 +46,7 @@ namespace osu.Game.Tournament.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(LadderInfo ladder, Storage storage)
|
private void load(LadderInfo ladder, TextureStore textures)
|
||||||
{
|
{
|
||||||
currentMatch.BindValueChanged(matchChanged);
|
currentMatch.BindValueChanged(matchChanged);
|
||||||
currentMatch.BindTo(ladder.CurrentMatch);
|
currentMatch.BindTo(ladder.CurrentMatch);
|
||||||
@ -135,7 +133,7 @@ namespace osu.Game.Tournament.Components
|
|||||||
if (!string.IsNullOrEmpty(mods))
|
if (!string.IsNullOrEmpty(mods))
|
||||||
AddInternal(new Sprite
|
AddInternal(new Sprite
|
||||||
{
|
{
|
||||||
Texture = new LargeTextureStore(new TextureLoaderStore(new StorageBackedResourceStore(storage))).Get($"mods/{mods}"),
|
Texture = textures.Get($"mods/{mods}"),
|
||||||
Anchor = Anchor.CentreRight,
|
Anchor = Anchor.CentreRight,
|
||||||
Origin = Anchor.CentreRight,
|
Origin = Anchor.CentreRight,
|
||||||
Margin = new MarginPadding(20),
|
Margin = new MarginPadding(20),
|
||||||
|
@ -138,7 +138,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
|
|||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: use OnClick instead once we have per-button clicks.
|
|
||||||
protected override bool OnClick(ClickEvent e)
|
protected override bool OnClick(ClickEvent e)
|
||||||
{
|
{
|
||||||
if (Team == null || editorInfo != null) return false;
|
if (Team == null || editorInfo != null) return false;
|
||||||
@ -196,8 +195,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
|
|||||||
return new MenuItem[]
|
return new MenuItem[]
|
||||||
{
|
{
|
||||||
new OsuMenuItem("Set as current", MenuItemType.Standard, setCurrent),
|
new OsuMenuItem("Set as current", MenuItemType.Standard, setCurrent),
|
||||||
new OsuMenuItem("Join with", MenuItemType.Standard, () => ladderEditor.RequestJoin(pairing, false)),
|
new OsuMenuItem("Join with", MenuItemType.Standard, () => ladderEditor.BeginJoin(pairing, false)),
|
||||||
new OsuMenuItem("Join with (loser)", MenuItemType.Standard, () => ladderEditor.RequestJoin(pairing, true)),
|
new OsuMenuItem("Join with (loser)", MenuItemType.Standard, () => ladderEditor.BeginJoin(pairing, true)),
|
||||||
new OsuMenuItem("Remove", MenuItemType.Destructive, () => ladderEditor.Remove(pairing)),
|
new OsuMenuItem("Remove", MenuItemType.Destructive, () => ladderEditor.Remove(pairing)),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -5,15 +5,26 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
|
|||||||
{
|
{
|
||||||
public class TournamentProgression
|
public class TournamentProgression
|
||||||
{
|
{
|
||||||
public int Item1;
|
public int SourceID;
|
||||||
public int Item2;
|
public int TargetID;
|
||||||
|
|
||||||
|
// migration
|
||||||
|
public int Item1
|
||||||
|
{
|
||||||
|
set => SourceID = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Item2
|
||||||
|
{
|
||||||
|
set => TargetID = value;
|
||||||
|
}
|
||||||
|
|
||||||
public bool Losers;
|
public bool Losers;
|
||||||
|
|
||||||
public TournamentProgression(int item1, int item2, bool losers = false)
|
public TournamentProgression(int sourceID, int targetID, bool losers = false)
|
||||||
{
|
{
|
||||||
Item1 = item1;
|
SourceID = sourceID;
|
||||||
Item2 = item2;
|
TargetID = targetID;
|
||||||
Losers = losers;
|
Losers = losers;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Tournament.Screens.Ladder
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
((Container)InternalChild).Add(new LadderEditorSettings
|
Content.Add(new LadderEditorSettings
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
@ -58,9 +58,9 @@ namespace osu.Game.Tournament.Screens.Ladder
|
|||||||
updateInfo();
|
updateInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RequestJoin(MatchPairing pairing, bool losers)
|
public void BeginJoin(MatchPairing pairing, bool losers)
|
||||||
{
|
{
|
||||||
ScrollContent.Add(new JoinRequestHandler(PairingsContainer, pairing, losers, updateInfo));
|
ScrollContent.Add(new JoinVisualiser(PairingsContainer, pairing, losers, updateInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
public MenuItem[] ContextMenuItems
|
public MenuItem[] ContextMenuItems
|
||||||
@ -91,7 +91,7 @@ namespace osu.Game.Tournament.Screens.Ladder
|
|||||||
PairingsContainer.FirstOrDefault(p => p.Pairing == pairing)?.Remove();
|
PairingsContainer.FirstOrDefault(p => p.Pairing == pairing)?.Remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
private class JoinRequestHandler : CompositeDrawable
|
private class JoinVisualiser : CompositeDrawable
|
||||||
{
|
{
|
||||||
private readonly Container<DrawableMatchPairing> pairingsContainer;
|
private readonly Container<DrawableMatchPairing> pairingsContainer;
|
||||||
public readonly MatchPairing Source;
|
public readonly MatchPairing Source;
|
||||||
@ -100,7 +100,7 @@ namespace osu.Game.Tournament.Screens.Ladder
|
|||||||
|
|
||||||
private ProgressionPath path;
|
private ProgressionPath path;
|
||||||
|
|
||||||
public JoinRequestHandler(Container<DrawableMatchPairing> pairingsContainer, MatchPairing source, bool losers, Action complete)
|
public JoinVisualiser(Container<DrawableMatchPairing> pairingsContainer, MatchPairing source, bool losers, Action complete)
|
||||||
{
|
{
|
||||||
this.pairingsContainer = pairingsContainer;
|
this.pairingsContainer = pairingsContainer;
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
@ -24,6 +24,8 @@ namespace osu.Game.Tournament.Screens.Ladder
|
|||||||
|
|
||||||
protected LadderDragContainer ScrollContent;
|
protected LadderDragContainer ScrollContent;
|
||||||
|
|
||||||
|
protected Container Content;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours, Storage storage)
|
private void load(OsuColour colours, Storage storage)
|
||||||
{
|
{
|
||||||
@ -32,7 +34,7 @@ namespace osu.Game.Tournament.Screens.Ladder
|
|||||||
|
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
InternalChild = new Container
|
InternalChild = Content = new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
|
@ -110,8 +110,8 @@ namespace osu.Game.Tournament
|
|||||||
// assign progressions
|
// assign progressions
|
||||||
foreach (var pair in ladder.Progressions)
|
foreach (var pair in ladder.Progressions)
|
||||||
{
|
{
|
||||||
var src = ladder.Pairings.FirstOrDefault(p => p.ID == pair.Item1);
|
var src = ladder.Pairings.FirstOrDefault(p => p.ID == pair.SourceID);
|
||||||
var dest = ladder.Pairings.FirstOrDefault(p => p.ID == pair.Item2);
|
var dest = ladder.Pairings.FirstOrDefault(p => p.ID == pair.TargetID);
|
||||||
|
|
||||||
if (src == null) throw new InvalidOperationException();
|
if (src == null) throw new InvalidOperationException();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user