1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 08:02:55 +08:00

Made requested changes

This commit is contained in:
DrabWeb 2017-03-17 18:16:59 -03:00
parent a22b34817c
commit 0834b5b794
13 changed files with 82 additions and 70 deletions

View File

@ -25,57 +25,57 @@ namespace osu.Desktop.VisualTests.Tests
private class TestTeamList : ITeamList
{
public IEnumerable<Region> Teams { get; } = new[]
public IEnumerable<Country> Teams { get; } = new[]
{
new Region
new Country
{
FlagName = "GB",
FullName = "United Kingdom",
Acronym = "UK"
},
new Region
new Country
{
FlagName = "FR",
FullName = "France",
Acronym = "FRA"
},
new Region
new Country
{
FlagName = "CN",
FullName = "China",
Acronym = "CHN"
},
new Region
new Country
{
FlagName = "AU",
FullName = "Australia",
Acronym = "AUS"
},
new Region
new Country
{
FlagName = "JP",
FullName = "Japan",
Acronym = "JPN"
},
new Region
new Country
{
FlagName = "RO",
FullName = "Romania",
Acronym = "ROM"
},
new Region
new Country
{
FlagName = "IT",
FullName = "Italy",
Acronym = "PIZZA"
},
new Region
new Country
{
FlagName = "VE",
FullName = "Venezuela",
Acronym = "VNZ"
},
new Region
new Country
{
FlagName = "US",
FullName = "United States of America",

View File

@ -33,7 +33,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 6602580,
Username = @"waaiiru",
Region = new Region
Region = new Country
{
FullName = @"Spain",
FlagName = @"ES",
@ -51,7 +51,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 4608074,
Username = @"Skycries",
Region = new Region
Region = new Country
{
FullName = @"Brazil",
FlagName = @"BR",
@ -69,7 +69,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 1014222,
Username = @"eLy",
Region = new Region
Region = new Country
{
FullName = @"Japan",
FlagName = @"JP",
@ -87,7 +87,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 1541390,
Username = @"Toukai",
Region = new Region
Region = new Country
{
FullName = @"Canada",
FlagName = @"CA",
@ -105,7 +105,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 2243452,
Username = @"Satoruu",
Region = new Region
Region = new Country
{
FullName = @"Venezuela",
FlagName = @"VE",
@ -123,7 +123,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 2705430,
Username = @"Mooha",
Region = new Region
Region = new Country
{
FullName = @"France",
FlagName = @"FR",
@ -141,7 +141,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 7151382,
Username = @"Mayuri Hana",
Region = new Region
Region = new Country
{
FullName = @"Thailand",
FlagName = @"TH",
@ -159,7 +159,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 2051389,
Username = @"FunOrange",
Region = new Region
Region = new Country
{
FullName = @"Canada",
FlagName = @"CA",
@ -177,7 +177,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 6169483,
Username = @"-Hebel-",
Region = new Region
Region = new Country
{
FullName = @"Mexico",
FlagName = @"MX",
@ -195,7 +195,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 6702666,
Username = @"prhtnsm",
Region = new Region
Region = new Country
{
FullName = @"Germany",
FlagName = @"DE",

View File

@ -24,7 +24,7 @@ namespace osu.Game.Screens.Select.Leaderboards
private const float corner_radius = 5;
private const float edge_margin = 10;
private const float background_alpha = 0.25f;
private const float score_rank_size = 40f;
private const float index_width = 40;
private readonly EdgeEffect imageShadow = new EdgeEffect
{
@ -129,7 +129,7 @@ namespace osu.Game.Screens.Select.Leaderboards
new Container
{
RelativeSizeAxes = Axes.Y,
Width = 40,
Width = index_width,
Children = new[]
{
new OsuSpriteText
@ -145,7 +145,7 @@ namespace osu.Game.Screens.Select.Leaderboards
content = new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Left = 40, },
Padding = new MarginPadding { Left = index_width, },
Children = new Drawable[]
{
new Container
@ -213,7 +213,7 @@ namespace osu.Game.Screens.Select.Leaderboards
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(10f, 0f),
Margin = new MarginPadding { Left = 10, },
Margin = new MarginPadding { Left = edge_margin, },
Children = new Drawable[]
{
maxCombo = new ScoreComponentLabel(FontAwesome.fa_link, Score.MaxCombo.ToString()),
@ -224,26 +224,39 @@ namespace osu.Game.Screens.Select.Leaderboards
},
},
},
scoreRank = new DrawableRank(Score.Rank)
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Size = new Vector2(score_rank_size),
Position = new Vector2(0f, -10f),
},
scoreLabel = new GlowingSpriteText(Score.TotalScore.ToString(@"N0"), @"Venera", 23, Color4.White, OsuColour.FromHex(@"83ccfa"))
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Position = new Vector2(-score_rank_size - 5f, 0f),
Direction = FillDirection.Horizontal,
Spacing = new Vector2(5f, 0f),
Children = new Drawable[]
{
scoreLabel = new GlowingSpriteText(Score.TotalScore.ToString(@"N0"), @"Venera", 23, Color4.White, OsuColour.FromHex(@"83ccfa"))
{
},
new Container
{
Size = new Vector2(40f, 20f),
Children = new[]
{
scoreRank = new DrawableRank(Score.Rank)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(40f),
},
},
},
},
},
modsContainer = new FillFlowContainer<ScoreModIcon>
{
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
AutoSizeAxes = Axes.Both,
// TODO: Probably remove? Seems like others don't like this kind of thing
Position = new Vector2(0f, 4f), //properly align the mod icons
Direction = FillDirection.Horizontal,
},
},
@ -325,6 +338,7 @@ namespace osu.Game.Screens.Select.Leaderboards
Colour = colour,
Shadow = true,
TextSize = 30,
UseFullGlyphHeight = false,
},
new TextAwesome
{
@ -333,6 +347,8 @@ namespace osu.Game.Screens.Select.Leaderboards
Icon = icon,
Colour = OsuColour.Gray(84),
TextSize = 18,
Position = new Vector2(0f, 2f),
UseFullGlyphHeight = false,
},
};
}

View File

@ -37,7 +37,7 @@ namespace osu.Game.Screens.Tournament
private GroupContainer groupsContainer;
private OsuSpriteText fullTeamNameText;
private List<Region> allTeams = new List<Region>();
private List<Country> allTeams = new List<Country>();
private DrawingsConfigManager drawingsConfig;
@ -239,7 +239,7 @@ namespace osu.Game.Screens.Tournament
reset(true);
}
private void onTeamSelected(Region team)
private void onTeamSelected(Country team)
{
groupsContainer.AddTeam(team);
@ -276,13 +276,13 @@ namespace osu.Game.Screens.Tournament
teamsContainer.ClearTeams();
allTeams.Clear();
foreach (Region r in TeamList.Teams)
foreach (Country t in TeamList.Teams)
{
if (groupsContainer.ContainsTeam(r.FullName))
if (groupsContainer.ContainsTeam(t.FullName))
continue;
allTeams.Add(r);
teamsContainer.AddTeam(r);
allTeams.Add(t);
teamsContainer.AddTeam(t);
}
}
@ -312,7 +312,7 @@ namespace osu.Game.Screens.Tournament
if (line.ToUpper().StartsWith("GROUP"))
continue;
Region teamToAdd = allTeams.FirstOrDefault(r => r.FullName == line);
Country teamToAdd = allTeams.FirstOrDefault(t => t.FullName == line);
if (teamToAdd == null)
continue;

View File

@ -73,7 +73,7 @@ namespace osu.Game.Screens.Tournament
};
}
public void AddTeam(Region team)
public void AddTeam(Country team)
{
GroupTeam gt = new GroupTeam(team);
@ -91,7 +91,7 @@ namespace osu.Game.Screens.Tournament
return allTeams.Any(t => t.Team.FullName == fullName);
}
public bool RemoveTeam(Region team)
public bool RemoveTeam(Country team)
{
allTeams.RemoveAll(gt => gt.Team == team);
@ -122,12 +122,12 @@ namespace osu.Game.Screens.Tournament
private class GroupTeam : Container
{
public Region Team;
public Country Team;
private FillFlowContainer innerContainer;
private Sprite flagSprite;
public GroupTeam(Region team)
public GroupTeam(Country team)
{
Team = team;

View File

@ -64,7 +64,7 @@ namespace osu.Game.Screens.Tournament
}
}
public void AddTeam(Region team)
public void AddTeam(Country team)
{
if (groups[currentGroup].TeamsCount == maxTeams)
return;

View File

@ -22,9 +22,9 @@ namespace osu.Game.Screens.Tournament
public class ScrollingTeamContainer : Container
{
public event Action OnScrollStarted;
public event Action<Region> OnSelected;
public event Action<Country> OnSelected;
private readonly List<Region> availableTeams = new List<Region>();
private readonly List<Country> availableTeams = new List<Country>();
private Container tracker;
@ -158,7 +158,7 @@ namespace osu.Game.Screens.Tournament
}
}
public void AddTeam(Region team)
public void AddTeam(Country team)
{
if (availableTeams.Contains(team))
return;
@ -169,12 +169,12 @@ namespace osu.Game.Screens.Tournament
scrollState = ScrollState.Idle;
}
public void AddTeams(IEnumerable<Region> teams)
public void AddTeams(IEnumerable<Country> teams)
{
if (teams == null)
return;
foreach (Region t in teams)
foreach (Country t in teams)
AddTeam(t);
}
@ -185,7 +185,7 @@ namespace osu.Game.Screens.Tournament
scrollState = ScrollState.Idle;
}
public void RemoveTeam(Region team)
public void RemoveTeam(Country team)
{
availableTeams.Remove(team);
@ -270,9 +270,9 @@ namespace osu.Game.Screens.Tournament
private void addFlags()
{
foreach (Region r in availableTeams)
foreach (Country t in availableTeams)
{
Add(new ScrollingTeam(r)
Add(new ScrollingTeam(t)
{
X = leftPos + DrawWidth
});
@ -326,7 +326,7 @@ namespace osu.Game.Screens.Tournament
public const float WIDTH = 58;
public const float HEIGHT = 41;
public Region Team;
public Country Team;
private Sprite flagSprite;
private Box outline;
@ -346,7 +346,7 @@ namespace osu.Game.Screens.Tournament
}
}
public ScrollingTeam(Region team)
public ScrollingTeam(Country team)
{
Team = team;

View File

@ -8,6 +8,6 @@ namespace osu.Game.Screens.Tournament.Teams
{
public interface ITeamList
{
IEnumerable<Region> Teams { get; }
IEnumerable<Country> Teams { get; }
}
}

View File

@ -21,11 +21,11 @@ namespace osu.Game.Screens.Tournament.Teams
this.storage = storage;
}
public IEnumerable<Region> Teams
public IEnumerable<Country> Teams
{
get
{
var teams = new List<Region>();
var teams = new List<Country>();
try
{
@ -53,7 +53,7 @@ namespace osu.Game.Screens.Tournament.Teams
string acronym = split.Length >= 3 ? split[2].Trim() : teamName;
acronym = acronym.Substring(0, Math.Min(3, acronym.Length));
teams.Add(new Region
teams.Add(new Country
{
FlagName = flagName,
FullName = teamName,

View File

@ -10,10 +10,10 @@ using osu.Game.Graphics.UserInterface;
namespace osu.Game.Users
{
public class Region : IHasDrawableRepresentation<DrawableFlag>
public class Country : IHasDrawableRepresentation<DrawableFlag>
{
/// <summary>
/// The name of this team.
/// The name of this country.
/// </summary>
public string FullName;

View File

@ -10,14 +10,10 @@ namespace osu.Game.Users
public class Team : IHasDrawableRepresentation<Sprite>
{
public string Name;
public Texture Flag; // TODO: Replace this with something better
public Sprite CreateDrawable()
{
return new Sprite
{
Texture = Flag,
};
return new Sprite { };
}
}
}

View File

@ -7,7 +7,7 @@ namespace osu.Game.Users
{
public int Id;
public string Username;
public Region Region;
public Country Region;
public Team Team;
}
}

View File

@ -350,7 +350,7 @@
<Compile Include="Screens\Select\Leaderboards\Leaderboard.cs" />
<Compile Include="Screens\Select\Leaderboards\LeaderboardScore.cs" />
<Compile Include="Graphics\UserInterface\IHasDrawableRepresentation.cs" />
<Compile Include="Users\Region.cs" />
<Compile Include="Users\Country.cs" />
<Compile Include="Users\Team.cs" />
<Compile Include="Modes\ScoreRank.cs" />
<Compile Include="Users\Avatar.cs" />