1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 16:07:25 +08:00

Merge pull request #971 from Tom94/children-list

Update framework with better children list
This commit is contained in:
Dean Herbert 2017-06-25 15:02:17 +09:00 committed by GitHub
commit 7291f1d5c4
14 changed files with 15 additions and 16 deletions

@ -1 +1 @@
Subproject commit 2f7ebfcf637cc1928d8d37f6336e5da77f4926a0
Subproject commit a5e66079b9df3cf74a8bd1431c1cb7faad3c4d9f

View File

@ -125,7 +125,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
if (!userTriggered && Time.Current >= slider.EndTime)
{
var ticksCount = ticks.Children.Count() + 1;
var ticksCount = ticks.Children.Count + 1;
var ticksHit = ticks.Children.Count(t => t.Judgement.Result == HitResult.Hit);
if (initialCircle.Judgement.Result == HitResult.Hit)
ticksHit++;

View File

@ -29,7 +29,7 @@ namespace osu.Game.Graphics.UserInterface
base.Direction = (direction & BarDirection.Horizontal) > 0 ? FillDirection.Vertical : FillDirection.Horizontal;
foreach (var bar in Children)
{
bar.Size = (direction & BarDirection.Horizontal) > 0 ? new Vector2(1, 1.0f / Children.Count()) : new Vector2(1.0f / Children.Count(), 1);
bar.Size = (direction & BarDirection.Horizontal) > 0 ? new Vector2(1, 1.0f / Children.Count) : new Vector2(1.0f / Children.Count, 1);
bar.Direction = direction;
}
}

View File

@ -35,7 +35,7 @@ namespace osu.Game.Overlays.Chat
public IEnumerable<Channel> Channels
{
set { ChannelFlow.Children = value.Select(c => new ChannelListItem(c)); }
set { ChannelFlow.ChildrenEnumerable = value.Select(c => new ChannelListItem(c)); }
}
public ChannelSection()

View File

@ -38,7 +38,7 @@ namespace osu.Game.Overlays.Chat
{
set
{
sectionsFlow.Children = value;
sectionsFlow.ChildrenEnumerable = value;
foreach (ChannelSection s in sectionsFlow.Children)
{

View File

@ -56,7 +56,7 @@ namespace osu.Game.Overlays.Dialog
get { return buttonsContainer.Children; }
set
{
buttonsContainer.Children = value;
buttonsContainer.ChildrenEnumerable = value;
foreach (PopupDialogButton b in value)
{
var action = b.Action;

View File

@ -24,7 +24,7 @@ namespace osu.Game.Overlays.Direct
SetInfo = setInfo;
}
protected IEnumerable<DifficultyIcon> GetDifficultyIcons()
protected List<DifficultyIcon> GetDifficultyIcons()
{
var icons = new List<DifficultyIcon>();

View File

@ -129,7 +129,7 @@ namespace osu.Game.Overlays
private void recreatePanels(PanelDisplayStyle displayStyle)
{
if (BeatmapSets == null) return;
panels.Children = BeatmapSets.Select(b => displayStyle == PanelDisplayStyle.Grid ? (DirectPanel)new DirectGridPanel(b) { Width = 400 } : new DirectListPanel(b));
panels.ChildrenEnumerable = BeatmapSets.Select(b => displayStyle == PanelDisplayStyle.Grid ? (DirectPanel)new DirectGridPanel(b) { Width = 400 } : new DirectListPanel(b));
}
public class ResultCounts

View File

@ -3,7 +3,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Extensions;
@ -182,7 +181,7 @@ namespace osu.Game.Overlays
textLine2.Origin = optionCount > 0 ? Anchor.BottomCentre : Anchor.Centre;
textLine2.Y = optionCount > 0 ? 0 : 5;
if (optionLights.Children.Count() != optionCount)
if (optionLights.Children.Count != optionCount)
{
optionLights.Clear();
for (int i = 0; i < optionCount; i++)
@ -190,7 +189,7 @@ namespace osu.Game.Overlays
}
for (int i = 0; i < optionCount; i++)
optionLights.Children.Skip(i).First().Glowing = i == selectedOption;
optionLights.Children[i].Glowing = i == selectedOption;
});
}

View File

@ -44,7 +44,7 @@ namespace osu.Game.Overlays
panelFlow.Clear();
else
{
panelFlow.Children = users.Select(u =>
panelFlow.ChildrenEnumerable = users.Select(u =>
{
var p = new UserPanel(u) { Width = 300 };
p.Status.BindTo(u.Status);

View File

@ -495,7 +495,7 @@ namespace osu.Game.Screens.Multiplayer
levelRangeLower.Text = ranks.Min().ToString();
levelRangeHigher.Text = ranks.Max().ToString();
participantsFlow.Children = value.Select(u => new UserTile(u));
participantsFlow.ChildrenEnumerable = value.Select(u => new UserTile(u));
}
private class UserTile : Container, IHasTooltip

View File

@ -164,7 +164,7 @@ namespace osu.Game.Screens.Ranking
}
};
statisticsContainer.Children = Score.Statistics.Select(s => new DrawableScoreStatistic(s));
statisticsContainer.ChildrenEnumerable = Score.Statistics.Select(s => new DrawableScoreStatistic(s));
}
protected override void LoadComplete()

View File

@ -439,7 +439,7 @@ namespace osu.Game.Screens.Select
{
Show();
if (header.Text == "Tags")
content.Children = value.Split(' ').Select(text => new OsuSpriteText
content.ChildrenEnumerable = value.Split(' ').Select(text => new OsuSpriteText
{
Text = text,
Font = "Exo2.0-Regular",

View File

@ -84,7 +84,7 @@ namespace osu.Game.Screens.Tournament.Components
{
base.UpdateAfterChildren();
while (Children.Count() < 3)
while (Children.Count < 3)
addLine();
float pos = leftPos;