Skip to content

Commit

Permalink
Merge pull request #1214 from smoogipoo/netstandard
Browse files Browse the repository at this point in the history
Merge master into netstandard
  • Loading branch information
peppy committed Dec 1, 2017
2 parents 08009b3 + 13ba85a commit 19e8161
Show file tree
Hide file tree
Showing 73 changed files with 864 additions and 416 deletions.
6 changes: 0 additions & 6 deletions LangVer.props

This file was deleted.

3 changes: 1 addition & 2 deletions SampleGame/SampleGame.csproj
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\LangVer.props" />
<Import Project="..\OpenTK.props" />
<Import Project="..\System.Drawing.props" />
<Import Project="..\osu.framework.props" />
<Import Project="..\osu.Framework.props" />

<PropertyGroup Label="Project">
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
Expand Down
5 changes: 5 additions & 0 deletions osu-framework.sln.DotSettings
Expand Up @@ -31,6 +31,7 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToAutoProperty/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToConstant_002ELocal/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToLambdaExpression/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToLocalFunction/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToStaticClass/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=DoubleNegationOperator/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EmptyGeneralCatchClause/@EntryIndexedValue">DO_NOT_SHOW</s:String>
Expand All @@ -41,13 +42,16 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ForCanBeConvertedToForeach/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InconsistentNaming/@EntryIndexedValue">ERROR</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InheritdocConsiderUsage/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InlineOutVariableDeclaration/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InvertIf/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InvokeAsExtensionMethod/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=JoinDeclarationAndInitializer/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=JoinNullCheckWithUsage/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MemberCanBeMadeStatic_002ELocal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MemberCanBePrivate_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MemberCanBePrivate_002ELocal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MemberCanBeProtected_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MergeCastWithTypeCheck/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MergeConditionalExpression/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MergeSequentialChecks/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MethodSupportsCancellation/@EntryIndexedValue">WARNING</s:String>
Expand Down Expand Up @@ -146,6 +150,7 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseNameofExpression/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseNullPropagation/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseObjectOrCollectionInitializer/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UsePatternMatching/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseStringInterpolation/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=VariableCanBeMadeConst/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=VirtualMemberCallInConstructor/@EntryIndexedValue">HINT</s:String>
Expand Down
3 changes: 1 addition & 2 deletions osu.Framework.Tests/Visual/TestCaseAnimation.cs
Expand Up @@ -15,10 +15,9 @@
namespace osu.Framework.Tests.Visual
{
[TestFixture]
[System.ComponentModel.Description("frame-based animations")]
internal class TestCaseAnimation : TestCase
{
public override string Description => "Various frame-based animations";

public TestCaseAnimation()
{
DrawableAnimation drawableAnimation;
Expand Down
2 changes: 0 additions & 2 deletions osu.Framework.Tests/Visual/TestCaseBufferedContainer.cs
Expand Up @@ -11,8 +11,6 @@ namespace osu.Framework.Tests.Visual
[TestFixture]
internal class TestCaseBufferedContainer : TestCaseMasking
{
public override string Description => @"Buffered containers containing almost all visual effects.";

private readonly BufferedContainer buffer;

public TestCaseBufferedContainer()
Expand Down
2 changes: 0 additions & 2 deletions osu.Framework.Tests/Visual/TestCaseCheckboxes.cs
Expand Up @@ -13,8 +13,6 @@ namespace osu.Framework.Tests.Visual
[TestFixture]
internal class TestCaseCheckboxes : TestCase
{
public override string Description => @"Checkboxes with clickable labels";

public TestCaseCheckboxes()
{
Children = new Drawable[]
Expand Down
52 changes: 52 additions & 0 deletions osu.Framework.Tests/Visual/TestCaseCircularContainer.cs
@@ -0,0 +1,52 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

using osu.Framework.Graphics;
using OpenTK;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Testing;

namespace osu.Framework.Tests.Visual
{
[System.ComponentModel.Description(@"Checking for bugged corner radius")]
internal class TestCaseCircularContainer : TestCase
{
private SingleUpdateCircularContainer container;

public TestCaseCircularContainer()
{
AddStep("128x128 box", () => addContainer(new Vector2(128)));
AddAssert("Expect CornerRadius = 64", () => container.CornerRadius == 64);
AddStep("128x64 box", () => addContainer(new Vector2(128, 64)));
AddAssert("Expect CornerRadius = 32", () => container.CornerRadius == 32);
AddStep("64x128 box", () => addContainer(new Vector2(64, 128)));
AddAssert("Expect CornerRadius = 32", () => container.CornerRadius == 32);
}

private void addContainer(Vector2 size)
{
Clear();
Add(container = new SingleUpdateCircularContainer
{
Masking = true,
AutoSizeAxes = Axes.Both,
Child = new Box { Size = size }
});
}

private class SingleUpdateCircularContainer : CircularContainer
{
private bool firstUpdate = true;

public override bool UpdateSubTree()
{
if (!firstUpdate)
return true;
firstUpdate = false;

return base.UpdateSubTree();
}
}
}
}
2 changes: 0 additions & 2 deletions osu.Framework.Tests/Visual/TestCaseCircularProgress.cs
Expand Up @@ -15,8 +15,6 @@ namespace osu.Framework.Tests.Visual
[TestFixture]
internal class TestCaseCircularProgress : TestCase
{
public override string Description => @"Circular progress bar";

private readonly CircularProgress clock;

private int rotateMode;
Expand Down
2 changes: 0 additions & 2 deletions osu.Framework.Tests/Visual/TestCaseColourGradient.cs
Expand Up @@ -81,8 +81,6 @@ public TestCaseColourGradient() : base(2, 2)
}
}

public override string Description => @"Various cases of colour gradients.";

private readonly Box[] boxes = new Box[4];

protected override void Update()
Expand Down
3 changes: 1 addition & 2 deletions osu.Framework.Tests/Visual/TestCaseContainerState.cs
Expand Up @@ -12,10 +12,9 @@
namespace osu.Framework.Tests.Visual
{
[TestFixture]
[System.ComponentModel.Description("ensure valid container state in various scenarios")]
public class TestCaseContainerState : TestCase
{
public override string Description => "Ensuring a container's state is consistent in various scenarios.";

private readonly Container container;

public TestCaseContainerState()
Expand Down
2 changes: 0 additions & 2 deletions osu.Framework.Tests/Visual/TestCaseContextMenu.cs
Expand Up @@ -16,8 +16,6 @@ namespace osu.Framework.Tests.Visual
[TestFixture]
internal class TestCaseContextMenu : TestCase
{
public override string Description => @"Menu visible on right click";

private const int start_time = 0;
private const int duration = 1000;

Expand Down
4 changes: 2 additions & 2 deletions osu.Framework.Tests/Visual/TestCaseDelayedLoad.cs
Expand Up @@ -57,7 +57,7 @@ public TestCaseDelayedLoad()
}
});

var childrenWithAvatarsLoaded = flow.Children.Where(c => c.Children.OfType<DelayedLoadWrapper>().First().Children.FirstOrDefault()?.IsLoaded ?? false);
var childrenWithAvatarsLoaded = flow.Children.Where(c => c.Children.OfType<DelayedLoadWrapper>().First().Content?.IsLoaded ?? false);

AddWaitStep(10);
AddStep("scroll down", () => scroll.ScrollToEnd());
Expand Down Expand Up @@ -91,4 +91,4 @@ private void load()
};
}
}
}
}
Expand Up @@ -12,9 +12,9 @@
namespace osu.Framework.Tests.Visual
{
[TestFixture]
internal class TestCaseDspfContainer : TestCase
internal class TestCaseDrawSizePreservingFillContainer : TestCase
{
public TestCaseDspfContainer()
public TestCaseDrawSizePreservingFillContainer()
{
DrawSizePreservingFillContainer fillContainer;
Child = new Container
Expand Down Expand Up @@ -57,7 +57,5 @@ public TestCaseDspfContainer()
AddSliderStep("Width", 50, 650, 500, v => Child.Width = v);
AddSliderStep("Height", 50, 650, 500, v => Child.Height = v);
}

public override string Description => @"DrawSize-preserving fill container.";
}
}
2 changes: 0 additions & 2 deletions osu.Framework.Tests/Visual/TestCaseDrawablePath.cs
Expand Up @@ -103,8 +103,6 @@ public TestCaseDrawablePath() : base(2, 2)
Colour = Color4.White,
};

public override string Description => @"Various cases of drawable paths.";

private class UserDrawnPath : Path
{
public override bool HandleInput => true;
Expand Down
2 changes: 0 additions & 2 deletions osu.Framework.Tests/Visual/TestCaseDropdownBox.cs
Expand Up @@ -16,8 +16,6 @@ namespace osu.Framework.Tests.Visual
[TestFixture]
internal class TestCaseDropdownBox : TestCase
{
public override string Description => @"Drop-down boxes";

private const int items_to_add = 10;

public TestCaseDropdownBox()
Expand Down
3 changes: 1 addition & 2 deletions osu.Framework.Tests/Visual/TestCaseDynamicDepth.cs
Expand Up @@ -13,10 +13,9 @@
namespace osu.Framework.Tests.Visual
{
[TestFixture]
[System.ComponentModel.Description("changing depth of child dynamically")]
public class TestCaseDynamicDepth : TestCase
{
public override string Description => @"Dynamically change depth of a child.";

private void addDepthSteps(DepthBox box, Container container)
{
AddStep($@"bring forward {box.Name}", () => container.ChangeChildDepth(box, box.Depth - 1));
Expand Down
3 changes: 1 addition & 2 deletions osu.Framework.Tests/Visual/TestCaseEffects.cs
Expand Up @@ -15,10 +15,9 @@
namespace osu.Framework.Tests.Visual
{
[TestFixture]
[System.ComponentModel.Description("implementing the IEffect interface")]
internal class TestCaseEffects : TestCase
{
public override string Description => "Tests classes implement the IEffect interface.";

public TestCaseEffects()
{
var effect = new EdgeEffect
Expand Down
Expand Up @@ -20,10 +20,8 @@
namespace osu.Framework.Tests.Visual
{
[TestFixture]
internal class TestCaseFlow : TestCase
internal class TestCaseFillFlowContainer : TestCase
{
public override string Description => "Test lots of different settings for Flow Containers";

private FillDirectionDropdown selectionDropdown;

private Anchor childAnchor = Anchor.TopLeft;
Expand All @@ -36,7 +34,7 @@ internal class TestCaseFlow : TestCase
private ScheduledDelegate scheduledAdder;
private bool doNotAddChildren;

public TestCaseFlow()
public TestCaseFillFlowContainer()
{
reset();
}
Expand Down
3 changes: 1 addition & 2 deletions osu.Framework.Tests/Visual/TestCaseFillModes.cs
Expand Up @@ -16,6 +16,7 @@
namespace osu.Framework.Tests.Visual
{
[TestFixture]
[System.ComponentModel.Description("sprite stretching")]
internal class TestCaseFillModes : GridTestCase
{
public TestCaseFillModes() : base(3, 3)
Expand Down Expand Up @@ -76,8 +77,6 @@ protected override void LoadComplete()
}
}

public override string Description => @"Test sprite display and fill modes";

private Texture texture;

[BackgroundDependencyLoader]
Expand Down
33 changes: 33 additions & 0 deletions osu.Framework.Tests/Visual/TestCaseGridContainer.cs
Expand Up @@ -317,6 +317,39 @@ public TestCaseGridContainer()
}
};
});

AddStep("Auto size", () =>
{
reset();
grid.Content = new[]
{
new Drawable[] { new Box { Size = new Vector2(30) }, new FillBox(), new FillBox() },
new Drawable[] { new FillBox(), new FillBox(), new FillBox() },
new Drawable[] { new FillBox(), new FillBox(), new FillBox() }
};
grid.RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.Relative, 0.5f) };
grid.ColumnDimensions = new[] { new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.Relative, 0.5f) };
});

AddStep("Autosizing child", () =>
{
reset();
grid.Content = new[]
{
new Drawable[]
{
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Child = new Box { Size = new Vector2(100, 50) }
},
new FillBox()
}
};
grid.ColumnDimensions = new[] { new Dimension(GridSizeMode.AutoSize) };
});
}

private void reset()
Expand Down
2 changes: 0 additions & 2 deletions osu.Framework.Tests/Visual/TestCaseHollowEdgeEffect.cs
Expand Up @@ -85,7 +85,5 @@ public TestCaseHollowEdgeEffect() : base(2, 2)
});
}
}

public override string Description => @"Hollow Container with EdgeEffect";
}
}
3 changes: 1 addition & 2 deletions osu.Framework.Tests/Visual/TestCaseInputResampler.cs
Expand Up @@ -16,6 +16,7 @@
namespace osu.Framework.Tests.Visual
{
[TestFixture]
[System.ComponentModel.Description("live path optimiastion")]
internal class TestCaseInputResampler : GridTestCase
{
public TestCaseInputResampler() : base(3, 3)
Expand Down Expand Up @@ -121,8 +122,6 @@ public TestCaseInputResampler() : base(3, 3)
Colour = Color4.White,
};

public override string Description => @"Live optimizing paths to relevant nodes.";

private class SmoothedPath : Path
{
protected SmoothedPath()
Expand Down
2 changes: 0 additions & 2 deletions osu.Framework.Tests/Visual/TestCaseKeyBindings.cs
Expand Up @@ -18,8 +18,6 @@ namespace osu.Framework.Tests.Visual
[TestFixture]
public class TestCaseKeyBindings : GridTestCase
{
public override string Description => @"Keybindings";

public TestCaseKeyBindings()
: base(2, 2)
{
Expand Down
2 changes: 0 additions & 2 deletions osu.Framework.Tests/Visual/TestCaseLocalisation.cs
Expand Up @@ -20,8 +20,6 @@ namespace osu.Framework.Tests.Visual
[TestFixture]
internal class TestCaseLocalisation : TestCase
{
public override string Description => "Localisation engine";

// ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable
private readonly LocalisationEngine engine; //keep a reference to avoid GC of the engine

Expand Down
2 changes: 0 additions & 2 deletions osu.Framework.Tests/Visual/TestCaseMasking.cs
Expand Up @@ -17,8 +17,6 @@ namespace osu.Framework.Tests.Visual
[TestFixture]
internal class TestCaseMasking : TestCase
{
public override string Description => @"Various scenarios which potentially challenge masking calculations.";

protected Container TestContainer;

public TestCaseMasking()
Expand Down
2 changes: 0 additions & 2 deletions osu.Framework.Tests/Visual/TestCaseNestedHover.cs
Expand Up @@ -15,8 +15,6 @@ namespace osu.Framework.Tests.Visual
[TestFixture]
internal class TestCaseNestedHover : TestCase
{
public override string Description => @"Hovering multiple nested elements";

public TestCaseNestedHover()
{
HoverBox box1;
Expand Down
2 changes: 0 additions & 2 deletions osu.Framework.Tests/Visual/TestCasePadding.cs
Expand Up @@ -175,8 +175,6 @@ public TestCasePadding() : base(2, 2)
});
}

public override string Description => @"Add fixed padding via a PaddingContainer";

private class PaddedBox : Container
{
private readonly SpriteText t1;
Expand Down

0 comments on commit 19e8161

Please sign in to comment.