mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 09:32:55 +08:00
Merge branch 'master' into ismaskedaway-fix
This commit is contained in:
commit
3fe3123cdc
@ -45,6 +45,18 @@
|
||||
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0.11\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">
|
||||
<HintPath>$(SolutionDir)\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\net45\SQLitePCLRaw.batteries_green.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SQLitePCLRaw.batteries_v2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8226ea5df37bcae9, processorArchitecture=MSIL">
|
||||
<HintPath>$(SolutionDir)\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\net45\SQLitePCLRaw.batteries_v2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SQLitePCLRaw.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
|
||||
<HintPath>$(SolutionDir)\packages\SQLitePCLRaw.core.1.1.8\lib\net45\SQLitePCLRaw.core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SQLitePCLRaw.provider.e_sqlite3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9c301db686d0bd12, processorArchitecture=MSIL">
|
||||
<HintPath>$(SolutionDir)\packages\SQLitePCLRaw.provider.e_sqlite3.net45.1.1.8\lib\net45\SQLitePCLRaw.provider.e_sqlite3.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
|
||||
<HintPath>$(SolutionDir)\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
@ -171,4 +183,15 @@
|
||||
<EmbeddedResource Include="Resources\Kozato snow - Rengetsu Ouka %28_Kiva%29 [Yuki YukI].osu" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets" Condition="Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets'))" />
|
||||
<Error Condition="!Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets'))" />
|
||||
<Error Condition="!Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets'))" />
|
||||
</Target>
|
||||
<Import Project="$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets" Condition="Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets')" />
|
||||
<Import Project="$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets" Condition="Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets')" />
|
||||
</Project>
|
@ -8,5 +8,11 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
|
||||
<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="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" />
|
||||
<package id="SQLitePCLRaw.lib.e_sqlite3.osx" version="1.1.8" targetFramework="net461" />
|
||||
<package id="SQLitePCLRaw.lib.e_sqlite3.v110_xp" version="1.1.8" targetFramework="net461" />
|
||||
<package id="SQLitePCLRaw.provider.e_sqlite3.net45" version="1.1.8" targetFramework="net461" />
|
||||
<package id="System.ValueTuple" version="4.4.0" targetFramework="net461" />
|
||||
</packages>
|
@ -433,7 +433,13 @@ namespace osu.Game.Overlays.Profile
|
||||
if (string.IsNullOrEmpty(str)) return;
|
||||
|
||||
infoTextRight.AddIcon(icon);
|
||||
infoTextRight.AddLink(" " + str, url);
|
||||
if (url != null)
|
||||
{
|
||||
infoTextRight.AddLink(" " + str, url);
|
||||
} else
|
||||
{
|
||||
infoTextRight.AddText(" " + str);
|
||||
}
|
||||
infoTextRight.NewLine();
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,6 @@ using OpenTK.Graphics;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
@ -16,6 +15,7 @@ using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Overlays.Settings
|
||||
{
|
||||
@ -33,22 +33,10 @@ namespace osu.Game.Overlays.Settings
|
||||
|
||||
private SpriteText text;
|
||||
|
||||
private readonly RestoreDefaultValueButton restoreDefaultValueButton = new RestoreDefaultValueButton();
|
||||
private readonly RestoreDefaultValueButton restoreDefaultButton;
|
||||
|
||||
public bool ShowsDefaultIndicator = true;
|
||||
|
||||
private Color4? restoreDefaultValueColour;
|
||||
|
||||
public Color4 RestoreDefaultValueColour
|
||||
{
|
||||
get { return restoreDefaultValueColour ?? Color4.White; }
|
||||
set
|
||||
{
|
||||
restoreDefaultValueColour = value;
|
||||
restoreDefaultValueButton?.SetButtonColour(RestoreDefaultValueColour);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual string LabelText
|
||||
{
|
||||
get { return text?.Text ?? string.Empty; }
|
||||
@ -69,10 +57,7 @@ namespace osu.Game.Overlays.Settings
|
||||
|
||||
public virtual Bindable<T> Bindable
|
||||
{
|
||||
get
|
||||
{
|
||||
return bindable;
|
||||
}
|
||||
get { return bindable; }
|
||||
|
||||
set
|
||||
{
|
||||
@ -80,8 +65,8 @@ namespace osu.Game.Overlays.Settings
|
||||
controlWithCurrent?.Current.BindTo(bindable);
|
||||
if (ShowsDefaultIndicator)
|
||||
{
|
||||
restoreDefaultValueButton.Bindable = bindable.GetBoundCopy();
|
||||
restoreDefaultValueButton.Bindable.TriggerChange();
|
||||
restoreDefaultButton.Bindable = bindable.GetBoundCopy();
|
||||
restoreDefaultButton.Bindable.TriggerChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -103,38 +88,30 @@ namespace osu.Game.Overlays.Settings
|
||||
AutoSizeAxes = Axes.Y;
|
||||
Padding = new MarginPadding { Right = SettingsOverlay.CONTENT_MARGINS };
|
||||
|
||||
FlowContent = new FillFlowContainer
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Padding = new MarginPadding { Left = SettingsOverlay.CONTENT_MARGINS, Right = 5 },
|
||||
restoreDefaultButton = new RestoreDefaultValueButton(),
|
||||
FlowContent = new FillFlowContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Padding = new MarginPadding { Left = SettingsOverlay.CONTENT_MARGINS },
|
||||
Child = Control = CreateControl()
|
||||
},
|
||||
};
|
||||
|
||||
if ((Control = CreateControl()) != null)
|
||||
{
|
||||
if (controlWithCurrent != null)
|
||||
controlWithCurrent.Current.DisabledChanged += disabled => { Colour = disabled ? Color4.Gray : Color4.White; };
|
||||
FlowContent.Add(Control);
|
||||
}
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
private void load()
|
||||
{
|
||||
AddInternal(FlowContent);
|
||||
|
||||
if (restoreDefaultValueButton != null)
|
||||
{
|
||||
if (!restoreDefaultValueColour.HasValue)
|
||||
restoreDefaultValueColour = colours.Yellow;
|
||||
restoreDefaultValueButton.SetButtonColour(RestoreDefaultValueColour);
|
||||
AddInternal(restoreDefaultValueButton);
|
||||
}
|
||||
if (controlWithCurrent != null)
|
||||
controlWithCurrent.Current.DisabledChanged += disabled => { Colour = disabled ? Color4.Gray : Color4.White; };
|
||||
}
|
||||
|
||||
private class RestoreDefaultValueButton : Box, IHasTooltip
|
||||
private class RestoreDefaultValueButton : Container, IHasTooltip
|
||||
{
|
||||
private Bindable<T> bindable;
|
||||
|
||||
public Bindable<T> Bindable
|
||||
{
|
||||
get { return bindable; }
|
||||
@ -157,6 +134,36 @@ namespace osu.Game.Overlays.Settings
|
||||
Alpha = 0f;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colour)
|
||||
{
|
||||
buttonColour = colour.Yellow;
|
||||
|
||||
Child = new Container
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
CornerRadius = 3,
|
||||
Masking = true,
|
||||
Colour = buttonColour,
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Colour = buttonColour.Opacity(0.1f),
|
||||
Type = EdgeEffectType.Glow,
|
||||
Radius = 2,
|
||||
},
|
||||
Size = new Vector2(0.33f, 0.8f),
|
||||
Child = new Box { RelativeSizeAxes = Axes.Both },
|
||||
};
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
UpdateState();
|
||||
}
|
||||
|
||||
public string TooltipText => "Revert to default";
|
||||
|
||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
||||
@ -193,9 +200,10 @@ namespace osu.Game.Overlays.Settings
|
||||
{
|
||||
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);
|
||||
|
||||
this.FadeTo(bindable.IsDefault ? 0f :
|
||||
hovering && !bindable.Disabled ? 1f : 0.65f, 200, Easing.OutQuint);
|
||||
this.FadeColour(bindable.Disabled ? Color4.Gray : buttonColour, 200, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
public abstract class SettingsOverlay : OsuFocusedOverlayContainer
|
||||
{
|
||||
public const float CONTENT_MARGINS = 10;
|
||||
public const float CONTENT_MARGINS = 15;
|
||||
|
||||
public const float TRANSITION_LENGTH = 600;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user