2019-01-24 17:43:03 +09:00
|
|
|
|
// 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.
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2022-06-17 16:37:17 +09:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2019-04-24 12:35:34 +09:00
|
|
|
|
using System;
|
2019-04-08 18:32:05 +09:00
|
|
|
|
using System.Collections.Generic;
|
2018-07-17 14:29:22 +09:00
|
|
|
|
using System.Linq;
|
2017-08-09 11:50:34 +09:00
|
|
|
|
using osu.Framework.Input;
|
2017-03-10 15:08:53 +09:00
|
|
|
|
using osu.Game.Beatmaps;
|
2018-02-28 16:34:47 +09:00
|
|
|
|
using osu.Game.Input.Handlers;
|
2018-11-28 17:20:37 +09:00
|
|
|
|
using osu.Game.Replays;
|
2019-04-08 18:32:05 +09:00
|
|
|
|
using osu.Game.Rulesets.Mods;
|
2020-11-12 14:19:26 +09:00
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
2019-01-23 11:46:53 +01:00
|
|
|
|
using osu.Game.Rulesets.Osu.Configuration;
|
2017-04-18 16:05:58 +09:00
|
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
2017-08-24 15:36:42 +09:00
|
|
|
|
using osu.Game.Rulesets.Osu.Replays;
|
2017-04-18 16:05:58 +09:00
|
|
|
|
using osu.Game.Rulesets.UI;
|
2020-12-14 16:52:14 +09:00
|
|
|
|
using osu.Game.Scoring;
|
2019-03-25 19:21:25 +09:00
|
|
|
|
using osu.Game.Screens.Play;
|
2019-11-29 17:35:11 +09:00
|
|
|
|
using osuTK;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2017-04-18 16:05:58 +09:00
|
|
|
|
namespace osu.Game.Rulesets.Osu.UI
|
2016-09-02 19:25:13 +09:00
|
|
|
|
{
|
2019-03-20 11:29:16 +09:00
|
|
|
|
public partial class DrawableOsuRuleset : DrawableRuleset<OsuHitObject>
|
2016-09-02 19:25:13 +09:00
|
|
|
|
{
|
2019-01-25 11:14:37 +01:00
|
|
|
|
protected new OsuRulesetConfigManager Config => (OsuRulesetConfigManager)base.Config;
|
2019-01-23 11:46:53 +01:00
|
|
|
|
|
2020-11-11 00:22:06 +09:00
|
|
|
|
public new OsuPlayfield Playfield => (OsuPlayfield)base.Playfield;
|
|
|
|
|
|
2019-12-12 15:58:11 +09:00
|
|
|
|
public DrawableOsuRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods = null)
|
2019-04-08 18:32:05 +09:00
|
|
|
|
: base(ruleset, beatmap, mods)
|
2017-03-10 15:08:53 +09:00
|
|
|
|
{
|
|
|
|
|
}
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2020-11-13 14:58:32 +09:00
|
|
|
|
public override DrawableHitObject<OsuHitObject> CreateDrawableRepresentation(OsuHitObject h) => null;
|
|
|
|
|
|
2019-11-29 17:35:11 +09:00
|
|
|
|
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; // always show the gameplay cursor
|
|
|
|
|
|
2017-09-12 18:19:28 +09:00
|
|
|
|
protected override Playfield CreatePlayfield() => new OsuPlayfield();
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2019-03-19 20:21:31 +09:00
|
|
|
|
protected override PassThroughInputManager CreateInputManager() => new OsuInputManager(Ruleset.RulesetInfo);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2020-08-04 15:43:33 +02:00
|
|
|
|
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new OsuPlayfieldAdjustmentContainer { AlignWithStoryboard = true };
|
2019-03-26 13:31:49 +09:00
|
|
|
|
|
2019-03-25 19:21:25 +09:00
|
|
|
|
protected override ResumeOverlay CreateResumeOverlay() => new OsuResumeOverlay();
|
|
|
|
|
|
2019-02-20 21:08:52 +09:00
|
|
|
|
protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new OsuFramedReplayInputHandler(replay);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2020-12-14 16:52:14 +09:00
|
|
|
|
protected override ReplayRecorder CreateReplayRecorder(Score score) => new OsuReplayRecorder(score);
|
2020-03-23 19:18:56 +09:00
|
|
|
|
|
2018-07-17 14:29:22 +09:00
|
|
|
|
public override double GameplayStartTime
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2019-05-14 16:18:46 -04:00
|
|
|
|
if (Objects.FirstOrDefault() is OsuHitObject first)
|
2019-05-13 23:29:24 -04:00
|
|
|
|
return first.StartTime - Math.Max(2000, first.TimePreempt);
|
2019-05-15 10:55:02 +09:00
|
|
|
|
|
|
|
|
|
return 0;
|
2018-07-17 14:29:22 +09:00
|
|
|
|
}
|
|
|
|
|
}
|
2016-09-02 19:25:13 +09:00
|
|
|
|
}
|
|
|
|
|
}
|