mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 13:32:54 +08:00
Merge branch 'master' of git://github.com/ppy/osu into profile-header-update
This commit is contained in:
commit
5bc6042309
11
.github/ISSUE_TEMPLATE.md
vendored
11
.github/ISSUE_TEMPLATE.md
vendored
@ -1,11 +0,0 @@
|
||||
osu!lazer is currently still under heavy development!
|
||||
|
||||
Please ensure that you are making an issue for one of the following:
|
||||
|
||||
- A bug with currently implemented features (not features that don't exist)
|
||||
- A feature you are considering adding, so we can collaborate on feedback and design.
|
||||
- Discussions about technical design decisions
|
||||
|
||||
If your issue qualifies, replace this text with a detailed description of your issue with as much relevant information as you can provide.
|
||||
|
||||
Screenshots and log files are highly welcomed.
|
11
.github/ISSUE_TEMPLATE/bug-issues.md
vendored
11
.github/ISSUE_TEMPLATE/bug-issues.md
vendored
@ -1,14 +1,11 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: For issues regarding encountered game bugs
|
||||
about: Issues regarding encountered bugs.
|
||||
---
|
||||
|
||||
<!-- After you fill in all information, delete all comments in the issue -->
|
||||
|
||||
**Describe your problem:** <!-- Provide any information you believe could be useful -->
|
||||
**Describe the bug:**
|
||||
|
||||
**Screenshots or videos showing encountered issue:**
|
||||
|
||||
**osu!lazer version:** <!-- Provide the version of your osu!lazer, you can find it at the bottom of the screen -->
|
||||
**osu!lazer version:**
|
||||
|
||||
**Logs:** <!-- Attach your osu!lazer logs, you can find them under %appdata%\osu\logs in Windows, or under ~/.local/share/osu/ in Linux and macOS -->
|
||||
**Logs:**
|
||||
|
13
.github/ISSUE_TEMPLATE/crash-issues.md
vendored
13
.github/ISSUE_TEMPLATE/crash-issues.md
vendored
@ -1,16 +1,13 @@
|
||||
---
|
||||
name: Crash Report
|
||||
about: For issues regarding game crashes or permanent freezes
|
||||
about: Issues regarding crashes or permanent freezes.
|
||||
---
|
||||
|
||||
<!-- After you fill in all information, delete all comments in the issue -->
|
||||
|
||||
**Describe your problem:** <!-- Provide any information you believe could be useful -->
|
||||
**Describe the crash:**
|
||||
|
||||
**Screenshots or videos showing encountered issue:**
|
||||
|
||||
**osu!lazer version:** <!-- Provide the version of your osu!lazer, you can find it at the bottom of the screen -->
|
||||
**osu!lazer version:**
|
||||
|
||||
**Logs:** <!-- Attach your osu!lazer logs, you can find them under %appdata%\osu\logs in Windows, or under ~/.local/share/osu/ in Linux and macOS -->
|
||||
**Logs:**
|
||||
|
||||
**Computer Specifications:** <!-- Attach your computer specifications, you can find them by using System Information in Windows, System Monitor in Linux, or About This Mac in macOS -->
|
||||
**Computer Specifications:**
|
||||
|
@ -1,10 +1,7 @@
|
||||
---
|
||||
name: Feature Request
|
||||
about: Let us know what you would like to see in the game!
|
||||
about: Features you would like to see in the game!
|
||||
---
|
||||
**Describe the new feature:**
|
||||
|
||||
<!-- After you fill in all information, delete all comments in the issue -->
|
||||
|
||||
**Describe the feature:** <!-- Describe the feature you would like to see in the game -->
|
||||
|
||||
**Proposal designs of the feature:** <!-- Attach screenshots of how the feature should look like according to you -->
|
||||
**Proposal designs of the feature:**
|
||||
|
@ -1,10 +1,7 @@
|
||||
---
|
||||
name: Missing for Live
|
||||
about: Let us know the features you need which are available in osu-stable but not lazer
|
||||
about: Features which are available in osu!stable but not yet in osu!lazer.
|
||||
---
|
||||
**Describe the missing feature:**
|
||||
|
||||
<!-- After you fill in all information, delete all comments in the issue -->
|
||||
|
||||
**Describe the feature:** <!-- Describe the missing game feature -->
|
||||
|
||||
**Designs:** <!-- Attach screenshots of how the feature is supposed to look like. For illustrative purpose only; final designs are usually re-imagined from scratch. -->
|
||||
**Proposal designs of the feature:**
|
||||
|
@ -1,5 +1,5 @@
|
||||
#addin "nuget:?package=CodeFileSanity&version=0.0.21"
|
||||
#addin "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2018.2.2"
|
||||
#addin "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2018.3.4"
|
||||
#tool "nuget:?package=NVika.MSBuild&version=1.0.1"
|
||||
var nVikaToolPath = GetFiles("./tools/NVika.MSBuild.*/tools/NVika.exe").First();
|
||||
|
||||
@ -46,7 +46,9 @@ Task("InspectCode")
|
||||
OutputFile = "inspectcodereport.xml",
|
||||
});
|
||||
|
||||
StartProcess(nVikaToolPath, @"parsereport ""inspectcodereport.xml"" --treatwarningsaserrors");
|
||||
int returnCode = StartProcess(nVikaToolPath, $@"parsereport ""inspectcodereport.xml"" --treatwarningsaserrors");
|
||||
if (returnCode != 0)
|
||||
throw new Exception($"inspectcode failed with return code {returnCode}");
|
||||
});
|
||||
|
||||
Task("CodeFileSanity")
|
||||
|
@ -14,6 +14,7 @@ using osuTK.Input;
|
||||
using Microsoft.Win32;
|
||||
using osu.Desktop.Updater;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Platform.Windows;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Screens.Menu;
|
||||
@ -35,12 +36,15 @@ namespace osu.Desktop
|
||||
{
|
||||
try
|
||||
{
|
||||
return new StableStorage();
|
||||
if (Host is DesktopGameHost desktopHost)
|
||||
return new StableStorage(desktopHost);
|
||||
}
|
||||
catch
|
||||
catch (Exception e)
|
||||
{
|
||||
return null;
|
||||
Logger.Error(e, "Error while searching for stable install");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -139,8 +143,8 @@ namespace osu.Desktop
|
||||
return null;
|
||||
}
|
||||
|
||||
public StableStorage()
|
||||
: base(string.Empty, null)
|
||||
public StableStorage(DesktopGameHost host)
|
||||
: base(string.Empty, host)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ namespace osu.Desktop.Overlays
|
||||
public UpdateCompleteNotification(string version, Action<string> openUrl = null)
|
||||
{
|
||||
Text = $"You are now running osu!lazer {version}.\nClick to see what's new!";
|
||||
Icon = FontAwesome.fa_check_square;
|
||||
Icon = FontAwesome.Solid.CheckSquare;
|
||||
Activated = delegate
|
||||
{
|
||||
openUrl?.Invoke($"https://osu.ppy.sh/home/changelog/lazer/{version}");
|
||||
|
@ -7,10 +7,10 @@ using Newtonsoft.Json;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.IO.Network;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
|
||||
@ -54,7 +54,7 @@ namespace osu.Desktop.Updater
|
||||
{
|
||||
Text = $"A newer release of osu! has been found ({version} → {latest.TagName}).\n\n"
|
||||
+ "Click here to download the new version, which can be installed over the top of your existing installation",
|
||||
Icon = FontAwesome.fa_upload,
|
||||
Icon = FontAwesome.Solid.Upload,
|
||||
Activated = () =>
|
||||
{
|
||||
host.OpenUrlExternally(getBestUrl(latest));
|
||||
|
@ -9,6 +9,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game;
|
||||
using osu.Game.Graphics;
|
||||
@ -158,7 +159,7 @@ namespace osu.Desktop.Updater
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Icon = FontAwesome.fa_upload,
|
||||
Icon = FontAwesome.Solid.Upload,
|
||||
Colour = Color4.White,
|
||||
Size = new Vector2(20),
|
||||
}
|
||||
|
@ -27,8 +27,8 @@
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="System.IO.Packaging" Version="4.5.0" />
|
||||
<PackageReference Include="ppy.squirrel.windows" Version="1.9.0.3" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.2.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.3" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.2.3" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Resources">
|
||||
<EmbeddedResource Include="lazer.ico" />
|
||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
protected override string ResourceAssembly => "osu.Game.Rulesets.Catch";
|
||||
|
||||
[TestCase(4.2038001515546597d, "diffcalc-test")]
|
||||
[TestCase(4.2058561036909863d, "diffcalc-test")]
|
||||
public void Test(double expected, string name)
|
||||
=> base.Test(expected, name);
|
||||
|
||||
|
@ -13,7 +13,7 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
public class TestCaseAutoJuiceStream : TestCasePlayer
|
||||
public class TestCaseAutoJuiceStream : PlayerTestCase
|
||||
{
|
||||
public TestCaseAutoJuiceStream()
|
||||
: base(new CatchRuleset())
|
||||
|
@ -8,11 +8,12 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Catch.Objects;
|
||||
using osu.Game.Rulesets.Catch.Objects.Drawable;
|
||||
using osu.Game.Rulesets.Catch.UI;
|
||||
using osu.Game.Tests.Visual;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestCaseBananaShower : Game.Tests.Visual.TestCasePlayer
|
||||
public class TestCaseBananaShower : PlayerTestCase
|
||||
{
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||
{
|
||||
@ -20,7 +21,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
typeof(DrawableBananaShower),
|
||||
|
||||
typeof(CatchRuleset),
|
||||
typeof(CatchRulesetContainer),
|
||||
typeof(DrawableCatchRuleset),
|
||||
};
|
||||
|
||||
public TestCaseBananaShower()
|
||||
|
@ -2,11 +2,12 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using NUnit.Framework;
|
||||
using osu.Game.Tests.Visual;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestCaseCatchPlayer : Game.Tests.Visual.TestCasePlayer
|
||||
public class TestCaseCatchPlayer : PlayerTestCase
|
||||
{
|
||||
public TestCaseCatchPlayer()
|
||||
: base(new CatchRuleset())
|
||||
|
@ -4,11 +4,12 @@
|
||||
using NUnit.Framework;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Catch.Objects;
|
||||
using osu.Game.Tests.Visual;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestCaseCatchStacker : Game.Tests.Visual.TestCasePlayer
|
||||
public class TestCaseCatchStacker : PlayerTestCase
|
||||
{
|
||||
public TestCaseCatchStacker()
|
||||
: base(new CatchRuleset())
|
||||
|
@ -1,22 +1,28 @@
|
||||
// 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 System;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Catch.Objects;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Tests.Visual;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestCaseHyperDash : Game.Tests.Visual.TestCasePlayer
|
||||
public class TestCaseHyperDash : PlayerTestCase
|
||||
{
|
||||
public TestCaseHyperDash()
|
||||
: base(new CatchRuleset())
|
||||
{
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
AddAssert("First note is hyperdash", () => Beatmap.Value.Beatmap.HitObjects[0] is Fruit f && f.HyperDash);
|
||||
}
|
||||
|
||||
protected override IBeatmap CreateBeatmap(Ruleset ruleset)
|
||||
{
|
||||
var beatmap = new Beatmap
|
||||
@ -28,7 +34,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
}
|
||||
};
|
||||
|
||||
// Should produce a hperdash
|
||||
// Should produce a hyper-dash
|
||||
beatmap.HitObjects.Add(new Fruit { StartTime = 816, X = 308 / 512f, NewCombo = true });
|
||||
beatmap.HitObjects.Add(new Fruit { StartTime = 1008, X = 56 / 512f, });
|
||||
|
||||
@ -38,11 +44,5 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
|
||||
return beatmap;
|
||||
}
|
||||
|
||||
protected override void AddCheckSteps(Func<Player> player)
|
||||
{
|
||||
base.AddCheckSteps(player);
|
||||
AddAssert("First note is hyperdash", () => Beatmap.Value.Beatmap.HitObjects[0] is Fruit f && f.HyperDash);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +2,9 @@
|
||||
<Import Project="..\osu.TestProject.props" />
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
|
||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="3.12.0" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
|
||||
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Project">
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Catch.Objects;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Beatmaps
|
||||
@ -23,19 +23,19 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
|
||||
{
|
||||
Name = @"Fruit Count",
|
||||
Content = fruits.ToString(),
|
||||
Icon = FontAwesome.fa_circle_o
|
||||
Icon = FontAwesome.Regular.Circle
|
||||
},
|
||||
new BeatmapStatistic
|
||||
{
|
||||
Name = @"Juice Stream Count",
|
||||
Content = juiceStreams.ToString(),
|
||||
Icon = FontAwesome.fa_circle
|
||||
Icon = FontAwesome.Regular.Circle
|
||||
},
|
||||
new BeatmapStatistic
|
||||
{
|
||||
Name = @"Banana Shower Count",
|
||||
Content = bananaShowers.ToString(),
|
||||
Icon = FontAwesome.fa_circle
|
||||
Icon = FontAwesome.Regular.Circle
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Game.Rulesets.Catch.Objects;
|
||||
using osu.Game.Rulesets.Catch.Replays;
|
||||
@ -17,12 +18,13 @@ using osu.Game.Beatmaps.Legacy;
|
||||
using osu.Game.Rulesets.Catch.Beatmaps;
|
||||
using osu.Game.Rulesets.Catch.Difficulty;
|
||||
using osu.Game.Rulesets.Difficulty;
|
||||
using osu.Game.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch
|
||||
{
|
||||
public class CatchRuleset : Ruleset
|
||||
{
|
||||
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap) => new CatchRulesetContainer(this, beatmap);
|
||||
public override DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap) => new DrawableCatchRuleset(this, beatmap);
|
||||
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new CatchBeatmapConverter(beatmap);
|
||||
public override IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => new CatchBeatmapProcessor(beatmap);
|
||||
|
||||
@ -114,10 +116,12 @@ namespace osu.Game.Rulesets.Catch
|
||||
|
||||
public override string ShortName => "fruits";
|
||||
|
||||
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_fruits_o };
|
||||
public override Drawable CreateIcon() => new SpriteIcon { Icon = OsuIcon.RulesetCatch };
|
||||
|
||||
public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new CatchDifficultyCalculator(this, beatmap);
|
||||
|
||||
public override PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, ScoreInfo score) => new CatchPerformanceCalculator(this, beatmap, score);
|
||||
|
||||
public override int? LegacyID => 2;
|
||||
|
||||
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new CatchReplayFrame();
|
||||
|
@ -7,6 +7,7 @@ using System.Linq;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Catch.Difficulty.Preprocessing;
|
||||
using osu.Game.Rulesets.Catch.Difficulty.Skills;
|
||||
using osu.Game.Rulesets.Catch.Mods;
|
||||
using osu.Game.Rulesets.Catch.Objects;
|
||||
using osu.Game.Rulesets.Catch.UI;
|
||||
using osu.Game.Rulesets.Difficulty;
|
||||
@ -22,16 +23,9 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
||||
|
||||
protected override int SectionLength => 750;
|
||||
|
||||
private readonly float halfCatchWidth;
|
||||
|
||||
public CatchDifficultyCalculator(Ruleset ruleset, WorkingBeatmap beatmap)
|
||||
: base(ruleset, beatmap)
|
||||
{
|
||||
var catcher = new CatcherArea.Catcher(beatmap.BeatmapInfo.BaseDifficulty);
|
||||
halfCatchWidth = catcher.CatchWidth * 0.5f;
|
||||
|
||||
// We're only using 80% of the catcher's width to simulate imperfect gameplay.
|
||||
halfCatchWidth *= 0.8f;
|
||||
}
|
||||
|
||||
protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate)
|
||||
@ -53,6 +47,14 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
||||
|
||||
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate)
|
||||
{
|
||||
float halfCatchWidth;
|
||||
|
||||
using (var catcher = new CatcherArea.Catcher(beatmap.BeatmapInfo.BaseDifficulty))
|
||||
{
|
||||
halfCatchWidth = catcher.CatchWidth * 0.5f;
|
||||
halfCatchWidth *= 0.8f; // We're only using 80% of the catcher's width to simulate imperfect gameplay.
|
||||
}
|
||||
|
||||
CatchHitObject lastObject = null;
|
||||
|
||||
foreach (var hitObject in beatmap.HitObjects.OfType<CatchHitObject>())
|
||||
@ -88,5 +90,13 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
||||
{
|
||||
new Movement(),
|
||||
};
|
||||
|
||||
protected override Mod[] DifficultyAdjustmentMods => new Mod[]
|
||||
{
|
||||
new CatchModDoubleTime(),
|
||||
new CatchModHalfTime(),
|
||||
new CatchModHardRock(),
|
||||
new CatchModEasy(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
104
osu.Game.Rulesets.Catch/Difficulty/CatchPerformanceCalculator.cs
Normal file
104
osu.Game.Rulesets.Catch/Difficulty/CatchPerformanceCalculator.cs
Normal file
@ -0,0 +1,104 @@
|
||||
// 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 System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Difficulty;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Scoring.Legacy;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Difficulty
|
||||
{
|
||||
public class CatchPerformanceCalculator : PerformanceCalculator
|
||||
{
|
||||
protected new CatchDifficultyAttributes Attributes => (CatchDifficultyAttributes)base.Attributes;
|
||||
|
||||
private Mod[] mods;
|
||||
|
||||
private int fruitsHit;
|
||||
private int ticksHit;
|
||||
private int tinyTicksHit;
|
||||
private int tinyTicksMissed;
|
||||
private int misses;
|
||||
|
||||
public CatchPerformanceCalculator(Ruleset ruleset, WorkingBeatmap beatmap, ScoreInfo score)
|
||||
: base(ruleset, beatmap, score)
|
||||
{
|
||||
}
|
||||
|
||||
public override double Calculate(Dictionary<string, double> categoryDifficulty = null)
|
||||
{
|
||||
mods = Score.Mods;
|
||||
|
||||
var legacyScore = Score as LegacyScoreInfo;
|
||||
|
||||
fruitsHit = legacyScore?.Count300 ?? Score.Statistics[HitResult.Perfect];
|
||||
ticksHit = legacyScore?.Count100 ?? 0;
|
||||
tinyTicksHit = legacyScore?.Count50 ?? 0;
|
||||
tinyTicksMissed = legacyScore?.CountKatu ?? 0;
|
||||
misses = Score.Statistics[HitResult.Miss];
|
||||
|
||||
// Don't count scores made with supposedly unranked mods
|
||||
if (mods.Any(m => !m.Ranked))
|
||||
return 0;
|
||||
|
||||
// We are heavily relying on aim in catch the beat
|
||||
double value = Math.Pow(5.0f * Math.Max(1.0f, Attributes.StarRating / 0.0049f) - 4.0f, 2.0f) / 100000.0f;
|
||||
|
||||
// Longer maps are worth more. "Longer" means how many hits there are which can contribute to combo
|
||||
int numTotalHits = totalComboHits();
|
||||
|
||||
// Longer maps are worth more
|
||||
float lengthBonus =
|
||||
0.95f + 0.4f * Math.Min(1.0f, numTotalHits / 3000.0f) +
|
||||
(numTotalHits > 3000 ? (float)Math.Log10(numTotalHits / 3000.0f) * 0.5f : 0.0f);
|
||||
|
||||
// Longer maps are worth more
|
||||
value *= lengthBonus;
|
||||
|
||||
// Penalize misses exponentially. This mainly fixes tag4 maps and the likes until a per-hitobject solution is available
|
||||
value *= Math.Pow(0.97f, misses);
|
||||
|
||||
// Combo scaling
|
||||
float beatmapMaxCombo = Attributes.MaxCombo;
|
||||
if (beatmapMaxCombo > 0)
|
||||
value *= Math.Min(Math.Pow(Attributes.MaxCombo, 0.8f) / Math.Pow(beatmapMaxCombo, 0.8f), 1.0f);
|
||||
|
||||
float approachRate = (float)Attributes.ApproachRate;
|
||||
float approachRateFactor = 1.0f;
|
||||
if (approachRate > 9.0f)
|
||||
approachRateFactor += 0.1f * (approachRate - 9.0f); // 10% for each AR above 9
|
||||
else if (approachRate < 8.0f)
|
||||
approachRateFactor += 0.025f * (8.0f - approachRate); // 2.5% for each AR below 8
|
||||
|
||||
value *= approachRateFactor;
|
||||
|
||||
if (mods.Any(m => m is ModHidden))
|
||||
// Hiddens gives nothing on max approach rate, and more the lower it is
|
||||
value *= 1.05f + 0.075f * (10.0f - Math.Min(10.0f, approachRate)); // 7.5% for each AR below 10
|
||||
|
||||
if (mods.Any(m => m is ModFlashlight))
|
||||
// Apply length bonus again if flashlight is on simply because it becomes a lot harder on longer maps.
|
||||
value *= 1.35f * lengthBonus;
|
||||
|
||||
// Scale the aim value with accuracy _slightly_
|
||||
value *= Math.Pow(accuracy(), 5.5f);
|
||||
|
||||
// Custom multipliers for NoFail. SpunOut is not applicable.
|
||||
if (mods.Any(m => m is ModNoFail))
|
||||
value *= 0.90f;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
private float accuracy() => totalHits() == 0 ? 0 : MathHelper.Clamp((float)totalSuccessfulHits() / totalHits(), 0f, 1f);
|
||||
private int totalHits() => tinyTicksHit + ticksHit + fruitsHit + misses + tinyTicksMissed;
|
||||
private int totalSuccessfulHits() => tinyTicksHit + ticksHit + fruitsHit;
|
||||
private int totalComboHits() => misses + ticksHit + fruitsHit;
|
||||
}
|
||||
}
|
@ -21,10 +21,10 @@ namespace osu.Game.Rulesets.Catch.Mods
|
||||
|
||||
private CatchPlayfield playfield;
|
||||
|
||||
public override void ApplyToRulesetContainer(RulesetContainer<CatchHitObject> rulesetContainer)
|
||||
public override void ApplyToDrawableRuleset(DrawableRuleset<CatchHitObject> drawableRuleset)
|
||||
{
|
||||
playfield = (CatchPlayfield)rulesetContainer.Playfield;
|
||||
base.ApplyToRulesetContainer(rulesetContainer);
|
||||
playfield = (CatchPlayfield)drawableRuleset.Playfield;
|
||||
base.ApplyToDrawableRuleset(drawableRuleset);
|
||||
}
|
||||
|
||||
private class CatchFlashlight : Flashlight
|
||||
|
@ -15,41 +15,73 @@ namespace osu.Game.Rulesets.Catch.Mods
|
||||
public override double ScoreMultiplier => 1.12;
|
||||
public override bool Ranked => true;
|
||||
|
||||
private float lastStartX;
|
||||
private int lastStartTime;
|
||||
private float? lastPosition;
|
||||
private double lastStartTime;
|
||||
|
||||
public void ApplyToHitObject(HitObject hitObject)
|
||||
{
|
||||
if (hitObject is JuiceStream stream)
|
||||
{
|
||||
lastPosition = stream.EndX;
|
||||
lastStartTime = stream.EndTime;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(hitObject is Fruit))
|
||||
return;
|
||||
|
||||
var catchObject = (CatchHitObject)hitObject;
|
||||
|
||||
float position = catchObject.X;
|
||||
int startTime = (int)hitObject.StartTime;
|
||||
double startTime = hitObject.StartTime;
|
||||
|
||||
if (lastStartX == 0)
|
||||
if (lastPosition == null)
|
||||
{
|
||||
lastStartX = position;
|
||||
lastPosition = position;
|
||||
lastStartTime = startTime;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
float diff = lastStartX - position;
|
||||
int timeDiff = startTime - lastStartTime;
|
||||
float positionDiff = position - lastPosition.Value;
|
||||
double timeDiff = startTime - lastStartTime;
|
||||
|
||||
if (timeDiff > 1000)
|
||||
{
|
||||
lastStartX = position;
|
||||
lastPosition = position;
|
||||
lastStartTime = startTime;
|
||||
return;
|
||||
}
|
||||
|
||||
if (diff == 0)
|
||||
if (positionDiff == 0)
|
||||
{
|
||||
applyRandomOffset(ref position, timeDiff / 4d);
|
||||
catchObject.X = position;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Math.Abs(positionDiff * CatchPlayfield.BASE_WIDTH) < timeDiff / 3d)
|
||||
applyOffset(ref position, positionDiff);
|
||||
|
||||
catchObject.X = position;
|
||||
|
||||
lastPosition = position;
|
||||
lastStartTime = startTime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Applies a random offset in a random direction to a position, ensuring that the final position remains within the boundary of the playfield.
|
||||
/// </summary>
|
||||
/// <param name="position">The position which the offset should be applied to.</param>
|
||||
/// <param name="maxOffset">The maximum offset, cannot exceed 20px.</param>
|
||||
private void applyRandomOffset(ref float position, double maxOffset)
|
||||
{
|
||||
bool right = RNG.NextBool();
|
||||
|
||||
float rand = Math.Min(20, (float)RNG.NextDouble(0, timeDiff / 4d)) / CatchPlayfield.BASE_WIDTH;
|
||||
float rand = Math.Min(20, (float)RNG.NextDouble(0, Math.Max(0, maxOffset))) / CatchPlayfield.BASE_WIDTH;
|
||||
|
||||
if (right)
|
||||
{
|
||||
// Clamp to the right bound
|
||||
if (position + rand <= 1)
|
||||
position += rand;
|
||||
else
|
||||
@ -57,35 +89,33 @@ namespace osu.Game.Rulesets.Catch.Mods
|
||||
}
|
||||
else
|
||||
{
|
||||
// Clamp to the left bound
|
||||
if (position - rand >= 0)
|
||||
position -= rand;
|
||||
else
|
||||
position += rand;
|
||||
}
|
||||
|
||||
catchObject.X = position;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (Math.Abs(diff) < timeDiff / 3d)
|
||||
/// <summary>
|
||||
/// Applies an offset to a position, ensuring that the final position remains within the boundary of the playfield.
|
||||
/// </summary>
|
||||
/// <param name="position">The position which the offset should be applied to.</param>
|
||||
/// <param name="amount">The amount to offset by.</param>
|
||||
private void applyOffset(ref float position, float amount)
|
||||
{
|
||||
if (diff > 0)
|
||||
if (amount > 0)
|
||||
{
|
||||
if (position - diff > 0)
|
||||
position -= diff;
|
||||
// Clamp to the right bound
|
||||
if (position + amount < 1)
|
||||
position += amount;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (position - diff < 1)
|
||||
position -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
catchObject.X = position;
|
||||
|
||||
lastStartX = position;
|
||||
lastStartTime = startTime;
|
||||
// Clamp to the left bound
|
||||
if (position + amount > 0)
|
||||
position += amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,17 +13,17 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||
{
|
||||
private readonly Container bananaContainer;
|
||||
|
||||
public DrawableBananaShower(BananaShower s, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> getVisualRepresentation = null)
|
||||
public DrawableBananaShower(BananaShower s, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> createDrawableRepresentation = null)
|
||||
: base(s)
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Origin = Anchor.BottomLeft;
|
||||
X = 0;
|
||||
|
||||
InternalChild = bananaContainer = new Container { RelativeSizeAxes = Axes.Both };
|
||||
AddInternal(bananaContainer = new Container { RelativeSizeAxes = Axes.Both });
|
||||
|
||||
foreach (var b in s.NestedHitObjects.Cast<Banana>())
|
||||
AddNested(getVisualRepresentation?.Invoke(b));
|
||||
AddNested(createDrawableRepresentation?.Invoke(b));
|
||||
}
|
||||
|
||||
protected override void AddNested(DrawableHitObject h)
|
||||
|
@ -26,10 +26,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
InternalChild = pulp = new Pulp
|
||||
{
|
||||
Size = Size
|
||||
};
|
||||
AddInternal(pulp = new Pulp { Size = Size });
|
||||
}
|
||||
|
||||
public override Color4 AccentColour
|
||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||
// todo: this should come from the skin.
|
||||
AccentColour = colourForRepresentation(HitObject.VisualRepresentation);
|
||||
|
||||
InternalChildren = new[]
|
||||
AddRangeInternal(new[]
|
||||
{
|
||||
createPulp(HitObject.VisualRepresentation),
|
||||
border = new Circle
|
||||
@ -70,7 +70,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
if (HitObject.HyperDash)
|
||||
{
|
||||
|
@ -13,17 +13,17 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||
{
|
||||
private readonly Container dropletContainer;
|
||||
|
||||
public DrawableJuiceStream(JuiceStream s, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> getVisualRepresentation = null)
|
||||
public DrawableJuiceStream(JuiceStream s, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> createDrawableRepresentation = null)
|
||||
: base(s)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
Origin = Anchor.BottomLeft;
|
||||
X = 0;
|
||||
|
||||
InternalChild = dropletContainer = new Container { RelativeSizeAxes = Axes.Both, };
|
||||
AddInternal(dropletContainer = new Container { RelativeSizeAxes = Axes.Both, });
|
||||
|
||||
foreach (var o in s.NestedHitObjects.Cast<CatchHitObject>())
|
||||
AddNested(getVisualRepresentation?.Invoke(o));
|
||||
AddNested(createDrawableRepresentation?.Invoke(o));
|
||||
}
|
||||
|
||||
protected override void AddNested(DrawableHitObject h)
|
||||
|
@ -1,7 +1,6 @@
|
||||
// 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 System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Game.Audio;
|
||||
@ -25,6 +24,11 @@ namespace osu.Game.Rulesets.Catch.Objects
|
||||
public double Velocity;
|
||||
public double TickDistance;
|
||||
|
||||
/// <summary>
|
||||
/// The length of one span of this <see cref="JuiceStream"/>.
|
||||
/// </summary>
|
||||
public double SpanDuration => Duration / this.SpanCount();
|
||||
|
||||
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
|
||||
{
|
||||
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
|
||||
@ -41,19 +45,6 @@ namespace osu.Game.Rulesets.Catch.Objects
|
||||
protected override void CreateNestedHitObjects()
|
||||
{
|
||||
base.CreateNestedHitObjects();
|
||||
createTicks();
|
||||
}
|
||||
|
||||
private void createTicks()
|
||||
{
|
||||
if (TickDistance == 0)
|
||||
return;
|
||||
|
||||
var length = Path.Distance;
|
||||
var tickDistance = Math.Min(TickDistance, length);
|
||||
var spanDuration = length / Velocity;
|
||||
|
||||
var minDistanceFromEnd = Velocity * 0.01;
|
||||
|
||||
var tickSamples = Samples.Select(s => new SampleInfo
|
||||
{
|
||||
@ -62,81 +53,59 @@ namespace osu.Game.Rulesets.Catch.Objects
|
||||
Volume = s.Volume
|
||||
}).ToList();
|
||||
|
||||
AddNested(new Fruit
|
||||
SliderEventDescriptor? lastEvent = null;
|
||||
|
||||
foreach (var e in SliderEventGenerator.Generate(StartTime, SpanDuration, Velocity, TickDistance, Path.Distance, this.SpanCount(), LegacyLastTickOffset))
|
||||
{
|
||||
Samples = Samples,
|
||||
StartTime = StartTime,
|
||||
X = X
|
||||
});
|
||||
|
||||
double lastTickTime = StartTime;
|
||||
|
||||
for (int span = 0; span < this.SpanCount(); span++)
|
||||
// generate tiny droplets since the last point
|
||||
if (lastEvent != null)
|
||||
{
|
||||
var spanStartTime = StartTime + span * spanDuration;
|
||||
var reversed = span % 2 == 1;
|
||||
double sinceLastTick = e.Time - lastEvent.Value.Time;
|
||||
|
||||
for (double d = tickDistance;; d += tickDistance)
|
||||
if (sinceLastTick > 80)
|
||||
{
|
||||
bool isLastTick = false;
|
||||
if (d + minDistanceFromEnd >= length)
|
||||
double timeBetweenTiny = sinceLastTick;
|
||||
while (timeBetweenTiny > 100)
|
||||
timeBetweenTiny /= 2;
|
||||
|
||||
for (double t = timeBetweenTiny; t < sinceLastTick; t += timeBetweenTiny)
|
||||
{
|
||||
d = length;
|
||||
isLastTick = true;
|
||||
}
|
||||
|
||||
var timeProgress = d / length;
|
||||
var distanceProgress = reversed ? 1 - timeProgress : timeProgress;
|
||||
|
||||
double time = spanStartTime + timeProgress * spanDuration;
|
||||
|
||||
if (LegacyLastTickOffset != null)
|
||||
{
|
||||
// If we're the last tick, apply the legacy offset
|
||||
if (span == this.SpanCount() - 1 && isLastTick)
|
||||
time = Math.Max(StartTime + Duration / 2, time - LegacyLastTickOffset.Value);
|
||||
}
|
||||
|
||||
int tinyTickCount = 1;
|
||||
double tinyTickInterval = time - lastTickTime;
|
||||
while (tinyTickInterval > 100 && tinyTickCount < 10000)
|
||||
{
|
||||
tinyTickInterval /= 2;
|
||||
tinyTickCount *= 2;
|
||||
}
|
||||
|
||||
for (int tinyTickIndex = 0; tinyTickIndex < tinyTickCount - 1; tinyTickIndex++)
|
||||
{
|
||||
var t = lastTickTime + (tinyTickIndex + 1) * tinyTickInterval;
|
||||
double progress = reversed ? 1 - (t - spanStartTime) / spanDuration : (t - spanStartTime) / spanDuration;
|
||||
|
||||
AddNested(new TinyDroplet
|
||||
{
|
||||
StartTime = t,
|
||||
X = X + Path.PositionAt(progress).X / CatchPlayfield.BASE_WIDTH,
|
||||
Samples = tickSamples
|
||||
Samples = tickSamples,
|
||||
StartTime = t + lastEvent.Value.Time,
|
||||
X = X + Path.PositionAt(
|
||||
lastEvent.Value.PathProgress + (t / sinceLastTick) * (e.PathProgress - lastEvent.Value.PathProgress)).X / CatchPlayfield.BASE_WIDTH,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lastTickTime = time;
|
||||
|
||||
if (isLastTick)
|
||||
break;
|
||||
// this also includes LegacyLastTick and this is used for TinyDroplet generation above.
|
||||
// this means that the final segment of TinyDroplets are increasingly mistimed where LegacyLastTickOffset is being applied.
|
||||
lastEvent = e;
|
||||
|
||||
switch (e.Type)
|
||||
{
|
||||
case SliderEventType.Tick:
|
||||
AddNested(new Droplet
|
||||
{
|
||||
StartTime = time,
|
||||
X = X + Path.PositionAt(distanceProgress).X / CatchPlayfield.BASE_WIDTH,
|
||||
Samples = tickSamples
|
||||
Samples = tickSamples,
|
||||
StartTime = e.Time,
|
||||
X = X + Path.PositionAt(e.PathProgress).X / CatchPlayfield.BASE_WIDTH,
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
case SliderEventType.Head:
|
||||
case SliderEventType.Tail:
|
||||
case SliderEventType.Repeat:
|
||||
AddNested(new Fruit
|
||||
{
|
||||
Samples = Samples,
|
||||
StartTime = spanStartTime + spanDuration,
|
||||
X = X + Path.PositionAt(reversed ? 0 : 1).X / CatchPlayfield.BASE_WIDTH
|
||||
StartTime = e.Time,
|
||||
X = X + Path.PositionAt(e.PathProgress).X / CatchPlayfield.BASE_WIDTH,
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using osu.Framework.Input.StateChanges;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Game.Replays;
|
||||
@ -22,10 +23,14 @@ namespace osu.Game.Rulesets.Catch.Replays
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!HasFrames)
|
||||
var frame = CurrentFrame;
|
||||
|
||||
if (frame == null)
|
||||
return null;
|
||||
|
||||
return Interpolation.ValueAt(CurrentTime, CurrentFrame.Position, NextFrame.Position, CurrentFrame.Time, NextFrame.Time);
|
||||
Debug.Assert(CurrentTime != null);
|
||||
|
||||
return NextFrame != null ? Interpolation.ValueAt(CurrentTime.Value, frame.Position, NextFrame.Position, frame.Time, NextFrame.Time) : frame.Position;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,8 +13,8 @@ namespace osu.Game.Rulesets.Catch.Scoring
|
||||
{
|
||||
public class CatchScoreProcessor : ScoreProcessor<CatchHitObject>
|
||||
{
|
||||
public CatchScoreProcessor(RulesetContainer<CatchHitObject> rulesetContainer)
|
||||
: base(rulesetContainer)
|
||||
public CatchScoreProcessor(DrawableRuleset<CatchHitObject> drawableRuleset)
|
||||
: base(drawableRuleset)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,6 @@ using osu.Game.Rulesets.Catch.Objects.Drawable;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.UI.Scrolling;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.UI
|
||||
{
|
||||
@ -20,19 +19,11 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
|
||||
internal readonly CatcherArea CatcherArea;
|
||||
|
||||
public CatchPlayfield(BeatmapDifficulty difficulty, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> getVisualRepresentation)
|
||||
public CatchPlayfield(BeatmapDifficulty difficulty, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> createDrawableRepresentation)
|
||||
{
|
||||
Container explodingFruitContainer;
|
||||
|
||||
Anchor = Anchor.TopCentre;
|
||||
Origin = Anchor.TopCentre;
|
||||
|
||||
Size = new Vector2(0.86f); // matches stable's vertical offset for catcher plate
|
||||
|
||||
InternalChild = new PlayfieldAdjustmentContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
explodingFruitContainer = new Container
|
||||
{
|
||||
@ -40,13 +31,12 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
},
|
||||
CatcherArea = new CatcherArea(difficulty)
|
||||
{
|
||||
GetVisualRepresentation = getVisualRepresentation,
|
||||
CreateDrawableRepresentation = createDrawableRepresentation,
|
||||
ExplodingFruitTarget = explodingFruitContainer,
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.TopLeft,
|
||||
},
|
||||
HitObjectContainer
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -3,17 +3,23 @@
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.UI
|
||||
{
|
||||
public class PlayfieldAdjustmentContainer : Container
|
||||
public class CatchPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer
|
||||
{
|
||||
protected override Container<Drawable> Content => content;
|
||||
private readonly Container content;
|
||||
|
||||
public PlayfieldAdjustmentContainer()
|
||||
public CatchPlayfieldAdjustmentContainer()
|
||||
{
|
||||
Anchor = Anchor.TopCentre;
|
||||
Origin = Anchor.TopCentre;
|
||||
|
||||
Size = new Vector2(0.86f); // matches stable's vertical offset for catcher plate
|
||||
|
||||
InternalChild = new Container
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
|
||||
protected internal readonly Catcher MovableCatcher;
|
||||
|
||||
public Func<CatchHitObject, DrawableHitObject<CatchHitObject>> GetVisualRepresentation;
|
||||
public Func<CatchHitObject, DrawableHitObject<CatchHitObject>> CreateDrawableRepresentation;
|
||||
|
||||
public Container ExplodingFruitTarget
|
||||
{
|
||||
@ -60,12 +60,12 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
if (lastPlateableFruit.IsLoaded)
|
||||
action();
|
||||
else
|
||||
lastPlateableFruit.OnLoadComplete = _ => action();
|
||||
lastPlateableFruit.OnLoadComplete += _ => action();
|
||||
}
|
||||
|
||||
if (result.IsHit && fruit.CanBePlated)
|
||||
{
|
||||
var caughtFruit = (DrawableCatchHitObject)GetVisualRepresentation?.Invoke(fruit.HitObject);
|
||||
var caughtFruit = (DrawableCatchHitObject)CreateDrawableRepresentation?.Invoke(fruit.HitObject);
|
||||
|
||||
if (caughtFruit == null) return;
|
||||
|
||||
|
@ -17,13 +17,13 @@ using osu.Game.Rulesets.UI.Scrolling;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.UI
|
||||
{
|
||||
public class CatchRulesetContainer : ScrollingRulesetContainer<CatchPlayfield, CatchHitObject>
|
||||
public class DrawableCatchRuleset : DrawableScrollingRuleset<CatchHitObject>
|
||||
{
|
||||
protected override ScrollVisualisationMethod VisualisationMethod => ScrollVisualisationMethod.Constant;
|
||||
|
||||
protected override bool UserScrollSpeedAdjustment => false;
|
||||
|
||||
public CatchRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap)
|
||||
public DrawableCatchRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
|
||||
: base(ruleset, beatmap)
|
||||
{
|
||||
Direction.Value = ScrollingDirection.Down;
|
||||
@ -34,11 +34,13 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
|
||||
protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new CatchFramedReplayInputHandler(replay);
|
||||
|
||||
protected override Playfield CreatePlayfield() => new CatchPlayfield(Beatmap.BeatmapInfo.BaseDifficulty, GetVisualRepresentation);
|
||||
protected override Playfield CreatePlayfield() => new CatchPlayfield(Beatmap.BeatmapInfo.BaseDifficulty, CreateDrawableRepresentation);
|
||||
|
||||
public override PassThroughInputManager CreateInputManager() => new CatchInputManager(Ruleset.RulesetInfo);
|
||||
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new CatchPlayfieldAdjustmentContainer();
|
||||
|
||||
public override DrawableHitObject<CatchHitObject> GetVisualRepresentation(CatchHitObject h)
|
||||
protected override PassThroughInputManager CreateInputManager() => new CatchInputManager(Ruleset.RulesetInfo);
|
||||
|
||||
public override DrawableHitObject<CatchHitObject> CreateDrawableRepresentation(CatchHitObject h)
|
||||
{
|
||||
switch (h)
|
||||
{
|
||||
@ -47,9 +49,9 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
case Fruit fruit:
|
||||
return new DrawableFruit(fruit);
|
||||
case JuiceStream stream:
|
||||
return new DrawableJuiceStream(stream, GetVisualRepresentation);
|
||||
return new DrawableJuiceStream(stream, CreateDrawableRepresentation);
|
||||
case BananaShower shower:
|
||||
return new DrawableBananaShower(shower, GetVisualRepresentation);
|
||||
return new DrawableBananaShower(shower, CreateDrawableRepresentation);
|
||||
case TinyDroplet tiny:
|
||||
return new DrawableTinyDroplet(tiny);
|
||||
case Droplet droplet:
|
@ -2,9 +2,9 @@
|
||||
<Import Project="..\osu.TestProject.props" />
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
|
||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="3.12.0" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
|
||||
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Project">
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Mania.Objects;
|
||||
using osu.Game.Rulesets.Mania.UI;
|
||||
|
||||
@ -42,13 +42,13 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
|
||||
{
|
||||
Name = @"Note Count",
|
||||
Content = notes.ToString(),
|
||||
Icon = FontAwesome.fa_circle_o
|
||||
Icon = FontAwesome.Regular.Circle
|
||||
},
|
||||
new BeatmapStatistic
|
||||
{
|
||||
Name = @"Hold Note Count",
|
||||
Content = holdnotes.ToString(),
|
||||
Icon = FontAwesome.fa_circle
|
||||
Icon = FontAwesome.Regular.Circle
|
||||
},
|
||||
};
|
||||
}
|
||||
|
@ -10,11 +10,11 @@ using osu.Game.Rulesets.UI.Scrolling;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Edit
|
||||
{
|
||||
public class ManiaEditRulesetContainer : ManiaRulesetContainer
|
||||
public class DrawableManiaEditRuleset : DrawableManiaRuleset
|
||||
{
|
||||
public new IScrollingInfo ScrollingInfo => base.ScrollingInfo;
|
||||
|
||||
public ManiaEditRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap)
|
||||
public DrawableManiaEditRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
|
||||
: base(ruleset, beatmap)
|
||||
{
|
||||
}
|
@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Mania.Edit
|
||||
[Cached(Type = typeof(IManiaHitObjectComposer))]
|
||||
public class ManiaHitObjectComposer : HitObjectComposer<ManiaHitObject>, IManiaHitObjectComposer
|
||||
{
|
||||
protected new ManiaEditRulesetContainer RulesetContainer { get; private set; }
|
||||
protected new DrawableManiaEditRuleset DrawableRuleset { get; private set; }
|
||||
|
||||
public ManiaHitObjectComposer(Ruleset ruleset)
|
||||
: base(ruleset)
|
||||
@ -32,23 +32,23 @@ namespace osu.Game.Rulesets.Mania.Edit
|
||||
/// </summary>
|
||||
/// <param name="screenSpacePosition">The screen-space position.</param>
|
||||
/// <returns>The column which intersects with <paramref name="screenSpacePosition"/>.</returns>
|
||||
public Column ColumnAt(Vector2 screenSpacePosition) => RulesetContainer.GetColumnByPosition(screenSpacePosition);
|
||||
public Column ColumnAt(Vector2 screenSpacePosition) => DrawableRuleset.GetColumnByPosition(screenSpacePosition);
|
||||
|
||||
private DependencyContainer dependencies;
|
||||
|
||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||
=> dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
||||
|
||||
public int TotalColumns => ((ManiaPlayfield)RulesetContainer.Playfield).TotalColumns;
|
||||
public int TotalColumns => ((ManiaPlayfield)DrawableRuleset.Playfield).TotalColumns;
|
||||
|
||||
protected override RulesetContainer<ManiaHitObject> CreateRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap)
|
||||
protected override DrawableRuleset<ManiaHitObject> CreateDrawableRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
|
||||
{
|
||||
RulesetContainer = new ManiaEditRulesetContainer(ruleset, beatmap);
|
||||
DrawableRuleset = new DrawableManiaEditRuleset(ruleset, beatmap);
|
||||
|
||||
// This is the earliest we can cache the scrolling info to ourselves, before masks are added to the hierarchy and inject it
|
||||
dependencies.CacheAs(RulesetContainer.ScrollingInfo);
|
||||
dependencies.CacheAs(DrawableRuleset.ScrollingInfo);
|
||||
|
||||
return RulesetContainer;
|
||||
return DrawableRuleset;
|
||||
}
|
||||
|
||||
protected override IReadOnlyList<HitObjectCompositionTool> CompositionTools => new HitObjectCompositionTool[]
|
||||
|
@ -10,6 +10,7 @@ using osu.Game.Rulesets.UI;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Mania.Objects;
|
||||
@ -31,7 +32,7 @@ namespace osu.Game.Rulesets.Mania
|
||||
{
|
||||
public class ManiaRuleset : Ruleset
|
||||
{
|
||||
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap) => new ManiaRulesetContainer(this, beatmap);
|
||||
public override DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap) => new DrawableManiaRuleset(this, beatmap);
|
||||
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new ManiaBeatmapConverter(beatmap);
|
||||
public override PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, ScoreInfo score) => new ManiaPerformanceCalculator(this, beatmap, score);
|
||||
|
||||
@ -160,7 +161,7 @@ namespace osu.Game.Rulesets.Mania
|
||||
|
||||
public override string ShortName => "mania";
|
||||
|
||||
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_mania_o };
|
||||
public override Drawable CreateIcon() => new SpriteIcon { Icon = OsuIcon.RulesetMania };
|
||||
|
||||
public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new ManiaDifficultyCalculator(this, beatmap);
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Mania.Objects;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
@ -12,7 +13,7 @@ namespace osu.Game.Rulesets.Mania.Mods
|
||||
{
|
||||
public override string Name => "Fade In";
|
||||
public override string Acronym => "FI";
|
||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden;
|
||||
public override IconUsage Icon => OsuIcon.ModHidden;
|
||||
public override ModType Type => ModType.DifficultyIncrease;
|
||||
public override string Description => @"Keys appear out of nowhere!";
|
||||
public override double ScoreMultiplier => 1;
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
using System.Linq;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
@ -17,7 +18,7 @@ namespace osu.Game.Rulesets.Mania.Mods
|
||||
public override string Name => "Random";
|
||||
public override string Acronym => "RD";
|
||||
public override ModType Type => ModType.Conversion;
|
||||
public override FontAwesome Icon => FontAwesome.fa_osu_dice;
|
||||
public override IconUsage Icon => OsuIcon.Dice;
|
||||
public override string Description => @"Shuffle around the keys!";
|
||||
public override double ScoreMultiplier => 1;
|
||||
|
||||
|
@ -43,7 +43,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
AddRangeInternal(new Drawable[]
|
||||
{
|
||||
bodyPiece = new BodyPiece
|
||||
{
|
||||
@ -67,7 +67,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
foreach (var tick in tickContainer)
|
||||
AddNested(tick);
|
||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Size = new Vector2(1);
|
||||
|
||||
InternalChildren = new[]
|
||||
AddRangeInternal(new[]
|
||||
{
|
||||
glowContainer = new CircularContainer
|
||||
{
|
||||
@ -51,7 +51,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
public override Color4 AccentColour
|
||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
CornerRadius = 5;
|
||||
Masking = true;
|
||||
|
||||
InternalChild = headPiece = new NotePiece();
|
||||
AddInternal(headPiece = new NotePiece());
|
||||
}
|
||||
|
||||
protected override void OnDirectionChanged(ValueChangedEvent<ScrollingDirection> e)
|
||||
|
@ -18,6 +18,6 @@ namespace osu.Game.Rulesets.Mania.Replays
|
||||
|
||||
protected override bool IsImportant(ManiaReplayFrame frame) => frame.Actions.Any();
|
||||
|
||||
public override List<IInput> GetPendingInputs() => new List<IInput> { new ReplayState<ManiaAction> { PressedActions = CurrentFrame.Actions } };
|
||||
public override List<IInput> GetPendingInputs() => new List<IInput> { new ReplayState<ManiaAction> { PressedActions = CurrentFrame?.Actions ?? new List<ManiaAction>() } };
|
||||
}
|
||||
}
|
||||
|
@ -92,8 +92,8 @@ namespace osu.Game.Rulesets.Mania.Scoring
|
||||
{
|
||||
}
|
||||
|
||||
public ManiaScoreProcessor(RulesetContainer<ManiaHitObject> rulesetContainer)
|
||||
: base(rulesetContainer)
|
||||
public ManiaScoreProcessor(DrawableRuleset<ManiaHitObject> drawableRuleset)
|
||||
: base(drawableRuleset)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -22,22 +22,15 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
JudgementText.Font = JudgementText.Font.With(size: 25);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
protected override double FadeInDuration => 50;
|
||||
|
||||
this.FadeInFromZero(50, Easing.OutQuint);
|
||||
|
||||
if (Result.IsHit)
|
||||
protected override void ApplyHitAnimations()
|
||||
{
|
||||
JudgementBody.ScaleTo(0.8f);
|
||||
JudgementBody.ScaleTo(1, 250, Easing.OutElastic);
|
||||
|
||||
JudgementBody.Delay(50).ScaleTo(0.75f, 250);
|
||||
this.Delay(50).FadeOut(200);
|
||||
}
|
||||
|
||||
Expire();
|
||||
JudgementBody.Delay(FadeInDuration).ScaleTo(0.75f, 250);
|
||||
this.Delay(FadeInDuration).FadeOut(200);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Game.Beatmaps;
|
||||
@ -28,8 +27,10 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.UI
|
||||
{
|
||||
public class ManiaRulesetContainer : ScrollingRulesetContainer<ManiaPlayfield, ManiaHitObject>
|
||||
public class DrawableManiaRuleset : DrawableScrollingRuleset<ManiaHitObject>
|
||||
{
|
||||
protected new ManiaPlayfield Playfield => (ManiaPlayfield)base.Playfield;
|
||||
|
||||
public new ManiaBeatmap Beatmap => (ManiaBeatmap)base.Beatmap;
|
||||
|
||||
public IEnumerable<BarLine> BarLines;
|
||||
@ -38,7 +39,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
|
||||
private readonly Bindable<ManiaScrollingDirection> configDirection = new Bindable<ManiaScrollingDirection>();
|
||||
|
||||
public ManiaRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap)
|
||||
public DrawableManiaRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
|
||||
: base(ruleset, beatmap)
|
||||
{
|
||||
// Generate the bar lines
|
||||
@ -87,19 +88,17 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
/// <returns>The column which intersects with <paramref name="screenSpacePosition"/>.</returns>
|
||||
public Column GetColumnByPosition(Vector2 screenSpacePosition) => Playfield.GetColumnByPosition(screenSpacePosition);
|
||||
|
||||
protected override Playfield CreatePlayfield() => new ManiaPlayfield(Beatmap.Stages)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
};
|
||||
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new ManiaPlayfieldAdjustmentContainer();
|
||||
|
||||
protected override Playfield CreatePlayfield() => new ManiaPlayfield(Beatmap.Stages);
|
||||
|
||||
public override ScoreProcessor CreateScoreProcessor() => new ManiaScoreProcessor(this);
|
||||
|
||||
public override int Variant => (int)(Beatmap.Stages.Count == 1 ? PlayfieldType.Single : PlayfieldType.Dual) + Beatmap.TotalColumns;
|
||||
|
||||
public override PassThroughInputManager CreateInputManager() => new ManiaInputManager(Ruleset.RulesetInfo, Variant);
|
||||
protected override PassThroughInputManager CreateInputManager() => new ManiaInputManager(Ruleset.RulesetInfo, Variant);
|
||||
|
||||
public override DrawableHitObject<ManiaHitObject> GetVisualRepresentation(ManiaHitObject h)
|
||||
public override DrawableHitObject<ManiaHitObject> CreateDrawableRepresentation(ManiaHitObject h)
|
||||
{
|
||||
switch (h)
|
||||
{
|
@ -28,8 +28,6 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
if (stageDefinitions.Count <= 0)
|
||||
throw new ArgumentException("Can't have zero or fewer stages.");
|
||||
|
||||
Size = new Vector2(1, 0.8f);
|
||||
|
||||
GridContainer playfieldGrid;
|
||||
AddInternal(playfieldGrid = new GridContainer
|
||||
{
|
||||
|
@ -0,0 +1,20 @@
|
||||
// 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 osu.Framework.Graphics;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.UI
|
||||
{
|
||||
public class ManiaPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer
|
||||
{
|
||||
public ManiaPlayfieldAdjustmentContainer()
|
||||
{
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
Size = new Vector2(1, 0.8f);
|
||||
}
|
||||
}
|
||||
}
|
@ -9,6 +9,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Game.Graphics.Cursor;
|
||||
using osu.Game.Rulesets.Osu.UI.Cursor;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Tests.Visual;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Tests
|
||||
@ -27,7 +28,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Add(cursorContainer = new GameplayCursorContainer { RelativeSizeAxes = Axes.Both });
|
||||
Add(cursorContainer = new OsuCursorContainer { RelativeSizeAxes = Axes.Both });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,12 +4,13 @@
|
||||
using NUnit.Framework;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Tests.Visual;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestCaseHitCircleLongCombo : Game.Tests.Visual.TestCasePlayer
|
||||
public class TestCaseHitCircleLongCombo : PlayerTestCase
|
||||
{
|
||||
public TestCaseHitCircleLongCombo()
|
||||
: base(new OsuRuleset())
|
||||
|
17
osu.Game.Rulesets.Osu.Tests/TestCaseOsuPlayer.cs
Normal file
17
osu.Game.Rulesets.Osu.Tests/TestCaseOsuPlayer.cs
Normal file
@ -0,0 +1,17 @@
|
||||
// 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.Game.Tests.Visual;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestCaseOsuPlayer : PlayerTestCase
|
||||
{
|
||||
public TestCaseOsuPlayer()
|
||||
: base(new OsuRuleset())
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
70
osu.Game.Rulesets.Osu.Tests/TestCaseResumeOverlay.cs
Normal file
70
osu.Game.Rulesets.Osu.Tests/TestCaseResumeOverlay.cs
Normal file
@ -0,0 +1,70 @@
|
||||
// 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 System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Game.Rulesets.Osu.UI;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Tests.Visual;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Tests
|
||||
{
|
||||
public class TestCaseResumeOverlay : ManualInputManagerTestCase
|
||||
{
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||
{
|
||||
typeof(OsuResumeOverlay),
|
||||
};
|
||||
|
||||
public TestCaseResumeOverlay()
|
||||
{
|
||||
ManualOsuInputManager osuInputManager;
|
||||
CursorContainer cursor;
|
||||
ResumeOverlay resume;
|
||||
|
||||
bool resumeFired = false;
|
||||
|
||||
Child = osuInputManager = new ManualOsuInputManager(new OsuRuleset().RulesetInfo)
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
cursor = new CursorContainer(),
|
||||
resume = new OsuResumeOverlay
|
||||
{
|
||||
GameplayCursor = cursor
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
resume.ResumeAction = () => resumeFired = true;
|
||||
|
||||
AddStep("move mouse to center", () => InputManager.MoveMouseTo(ScreenSpaceDrawQuad.Centre));
|
||||
AddStep("show", () => resume.Show());
|
||||
|
||||
AddStep("move mouse away", () => InputManager.MoveMouseTo(ScreenSpaceDrawQuad.TopLeft));
|
||||
AddStep("click", () => osuInputManager.GameClick());
|
||||
AddAssert("not dismissed", () => !resumeFired && resume.State == Visibility.Visible);
|
||||
|
||||
AddStep("move mouse back", () => InputManager.MoveMouseTo(ScreenSpaceDrawQuad.Centre));
|
||||
AddStep("click", () => osuInputManager.GameClick());
|
||||
AddAssert("dismissed", () => resumeFired && resume.State == Visibility.Hidden);
|
||||
}
|
||||
|
||||
private class ManualOsuInputManager : OsuInputManager
|
||||
{
|
||||
public ManualOsuInputManager(RulesetInfo ruleset)
|
||||
: base(ruleset)
|
||||
{
|
||||
}
|
||||
|
||||
public void GameClick()
|
||||
{
|
||||
KeyBindingContainer.TriggerPressed(OsuAction.LeftButton);
|
||||
KeyBindingContainer.TriggerReleased(OsuAction.LeftButton);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -297,11 +297,6 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
|
||||
private void performTest(List<ReplayFrame> frames)
|
||||
{
|
||||
// Empty frame to be added as a workaround for first frame behavior.
|
||||
// If an input exists on the first frame, the input would apply to the entire intro lead-in
|
||||
// Likely requires some discussion regarding how first frame inputs should be handled.
|
||||
frames.Insert(0, new OsuReplayFrame());
|
||||
|
||||
AddStep("load player", () =>
|
||||
{
|
||||
Beatmap.Value = new TestWorkingBeatmap(new Beatmap<OsuHitObject>
|
||||
@ -330,12 +325,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
},
|
||||
}, Clock);
|
||||
|
||||
var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } })
|
||||
{
|
||||
AllowPause = false,
|
||||
AllowLeadIn = false,
|
||||
AllowResults = false
|
||||
};
|
||||
var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } });
|
||||
|
||||
p.OnLoadComplete += _ =>
|
||||
{
|
||||
@ -354,9 +344,9 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
judgementResults = new List<JudgementResult>();
|
||||
});
|
||||
|
||||
AddUntilStep(() => Beatmap.Value.Track.CurrentTime == 0, "Beatmap at 0");
|
||||
AddUntilStep(() => currentPlayer.IsCurrentScreen(), "Wait until player is loaded");
|
||||
AddUntilStep(() => allJudgedFired, "Wait for all judged");
|
||||
AddUntilStep("Beatmap at 0", () => Beatmap.Value.Track.CurrentTime == 0);
|
||||
AddUntilStep("Wait until player is loaded", () => currentPlayer.IsCurrentScreen());
|
||||
AddUntilStep("Wait for all judged", () => allJudgedFired);
|
||||
}
|
||||
|
||||
private class ScoreAccessibleReplayPlayer : ReplayPlayer
|
||||
@ -364,7 +354,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
public new ScoreProcessor ScoreProcessor => base.ScoreProcessor;
|
||||
|
||||
public ScoreAccessibleReplayPlayer(Score score)
|
||||
: base(score)
|
||||
: base(score, false, false)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +2,9 @@
|
||||
<Import Project="..\osu.TestProject.props" />
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
|
||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="3.12.0" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
|
||||
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Project">
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Beatmaps
|
||||
@ -23,19 +23,19 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
||||
{
|
||||
Name = @"Circle Count",
|
||||
Content = circles.ToString(),
|
||||
Icon = FontAwesome.fa_circle_o
|
||||
Icon = FontAwesome.Regular.Circle
|
||||
},
|
||||
new BeatmapStatistic
|
||||
{
|
||||
Name = @"Slider Count",
|
||||
Content = sliders.ToString(),
|
||||
Icon = FontAwesome.fa_circle
|
||||
Icon = FontAwesome.Regular.Circle
|
||||
},
|
||||
new BeatmapStatistic
|
||||
{
|
||||
Name = @"Spinner Count",
|
||||
Content = spinners.ToString(),
|
||||
Icon = FontAwesome.fa_circle
|
||||
Icon = FontAwesome.Regular.Circle
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -8,21 +8,20 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Edit
|
||||
{
|
||||
public class OsuEditRulesetContainer : OsuRulesetContainer
|
||||
public class DrawableOsuEditRuleset : DrawableOsuRuleset
|
||||
{
|
||||
public OsuEditRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap)
|
||||
public DrawableOsuEditRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
|
||||
: base(ruleset, beatmap)
|
||||
{
|
||||
}
|
||||
|
||||
protected override Playfield CreatePlayfield() => new OsuPlayfieldNoCursor { Size = Vector2.One };
|
||||
protected override Playfield CreatePlayfield() => new OsuPlayfieldNoCursor();
|
||||
|
||||
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new OsuPlayfieldAdjustmentContainer { Size = Vector2.One };
|
||||
|
||||
private class OsuPlayfieldNoCursor : OsuPlayfield
|
||||
{
|
||||
public OsuPlayfieldNoCursor()
|
||||
{
|
||||
Cursor?.Expire();
|
||||
}
|
||||
protected override GameplayCursorContainer CreateCursor() => null;
|
||||
}
|
||||
}
|
||||
}
|
@ -2,8 +2,6 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
using osu.Game.Rulesets.Edit.Tools;
|
||||
@ -13,7 +11,6 @@ using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders;
|
||||
using osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Osu.UI;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Screens.Edit.Compose.Components;
|
||||
|
||||
@ -26,8 +23,8 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
{
|
||||
}
|
||||
|
||||
protected override RulesetContainer<OsuHitObject> CreateRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap)
|
||||
=> new OsuEditRulesetContainer(ruleset, beatmap);
|
||||
protected override DrawableRuleset<OsuHitObject> CreateDrawableRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
|
||||
=> new DrawableOsuEditRuleset(ruleset, beatmap);
|
||||
|
||||
protected override IReadOnlyList<HitObjectCompositionTool> CompositionTools => new HitObjectCompositionTool[]
|
||||
{
|
||||
@ -38,8 +35,6 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
|
||||
public override SelectionHandler CreateSelectionHandler() => new OsuSelectionHandler();
|
||||
|
||||
protected override Container CreateLayerContainer() => new PlayfieldAdjustmentContainer { RelativeSizeAxes = Axes.Both };
|
||||
|
||||
public override SelectionBlueprint CreateBlueprintFor(DrawableHitObject hitObject)
|
||||
{
|
||||
switch (hitObject)
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
|
||||
@ -11,7 +12,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
public override string Name => "Autopilot";
|
||||
public override string Acronym => "AP";
|
||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_autopilot;
|
||||
public override IconUsage Icon => OsuIcon.ModAutopilot;
|
||||
public override ModType Type => ModType.Automation;
|
||||
public override string Description => @"Automatic cursor movement - just follow the rhythm.";
|
||||
public override double ScoreMultiplier => 1;
|
||||
|
@ -8,7 +8,6 @@ using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
@ -18,13 +17,13 @@ using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
public class OsuModBlinds : Mod, IApplicableToRulesetContainer<OsuHitObject>, IApplicableToScoreProcessor
|
||||
public class OsuModBlinds : Mod, IApplicableToDrawableRuleset<OsuHitObject>, IApplicableToScoreProcessor
|
||||
{
|
||||
public override string Name => "Blinds";
|
||||
public override string Description => "Play with blinds on your screen.";
|
||||
public override string Acronym => "BL";
|
||||
|
||||
public override FontAwesome Icon => FontAwesome.fa_adjust;
|
||||
public override IconUsage Icon => FontAwesome.Solid.Adjust;
|
||||
public override ModType Type => ModType.DifficultyIncrease;
|
||||
|
||||
public override bool Ranked => false;
|
||||
@ -32,9 +31,9 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
public override double ScoreMultiplier => 1.12;
|
||||
private DrawableOsuBlinds blinds;
|
||||
|
||||
public void ApplyToRulesetContainer(RulesetContainer<OsuHitObject> rulesetContainer)
|
||||
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
|
||||
{
|
||||
rulesetContainer.Overlays.Add(blinds = new DrawableOsuBlinds(rulesetContainer.Playfield.HitObjectContainer, rulesetContainer.Beatmap));
|
||||
drawableRuleset.Overlays.Add(blinds = new DrawableOsuBlinds(drawableRuleset.Playfield.HitObjectContainer, drawableRuleset.Beatmap));
|
||||
}
|
||||
|
||||
public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
|
||||
public override string Acronym => "GR";
|
||||
|
||||
public override FontAwesome Icon => FontAwesome.fa_arrows_v;
|
||||
public override IconUsage Icon => FontAwesome.Solid.ArrowsAltV;
|
||||
|
||||
public override ModType Type => ModType.Fun;
|
||||
|
||||
|
@ -13,7 +13,7 @@ using static osu.Game.Input.Handlers.ReplayInputHandler;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
public class OsuModRelax : ModRelax, IApplicableFailOverride, IUpdatableByPlayfield, IApplicableToRulesetContainer<OsuHitObject>
|
||||
public class OsuModRelax : ModRelax, IApplicableFailOverride, IUpdatableByPlayfield, IApplicableToDrawableRuleset<OsuHitObject>
|
||||
{
|
||||
public override string Description => @"You don't need to click. Give your clicking/tapping fingers a break from the heat of things.";
|
||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModAutopilot)).ToArray();
|
||||
@ -79,10 +79,10 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
state.Apply(osuInputManager.CurrentState, osuInputManager);
|
||||
}
|
||||
|
||||
public void ApplyToRulesetContainer(RulesetContainer<OsuHitObject> rulesetContainer)
|
||||
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
|
||||
{
|
||||
// grab the input manager for future use.
|
||||
osuInputManager = (OsuInputManager)rulesetContainer.KeyBindingInputManager;
|
||||
osuInputManager = (OsuInputManager)drawableRuleset.KeyBindingInputManager;
|
||||
osuInputManager.AllowUserPresses = false;
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
|
||||
@ -11,7 +12,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
public override string Name => "Spun Out";
|
||||
public override string Acronym => "SO";
|
||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_spunout;
|
||||
public override IconUsage Icon => OsuIcon.ModSpunout;
|
||||
public override ModType Type => ModType.DifficultyReduction;
|
||||
public override string Description => @"Spinners will be automatically completed.";
|
||||
public override double ScoreMultiplier => 0.9;
|
||||
|
@ -1,6 +1,7 @@
|
||||
// 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 osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
|
||||
@ -11,7 +12,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
public override string Name => "Target";
|
||||
public override string Acronym => "TP";
|
||||
public override ModType Type => ModType.Conversion;
|
||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_target;
|
||||
public override IconUsage Icon => OsuIcon.ModTarget;
|
||||
public override string Description => @"Practice keeping up with the beat of the song.";
|
||||
public override double ScoreMultiplier => 1;
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
public override string Name => "Transform";
|
||||
public override string Acronym => "TR";
|
||||
public override FontAwesome Icon => FontAwesome.fa_arrows;
|
||||
public override IconUsage Icon => FontAwesome.Solid.ArrowsAlt;
|
||||
public override ModType Type => ModType.Fun;
|
||||
public override string Description => "Everything rotates. EVERYTHING.";
|
||||
public override double ScoreMultiplier => 1;
|
||||
|
@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
public override string Name => "Wiggle";
|
||||
public override string Acronym => "WG";
|
||||
public override FontAwesome Icon => FontAwesome.fa_certificate;
|
||||
public override IconUsage Icon => FontAwesome.Solid.Certificate;
|
||||
public override ModType Type => ModType.Fun;
|
||||
public override string Description => "They just won't stay still...";
|
||||
public override double ScoreMultiplier => 1;
|
||||
|
@ -5,7 +5,6 @@ using osu.Framework.Graphics;
|
||||
using osuTK;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
{
|
||||
@ -16,12 +15,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
{
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
protected override void ApplyHitAnimations()
|
||||
{
|
||||
if (Result.Type != HitResult.Miss)
|
||||
JudgementText?.TransformSpacingTo(new Vector2(14, 0), 1800, Easing.OutQuint);
|
||||
|
||||
base.LoadComplete();
|
||||
base.ApplyHitAnimations();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,10 +4,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osuTK;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Skinning;
|
||||
|
||||
@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
new SkinnableDrawable("Play/osu/reversearrow", _ => new SpriteIcon
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Icon = FontAwesome.fa_chevron_right
|
||||
Icon = FontAwesome.Solid.ChevronRight
|
||||
}, restrictSize: false)
|
||||
};
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ using osu.Game.Graphics;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Screens.Ranking;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
@ -76,7 +77,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(48),
|
||||
Icon = FontAwesome.fa_asterisk,
|
||||
Icon = FontAwesome.Solid.Asterisk,
|
||||
Shadow = false,
|
||||
},
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ using System.Linq;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osuTK.Graphics;
|
||||
@ -14,7 +15,7 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
{
|
||||
public class SliderBall : CircularContainer, ISliderProgress
|
||||
public class SliderBall : CircularContainer, ISliderProgress, IRequireHighFrequencyMousePosition
|
||||
{
|
||||
private const float width = 128;
|
||||
|
||||
@ -107,18 +108,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
|
||||
private Vector2? lastScreenSpaceMousePosition;
|
||||
|
||||
protected override bool OnMouseDown(MouseDownEvent e)
|
||||
{
|
||||
lastScreenSpaceMousePosition = e.ScreenSpaceMousePosition;
|
||||
return base.OnMouseDown(e);
|
||||
}
|
||||
|
||||
protected override bool OnMouseUp(MouseUpEvent e)
|
||||
{
|
||||
lastScreenSpaceMousePosition = e.ScreenSpaceMousePosition;
|
||||
return base.OnMouseUp(e);
|
||||
}
|
||||
|
||||
protected override bool OnMouseMove(MouseMoveEvent e)
|
||||
{
|
||||
lastScreenSpaceMousePosition = e.ScreenSpaceMousePosition;
|
||||
@ -132,6 +121,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
base.ClearTransformsAfter(time, false, targetMember);
|
||||
}
|
||||
|
||||
public override void ApplyTransformsAt(double time, bool propagateChildren = false)
|
||||
{
|
||||
// For the same reasons as above w.r.t rewinding, we shouldn't propagate to children here either.
|
||||
base.ApplyTransformsAt(time, false);
|
||||
}
|
||||
|
||||
private bool tracking;
|
||||
|
||||
public bool Tracking
|
||||
|
@ -1,7 +1,6 @@
|
||||
// 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 System;
|
||||
using osuTK;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using System.Collections.Generic;
|
||||
@ -155,66 +154,9 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
{
|
||||
base.CreateNestedHitObjects();
|
||||
|
||||
createSliderEnds();
|
||||
createTicks();
|
||||
createRepeatPoints();
|
||||
|
||||
if (LegacyLastTickOffset != null)
|
||||
TailCircle.StartTime = Math.Max(StartTime + Duration / 2, TailCircle.StartTime - LegacyLastTickOffset.Value);
|
||||
}
|
||||
|
||||
private void createSliderEnds()
|
||||
foreach (var e in
|
||||
SliderEventGenerator.Generate(StartTime, SpanDuration, Velocity, TickDistance, Path.Distance, this.SpanCount(), LegacyLastTickOffset))
|
||||
{
|
||||
HeadCircle = new SliderCircle
|
||||
{
|
||||
StartTime = StartTime,
|
||||
Position = Position,
|
||||
Samples = getNodeSamples(0),
|
||||
SampleControlPoint = SampleControlPoint,
|
||||
IndexInCurrentCombo = IndexInCurrentCombo,
|
||||
ComboIndex = ComboIndex,
|
||||
};
|
||||
|
||||
TailCircle = new SliderTailCircle(this)
|
||||
{
|
||||
StartTime = EndTime,
|
||||
Position = EndPosition,
|
||||
IndexInCurrentCombo = IndexInCurrentCombo,
|
||||
ComboIndex = ComboIndex,
|
||||
};
|
||||
|
||||
AddNested(HeadCircle);
|
||||
AddNested(TailCircle);
|
||||
}
|
||||
|
||||
private void createTicks()
|
||||
{
|
||||
// A very lenient maximum length of a slider for ticks to be generated.
|
||||
// This exists for edge cases such as /b/1573664 where the beatmap has been edited by the user, and should never be reached in normal usage.
|
||||
const double max_length = 100000;
|
||||
|
||||
var length = Math.Min(max_length, Path.Distance);
|
||||
var tickDistance = MathHelper.Clamp(TickDistance, 0, length);
|
||||
|
||||
if (tickDistance == 0) return;
|
||||
|
||||
var minDistanceFromEnd = Velocity * 10;
|
||||
|
||||
var spanCount = this.SpanCount();
|
||||
|
||||
for (var span = 0; span < spanCount; span++)
|
||||
{
|
||||
var spanStartTime = StartTime + span * SpanDuration;
|
||||
var reversed = span % 2 == 1;
|
||||
|
||||
for (var d = tickDistance; d <= length; d += tickDistance)
|
||||
{
|
||||
if (d > length - minDistanceFromEnd)
|
||||
break;
|
||||
|
||||
var distanceProgress = d / length;
|
||||
var timeProgress = reversed ? 1 - distanceProgress : distanceProgress;
|
||||
|
||||
var firstSample = Samples.Find(s => s.Name == SampleInfo.HIT_NORMAL)
|
||||
?? Samples.FirstOrDefault(); // TODO: remove this when guaranteed sort is present for samples (https://github.com/ppy/osu/issues/1933)
|
||||
var sampleList = new List<SampleInfo>();
|
||||
@ -227,44 +169,61 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
Name = @"slidertick",
|
||||
});
|
||||
|
||||
switch (e.Type)
|
||||
{
|
||||
case SliderEventType.Tick:
|
||||
AddNested(new SliderTick
|
||||
{
|
||||
SpanIndex = span,
|
||||
SpanStartTime = spanStartTime,
|
||||
StartTime = spanStartTime + timeProgress * SpanDuration,
|
||||
Position = Position + Path.PositionAt(distanceProgress),
|
||||
SpanIndex = e.SpanIndex,
|
||||
SpanStartTime = e.SpanStartTime,
|
||||
StartTime = e.Time,
|
||||
Position = Position + Path.PositionAt(e.PathProgress),
|
||||
StackHeight = StackHeight,
|
||||
Scale = Scale,
|
||||
Samples = sampleList
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void createRepeatPoints()
|
||||
break;
|
||||
case SliderEventType.Head:
|
||||
AddNested(HeadCircle = new SliderCircle
|
||||
{
|
||||
for (int repeatIndex = 0, repeat = 1; repeatIndex < RepeatCount; repeatIndex++, repeat++)
|
||||
StartTime = e.Time,
|
||||
Position = Position,
|
||||
Samples = getNodeSamples(0),
|
||||
SampleControlPoint = SampleControlPoint,
|
||||
IndexInCurrentCombo = IndexInCurrentCombo,
|
||||
ComboIndex = ComboIndex,
|
||||
});
|
||||
break;
|
||||
case SliderEventType.LegacyLastTick:
|
||||
// we need to use the LegacyLastTick here for compatibility reasons (difficulty).
|
||||
// it is *okay* to use this because the TailCircle is not used for any meaningful purpose in gameplay.
|
||||
// if this is to change, we should revisit this.
|
||||
AddNested(TailCircle = new SliderTailCircle(this)
|
||||
{
|
||||
StartTime = e.Time,
|
||||
Position = EndPosition,
|
||||
IndexInCurrentCombo = IndexInCurrentCombo,
|
||||
ComboIndex = ComboIndex,
|
||||
});
|
||||
break;
|
||||
case SliderEventType.Repeat:
|
||||
AddNested(new RepeatPoint
|
||||
{
|
||||
RepeatIndex = repeatIndex,
|
||||
RepeatIndex = e.SpanIndex,
|
||||
SpanDuration = SpanDuration,
|
||||
StartTime = StartTime + repeat * SpanDuration,
|
||||
Position = Position + Path.PositionAt(repeat % 2),
|
||||
StartTime = StartTime + (e.SpanIndex + 1) * SpanDuration,
|
||||
Position = Position + Path.PositionAt(e.PathProgress),
|
||||
StackHeight = StackHeight,
|
||||
Scale = Scale,
|
||||
Samples = getNodeSamples(1 + repeatIndex)
|
||||
Samples = getNodeSamples(e.SpanIndex + 1)
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<SampleInfo> getNodeSamples(int nodeIndex)
|
||||
{
|
||||
if (nodeIndex < NodeSamples.Count)
|
||||
return NodeSamples[nodeIndex];
|
||||
|
||||
return Samples;
|
||||
}
|
||||
private List<SampleInfo> getNodeSamples(int nodeIndex) =>
|
||||
nodeIndex < NodeSamples.Count ? NodeSamples[nodeIndex] : Samples;
|
||||
|
||||
public override Judgement CreateJudgement() => new OsuJudgement();
|
||||
}
|
||||
|
@ -8,6 +8,10 @@ using osu.Game.Rulesets.Osu.Judgements;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Objects
|
||||
{
|
||||
/// <summary>
|
||||
/// Note that this should not be used for timing correctness.
|
||||
/// See <see cref="SliderEventType.LegacyLastTick"/> usage in <see cref="Slider"/> for more information.
|
||||
/// </summary>
|
||||
public class SliderTailCircle : SliderCircle
|
||||
{
|
||||
private readonly IBindable<SliderPath> pathBindable = new Bindable<SliderPath>();
|
||||
|
@ -9,6 +9,7 @@ using osu.Game.Rulesets.Osu.UI;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Overlays.Settings;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Game.Rulesets.Osu.Edit;
|
||||
@ -29,7 +30,7 @@ namespace osu.Game.Rulesets.Osu
|
||||
{
|
||||
public class OsuRuleset : Ruleset
|
||||
{
|
||||
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap) => new OsuRulesetContainer(this, beatmap);
|
||||
public override DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap) => new DrawableOsuRuleset(this, beatmap);
|
||||
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new OsuBeatmapConverter(beatmap);
|
||||
public override IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => new OsuBeatmapProcessor(beatmap);
|
||||
|
||||
@ -137,7 +138,7 @@ namespace osu.Game.Rulesets.Osu
|
||||
}
|
||||
}
|
||||
|
||||
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_osu_o };
|
||||
public override Drawable CreateIcon() => new SpriteIcon { Icon = OsuIcon.RulesetOsu };
|
||||
|
||||
public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new OsuDifficultyCalculator(this, beatmap);
|
||||
|
||||
|
@ -292,7 +292,6 @@ namespace osu.Game.Rulesets.Osu.Replays
|
||||
{
|
||||
// We add intermediate frames for spinning / following a slider here.
|
||||
case Spinner spinner:
|
||||
{
|
||||
Vector2 difference = startPosition - SPINNER_CENTRE;
|
||||
|
||||
float radius = difference.Length;
|
||||
@ -315,9 +314,7 @@ namespace osu.Game.Rulesets.Osu.Replays
|
||||
|
||||
endFrame.Position = endPosition;
|
||||
break;
|
||||
}
|
||||
case Slider slider:
|
||||
{
|
||||
for (double j = FrameDelay; j < slider.Duration; j += FrameDelay)
|
||||
{
|
||||
Vector2 pos = slider.StackedPositionAt(j / slider.Duration);
|
||||
@ -327,7 +324,6 @@ namespace osu.Game.Rulesets.Osu.Replays
|
||||
AddFrameToReplay(new OsuReplayFrame(slider.EndTime, new Vector2(slider.StackedEndPosition.X, slider.StackedEndPosition.Y), action));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// We only want to let go of our button if we are at the end of the current replay. Otherwise something is still going on after us so we need to keep the button pressed!
|
||||
if (Frames[Frames.Count - 1].Time <= endFrame.Time)
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using osu.Framework.Input.StateChanges;
|
||||
using osu.Framework.MathUtils;
|
||||
@ -24,10 +25,14 @@ namespace osu.Game.Rulesets.Osu.Replays
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!HasFrames)
|
||||
var frame = CurrentFrame;
|
||||
|
||||
if (frame == null)
|
||||
return null;
|
||||
|
||||
return Interpolation.ValueAt(CurrentTime, CurrentFrame.Position, NextFrame.Position, CurrentFrame.Time, NextFrame.Time);
|
||||
Debug.Assert(CurrentTime != null);
|
||||
|
||||
return NextFrame != null ? Interpolation.ValueAt(CurrentTime.Value, frame.Position, NextFrame.Position, frame.Time, NextFrame.Time) : frame.Position;
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,7 +46,7 @@ namespace osu.Game.Rulesets.Osu.Replays
|
||||
},
|
||||
new ReplayState<OsuAction>
|
||||
{
|
||||
PressedActions = CurrentFrame.Actions
|
||||
PressedActions = CurrentFrame?.Actions ?? new List<OsuAction>()
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -15,8 +15,8 @@ namespace osu.Game.Rulesets.Osu.Scoring
|
||||
{
|
||||
internal class OsuScoreProcessor : ScoreProcessor<OsuHitObject>
|
||||
{
|
||||
public OsuScoreProcessor(RulesetContainer<OsuHitObject> rulesetContainer)
|
||||
: base(rulesetContainer)
|
||||
public OsuScoreProcessor(DrawableRuleset<OsuHitObject> drawableRuleset)
|
||||
: base(drawableRuleset)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -1,223 +0,0 @@
|
||||
// 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 osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.UI.Cursor
|
||||
{
|
||||
public class GameplayCursorContainer : CursorContainer, IKeyBindingHandler<OsuAction>
|
||||
{
|
||||
protected override Drawable CreateCursor() => new OsuCursor();
|
||||
|
||||
protected override Container<Drawable> Content => fadeContainer;
|
||||
|
||||
private readonly Container<Drawable> fadeContainer;
|
||||
|
||||
public GameplayCursorContainer()
|
||||
{
|
||||
InternalChild = fadeContainer = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new CursorTrail { Depth = 1 }
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private int downCount;
|
||||
|
||||
private void updateExpandedState()
|
||||
{
|
||||
if (downCount > 0)
|
||||
(ActiveCursor as OsuCursor)?.Expand();
|
||||
else
|
||||
(ActiveCursor as OsuCursor)?.Contract();
|
||||
}
|
||||
|
||||
public bool OnPressed(OsuAction action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case OsuAction.LeftButton:
|
||||
case OsuAction.RightButton:
|
||||
downCount++;
|
||||
updateExpandedState();
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool OnReleased(OsuAction action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case OsuAction.LeftButton:
|
||||
case OsuAction.RightButton:
|
||||
if (--downCount == 0)
|
||||
updateExpandedState();
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool HandlePositionalInput => true; // OverlayContainer will set this false when we go hidden, but we always want to receive input.
|
||||
|
||||
protected override void PopIn()
|
||||
{
|
||||
fadeContainer.FadeTo(1, 300, Easing.OutQuint);
|
||||
ActiveCursor.ScaleTo(1, 400, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
fadeContainer.FadeTo(0.05f, 450, Easing.OutQuint);
|
||||
ActiveCursor.ScaleTo(0.8f, 450, Easing.OutQuint);
|
||||
}
|
||||
|
||||
public class OsuCursor : SkinReloadableDrawable
|
||||
{
|
||||
private bool cursorExpand;
|
||||
|
||||
private Bindable<double> cursorScale;
|
||||
private Bindable<bool> autoCursorScale;
|
||||
private readonly IBindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
|
||||
|
||||
private Container expandTarget;
|
||||
private Drawable scaleTarget;
|
||||
|
||||
public OsuCursor()
|
||||
{
|
||||
Origin = Anchor.Centre;
|
||||
Size = new Vector2(28);
|
||||
}
|
||||
|
||||
protected override void SkinChanged(ISkinSource skin, bool allowFallback)
|
||||
{
|
||||
cursorExpand = skin.GetValue<SkinConfiguration, bool>(s => s.CursorExpand ?? true);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config, IBindable<WorkingBeatmap> beatmap)
|
||||
{
|
||||
InternalChild = expandTarget = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.Centre,
|
||||
Child = scaleTarget = new SkinnableDrawable("cursor", _ => new CircularContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Masking = true,
|
||||
BorderThickness = Size.X / 6,
|
||||
BorderColour = Color4.White,
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Colour = Color4.Pink.Opacity(0.5f),
|
||||
Radius = 5,
|
||||
},
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Alpha = 0,
|
||||
AlwaysPresent = true,
|
||||
},
|
||||
new CircularContainer
|
||||
{
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Masking = true,
|
||||
BorderThickness = Size.X / 3,
|
||||
BorderColour = Color4.White.Opacity(0.5f),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Alpha = 0,
|
||||
AlwaysPresent = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
new CircularContainer
|
||||
{
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Scale = new Vector2(0.1f),
|
||||
Masking = true,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = Color4.White,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}, restrictSize: false)
|
||||
{
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
}
|
||||
};
|
||||
|
||||
this.beatmap.BindTo(beatmap);
|
||||
this.beatmap.ValueChanged += _ => calculateScale();
|
||||
|
||||
cursorScale = config.GetBindable<double>(OsuSetting.GameplayCursorSize);
|
||||
cursorScale.ValueChanged += _ => calculateScale();
|
||||
|
||||
autoCursorScale = config.GetBindable<bool>(OsuSetting.AutoCursorSize);
|
||||
autoCursorScale.ValueChanged += _ => calculateScale();
|
||||
|
||||
calculateScale();
|
||||
}
|
||||
|
||||
private void calculateScale()
|
||||
{
|
||||
float scale = (float)cursorScale.Value;
|
||||
|
||||
if (autoCursorScale.Value && beatmap.Value != null)
|
||||
{
|
||||
// if we have a beatmap available, let's get its circle size to figure out an automatic cursor scale modifier.
|
||||
scale *= (float)(1 - 0.7 * (1 + beatmap.Value.BeatmapInfo.BaseDifficulty.CircleSize - BeatmapDifficulty.DEFAULT_DIFFICULTY) / BeatmapDifficulty.DEFAULT_DIFFICULTY);
|
||||
}
|
||||
|
||||
scaleTarget.Scale = new Vector2(scale);
|
||||
}
|
||||
|
||||
private const float pressed_scale = 1.2f;
|
||||
private const float released_scale = 1f;
|
||||
|
||||
public void Expand()
|
||||
{
|
||||
if (!cursorExpand) return;
|
||||
|
||||
expandTarget.ScaleTo(released_scale).ScaleTo(pressed_scale, 100, Easing.OutQuad);
|
||||
}
|
||||
|
||||
public void Contract() => expandTarget.ScaleTo(released_scale, 100, Easing.OutQuad);
|
||||
}
|
||||
}
|
||||
}
|
148
osu.Game.Rulesets.Osu/UI/Cursor/OsuCursor.cs
Normal file
148
osu.Game.Rulesets.Osu/UI/Cursor/OsuCursor.cs
Normal file
@ -0,0 +1,148 @@
|
||||
// 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 osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.UI.Cursor
|
||||
{
|
||||
public class OsuCursor : SkinReloadableDrawable
|
||||
{
|
||||
private bool cursorExpand;
|
||||
|
||||
private Bindable<double> cursorScale;
|
||||
private Bindable<bool> autoCursorScale;
|
||||
private readonly IBindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
|
||||
|
||||
private Container expandTarget;
|
||||
private Drawable scaleTarget;
|
||||
|
||||
public OsuCursor()
|
||||
{
|
||||
Origin = Anchor.Centre;
|
||||
Size = new Vector2(28);
|
||||
}
|
||||
|
||||
protected override void SkinChanged(ISkinSource skin, bool allowFallback)
|
||||
{
|
||||
cursorExpand = skin.GetValue<SkinConfiguration, bool>(s => s.CursorExpand ?? true);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config, IBindable<WorkingBeatmap> beatmap)
|
||||
{
|
||||
InternalChild = expandTarget = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.Centre,
|
||||
Child = scaleTarget = new SkinnableDrawable("cursor", _ => new CircularContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Masking = true,
|
||||
BorderThickness = Size.X / 6,
|
||||
BorderColour = Color4.White,
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Colour = Color4.Pink.Opacity(0.5f),
|
||||
Radius = 5,
|
||||
},
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Alpha = 0,
|
||||
AlwaysPresent = true,
|
||||
},
|
||||
new CircularContainer
|
||||
{
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Masking = true,
|
||||
BorderThickness = Size.X / 3,
|
||||
BorderColour = Color4.White.Opacity(0.5f),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Alpha = 0,
|
||||
AlwaysPresent = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
new CircularContainer
|
||||
{
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Scale = new Vector2(0.1f),
|
||||
Masking = true,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = Color4.White,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}, restrictSize: false)
|
||||
{
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
}
|
||||
};
|
||||
|
||||
this.beatmap.BindTo(beatmap);
|
||||
this.beatmap.ValueChanged += _ => calculateScale();
|
||||
|
||||
cursorScale = config.GetBindable<double>(OsuSetting.GameplayCursorSize);
|
||||
cursorScale.ValueChanged += _ => calculateScale();
|
||||
|
||||
autoCursorScale = config.GetBindable<bool>(OsuSetting.AutoCursorSize);
|
||||
autoCursorScale.ValueChanged += _ => calculateScale();
|
||||
|
||||
calculateScale();
|
||||
}
|
||||
|
||||
private void calculateScale()
|
||||
{
|
||||
float scale = (float)cursorScale.Value;
|
||||
|
||||
if (autoCursorScale.Value && beatmap.Value != null)
|
||||
{
|
||||
// if we have a beatmap available, let's get its circle size to figure out an automatic cursor scale modifier.
|
||||
scale *= (float)(1 - 0.7 * (1 + beatmap.Value.BeatmapInfo.BaseDifficulty.CircleSize - BeatmapDifficulty.DEFAULT_DIFFICULTY) / BeatmapDifficulty.DEFAULT_DIFFICULTY);
|
||||
}
|
||||
|
||||
scaleTarget.Scale = new Vector2(scale);
|
||||
}
|
||||
|
||||
private const float pressed_scale = 1.2f;
|
||||
private const float released_scale = 1f;
|
||||
|
||||
public void Expand()
|
||||
{
|
||||
if (!cursorExpand) return;
|
||||
|
||||
expandTarget.ScaleTo(released_scale).ScaleTo(pressed_scale, 100, Easing.OutQuad);
|
||||
}
|
||||
|
||||
public void Contract() => expandTarget.ScaleTo(released_scale, 100, Easing.OutQuad);
|
||||
}
|
||||
}
|
83
osu.Game.Rulesets.Osu/UI/Cursor/OsuCursorContainer.cs
Normal file
83
osu.Game.Rulesets.Osu/UI/Cursor/OsuCursorContainer.cs
Normal file
@ -0,0 +1,83 @@
|
||||
// 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 osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Game.Rulesets.UI;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.UI.Cursor
|
||||
{
|
||||
public class OsuCursorContainer : GameplayCursorContainer, IKeyBindingHandler<OsuAction>
|
||||
{
|
||||
protected override Drawable CreateCursor() => new OsuCursor();
|
||||
|
||||
protected override Container<Drawable> Content => fadeContainer;
|
||||
|
||||
private readonly Container<Drawable> fadeContainer;
|
||||
|
||||
public OsuCursorContainer()
|
||||
{
|
||||
InternalChild = fadeContainer = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new CursorTrail { Depth = 1 }
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private int downCount;
|
||||
|
||||
private void updateExpandedState()
|
||||
{
|
||||
if (downCount > 0)
|
||||
(ActiveCursor as OsuCursor)?.Expand();
|
||||
else
|
||||
(ActiveCursor as OsuCursor)?.Contract();
|
||||
}
|
||||
|
||||
public bool OnPressed(OsuAction action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case OsuAction.LeftButton:
|
||||
case OsuAction.RightButton:
|
||||
downCount++;
|
||||
updateExpandedState();
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool OnReleased(OsuAction action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case OsuAction.LeftButton:
|
||||
case OsuAction.RightButton:
|
||||
if (--downCount == 0)
|
||||
updateExpandedState();
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool HandlePositionalInput => true; // OverlayContainer will set this false when we go hidden, but we always want to receive input.
|
||||
|
||||
protected override void PopIn()
|
||||
{
|
||||
fadeContainer.FadeTo(1, 300, Easing.OutQuint);
|
||||
ActiveCursor.ScaleTo(1, 400, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
fadeContainer.FadeTo(0.05f, 450, Easing.OutQuint);
|
||||
ActiveCursor.ScaleTo(0.8f, 450, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
}
|
@ -14,14 +14,15 @@ using osu.Game.Rulesets.Osu.Replays;
|
||||
using osu.Game.Rulesets.Osu.Scoring;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Screens.Play;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.UI
|
||||
{
|
||||
public class OsuRulesetContainer : RulesetContainer<OsuPlayfield, OsuHitObject>
|
||||
public class DrawableOsuRuleset : DrawableRuleset<OsuHitObject>
|
||||
{
|
||||
protected new OsuRulesetConfigManager Config => (OsuRulesetConfigManager)base.Config;
|
||||
|
||||
public OsuRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap)
|
||||
public DrawableOsuRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
|
||||
: base(ruleset, beatmap)
|
||||
{
|
||||
}
|
||||
@ -30,9 +31,13 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
|
||||
protected override Playfield CreatePlayfield() => new OsuPlayfield();
|
||||
|
||||
public override PassThroughInputManager CreateInputManager() => new OsuInputManager(Ruleset.RulesetInfo);
|
||||
protected override PassThroughInputManager CreateInputManager() => new OsuInputManager(Ruleset.RulesetInfo);
|
||||
|
||||
public override DrawableHitObject<OsuHitObject> GetVisualRepresentation(OsuHitObject h)
|
||||
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new OsuPlayfieldAdjustmentContainer();
|
||||
|
||||
protected override ResumeOverlay CreateResumeOverlay() => new OsuResumeOverlay();
|
||||
|
||||
public override DrawableHitObject<OsuHitObject> CreateDrawableRepresentation(OsuHitObject h)
|
||||
{
|
||||
switch (h)
|
||||
{
|
@ -10,7 +10,6 @@ using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Osu.Objects.Drawables.Connections;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Osu.UI.Cursor;
|
||||
|
||||
@ -24,23 +23,11 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
|
||||
public static readonly Vector2 BASE_SIZE = new Vector2(512, 384);
|
||||
|
||||
private readonly PlayfieldAdjustmentContainer adjustmentContainer;
|
||||
|
||||
protected override Container CursorTargetContainer => adjustmentContainer;
|
||||
|
||||
protected override CursorContainer CreateCursor() => new GameplayCursorContainer();
|
||||
protected override GameplayCursorContainer CreateCursor() => new OsuCursorContainer();
|
||||
|
||||
public OsuPlayfield()
|
||||
{
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
Size = new Vector2(0.75f);
|
||||
|
||||
InternalChild = adjustmentContainer = new PlayfieldAdjustmentContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
connectionLayer = new FollowPointRenderer
|
||||
{
|
||||
@ -58,7 +45,6 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Depth = -1,
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -3,17 +3,23 @@
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.UI
|
||||
{
|
||||
public class PlayfieldAdjustmentContainer : Container
|
||||
public class OsuPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer
|
||||
{
|
||||
protected override Container<Drawable> Content => content;
|
||||
private readonly Container content;
|
||||
|
||||
public PlayfieldAdjustmentContainer()
|
||||
public OsuPlayfieldAdjustmentContainer()
|
||||
{
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
Size = new Vector2(0.75f);
|
||||
|
||||
InternalChild = new Container
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
109
osu.Game.Rulesets.Osu/UI/OsuResumeOverlay.cs
Normal file
109
osu.Game.Rulesets.Osu/UI/OsuResumeOverlay.cs
Normal file
@ -0,0 +1,109 @@
|
||||
// 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 System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Rulesets.Osu.UI.Cursor;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Screens.Play;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.UI
|
||||
{
|
||||
public class OsuResumeOverlay : ResumeOverlay
|
||||
{
|
||||
private OsuClickToResumeCursor clickToResumeCursor;
|
||||
|
||||
private GameplayCursorContainer localCursorContainer;
|
||||
|
||||
public override CursorContainer LocalCursor => State == Visibility.Visible ? localCursorContainer : null;
|
||||
|
||||
protected override string Message => "Click the orange cursor to resume";
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Add(clickToResumeCursor = new OsuClickToResumeCursor { ResumeRequested = Resume });
|
||||
}
|
||||
|
||||
public override void Show()
|
||||
{
|
||||
base.Show();
|
||||
clickToResumeCursor.ShowAt(GameplayCursor.ActiveCursor.Position);
|
||||
|
||||
if (localCursorContainer == null)
|
||||
Add(localCursorContainer = new OsuCursorContainer());
|
||||
}
|
||||
|
||||
public override void Hide()
|
||||
{
|
||||
localCursorContainer?.Expire();
|
||||
localCursorContainer = null;
|
||||
|
||||
base.Hide();
|
||||
}
|
||||
|
||||
protected override bool OnHover(HoverEvent e) => true;
|
||||
|
||||
public class OsuClickToResumeCursor : OsuCursor, IKeyBindingHandler<OsuAction>
|
||||
{
|
||||
public override bool HandlePositionalInput => true;
|
||||
|
||||
public Action ResumeRequested;
|
||||
|
||||
public OsuClickToResumeCursor()
|
||||
{
|
||||
RelativePositionAxes = Axes.Both;
|
||||
}
|
||||
|
||||
protected override bool OnHover(HoverEvent e)
|
||||
{
|
||||
updateColour();
|
||||
return base.OnHover(e);
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(HoverLostEvent e)
|
||||
{
|
||||
updateColour();
|
||||
base.OnHoverLost(e);
|
||||
}
|
||||
|
||||
public bool OnPressed(OsuAction action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case OsuAction.LeftButton:
|
||||
case OsuAction.RightButton:
|
||||
if (!IsHovered) return false;
|
||||
|
||||
this.ScaleTo(new Vector2(2), TRANSITION_TIME, Easing.OutQuint);
|
||||
|
||||
ResumeRequested?.Invoke();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool OnReleased(OsuAction action) => false;
|
||||
|
||||
public void ShowAt(Vector2 activeCursorPosition) => Schedule(() =>
|
||||
{
|
||||
updateColour();
|
||||
this.MoveTo(activeCursorPosition);
|
||||
this.ScaleTo(new Vector2(4)).Then().ScaleTo(Vector2.One, 1000, Easing.OutQuint);
|
||||
});
|
||||
|
||||
private void updateColour()
|
||||
{
|
||||
this.FadeColour(IsHovered ? Color4.White : Color4.Orange, 400, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
||||
protected override double TimePerAction => default_duration * 2;
|
||||
|
||||
private readonly Random rng = new Random(1337);
|
||||
private TaikoRulesetContainer rulesetContainer;
|
||||
private DrawableTaikoRuleset drawableRuleset;
|
||||
private Container playfieldContainer;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -86,7 +86,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = 768,
|
||||
Children = new[] { rulesetContainer = new TaikoRulesetContainer(new TaikoRuleset(), beatmap) }
|
||||
Children = new[] { drawableRuleset = new DrawableTaikoRuleset(new TaikoRuleset(), beatmap) }
|
||||
});
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
||||
|
||||
var h = new DrawableTestHit(hit) { X = RNG.NextSingle(hitResult == HitResult.Good ? -0.1f : -0.05f, hitResult == HitResult.Good ? 0.1f : 0.05f) };
|
||||
|
||||
((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(h, new JudgementResult(new TaikoJudgement()) { Type = hitResult });
|
||||
((TaikoPlayfield)drawableRuleset.Playfield).OnNewResult(h, new JudgementResult(new TaikoJudgement()) { Type = hitResult });
|
||||
}
|
||||
|
||||
private void addStrongHitJudgement(bool kiai)
|
||||
@ -154,33 +154,33 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
||||
|
||||
var h = new DrawableTestHit(hit) { X = RNG.NextSingle(hitResult == HitResult.Good ? -0.1f : -0.05f, hitResult == HitResult.Good ? 0.1f : 0.05f) };
|
||||
|
||||
((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(h, new JudgementResult(new TaikoJudgement()) { Type = hitResult });
|
||||
((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(new TestStrongNestedHit(h), new JudgementResult(new TaikoStrongJudgement()) { Type = HitResult.Great });
|
||||
((TaikoPlayfield)drawableRuleset.Playfield).OnNewResult(h, new JudgementResult(new TaikoJudgement()) { Type = hitResult });
|
||||
((TaikoPlayfield)drawableRuleset.Playfield).OnNewResult(new TestStrongNestedHit(h), new JudgementResult(new TaikoStrongJudgement()) { Type = HitResult.Great });
|
||||
}
|
||||
|
||||
private void addMissJudgement()
|
||||
{
|
||||
((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(new DrawableTestHit(new Hit()), new JudgementResult(new TaikoJudgement()) { Type = HitResult.Miss });
|
||||
((TaikoPlayfield)drawableRuleset.Playfield).OnNewResult(new DrawableTestHit(new Hit()), new JudgementResult(new TaikoJudgement()) { Type = HitResult.Miss });
|
||||
}
|
||||
|
||||
private void addBarLine(bool major, double delay = scroll_time)
|
||||
{
|
||||
BarLine bl = new BarLine { StartTime = rulesetContainer.Playfield.Time.Current + delay };
|
||||
BarLine bl = new BarLine { StartTime = drawableRuleset.Playfield.Time.Current + delay };
|
||||
|
||||
rulesetContainer.Playfield.Add(major ? new DrawableBarLineMajor(bl) : new DrawableBarLine(bl));
|
||||
drawableRuleset.Playfield.Add(major ? new DrawableBarLineMajor(bl) : new DrawableBarLine(bl));
|
||||
}
|
||||
|
||||
private void addSwell(double duration = default_duration)
|
||||
{
|
||||
var swell = new Swell
|
||||
{
|
||||
StartTime = rulesetContainer.Playfield.Time.Current + scroll_time,
|
||||
StartTime = drawableRuleset.Playfield.Time.Current + scroll_time,
|
||||
Duration = duration,
|
||||
};
|
||||
|
||||
swell.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
||||
|
||||
rulesetContainer.Playfield.Add(new DrawableSwell(swell));
|
||||
drawableRuleset.Playfield.Add(new DrawableSwell(swell));
|
||||
}
|
||||
|
||||
private void addDrumRoll(bool strong, double duration = default_duration)
|
||||
@ -190,40 +190,40 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
||||
|
||||
var d = new DrumRoll
|
||||
{
|
||||
StartTime = rulesetContainer.Playfield.Time.Current + scroll_time,
|
||||
StartTime = drawableRuleset.Playfield.Time.Current + scroll_time,
|
||||
IsStrong = strong,
|
||||
Duration = duration,
|
||||
};
|
||||
|
||||
d.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
||||
|
||||
rulesetContainer.Playfield.Add(new DrawableDrumRoll(d));
|
||||
drawableRuleset.Playfield.Add(new DrawableDrumRoll(d));
|
||||
}
|
||||
|
||||
private void addCentreHit(bool strong)
|
||||
{
|
||||
Hit h = new Hit
|
||||
{
|
||||
StartTime = rulesetContainer.Playfield.Time.Current + scroll_time,
|
||||
StartTime = drawableRuleset.Playfield.Time.Current + scroll_time,
|
||||
IsStrong = strong
|
||||
};
|
||||
|
||||
h.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
||||
|
||||
rulesetContainer.Playfield.Add(new DrawableCentreHit(h));
|
||||
drawableRuleset.Playfield.Add(new DrawableCentreHit(h));
|
||||
}
|
||||
|
||||
private void addRimHit(bool strong)
|
||||
{
|
||||
Hit h = new Hit
|
||||
{
|
||||
StartTime = rulesetContainer.Playfield.Time.Current + scroll_time,
|
||||
StartTime = drawableRuleset.Playfield.Time.Current + scroll_time,
|
||||
IsStrong = strong
|
||||
};
|
||||
|
||||
h.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
|
||||
|
||||
rulesetContainer.Playfield.Add(new DrawableRimHit(h));
|
||||
drawableRuleset.Playfield.Add(new DrawableRimHit(h));
|
||||
}
|
||||
|
||||
private class TestStrongNestedHit : DrawableStrongNestedHit
|
||||
|
@ -2,9 +2,9 @@
|
||||
<Import Project="..\osu.TestProject.props" />
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
|
||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="3.12.0" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
|
||||
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Project">
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Taiko.Objects;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.Beatmaps
|
||||
@ -23,19 +23,19 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
|
||||
{
|
||||
Name = @"Hit Count",
|
||||
Content = hits.ToString(),
|
||||
Icon = FontAwesome.fa_circle_o
|
||||
Icon = FontAwesome.Regular.Circle
|
||||
},
|
||||
new BeatmapStatistic
|
||||
{
|
||||
Name = @"Drumroll Count",
|
||||
Content = drumrolls.ToString(),
|
||||
Icon = FontAwesome.fa_circle
|
||||
Icon = FontAwesome.Regular.Circle
|
||||
},
|
||||
new BeatmapStatistic
|
||||
{
|
||||
Name = @"Swell Count",
|
||||
Content = swells.ToString(),
|
||||
Icon = FontAwesome.fa_circle
|
||||
Icon = FontAwesome.Regular.Circle
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -22,10 +22,10 @@ namespace osu.Game.Rulesets.Taiko.Mods
|
||||
|
||||
private TaikoPlayfield playfield;
|
||||
|
||||
public override void ApplyToRulesetContainer(RulesetContainer<TaikoHitObject> rulesetContainer)
|
||||
public override void ApplyToDrawableRuleset(DrawableRuleset<TaikoHitObject> drawableRuleset)
|
||||
{
|
||||
playfield = (TaikoPlayfield)rulesetContainer.Playfield;
|
||||
base.ApplyToRulesetContainer(rulesetContainer);
|
||||
playfield = (TaikoPlayfield)drawableRuleset.Playfield;
|
||||
base.ApplyToDrawableRuleset(drawableRuleset);
|
||||
}
|
||||
|
||||
private class TaikoFlashlight : Flashlight
|
||||
|
@ -44,17 +44,14 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
RelativeSizeAxes = Axes.Y;
|
||||
Width = tracker_width;
|
||||
|
||||
InternalChildren = new[]
|
||||
{
|
||||
Tracker = new Box
|
||||
AddInternal(Tracker = new Box
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
EdgeSmoothness = new Vector2(0.5f, 0),
|
||||
Alpha = 0.75f
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
protected override void UpdateState(ArmedState state)
|
||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
protected DrawableTaikoHitObject(TaikoHitObject hitObject)
|
||||
: base(hitObject)
|
||||
{
|
||||
InternalChildren = new[]
|
||||
AddRangeInternal(new[]
|
||||
{
|
||||
nonProxiedContent = new Container
|
||||
{
|
||||
@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
Child = Content = new Container { RelativeSizeAxes = Axes.Both }
|
||||
},
|
||||
proxiedContent = new ProxiedContentContainer { RelativeSizeAxes = Axes.Both }
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -4,7 +4,7 @@
|
||||
using osuTK;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
||||
{
|
||||
@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
|
||||
new SpriteIcon
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Icon = FontAwesome.fa_asterisk,
|
||||
Icon = FontAwesome.Solid.Asterisk,
|
||||
Shadow = false
|
||||
}
|
||||
};
|
||||
|
@ -18,6 +18,6 @@ namespace osu.Game.Rulesets.Taiko.Replays
|
||||
|
||||
protected override bool IsImportant(TaikoReplayFrame frame) => frame.Actions.Any();
|
||||
|
||||
public override List<IInput> GetPendingInputs() => new List<IInput> { new ReplayState<TaikoAction> { PressedActions = CurrentFrame.Actions } };
|
||||
public override List<IInput> GetPendingInputs() => new List<IInput> { new ReplayState<TaikoAction> { PressedActions = CurrentFrame?.Actions ?? new List<TaikoAction>() } };
|
||||
}
|
||||
}
|
||||
|
@ -32,8 +32,8 @@ namespace osu.Game.Rulesets.Taiko.Scoring
|
||||
/// </summary>
|
||||
private double hpMissMultiplier;
|
||||
|
||||
public TaikoScoreProcessor(RulesetContainer<TaikoHitObject> rulesetContainer)
|
||||
: base(rulesetContainer)
|
||||
public TaikoScoreProcessor(DrawableRuleset<TaikoHitObject> drawableRuleset)
|
||||
: base(drawableRuleset)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ using osu.Game.Rulesets.Taiko.UI;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Game.Rulesets.Replays.Types;
|
||||
using osu.Game.Rulesets.Taiko.Objects;
|
||||
@ -23,7 +24,7 @@ namespace osu.Game.Rulesets.Taiko
|
||||
{
|
||||
public class TaikoRuleset : Ruleset
|
||||
{
|
||||
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap) => new TaikoRulesetContainer(this, beatmap);
|
||||
public override DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap) => new DrawableTaikoRuleset(this, beatmap);
|
||||
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new TaikoBeatmapConverter(beatmap);
|
||||
|
||||
public override IEnumerable<KeyBinding> GetDefaultKeyBindings(int variant = 0) => new[]
|
||||
@ -114,7 +115,7 @@ namespace osu.Game.Rulesets.Taiko
|
||||
|
||||
public override string ShortName => "taiko";
|
||||
|
||||
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_taiko_o };
|
||||
public override Drawable CreateIcon() => new SpriteIcon { Icon = OsuIcon.RulesetTaiko };
|
||||
|
||||
public override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new TaikoDifficultyCalculator(this, beatmap);
|
||||
|
||||
|
@ -39,12 +39,10 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
}
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
protected override void ApplyHitAnimations()
|
||||
{
|
||||
if (Result.IsHit)
|
||||
this.MoveToY(-100, 500);
|
||||
|
||||
base.LoadComplete();
|
||||
base.ApplyHitAnimations();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,13 +20,13 @@ using osu.Game.Rulesets.UI.Scrolling;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.UI
|
||||
{
|
||||
public class TaikoRulesetContainer : ScrollingRulesetContainer<TaikoPlayfield, TaikoHitObject>
|
||||
public class DrawableTaikoRuleset : DrawableScrollingRuleset<TaikoHitObject>
|
||||
{
|
||||
protected override ScrollVisualisationMethod VisualisationMethod => ScrollVisualisationMethod.Overlapping;
|
||||
|
||||
protected override bool UserScrollSpeedAdjustment => false;
|
||||
|
||||
public TaikoRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap)
|
||||
public DrawableTaikoRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
|
||||
: base(ruleset, beatmap)
|
||||
{
|
||||
Direction.Value = ScrollingDirection.Left;
|
||||
@ -81,11 +81,13 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
|
||||
public override ScoreProcessor CreateScoreProcessor() => new TaikoScoreProcessor(this);
|
||||
|
||||
public override PassThroughInputManager CreateInputManager() => new TaikoInputManager(Ruleset.RulesetInfo);
|
||||
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new TaikoPlayfieldAdjustmentContainer();
|
||||
|
||||
protected override PassThroughInputManager CreateInputManager() => new TaikoInputManager(Ruleset.RulesetInfo);
|
||||
|
||||
protected override Playfield CreatePlayfield() => new TaikoPlayfield(Beatmap.ControlPointInfo);
|
||||
|
||||
public override DrawableHitObject<TaikoHitObject> GetVisualRepresentation(TaikoHitObject h)
|
||||
public override DrawableHitObject<TaikoHitObject> CreateDrawableRepresentation(TaikoHitObject h)
|
||||
{
|
||||
switch (h)
|
||||
{
|
@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
public class TaikoPlayfield : ScrollingPlayfield
|
||||
{
|
||||
/// <summary>
|
||||
/// Default height of a <see cref="TaikoPlayfield"/> when inside a <see cref="TaikoRulesetContainer"/>.
|
||||
/// Default height of a <see cref="TaikoPlayfield"/> when inside a <see cref="DrawableTaikoRuleset"/>.
|
||||
/// </summary>
|
||||
public const float DEFAULT_HEIGHT = 178;
|
||||
|
||||
@ -55,12 +55,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
|
||||
public TaikoPlayfield(ControlPointInfo controlPoints)
|
||||
{
|
||||
InternalChild = new PlayfieldAdjustmentContainer
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
backgroundContainer = new Container
|
||||
{
|
||||
@ -192,7 +187,6 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
Name = "Top level hit objects",
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1,16 +1,23 @@
|
||||
// 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 osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.UI
|
||||
{
|
||||
public class PlayfieldAdjustmentContainer : Container
|
||||
public class TaikoPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer
|
||||
{
|
||||
private const float default_relative_height = TaikoPlayfield.DEFAULT_HEIGHT / 768;
|
||||
private const float default_aspect = 16f / 9f;
|
||||
|
||||
public TaikoPlayfieldAdjustmentContainer()
|
||||
{
|
||||
Anchor = Anchor.CentreLeft;
|
||||
Origin = Anchor.CentreLeft;
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
@ -29,28 +29,28 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
|
||||
StoryboardLayer background = storyboard.Layers.FirstOrDefault(l => l.Depth == 3);
|
||||
Assert.IsNotNull(background);
|
||||
Assert.AreEqual(16, background.Elements.Count());
|
||||
Assert.AreEqual(16, background.Elements.Count);
|
||||
Assert.IsTrue(background.EnabledWhenFailing);
|
||||
Assert.IsTrue(background.EnabledWhenPassing);
|
||||
Assert.AreEqual("Background", background.Name);
|
||||
|
||||
StoryboardLayer fail = storyboard.Layers.FirstOrDefault(l => l.Depth == 2);
|
||||
Assert.IsNotNull(fail);
|
||||
Assert.AreEqual(0, fail.Elements.Count());
|
||||
Assert.AreEqual(0, fail.Elements.Count);
|
||||
Assert.IsTrue(fail.EnabledWhenFailing);
|
||||
Assert.IsFalse(fail.EnabledWhenPassing);
|
||||
Assert.AreEqual("Fail", fail.Name);
|
||||
|
||||
StoryboardLayer pass = storyboard.Layers.FirstOrDefault(l => l.Depth == 1);
|
||||
Assert.IsNotNull(pass);
|
||||
Assert.AreEqual(0, pass.Elements.Count());
|
||||
Assert.AreEqual(0, pass.Elements.Count);
|
||||
Assert.IsFalse(pass.EnabledWhenFailing);
|
||||
Assert.IsTrue(pass.EnabledWhenPassing);
|
||||
Assert.AreEqual("Pass", pass.Name);
|
||||
|
||||
StoryboardLayer foreground = storyboard.Layers.FirstOrDefault(l => l.Depth == 0);
|
||||
Assert.IsNotNull(foreground);
|
||||
Assert.AreEqual(151, foreground.Elements.Count());
|
||||
Assert.AreEqual(151, foreground.Elements.Count);
|
||||
Assert.IsTrue(foreground.EnabledWhenFailing);
|
||||
Assert.IsTrue(foreground.EnabledWhenPassing);
|
||||
Assert.AreEqual("Foreground", foreground.Name);
|
||||
@ -62,7 +62,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
Assert.AreEqual(15, spriteCount);
|
||||
Assert.AreEqual(1, animationCount);
|
||||
Assert.AreEqual(0, sampleCount);
|
||||
Assert.AreEqual(background.Elements.Count(), spriteCount + animationCount + sampleCount);
|
||||
Assert.AreEqual(background.Elements.Count, spriteCount + animationCount + sampleCount);
|
||||
|
||||
var sprite = background.Elements.ElementAt(0) as StoryboardSprite;
|
||||
Assert.NotNull(sprite);
|
||||
@ -70,9 +70,9 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
Assert.AreEqual(new Vector2(320, 240), sprite.InitialPosition);
|
||||
Assert.IsTrue(sprite.IsDrawable);
|
||||
Assert.AreEqual(Anchor.Centre, sprite.Origin);
|
||||
Assert.AreEqual("SB/lyric/ja-21.png", sprite.Path);
|
||||
Assert.AreEqual("SB/black.jpg", sprite.Path);
|
||||
|
||||
var animation = background.Elements.ElementAt(12) as StoryboardAnimation;
|
||||
var animation = background.Elements.OfType<StoryboardAnimation>().First();
|
||||
Assert.NotNull(animation);
|
||||
Assert.AreEqual(141175, animation.EndTime);
|
||||
Assert.AreEqual(10, animation.FrameCount);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user