1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 09:32:55 +08:00

Merge branch 'master' into slider-tooltip-precision

This commit is contained in:
Dean Herbert 2018-02-08 11:00:46 +09:00 committed by GitHub
commit 7e83aedb86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 68 additions and 52 deletions

@ -1 +1 @@
Subproject commit a584706f1303f54cd7f5472240e95b70920ce079
Subproject commit 1440ae8538560b3c40883ec51ab39108d6a69e3b

View File

@ -136,7 +136,7 @@
<Private>True</Private>
</Reference>
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll</HintPath>
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0.13\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SharpCompress, Version=0.18.1.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">

View File

@ -6,7 +6,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
<packages>
<package id="DeltaCompressionDotNet" version="1.1.0" targetFramework="net45" />
<package id="Mono.Cecil" version="0.9.6.4" targetFramework="net45" />
<package id="ppy.OpenTK" version="3.0.11" targetFramework="net461" />
<package id="ppy.OpenTK" version="3.0.13" targetFramework="net461" />
<package id="SharpCompress" version="0.18.1" targetFramework="net461" />
<package id="Splat" version="2.0.0" targetFramework="net45" />
<package id="SQLitePCLRaw.bundle_green" version="1.1.8" targetFramework="net461" />

View File

@ -41,7 +41,7 @@
<Private>True</Private>
</Reference>
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll</HintPath>
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0.13\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />

View File

@ -2,5 +2,5 @@
<packages>
<package id="JetBrains.Annotations" version="11.1.0" targetFramework="net461" />
<package id="NUnit" version="3.8.1" targetFramework="net461" />
<package id="ppy.OpenTK" version="3.0.11" targetFramework="net461" />
<package id="ppy.OpenTK" version="3.0.13" targetFramework="net461" />
</packages>

View File

@ -41,7 +41,7 @@
<Private>True</Private>
</Reference>
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll</HintPath>
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0.13\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">

View File

@ -2,5 +2,5 @@
<packages>
<package id="JetBrains.Annotations" version="11.1.0" targetFramework="net461" />
<package id="NUnit" version="3.8.1" targetFramework="net461" />
<package id="ppy.OpenTK" version="3.0.11" targetFramework="net461" />
<package id="ppy.OpenTK" version="3.0.13" targetFramework="net461" />
</packages>

View File

@ -42,7 +42,7 @@
<Private>True</Private>
</Reference>
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll</HintPath>
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0.13\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />

View File

@ -2,5 +2,5 @@
<packages>
<package id="JetBrains.Annotations" version="11.1.0" targetFramework="net461" />
<package id="NUnit" version="3.8.1" targetFramework="net461" />
<package id="ppy.OpenTK" version="3.0.11" targetFramework="net461" />
<package id="ppy.OpenTK" version="3.0.13" targetFramework="net461" />
</packages>

View File

@ -41,7 +41,7 @@
<Private>True</Private>
</Reference>
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll</HintPath>
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0.13\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />

View File

@ -2,5 +2,5 @@
<packages>
<package id="JetBrains.Annotations" version="11.1.0" targetFramework="net461" />
<package id="NUnit" version="3.8.1" targetFramework="net461" />
<package id="ppy.OpenTK" version="3.0.11" targetFramework="net461" />
<package id="ppy.OpenTK" version="3.0.13" targetFramework="net461" />
</packages>

View File

@ -63,8 +63,8 @@ namespace osu.Game.Tests.Visual
{
Value = new[]
{
new User { GlobalRank = 1355 },
new User { GlobalRank = 8756 },
new User { Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 1355 } } },
new User { Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 8756 } } },
},
},
}),
@ -99,10 +99,10 @@ namespace osu.Game.Tests.Visual
},
Participants =
{
Value = new[]
Value = new[]
{
new User { GlobalRank = 578975 },
new User { GlobalRank = 24554 },
new User { Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 578975 } } },
new User { Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 24554 } } },
},
},
}),
@ -116,8 +116,8 @@ namespace osu.Game.Tests.Visual
AddStep(@"change beatmap", () => first.Room.Beatmap.Value = null);
AddStep(@"change participants", () => first.Room.Participants.Value = new[]
{
new User { GlobalRank = 1254 },
new User { GlobalRank = 123189 },
new User { Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 1254 } } },
new User { Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 123189 } } },
});
}

View File

@ -65,7 +65,7 @@ namespace osu.Game.Tests.Visual
{
Statistics = new UserStatistics
{
Rank = 123456,
Ranks = new UserStatistics.UserRanks { Global = 123456 },
PP = 12345,
}
};
@ -77,7 +77,7 @@ namespace osu.Game.Tests.Visual
{
Statistics = new UserStatistics
{
Rank = 89000,
Ranks = new UserStatistics.UserRanks { Global = 89000 },
PP = 12345,
},
RankHistory = new User.RankHistoryData
@ -93,7 +93,7 @@ namespace osu.Game.Tests.Visual
{
Statistics = new UserStatistics
{
Rank = 89000,
Ranks = new UserStatistics.UserRanks { Global = 89000 },
PP = 12345,
},
RankHistory = new User.RankHistoryData
@ -109,7 +109,7 @@ namespace osu.Game.Tests.Visual
{
Statistics = new UserStatistics
{
Rank = 12000,
Ranks = new UserStatistics.UserRanks { Global = 12000 },
PP = 12345,
},
RankHistory = new User.RankHistoryData

View File

@ -54,12 +54,12 @@ namespace osu.Game.Tests.Visual
{
Value = new[]
{
new User { Username = @"flyte", Id = 3103765, GlobalRank = 1425 },
new User { Username = @"Cookiezi", Id = 124493, GlobalRank = 5466 },
new User { Username = @"Angelsim", Id = 1777162, GlobalRank = 2873 },
new User { Username = @"Rafis", Id = 2558286, GlobalRank = 4687 },
new User { Username = @"hvick225", Id = 50265, GlobalRank = 3258 },
new User { Username = @"peppy", Id = 2, GlobalRank = 6251 }
new User { Username = @"flyte", Id = 3103765, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 142 } } },
new User { Username = @"Cookiezi", Id = 124493, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 546 } } },
new User { Username = @"Angelsim", Id = 1777162, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 287 } } },
new User { Username = @"Rafis", Id = 2558286, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 468 } } },
new User { Username = @"hvick225", Id = 50265, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 325 } } },
new User { Username = @"peppy", Id = 2, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 625 } } },
}
}
};
@ -80,8 +80,8 @@ namespace osu.Game.Tests.Visual
AddStep(@"change max participants", () => room.MaxParticipants.Value = null);
AddStep(@"change participants", () => room.Participants.Value = new[]
{
new User { Username = @"filsdelama", Id = 2831793, GlobalRank = 8542 },
new User { Username = @"_index", Id = 652457, GlobalRank = 15024 }
new User { Username = @"filsdelama", Id = 2831793, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 854 } } },
new User { Username = @"_index", Id = 652457, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 150 } } }
});
AddStep(@"change room", () =>
@ -121,9 +121,9 @@ namespace osu.Game.Tests.Visual
{
Value = new[]
{
new User { Username = @"Angelsim", Id = 1777162, GlobalRank = 4 },
new User { Username = @"HappyStick", Id = 256802, GlobalRank = 752 },
new User { Username = @"-Konpaku-", Id = 2258797, GlobalRank = 571 }
new User { Username = @"Angelsim", Id = 1777162, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 4 } } },
new User { Username = @"HappyStick", Id = 256802, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 752 } } },
new User { Username = @"-Konpaku-", Id = 2258797, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 571 } } }
}
}
};

View File

@ -42,11 +42,10 @@ namespace osu.Game.Tests.Visual
LastVisit = DateTimeOffset.Now,
Age = 1,
ProfileOrder = new[] { "me" },
CountryRank = 1,
Statistics = new UserStatistics
{
Rank = 2148,
PP = 4567.89m
Ranks = new UserStatistics.UserRanks { Global = 2148, Country = 1 },
PP = 4567.89m,
},
RankHistory = new User.RankHistoryData
{

View File

@ -42,7 +42,7 @@
<Private>True</Private>
</Reference>
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll</HintPath>
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0.13\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SQLitePCLRaw.batteries_green, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a84b7dcfb1391f7f, processorArchitecture=MSIL">

View File

@ -7,7 +7,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
<package id="DeepEqual" version="1.6.0.0" targetFramework="net461" />
<package id="JetBrains.Annotations" version="11.1.0" targetFramework="net461" />
<package id="NUnit" version="3.8.1" targetFramework="net461" />
<package id="ppy.OpenTK" version="3.0.11" targetFramework="net461" />
<package id="ppy.OpenTK" version="3.0.13" targetFramework="net461" />
<package id="SQLitePCLRaw.bundle_green" version="1.1.8" targetFramework="net461" />
<package id="SQLitePCLRaw.core" version="1.1.8" targetFramework="net461" />
<package id="SQLitePCLRaw.lib.e_sqlite3.linux" version="1.1.8" targetFramework="net461" />

View File

@ -105,7 +105,7 @@ namespace osu.Game.Overlays.Profile
return;
}
int[] userRanks = user.RankHistory?.Data ?? new[] { user.Statistics.Rank };
int[] userRanks = user.RankHistory?.Data ?? new[] { user.Statistics.Ranks.Global };
ranks = userRanks.Select((x, index) => new KeyValuePair<int, int>(index, x)).Where(x => x.Value != 0).ToArray();
if (ranks.Length > 1)
@ -124,9 +124,11 @@ namespace osu.Game.Overlays.Profile
private void updateRankTexts()
{
rankText.Text = User.Value.Statistics.Rank > 0 ? $"#{User.Value.Statistics.Rank:#,0}" : "no rank";
performanceText.Text = User.Value.Statistics.PP != null ? $"{User.Value.Statistics.PP:#,0}pp" : string.Empty;
relativeText.Text = $"{User.Value.Country?.FullName} #{User.Value.CountryRank:#,0}";
var user = User.Value;
performanceText.Text = user.Statistics.PP != null ? $"{user.Statistics.PP:#,0}pp" : string.Empty;
rankText.Text = user.Statistics.Ranks.Global > 0 ? $"#{user.Statistics.Ranks.Global:#,0}" : "no rank";
relativeText.Text = user.Country != null && user.Statistics.Ranks.Country > 0 ? $"{user.Country.FullName} #{user.Statistics.Ranks.Country:#,0}" : "no rank";
}
private void showHistoryRankTexts(int dayIndex)

View File

@ -33,6 +33,11 @@ namespace osu.Game.Overlays.Settings.Sections.Input
LabelText = "Cursor Sensitivity",
Bindable = config.GetBindable<double>(FrameworkSetting.CursorSensitivity)
},
new SettingsCheckbox
{
LabelText = "Map absolute input to window",
Bindable = config.GetBindable<bool>(FrameworkSetting.MapAbsoluteInputToWindow)
},
new SettingsEnumDropdown<ConfineMouseMode>
{
LabelText = "Confine mouse cursor to window",
@ -88,6 +93,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
// this bindable will still act as the "interactive" bindable displayed during a drag.
base.Bindable = new BindableDouble(doubleValue.Value)
{
Default = doubleValue.Default,
MinValue = doubleValue.MinValue,
MaxValue = doubleValue.MaxValue
};

View File

@ -181,7 +181,7 @@ namespace osu.Game.Overlays.Settings
{
hovering = true;
UpdateState();
return true;
return false;
}
protected override void OnHoverLost(InputState state)

View File

@ -35,7 +35,7 @@ namespace osu.Game.Screens.Multiplayer
{
set
{
var ranks = value.Select(u => u.GlobalRank);
var ranks = value.Select(u => u.Statistics.Ranks.Global);
levelRangeLower.Text = ranks.Min().ToString();
levelRangeHigher.Text = ranks.Max().ToString();
}

View File

@ -26,10 +26,6 @@ namespace osu.Game.Users
[JsonProperty(@"age")]
public int? Age;
public int GlobalRank;
public int CountryRank;
//public Team Team;
[JsonProperty(@"profile_colour")]

View File

@ -22,8 +22,11 @@ namespace osu.Game.Users
[JsonProperty(@"pp")]
public decimal? PP;
[JsonProperty(@"pp_rank")]
public int Rank;
[JsonProperty(@"pp_rank")] // the API sometimes only returns this value in condensed user responses
private int rank { set => Ranks.Global = value; }
[JsonProperty(@"rank")]
public UserRanks Ranks;
[JsonProperty(@"ranked_score")]
public long RankedScore;
@ -66,5 +69,15 @@ namespace osu.Game.Users
[JsonProperty(@"a")]
public int A;
}
public struct UserRanks
{
[JsonProperty(@"global")]
public int Global;
[JsonProperty(@"country")]
public int Country;
}
}
}

View File

@ -148,7 +148,7 @@
<Private>True</Private>
</Reference>
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4">
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll</HintPath>
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0.13\lib\net45\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Remotion.Linq, Version=2.1.0.0, Culture=neutral, PublicKeyToken=fee00910d6e5f53b, processorArchitecture=MSIL">

View File

@ -67,7 +67,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
<package id="Microsoft.Extensions.Primitives" version="2.0.0" targetFramework="net461" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net461" />
<package id="NUnit" version="3.8.1" targetFramework="net461" />
<package id="ppy.OpenTK" version="3.0.11" targetFramework="net461" />
<package id="ppy.OpenTK" version="3.0.13" targetFramework="net461" />
<package id="Remotion.Linq" version="2.1.2" targetFramework="net461" />
<package id="SharpCompress" version="0.18.1" targetFramework="net461" />
<package id="SQLitePCLRaw.bundle_green" version="1.1.8" targetFramework="net461" />