-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force reset, fix dependencies and merge #1
- Loading branch information
Showing
12 changed files
with
144 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
osu.Game.Rulesets.tau/UI/TauPlayfieldAdjustmentContainer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Game.Rulesets.UI; | ||
using osuTK; | ||
|
||
namespace osu.Game.Rulesets.Tau.UI | ||
{ | ||
public class TauPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer | ||
{ | ||
protected override Container<Drawable> Content => content; | ||
private readonly Container content; | ||
|
||
private const float playfield_size_adjust = 1f; | ||
|
||
public TauPlayfieldAdjustmentContainer() | ||
{ | ||
Anchor = Anchor.Centre; | ||
Origin = Anchor.Centre; | ||
|
||
// Calculated from osu!stable as 512 (default gamefield size) / 640 (default window size) | ||
Size = new Vector2(playfield_size_adjust); | ||
|
||
InternalChild = new Container | ||
{ | ||
Anchor = Anchor.Centre, | ||
Origin = Anchor.Centre, | ||
RelativeSizeAxes = Axes.Both, | ||
FillMode = FillMode.Fit, | ||
FillAspectRatio = 1, | ||
Child = content = new ScalingContainer { RelativeSizeAxes = Axes.Both } | ||
}; | ||
} | ||
|
||
/// <summary> | ||
/// A <see cref="Container"/> which scales its content relative to a target width. | ||
/// </summary> | ||
private class ScalingContainer : Container | ||
{ | ||
protected override void Update() | ||
{ | ||
base.Update(); | ||
|
||
Scale = new Vector2(Parent.ChildSize.X / TauPlayfield.BASE_SIZE.X); | ||
|
||
Size = Vector2.Divide(Vector2.One, Scale); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System.Collections.Generic; | ||
using osu.Game.Replays; | ||
using osu.Game.Rulesets.Tau.Replays; | ||
using osu.Game.Rulesets.Replays; | ||
using osu.Game.Rulesets.UI; | ||
using osuTK; | ||
|
||
namespace osu.Game.Rulesets.Tau.UI | ||
{ | ||
public class TauReplayRecorder : ReplayRecorder<TauAction> | ||
{ | ||
public TauReplayRecorder(Replay replay) | ||
: base(replay) | ||
{ | ||
} | ||
|
||
protected override ReplayFrame HandleFrame(Vector2 mousePosition, List<TauAction> actions, ReplayFrame previousFrame) | ||
=> new TauReplayFrame(Time.Current, mousePosition, actions.ToArray() ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System.Collections.Generic; | ||
|
@@ -31,5 +31,9 @@ public DrawabletauRuleset(TauRuleset ruleset, IBeatmap beatmap, IReadOnlyList<Mo | |
public override DrawableHitObject<TauHitObject> CreateDrawableRepresentation(TauHitObject h) => new DrawabletauHitObject(h); | ||
|
||
protected override PassThroughInputManager CreateInputManager() => new TauInputManager(Ruleset?.RulesetInfo); | ||
|
||
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new TauPlayfieldAdjustmentContainer(); | ||
|
||
protected override ReplayRecorder CreateReplayRecorder(Replay replay) => new TauReplayRecorder(replay); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup Label="Project"> | ||
<TargetFramework>netcoreapp3.0</TargetFramework> | ||
<AssemblyTitle>osu.Game.Rulesets.Sample</AssemblyTitle> | ||
<OutputType>Library</OutputType> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<RootNamespace>osu.Game.Rulesets.Tau</RootNamespace> | ||
<LangVersion>8</LangVersion> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<EmbeddedResource Include="Resources\**" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="ppy.osu.Framework" Version="2020.305.0" /> | ||
<PackageReference Include="ppy.osu.Game" Version="2020.306.0" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Folder Include="Resources\Samples\Gameplay" /> | ||
<Folder Include="Resources\Textures" /> | ||
</ItemGroup> | ||
</Project> |