Skip to content

Commit

Permalink
Merge branch 'master' into fix-rearrangeablelist-scrolltotop
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy authored Feb 18, 2020
2 parents 3881ce6 + 952fe8c commit 4fd5e28
Show file tree
Hide file tree
Showing 39 changed files with 95 additions and 30 deletions.
1 change: 1 addition & 0 deletions .cfsignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
osu.Framework.Templates
4 changes: 2 additions & 2 deletions build/build.cake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Threading;
#addin "nuget:?package=CodeFileSanity&version=0.0.34"
#addin "nuget:?package=CodeFileSanity&version=0.0.36"
#addin "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2019.3.0"
#tool "nuget:?package=NVika.MSBuild&version=1.0.1"
#tool "nuget:?package=Python&version=3.7.2"
Expand All @@ -26,7 +26,7 @@ var frameworkProject = rootDirectory.CombineWithFilePath("osu.Framework/osu.Fram
var iosFrameworkProject = rootDirectory.CombineWithFilePath("osu.Framework.iOS/osu.Framework.iOS.csproj");
var androidFrameworkProject = rootDirectory.CombineWithFilePath("osu.Framework.Android/osu.Framework.Android.csproj");
var nativeLibsProject = rootDirectory.CombineWithFilePath("osu.Framework.NativeLibs/osu.Framework.NativeLibs.csproj");
var templateProject = rootDirectory.CombineWithFilePath("template-game/osu.Framework.Template.csproj");
var templateProject = rootDirectory.CombineWithFilePath("osu.Framework.Templates/osu.Framework.Templates.csproj");

///////////////////////////////////////////////////////////////////////////////
// Setup
Expand Down
10 changes: 10 additions & 0 deletions osu-framework.sln
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Framework.Benchmarks", "osu.Framework.Benchmarks\osu.Framework.Benchmarks.csproj", "{F294C804-8AE2-4020-841A-AF0D97FBE80C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Framework.Templates", "osu.Framework.Templates\osu.Framework.Templates.csproj", "{A95175BB-95D0-44B4-8B82-EABD166943DA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -185,6 +187,14 @@ Global
{F294C804-8AE2-4020-841A-AF0D97FBE80C}.Release|iPhone.Build.0 = Release|Any CPU
{F294C804-8AE2-4020-841A-AF0D97FBE80C}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{F294C804-8AE2-4020-841A-AF0D97FBE80C}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{A95175BB-95D0-44B4-8B82-EABD166943DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A95175BB-95D0-44B4-8B82-EABD166943DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A95175BB-95D0-44B4-8B82-EABD166943DA}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{A95175BB-95D0-44B4-8B82-EABD166943DA}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{A95175BB-95D0-44B4-8B82-EABD166943DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A95175BB-95D0-44B4-8B82-EABD166943DA}.Release|Any CPU.Build.0 = Release|Any CPU
{A95175BB-95D0-44B4-8B82-EABD166943DA}.Release|iPhone.ActiveCfg = Release|Any CPU
{A95175BB-95D0-44B4-8B82-EABD166943DA}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions osu.Framework.Templates/osu.Framework.Templates.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageType>Template</PackageType>
<PackageId>ppy.osu.Framework.Templates</PackageId>
<Title>osu! framework templates</Title>
<Authors>ppy Pty Ltd</Authors>
<PackageLicenseUrl>https://github.com/ppy/osu-framework/blob/master/LICENCE.md</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/ppy/osu-framework</PackageProjectUrl>
<RepositoryUrl>https://github.com/ppy/osu-framework</RepositoryUrl>
<PackageReleaseNotes>Automated release.</PackageReleaseNotes>
<copyright>Copyright (c) 2020 ppy Pty Ltd</copyright>
<Description>Templates that can be used as starting points for new games, built with of osu! framework.</Description>
<PackageTags>dotnet-new;templates;osu;framework</PackageTags>
<TargetFramework>netstandard2.1</TargetFramework>
<IncludeContentInPack>true</IncludeContentInPack>
<IncludeBuildOutput>false</IncludeBuildOutput>
<ContentTargetFolders>content</ContentTargetFolders>
</PropertyGroup>

<ItemGroup>
<Content Include="templates\**\*" Exclude="templates\**\bin\**;templates\**\obj\**" />
<Compile Remove="**\*" />
</ItemGroup>
</Project>
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "ppy Pty Ltd",
"classifications": [
"Console"
],
"name": "osu!framework empty game template",
"identity": "ppy.osu.Framework.Template.Empty",
"shortName": "osu-framework-game",
"tags": {
"language": "C#",
"type": "project"
},
"sourceName": "TemplateGame",
"preferNameDirectory": true
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion osu.Framework.Tests/Audio/DevicelessAudioTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public void TestPlayTrackWithoutDevices()

// start track
track.Restart();
Assert.IsTrue(track.IsRunning);

WaitForOrAssert(() => track.IsRunning, "Track started", 1000);

CheckTrackIsProgressing(track);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using NUnit.Framework;
using osu.Framework.Input;
using osu.Framework.Testing;
using osuTK;
using osuTK.Input;

namespace osu.Framework.Tests.Visual.Testing
{
public class TestSceneManualInputManagerTestScene : ManualInputManagerTestScene
{
protected override Vector2 InitialMousePosition => new Vector2(10f);

[Test]
public void TestResetInput()
{
AddStep("move mouse", () => InputManager.MoveMouseTo(Vector2.Zero));
AddStep("press mouse", () => InputManager.PressButton(MouseButton.Left));
AddStep("press key", () => InputManager.PressKey(Key.Z));
AddStep("press joystick", () => InputManager.PressJoystickButton(JoystickButton.Button1));

AddStep("reset input", ResetInput);

AddAssert("mouse position reset", () => InputManager.CurrentState.Mouse.Position == InitialMousePosition);
AddAssert("all input states released", () =>
!InputManager.CurrentState.Mouse.Buttons.HasAnyButtonPressed &&
!InputManager.CurrentState.Keyboard.Keys.HasAnyButtonPressed &&
!InputManager.CurrentState.Joystick.Buttons.HasAnyButtonPressed);
}

[Test]
public void TestMousePositionSetToInitial() => AddAssert("mouse position set to initial", () => InputManager.CurrentState.Mouse.Position == InitialMousePosition);
}
}
9 changes: 4 additions & 5 deletions osu.Framework/Testing/ManualInputManagerTestScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,12 @@ protected void ResetInput()
var joystick = currentState.Joystick;
joystick.Buttons.ForEach(InputManager.ReleaseJoystickButton);

InputManager.UseParentInput = true;
// schedule after children to ensure pending inputs have been applied before using parent input manager.
ScheduleAfterChildren(returnUserInput);
}

private void returnUserInput() =>
InputManager.UseParentInput = true;
private void returnUserInput() => InputManager.UseParentInput = true;

private void returnTestInput() =>
InputManager.UseParentInput = false;
private void returnTestInput() => InputManager.UseParentInput = false;
}
}
22 changes: 0 additions & 22 deletions template-game/osu.Framework.Template.csproj

This file was deleted.

0 comments on commit 4fd5e28

Please sign in to comment.