mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Add ruleset templates structure
This commit is contained in:
@ -0,0 +1,37 @@
|
||||
// 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.Collections.Generic;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Input.Handlers;
|
||||
using osu.Game.Replays;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Pippidon.Objects;
|
||||
using osu.Game.Rulesets.Pippidon.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Pippidon.Replays;
|
||||
using osu.Game.Rulesets.UI;
|
||||
|
||||
namespace osu.Game.Rulesets.Pippidon.UI
|
||||
{
|
||||
[Cached]
|
||||
public class DrawablePippidonRuleset : DrawableRuleset<PippidonHitObject>
|
||||
{
|
||||
public DrawablePippidonRuleset(PippidonRuleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods = null)
|
||||
: base(ruleset, beatmap, mods)
|
||||
{
|
||||
}
|
||||
|
||||
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new PippidonPlayfieldAdjustmentContainer();
|
||||
|
||||
protected override Playfield CreatePlayfield() => new PippidonPlayfield();
|
||||
|
||||
protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new PippidonFramedReplayInputHandler(replay);
|
||||
|
||||
public override DrawableHitObject<PippidonHitObject> CreateDrawableRepresentation(PippidonHitObject h) => new DrawablePippidonHitObject(h);
|
||||
|
||||
protected override PassThroughInputManager CreateInputManager() => new PippidonInputManager(Ruleset?.RulesetInfo);
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
// 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.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Pippidon.UI
|
||||
{
|
||||
public class PippidonCursorContainer : GameplayCursorContainer
|
||||
{
|
||||
private Sprite cursorSprite;
|
||||
private Texture cursorTexture;
|
||||
|
||||
protected override Drawable CreateCursor() => cursorSprite = new Sprite
|
||||
{
|
||||
Scale = new Vector2(0.5f),
|
||||
Origin = Anchor.Centre,
|
||||
Texture = cursorTexture,
|
||||
};
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures)
|
||||
{
|
||||
cursorTexture = textures.Get("character");
|
||||
|
||||
if (cursorSprite != null)
|
||||
cursorSprite.Texture = cursorTexture;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
// 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.Graphics;
|
||||
using osu.Game.Rulesets.UI;
|
||||
|
||||
namespace osu.Game.Rulesets.Pippidon.UI
|
||||
{
|
||||
[Cached]
|
||||
public class PippidonPlayfield : Playfield
|
||||
{
|
||||
protected override GameplayCursorContainer CreateCursor() => new PippidonCursorContainer();
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
AddRangeInternal(new Drawable[]
|
||||
{
|
||||
HitObjectContainer,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -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.Pippidon.UI
|
||||
{
|
||||
public class PippidonPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer
|
||||
{
|
||||
public PippidonPlayfieldAdjustmentContainer()
|
||||
{
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
Size = new Vector2(0.8f);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user