1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-17 17:33:02 +08:00

Compare commits

...

28 Commits

19 changed files with 72 additions and 59 deletions
@@ -11,7 +11,7 @@ using osu.Framework.Configuration;
namespace osu.Game.Graphics.Containers
{
internal class ParallaxContainer : Container, IRequireHighFrequencyMousePosition
public class ParallaxContainer : Container, IRequireHighFrequencyMousePosition
{
public float ParallaxAmount = 0.02f;
+1
View File
@@ -118,6 +118,7 @@ namespace osu.Game.Online.API
//NotificationOverlay.ShowMessage("Login failed!");
log.Add(@"Login failed!");
Password = null;
authentication.Clear();
continue;
}
+3
View File
@@ -27,6 +27,9 @@ namespace osu.Game.Online.API
internal bool AuthenticateWithLogin(string username, string password)
{
if (string.IsNullOrEmpty(username)) return false;
if (string.IsNullOrEmpty(password)) return false;
using (var req = new AccessTokenRequestPassword(username, password)
{
Url = $@"{endpoint}/oauth/token",
+18 -9
View File
@@ -80,7 +80,7 @@ namespace osu.Game.Overlays.Settings
controlWithCurrent?.Current.BindTo(bindable);
if (ShowsDefaultIndicator)
{
restoreDefaultValueButton.Bindable.BindTo(bindable);
restoreDefaultValueButton.Bindable = bindable.GetBoundCopy();
restoreDefaultValueButton.Bindable.TriggerChange();
}
}
@@ -134,7 +134,17 @@ namespace osu.Game.Overlays.Settings
private class RestoreDefaultValueButton<T> : Box, IHasTooltip
{
internal readonly Bindable<T> Bindable = new Bindable<T>();
private Bindable<T> bindable;
internal Bindable<T> Bindable
{
get { return bindable; }
set
{
bindable = value;
bindable.ValueChanged += newValue => UpdateState();
bindable.DisabledChanged += disabled => UpdateState();
}
}
private Color4 buttonColour;
@@ -142,9 +152,6 @@ namespace osu.Game.Overlays.Settings
public RestoreDefaultValueButton()
{
Bindable.ValueChanged += value => UpdateState();
Bindable.DisabledChanged += disabled => UpdateState();
RelativeSizeAxes = Axes.Y;
Width = SettingsOverlay.CONTENT_MARGINS;
Alpha = 0f;
@@ -160,8 +167,8 @@ namespace osu.Game.Overlays.Settings
protected override bool OnClick(InputState state)
{
if (!Bindable.Disabled)
Bindable.SetDefault();
if (bindable != null && !bindable.Disabled)
bindable.SetDefault();
return true;
}
@@ -186,8 +193,10 @@ namespace osu.Game.Overlays.Settings
internal void UpdateState()
{
var colour = Bindable.Disabled ? Color4.Gray : buttonColour;
this.FadeTo(Bindable.IsDefault ? 0f : hovering && !Bindable.Disabled ? 1f : 0.5f, 200, Easing.OutQuint);
if (bindable == null)
return;
var colour = bindable.Disabled ? Color4.Gray : buttonColour;
this.FadeTo(bindable.IsDefault ? 0f : hovering && !bindable.Disabled ? 1f : 0.5f, 200, Easing.OutQuint);
this.FadeColour(ColourInfo.GradientHorizontal(colour.Opacity(0.8f), colour.Opacity(0)), 200, Easing.OutQuint);
}
}
+1 -1
View File
@@ -24,7 +24,7 @@ namespace osu.Game.Screens.Edit
{
protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg4");
internal override bool ShowOverlays => false;
public override bool ShowOverlays => false;
private readonly Box bottomBackground;
private readonly Container screenContainer;
+1 -1
View File
@@ -8,7 +8,7 @@ namespace osu.Game.Screens
{
internal class Loader : OsuScreen
{
internal override bool ShowOverlays => false;
public override bool ShowOverlays => false;
public Loader()
{
+3 -3
View File
@@ -12,15 +12,15 @@ using OpenTK.Graphics;
namespace osu.Game.Screens.Menu
{
internal class Disclaimer : OsuScreen
public class Disclaimer : OsuScreen
{
private Intro intro;
private readonly SpriteIcon icon;
private Color4 iconColour;
internal override bool ShowOverlays => false;
public override bool ShowOverlays => false;
internal override bool HasLocalCursorDisplayed => true;
public override bool HasLocalCursorDisplayed => true;
public Disclaimer()
{
+5 -3
View File
@@ -33,9 +33,9 @@ namespace osu.Game.Screens.Menu
private SampleChannel welcome;
private SampleChannel seeya;
internal override bool HasLocalCursorDisplayed => true;
public override bool HasLocalCursorDisplayed => true;
internal override bool ShowOverlays => false;
public override bool ShowOverlays => false;
protected override BackgroundScreen CreateBackground() => new BackgroundScreenEmpty();
@@ -99,7 +99,9 @@ namespace osu.Game.Screens.Menu
welcome = audio.Sample.Get(@"welcome");
seeya = audio.Sample.Get(@"seeya");
beatmaps.Delete(setInfo);
if (setInfo.Protected)
beatmaps.Delete(setInfo);
}
protected override void OnEntering(Screen last)
+1 -1
View File
@@ -23,7 +23,7 @@ namespace osu.Game.Screens.Menu
{
private readonly ButtonSystem buttons;
internal override bool ShowOverlays => buttons.State != MenuState.Initial;
public override bool ShowOverlays => buttons.State != MenuState.Initial;
private readonly BackgroundScreenDefault background;
private Screen songSelect;
+4 -4
View File
@@ -16,7 +16,7 @@ namespace osu.Game.Screens
{
public abstract class OsuScreen : Screen
{
internal BackgroundScreen Background { get; private set; }
public BackgroundScreen Background { get; private set; }
/// <summary>
/// Override to create a BackgroundMode for the current screen.
@@ -24,17 +24,17 @@ namespace osu.Game.Screens
/// </summary>
protected virtual BackgroundScreen CreateBackground() => null;
internal virtual bool ShowOverlays => true;
public virtual bool ShowOverlays => true;
protected new OsuGameBase Game => base.Game as OsuGameBase;
internal virtual bool HasLocalCursorDisplayed => false;
public virtual bool HasLocalCursorDisplayed => false;
/// <summary>
/// Whether the beatmap or ruleset should be allowed to be changed by the user or game.
/// Used to mark exclusive areas where this is strongly prohibited, like gameplay.
/// </summary>
internal virtual bool AllowBeatmapRulesetChange => true;
public virtual bool AllowBeatmapRulesetChange => true;
protected readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
+3 -3
View File
@@ -34,13 +34,13 @@ namespace osu.Game.Screens.Play
{
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap);
internal override bool ShowOverlays => false;
public override bool ShowOverlays => false;
internal override bool HasLocalCursorDisplayed => !pauseContainer.IsPaused && !HasFailed && RulesetContainer.ProvidingUserCursor;
public override bool HasLocalCursorDisplayed => !pauseContainer.IsPaused && !HasFailed && RulesetContainer.ProvidingUserCursor;
public Action RestartRequested;
internal override bool AllowBeatmapRulesetChange => false;
public override bool AllowBeatmapRulesetChange => false;
public bool HasFailed { get; private set; }
+2 -2
View File
@@ -24,9 +24,9 @@ namespace osu.Game.Screens.Play
private BeatmapMetadataDisplay info;
private bool showOverlays = true;
internal override bool ShowOverlays => showOverlays;
public override bool ShowOverlays => showOverlays;
internal override bool AllowBeatmapRulesetChange => false;
public override bool AllowBeatmapRulesetChange => false;
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap);
+1 -1
View File
@@ -31,7 +31,7 @@ namespace osu.Game.Screens.Ranking
private ResultModeTabControl modeChangeButtons;
internal override bool AllowBeatmapRulesetChange => false;
public override bool AllowBeatmapRulesetChange => false;
private Container currentPage;
+16 -6
View File
@@ -186,13 +186,18 @@ namespace osu.Game.Screens.Select
public Action<BeatmapInfo> HideDifficultyRequested;
private void selectNullBeatmap()
{
selectedGroup = null;
selectedPanel = null;
SelectionChanged?.Invoke(null);
}
public void SelectNext(int direction = 1, bool skipDifficulties = true)
{
if (groups.All(g => g.State == BeatmapGroupState.Hidden))
{
selectedGroup = null;
selectedPanel = null;
SelectionChanged?.Invoke(null);
selectNullBeatmap();
return;
}
@@ -383,6 +388,14 @@ namespace osu.Game.Screens.Select
if (group == null)
return;
if (selectedGroup == group)
{
if (getVisibleGroups().Count() == 1)
selectNullBeatmap();
else
SelectNext();
}
groups.Remove(group);
panels.Remove(group.Header);
foreach (var p in group.BeatmapPanels)
@@ -391,9 +404,6 @@ namespace osu.Game.Screens.Select
scrollableContent.Remove(group.Header);
scrollableContent.RemoveRange(group.BeatmapPanels);
if (selectedGroup == group)
SelectNext();
computeYPositions();
}
+1 -1
View File
@@ -29,7 +29,7 @@ namespace osu.Game.Screens.Tournament
{
private const string results_filename = "drawings_results.txt";
internal override bool ShowOverlays => false;
public override bool ShowOverlays => false;
protected override BackgroundScreen CreateBackground() => new BackgroundScreenDefault();
-15
View File
@@ -83,21 +83,6 @@
</Win32Resource>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'VisualTests|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<WarningLevel>0</WarningLevel>
<NoStdLib>true</NoStdLib>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<LangVersion>6</LangVersion>
<ErrorReport>prompt</ErrorReport>
<StartArguments>--tests</StartArguments>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="DotNetZip, Version=1.10.1.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll</HintPath>
+9 -6
View File
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2006
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game", "osu.Game\osu.Game.csproj", "{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}"
EndProject
@@ -34,8 +34,8 @@ Global
{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Release|Any CPU.Build.0 = Release|Any CPU
{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.VisualTests|Any CPU.ActiveCfg = VisualTests|Any CPU
{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.VisualTests|Any CPU.Build.0 = VisualTests|Any CPU
{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU
{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.VisualTests|Any CPU.Build.0 = Debug|Any CPU
{C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -85,12 +85,15 @@ Global
{419659FD-72EA-4678-9EB8-B22A746CED70}.Debug|Any CPU.Build.0 = Debug|Any CPU
{419659FD-72EA-4678-9EB8-B22A746CED70}.Release|Any CPU.ActiveCfg = Release|Any CPU
{419659FD-72EA-4678-9EB8-B22A746CED70}.Release|Any CPU.Build.0 = Release|Any CPU
{419659FD-72EA-4678-9EB8-B22A746CED70}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU
{419659FD-72EA-4678-9EB8-B22A746CED70}.VisualTests|Any CPU.Build.0 = Debug|Any CPU
{419659FD-72EA-4678-9EB8-B22A746CED70}.VisualTests|Any CPU.ActiveCfg = VisualTests|Any CPU
{419659FD-72EA-4678-9EB8-B22A746CED70}.VisualTests|Any CPU.Build.0 = VisualTests|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {671B0BEC-2403-45B0-9357-2C97CC517668}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
$0.TextStylePolicy = $1