mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Merge branch 'master'
This commit is contained in:
@ -3,9 +3,9 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Game.Beatmaps.Objects;
|
||||
using osu.Game.Beatmaps.Timing;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Modes.Objects;
|
||||
|
||||
namespace osu.Game.Beatmaps
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using osu.Game.Beatmaps.Objects;
|
||||
using osu.Game.Modes.Objects;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.Beatmaps.Formats
|
||||
@ -48,6 +48,8 @@ namespace osu.Game.Beatmaps.Formats
|
||||
new Color4(121,9,13, 255),
|
||||
};
|
||||
|
||||
if (colours.Count == 0) return;
|
||||
|
||||
int i = -1;
|
||||
|
||||
foreach (HitObject h in b.HitObjects)
|
||||
|
@ -5,10 +5,11 @@ using System.IO;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Beatmaps.Events;
|
||||
using osu.Game.Beatmaps.Objects;
|
||||
using osu.Game.Beatmaps.Samples;
|
||||
using osu.Game.Beatmaps.Timing;
|
||||
using osu.Game.GameModes.Play;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Modes.Objects;
|
||||
using osu.Game.Screens.Play;
|
||||
|
||||
namespace osu.Game.Beatmaps.Formats
|
||||
{
|
||||
@ -220,7 +221,9 @@ namespace osu.Game.Beatmaps.Formats
|
||||
BaseDifficulty = new BaseDifficulty(),
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
HitObjectParser parser = null;
|
||||
|
||||
var section = Section.None;
|
||||
string line;
|
||||
while (true)
|
||||
@ -232,14 +235,14 @@ namespace osu.Game.Beatmaps.Formats
|
||||
continue;
|
||||
if (line.StartsWith(@"osu file format v"))
|
||||
continue;
|
||||
|
||||
|
||||
if (line.StartsWith(@"[") && line.EndsWith(@"]"))
|
||||
{
|
||||
if (!Enum.TryParse(line.Substring(1, line.Length - 2), out section))
|
||||
throw new InvalidDataException($@"Unknown osu section {line}");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
string val = line, key = null;
|
||||
if (section != Section.Events && section != Section.TimingPoints && section != Section.HitObjects)
|
||||
{
|
||||
@ -250,6 +253,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
{
|
||||
case Section.General:
|
||||
handleGeneral(beatmap, key, val);
|
||||
parser = Ruleset.GetRuleset(beatmap.BeatmapInfo.Mode).CreateHitObjectParser();
|
||||
break;
|
||||
case Section.Editor:
|
||||
handleEditor(beatmap, key, val);
|
||||
@ -270,13 +274,13 @@ namespace osu.Game.Beatmaps.Formats
|
||||
handleColours(beatmap, key, val);
|
||||
break;
|
||||
case Section.HitObjects:
|
||||
var h = HitObject.Parse(beatmap.BeatmapInfo.Mode, val);
|
||||
if (h != null)
|
||||
beatmap.HitObjects.Add(h);
|
||||
var obj = parser?.Parse(val);
|
||||
if (obj != null)
|
||||
beatmap.HitObjects.Add(obj);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return beatmap;
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Catch
|
||||
{
|
||||
public abstract class CatchBaseHit : HitObject
|
||||
{
|
||||
public float Position;
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Game.Beatmaps.Objects.Catch;
|
||||
using osu.Game.Beatmaps.Objects.Osu;
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Catch
|
||||
{
|
||||
class CatchConverter : HitObjectConverter<CatchBaseHit>
|
||||
{
|
||||
public override List<CatchBaseHit> Convert(List<HitObject> input)
|
||||
{
|
||||
List<CatchBaseHit> output = new List<CatchBaseHit>();
|
||||
|
||||
foreach (HitObject i in input)
|
||||
{
|
||||
CatchBaseHit h = i as CatchBaseHit;
|
||||
|
||||
if (h == null)
|
||||
{
|
||||
OsuBaseHit o = i as OsuBaseHit;
|
||||
|
||||
if (o == null) throw new HitObjectConvertException(@"Catch", i);
|
||||
|
||||
h = new Fruit
|
||||
{
|
||||
StartTime = o.StartTime,
|
||||
Position = o.Position.X,
|
||||
};
|
||||
}
|
||||
|
||||
output.Add(h);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using OpenTK;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Catch.Drawable
|
||||
{
|
||||
class DrawableFruit : Sprite
|
||||
{
|
||||
private CatchBaseHit h;
|
||||
|
||||
public DrawableFruit(CatchBaseHit h)
|
||||
{
|
||||
this.h = h;
|
||||
|
||||
Origin = Anchor.Centre;
|
||||
Scale = new Vector2(0.1f);
|
||||
RelativePositionAxes = Axes.Y;
|
||||
Position = new Vector2(h.Position, -0.1f);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures)
|
||||
{
|
||||
Texture = textures.Get(@"Menu/logo");
|
||||
|
||||
Transforms.Add(new TransformPosition { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = new Vector2(h.Position, -0.1f), EndValue = new Vector2(h.Position, 0.9f) });
|
||||
Transforms.Add(new TransformAlpha { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 });
|
||||
Expire(true);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Catch
|
||||
{
|
||||
public class Droplet : CatchBaseHit
|
||||
{
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Catch
|
||||
{
|
||||
public class Fruit : CatchBaseHit
|
||||
{
|
||||
}
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using OpenTK;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Mania.Drawable
|
||||
{
|
||||
public class DrawableNote : Sprite
|
||||
{
|
||||
private readonly ManiaBaseHit note;
|
||||
|
||||
public DrawableNote(ManiaBaseHit note)
|
||||
{
|
||||
this.note = note;
|
||||
Origin = Anchor.Centre;
|
||||
Scale = new Vector2(0.1f);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures)
|
||||
{
|
||||
Texture = textures.Get(@"Menu/logo");
|
||||
|
||||
Transforms.Add(new TransformPositionY() { StartTime = note.StartTime - 200, EndTime = note.StartTime, StartValue = -0.1f, EndValue = 0.9f });
|
||||
Transforms.Add(new TransformAlpha() { StartTime = note.StartTime + note.Duration + 200, EndTime = note.StartTime + note.Duration + 400, StartValue = 1, EndValue = 0 });
|
||||
Expire(true);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Mania
|
||||
{
|
||||
public abstract class ManiaBaseHit : HitObject
|
||||
{
|
||||
public int Column;
|
||||
}
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Beatmaps.Objects.Osu;
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Mania
|
||||
{
|
||||
class ManiaConverter : HitObjectConverter<ManiaBaseHit>
|
||||
{
|
||||
private readonly int columns;
|
||||
|
||||
public ManiaConverter(int columns)
|
||||
{
|
||||
this.columns = columns;
|
||||
}
|
||||
|
||||
public override List<ManiaBaseHit> Convert(List<HitObject> input)
|
||||
{
|
||||
List<ManiaBaseHit> output = new List<ManiaBaseHit>();
|
||||
|
||||
foreach (HitObject i in input)
|
||||
{
|
||||
ManiaBaseHit h = i as ManiaBaseHit;
|
||||
|
||||
if (h == null)
|
||||
{
|
||||
OsuBaseHit o = i as OsuBaseHit;
|
||||
|
||||
if (o == null) throw new HitObjectConvertException(@"Mania", i);
|
||||
|
||||
h = new Note
|
||||
{
|
||||
StartTime = o.StartTime,
|
||||
Column = (int)Math.Round(o.Position.X / 512 * columns)
|
||||
};
|
||||
}
|
||||
|
||||
output.Add(h);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Mania
|
||||
{
|
||||
public class Note : ManiaBaseHit
|
||||
{
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Osu
|
||||
{
|
||||
public class Circle : OsuBaseHit
|
||||
{
|
||||
}
|
||||
}
|
@ -1,337 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.MathUtils;
|
||||
using OpenTK;
|
||||
using osu.Framework.Allocation;
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Osu.Drawable
|
||||
{
|
||||
public class DrawableCircle : DrawableHitObject
|
||||
{
|
||||
private Sprite approachCircle;
|
||||
private CircleLayer circle;
|
||||
private RingLayer ring;
|
||||
private FlashLayer flash;
|
||||
private ExplodeLayer explode;
|
||||
private NumberLayer number;
|
||||
private GlowLayer glow;
|
||||
private OsuBaseHit h;
|
||||
|
||||
public DrawableCircle(Circle h) : base(h)
|
||||
{
|
||||
this.h = h;
|
||||
|
||||
Origin = Anchor.Centre;
|
||||
RelativePositionAxes = Axes.Both;
|
||||
Position = new Vector2(h.Position.X / 512, h.Position.Y / 384);
|
||||
|
||||
Children = new Framework.Graphics.Drawable[]
|
||||
{
|
||||
glow = new GlowLayer
|
||||
{
|
||||
Colour = h.Colour
|
||||
},
|
||||
circle = new CircleLayer
|
||||
{
|
||||
Colour = h.Colour,
|
||||
Hit = Hit,
|
||||
},
|
||||
number = new NumberLayer(),
|
||||
ring = new RingLayer(),
|
||||
flash = new FlashLayer(),
|
||||
explode = new ExplodeLayer
|
||||
{
|
||||
Colour = h.Colour,
|
||||
},
|
||||
approachCircle = new Sprite
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Colour = h.Colour
|
||||
}
|
||||
};
|
||||
|
||||
//may not be so correct
|
||||
Size = circle.DrawSize;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(BaseGame game)
|
||||
{
|
||||
approachCircle.Texture = game.Textures.Get(@"Play/osu/approachcircle@2x");
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
//force application of the state that was set before we loaded.
|
||||
UpdateState(State);
|
||||
}
|
||||
|
||||
protected override void UpdateState(ArmedState state)
|
||||
{
|
||||
if (!IsLoaded) return;
|
||||
|
||||
Flush(true); //move to DrawableHitObject
|
||||
|
||||
double t = HitTime ?? h.StartTime;
|
||||
|
||||
//sane defaults
|
||||
ring.Alpha = circle.Alpha = number.Alpha = approachCircle.Alpha = glow.Alpha = 1;
|
||||
explode.Alpha = 0;
|
||||
Scale = Vector2.One;
|
||||
|
||||
//always-present transforms
|
||||
Transforms.Add(new TransformAlpha { StartTime = t - 1000, EndTime = t - 800, StartValue = 0, EndValue = 1 });
|
||||
approachCircle.Transforms.Add(new TransformScale { StartTime = t - 1000, EndTime = t, StartValue = new Vector2(2f), EndValue = new Vector2(0.6f) });
|
||||
|
||||
//set transform delay to t==hitTime
|
||||
Delay(t - Time.Current, true);
|
||||
|
||||
approachCircle.FadeOut();
|
||||
glow.FadeOut(400);
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case ArmedState.Disarmed:
|
||||
Delay(h.Duration + 200);
|
||||
FadeOut(200);
|
||||
break;
|
||||
case ArmedState.Armed:
|
||||
const double flash_in = 30;
|
||||
|
||||
flash.FadeTo(0.8f, flash_in);
|
||||
flash.Delay(flash_in);
|
||||
flash.FadeOut(100);
|
||||
|
||||
explode.FadeIn(flash_in);
|
||||
|
||||
Delay(flash_in, true);
|
||||
|
||||
//after the flash, we can hide some elements that were behind it
|
||||
ring.FadeOut();
|
||||
circle.FadeOut();
|
||||
number.FadeOut();
|
||||
|
||||
FadeOut(800);
|
||||
ScaleTo(Scale * 1.5f, 400, EasingTypes.OutQuad);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private class NumberLayer : Container
|
||||
{
|
||||
private Sprite number;
|
||||
|
||||
public NumberLayer()
|
||||
{
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
Children = new[]
|
||||
{
|
||||
number = new Sprite
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Alpha = 1
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures)
|
||||
{
|
||||
number.Texture = textures.Get(@"Play/osu/number@2x");
|
||||
}
|
||||
}
|
||||
|
||||
private class GlowLayer : Container
|
||||
{
|
||||
private Sprite layer;
|
||||
|
||||
public GlowLayer()
|
||||
{
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
Children = new[]
|
||||
{
|
||||
layer = new Sprite
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
BlendingMode = BlendingMode.Additive,
|
||||
Alpha = 0.5f
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures)
|
||||
{
|
||||
layer.Texture = textures.Get(@"Play/osu/ring-glow@2x");
|
||||
}
|
||||
}
|
||||
|
||||
private class RingLayer : Container
|
||||
{
|
||||
private Sprite ring;
|
||||
|
||||
public RingLayer()
|
||||
{
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
Children = new Framework.Graphics.Drawable[]
|
||||
{
|
||||
ring = new Sprite
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures)
|
||||
{
|
||||
ring.Texture = textures.Get(@"Play/osu/ring@2x");
|
||||
}
|
||||
}
|
||||
|
||||
private class FlashLayer : Container
|
||||
{
|
||||
public FlashLayer()
|
||||
{
|
||||
Size = new Vector2(144);
|
||||
|
||||
Masking = true;
|
||||
CornerRadius = Size.X / 2;
|
||||
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
BlendingMode = BlendingMode.Additive;
|
||||
Alpha = 0;
|
||||
|
||||
Children = new Framework.Graphics.Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private class ExplodeLayer : Container
|
||||
{
|
||||
public ExplodeLayer()
|
||||
{
|
||||
Size = new Vector2(144);
|
||||
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
BlendingMode = BlendingMode.Additive;
|
||||
Alpha = 0;
|
||||
|
||||
Children = new Framework.Graphics.Drawable[]
|
||||
{
|
||||
new Triangles
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private class CircleLayer : Container
|
||||
{
|
||||
|
||||
private Sprite disc;
|
||||
private Triangles triangles;
|
||||
|
||||
public Func<bool> Hit;
|
||||
|
||||
public CircleLayer()
|
||||
{
|
||||
Size = new Vector2(144);
|
||||
Masking = true;
|
||||
CornerRadius = DrawSize.X / 2;
|
||||
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
Children = new Framework.Graphics.Drawable[]
|
||||
{
|
||||
disc = new Sprite
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre
|
||||
},
|
||||
triangles = new Triangles
|
||||
{
|
||||
BlendingMode = BlendingMode.Additive,
|
||||
RelativeSizeAxes = Axes.Both
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures)
|
||||
{
|
||||
disc.Texture = textures.Get(@"Play/osu/disc@2x");
|
||||
}
|
||||
|
||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
|
||||
{
|
||||
Hit?.Invoke();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private class Triangles : Container
|
||||
{
|
||||
private Texture tex;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures)
|
||||
{
|
||||
tex = textures.Get(@"Play/osu/triangle@2x");
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
Add(new Sprite
|
||||
{
|
||||
Texture = tex,
|
||||
Origin = Anchor.Centre,
|
||||
RelativePositionAxes = Axes.Both,
|
||||
Position = new Vector2(RNG.NextSingle(), RNG.NextSingle()),
|
||||
Scale = new Vector2(RNG.NextSingle() * 0.4f + 0.2f),
|
||||
Alpha = RNG.NextSingle() * 0.3f
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
foreach (Framework.Graphics.Drawable d in Children)
|
||||
d.Position -= new Vector2(0, (float)(d.Scale.X * (Time.Elapsed / 2880)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using OpenTK;
|
||||
using osu.Game.Beatmaps.Samples;
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Osu
|
||||
{
|
||||
public abstract class OsuBaseHit : HitObject
|
||||
{
|
||||
public Vector2 Position { get; set; }
|
||||
|
||||
[Flags]
|
||||
private enum HitObjectType
|
||||
{
|
||||
Circle = 1,
|
||||
Slider = 2,
|
||||
NewCombo = 4,
|
||||
CircleNewCombo = 5,
|
||||
SliderNewCombo = 6,
|
||||
Spinner = 8,
|
||||
ColourHax = 122,
|
||||
Hold = 128,
|
||||
ManiaLong = 128,
|
||||
}
|
||||
|
||||
public static OsuBaseHit Parse(string val)
|
||||
{
|
||||
string[] split = val.Split(',');
|
||||
var type = (HitObjectType)int.Parse(split[3]);
|
||||
bool combo = type.HasFlag(HitObjectType.NewCombo);
|
||||
type &= (HitObjectType)0xF;
|
||||
type &= ~HitObjectType.NewCombo;
|
||||
OsuBaseHit result;
|
||||
switch (type)
|
||||
{
|
||||
case HitObjectType.Circle:
|
||||
result = new Circle();
|
||||
break;
|
||||
case HitObjectType.Slider:
|
||||
result = new Slider();
|
||||
break;
|
||||
case HitObjectType.Spinner:
|
||||
result = new Spinner();
|
||||
break;
|
||||
default:
|
||||
throw new InvalidOperationException($@"Unknown hit object type {type}");
|
||||
}
|
||||
result.Position = new Vector2(int.Parse(split[0]), int.Parse(split[1]));
|
||||
result.StartTime = double.Parse(split[2]);
|
||||
result.Sample = new HitSampleInfo { Type = (SampleType)int.Parse(split[4]) };
|
||||
result.NewCombo = combo;
|
||||
// TODO: "addition" field
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Osu
|
||||
{
|
||||
class OsuConverter : HitObjectConverter<OsuBaseHit>
|
||||
{
|
||||
public override List<OsuBaseHit> Convert(List<HitObject> input)
|
||||
{
|
||||
List<OsuBaseHit> output = new List<OsuBaseHit>();
|
||||
|
||||
foreach (HitObject h in input)
|
||||
output.Add(h as OsuBaseHit);
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Collections.Generic;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Osu
|
||||
{
|
||||
public class Slider : OsuBaseHit
|
||||
{
|
||||
public List<Vector2> Path;
|
||||
|
||||
public int RepeatCount;
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Osu
|
||||
{
|
||||
public class Spinner : OsuBaseHit
|
||||
{
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using OpenTK;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Taiko.Drawable
|
||||
{
|
||||
class DrawableTaikoHit : Sprite
|
||||
{
|
||||
private TaikoBaseHit h;
|
||||
|
||||
public DrawableTaikoHit(TaikoBaseHit h)
|
||||
{
|
||||
this.h = h;
|
||||
|
||||
Origin = Anchor.Centre;
|
||||
Scale = new Vector2(0.2f);
|
||||
RelativePositionAxes = Axes.Both;
|
||||
Position = new Vector2(1.1f, 0.5f);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures)
|
||||
{
|
||||
Texture = textures.Get(@"Menu/logo");
|
||||
|
||||
Transforms.Add(new TransformPositionX { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = 1.1f, EndValue = 0.1f });
|
||||
Transforms.Add(new TransformAlpha { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 });
|
||||
Expire(true);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Taiko
|
||||
{
|
||||
public class TaikoBaseHit : HitObject
|
||||
{
|
||||
public float Scale = 1;
|
||||
|
||||
public TaikoColour Type;
|
||||
}
|
||||
|
||||
public enum TaikoColour
|
||||
{
|
||||
Red,
|
||||
Blue
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Beatmaps.Objects.Osu;
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Taiko
|
||||
{
|
||||
class TaikoConverter : HitObjectConverter<TaikoBaseHit>
|
||||
{
|
||||
public override List<TaikoBaseHit> Convert(List<HitObject> input)
|
||||
{
|
||||
List<TaikoBaseHit> output = new List<TaikoBaseHit>();
|
||||
|
||||
foreach (HitObject i in input)
|
||||
{
|
||||
TaikoBaseHit h = i as TaikoBaseHit;
|
||||
|
||||
if (h == null)
|
||||
{
|
||||
OsuBaseHit o = i as OsuBaseHit;
|
||||
|
||||
if (o == null) throw new HitObjectConvertException(@"Taiko", i);
|
||||
|
||||
h = new TaikoBaseHit
|
||||
{
|
||||
StartTime = o.StartTime,
|
||||
};
|
||||
}
|
||||
|
||||
output.Add(h);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
@ -3,8 +3,9 @@
|
||||
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.GameModes.Play;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Screens.Play;
|
||||
|
||||
namespace osu.Game.Configuration
|
||||
{
|
||||
|
@ -1,7 +1,8 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using osu.Game.Beatmaps.Samples;
|
||||
using osu.Game.GameModes.Play;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Screens.Play;
|
||||
using SQLite.Net.Attributes;
|
||||
using SQLiteNetExtensions.Attributes;
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Game.GameModes.Play;
|
||||
using SQLite.Net.Attributes;
|
||||
|
||||
namespace osu.Game.Database
|
||||
|
@ -1,13 +0,0 @@
|
||||
using osu.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace osu.Game.GameModes.Menu
|
||||
{
|
||||
internal class MenuVisualisation : Drawable
|
||||
{
|
||||
}
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK.Graphics;
|
||||
using osu.Game.GameModes.Play.Osu;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace osu.Game.GameModes.Play.Catch
|
||||
{
|
||||
/// <summary>
|
||||
/// Similar to Standard, but without the 'x' and has tinted pop-ups. Used in osu!catch.
|
||||
/// </summary>
|
||||
public class CatchComboCounter : OsuComboCounter
|
||||
{
|
||||
protected override bool CanPopOutWhileRolling => true;
|
||||
|
||||
protected virtual double FadeOutDelay => 1000;
|
||||
protected override double FadeOutDuration => 300;
|
||||
|
||||
protected override string FormatCount(ulong count)
|
||||
{
|
||||
return $@"{count:#,0}";
|
||||
}
|
||||
|
||||
private void animateFade()
|
||||
{
|
||||
Show();
|
||||
Delay(FadeOutDelay);
|
||||
FadeOut(FadeOutDuration);
|
||||
DelayReset();
|
||||
}
|
||||
|
||||
protected override void OnCountChange(ulong currentValue, ulong newValue)
|
||||
{
|
||||
if (newValue != 0)
|
||||
animateFade();
|
||||
base.OnCountChange(currentValue, newValue);
|
||||
}
|
||||
|
||||
protected override void OnCountRolling(ulong currentValue, ulong newValue)
|
||||
{
|
||||
if (!IsRolling)
|
||||
{
|
||||
PopOutSpriteText.Colour = DisplayedCountSpriteText.Colour;
|
||||
FadeOut(FadeOutDuration);
|
||||
}
|
||||
base.OnCountRolling(currentValue, newValue);
|
||||
}
|
||||
|
||||
protected override void OnCountIncrement(ulong currentValue, ulong newValue)
|
||||
{
|
||||
animateFade();
|
||||
base.OnCountIncrement(currentValue, newValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Increaces counter and tints pop-out before animation.
|
||||
/// </summary>
|
||||
/// <param name="colour">Last grabbed fruit colour.</param>
|
||||
public void CatchFruit(Color4 colour)
|
||||
{
|
||||
PopOutSpriteText.Colour = colour;
|
||||
Count++;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Beatmaps.Objects;
|
||||
using osu.Game.Beatmaps.Objects.Catch;
|
||||
using osu.Game.Beatmaps.Objects.Catch.Drawable;
|
||||
|
||||
namespace osu.Game.GameModes.Play.Catch
|
||||
{
|
||||
public class CatchHitRenderer : HitRenderer<CatchBaseHit>
|
||||
{
|
||||
protected override HitObjectConverter<CatchBaseHit> Converter => new CatchConverter();
|
||||
|
||||
protected override Playfield CreatePlayfield() => new CatchPlayfield();
|
||||
|
||||
protected override DrawableHitObject GetVisualRepresentation(CatchBaseHit h) => null;// new DrawableFruit(h);
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
|
||||
namespace osu.Game.GameModes.Play.Catch
|
||||
{
|
||||
public class CatchPlayfield : Playfield
|
||||
{
|
||||
public CatchPlayfield()
|
||||
{
|
||||
RelativeSizeAxes = Axes.Y;
|
||||
Size = new Vector2(512, 0.9f);
|
||||
Anchor = Anchor.BottomCentre;
|
||||
Origin = Anchor.BottomCentre;
|
||||
|
||||
Add(new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.5f });
|
||||
}
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Game.Beatmaps.Objects;
|
||||
using osu.Game.GameModes.Play.Osu;
|
||||
|
||||
namespace osu.Game.GameModes.Play.Catch
|
||||
{
|
||||
class CatchRuleset : Ruleset
|
||||
{
|
||||
public override ScoreOverlay CreateScoreOverlay() => new ScoreOverlayOsu();
|
||||
|
||||
public override HitRenderer CreateHitRendererWith(List<HitObject> objects) => new CatchHitRenderer { Objects = objects };
|
||||
}
|
||||
}
|
@ -1,84 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Game.GameModes.Play.Taiko;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace osu.Game.GameModes.Play.Mania
|
||||
{
|
||||
/// <summary>
|
||||
/// Similar to osu!taiko, with a pop-out animation when failing (rolling). Used in osu!mania.
|
||||
/// </summary>
|
||||
public class ManiaComboCounter : TaikoComboCounter
|
||||
{
|
||||
protected ushort KeysHeld = 0;
|
||||
|
||||
protected Color4 OriginalColour;
|
||||
|
||||
protected Color4 TintColour => Color4.Orange;
|
||||
protected EasingTypes TintEasing => EasingTypes.None;
|
||||
protected int TintDuration => 500;
|
||||
|
||||
protected Color4 PopOutColor => Color4.Red;
|
||||
protected override float PopOutInitialAlpha => 1.0f;
|
||||
protected override double PopOutDuration => 300;
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
PopOutSpriteText.Anchor = Anchor.BottomCentre;
|
||||
PopOutSpriteText.Origin = Anchor.Centre;
|
||||
PopOutSpriteText.FadeColour(PopOutColor, 0);
|
||||
OriginalColour = DisplayedCountSpriteText.Colour;
|
||||
}
|
||||
|
||||
protected override void OnCountRolling(ulong currentValue, ulong newValue)
|
||||
{
|
||||
if (!IsRolling && newValue < currentValue)
|
||||
{
|
||||
PopOutSpriteText.Text = FormatCount(currentValue);
|
||||
|
||||
PopOutSpriteText.FadeTo(PopOutInitialAlpha);
|
||||
PopOutSpriteText.ScaleTo(1.0f);
|
||||
|
||||
PopOutSpriteText.FadeOut(PopOutDuration, PopOutEasing);
|
||||
PopOutSpriteText.ScaleTo(PopOutScale, PopOutDuration, PopOutEasing);
|
||||
}
|
||||
|
||||
base.OnCountRolling(currentValue, newValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tints text while holding a key.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Does not alter combo. This has to be done depending of the scoring system.
|
||||
/// (i.e. v1 = each period of time; v2 = when starting and ending a key hold)
|
||||
/// </remarks>
|
||||
public void HoldStart()
|
||||
{
|
||||
if (KeysHeld == 0)
|
||||
DisplayedCountSpriteText.FadeColour(TintColour, TintDuration, TintEasing);
|
||||
KeysHeld++;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ends tinting.
|
||||
/// </summary>
|
||||
public void HoldEnd()
|
||||
{
|
||||
KeysHeld--;
|
||||
if (KeysHeld == 0)
|
||||
DisplayedCountSpriteText.FadeColour(OriginalColour, TintDuration, TintEasing);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Beatmaps.Objects;
|
||||
using osu.Game.Beatmaps.Objects.Mania;
|
||||
using osu.Game.Beatmaps.Objects.Mania.Drawable;
|
||||
|
||||
namespace osu.Game.GameModes.Play.Mania
|
||||
{
|
||||
public class ManiaHitRenderer : HitRenderer<ManiaBaseHit>
|
||||
{
|
||||
private readonly int columns;
|
||||
|
||||
public ManiaHitRenderer(int columns = 5)
|
||||
{
|
||||
this.columns = columns;
|
||||
}
|
||||
|
||||
protected override HitObjectConverter<ManiaBaseHit> Converter => new ManiaConverter(columns);
|
||||
|
||||
protected override Playfield CreatePlayfield() => new ManiaPlayfield(columns);
|
||||
|
||||
protected override DrawableHitObject GetVisualRepresentation(ManiaBaseHit h)
|
||||
{
|
||||
return null;
|
||||
//return new DrawableNote(h)
|
||||
//{
|
||||
// Position = new Vector2((float)(h.Column + 0.5) / columns, -0.1f),
|
||||
// RelativePositionAxes = Axes.Both
|
||||
//};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.GameModes.Play.Mania
|
||||
{
|
||||
public class ManiaPlayfield : Playfield
|
||||
{
|
||||
private readonly int columns;
|
||||
|
||||
public ManiaPlayfield(int columns)
|
||||
{
|
||||
this.columns = columns;
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
Size = new Vector2(columns / 20f, 1f);
|
||||
Anchor = Anchor.BottomCentre;
|
||||
Origin = Anchor.BottomCentre;
|
||||
|
||||
Add(new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.5f });
|
||||
|
||||
for (int i = 0; i < columns; i++)
|
||||
Add(new Box()
|
||||
{
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Size = new Vector2(2, 1),
|
||||
RelativePositionAxes = Axes.Both,
|
||||
Position = new Vector2((float)i / columns, 0),
|
||||
Alpha = 0.5f,
|
||||
Colour = Color4.Black
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Game.Beatmaps.Objects;
|
||||
using osu.Game.GameModes.Play.Osu;
|
||||
|
||||
namespace osu.Game.GameModes.Play.Mania
|
||||
{
|
||||
class ManiaRuleset : Ruleset
|
||||
{
|
||||
public override ScoreOverlay CreateScoreOverlay() => new ScoreOverlayOsu();
|
||||
|
||||
public override HitRenderer CreateHitRendererWith(List<HitObject> objects) => new ManiaHitRenderer { Objects = objects };
|
||||
}
|
||||
}
|
@ -1,157 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK;
|
||||
using osu.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Allocation;
|
||||
|
||||
namespace osu.Game.GameModes.Play.Osu
|
||||
{
|
||||
/// <summary>
|
||||
/// Uses the 'x' symbol and has a pop-out effect while rolling over. Used in osu! standard.
|
||||
/// </summary>
|
||||
public class OsuComboCounter : ComboCounter
|
||||
{
|
||||
protected uint ScheduledPopOutCurrentId = 0;
|
||||
|
||||
protected virtual float PopOutSmallScale => 1.1f;
|
||||
protected virtual bool CanPopOutWhileRolling => false;
|
||||
|
||||
public Vector2 InnerCountPosition
|
||||
{
|
||||
get
|
||||
{
|
||||
return DisplayedCountSpriteText.Position;
|
||||
}
|
||||
set
|
||||
{
|
||||
DisplayedCountSpriteText.Position = value;
|
||||
}
|
||||
}
|
||||
|
||||
public OsuComboCounter()
|
||||
{
|
||||
PopOutSpriteText.Origin = Origin;
|
||||
PopOutSpriteText.Anchor = Anchor;
|
||||
|
||||
Add(PopOutSpriteText);
|
||||
}
|
||||
|
||||
protected override string FormatCount(ulong count)
|
||||
{
|
||||
return $@"{count}x";
|
||||
}
|
||||
|
||||
protected virtual void TransformPopOut(ulong newValue)
|
||||
{
|
||||
PopOutSpriteText.Text = FormatCount(newValue);
|
||||
|
||||
PopOutSpriteText.ScaleTo(PopOutScale);
|
||||
PopOutSpriteText.FadeTo(PopOutInitialAlpha);
|
||||
PopOutSpriteText.MoveTo(Vector2.Zero);
|
||||
|
||||
PopOutSpriteText.ScaleTo(1, PopOutDuration, PopOutEasing);
|
||||
PopOutSpriteText.FadeOut(PopOutDuration, PopOutEasing);
|
||||
PopOutSpriteText.MoveTo(DisplayedCountSpriteText.Position, PopOutDuration, PopOutEasing);
|
||||
}
|
||||
|
||||
protected virtual void TransformPopOutRolling(ulong newValue)
|
||||
{
|
||||
TransformPopOut(newValue);
|
||||
TransformPopOutSmall(newValue);
|
||||
}
|
||||
|
||||
protected virtual void TransformNoPopOut(ulong newValue)
|
||||
{
|
||||
DisplayedCountSpriteText.Text = FormatCount(newValue);
|
||||
DisplayedCountSpriteText.ScaleTo(1);
|
||||
}
|
||||
|
||||
protected virtual void TransformPopOutSmall(ulong newValue)
|
||||
{
|
||||
DisplayedCountSpriteText.Text = FormatCount(newValue);
|
||||
DisplayedCountSpriteText.ScaleTo(PopOutSmallScale);
|
||||
DisplayedCountSpriteText.ScaleTo(1, PopOutDuration, PopOutEasing);
|
||||
}
|
||||
|
||||
protected virtual void ScheduledPopOutSmall(uint id)
|
||||
{
|
||||
// Too late; scheduled task invalidated
|
||||
if (id != ScheduledPopOutCurrentId)
|
||||
return;
|
||||
|
||||
DisplayedCount++;
|
||||
}
|
||||
|
||||
protected override void OnCountRolling(ulong currentValue, ulong newValue)
|
||||
{
|
||||
ScheduledPopOutCurrentId++;
|
||||
|
||||
// Hides displayed count if was increasing from 0 to 1 but didn't finish
|
||||
if (currentValue == 0 && newValue == 0)
|
||||
DisplayedCountSpriteText.FadeOut(FadeOutDuration);
|
||||
|
||||
base.OnCountRolling(currentValue, newValue);
|
||||
}
|
||||
|
||||
protected override void OnCountIncrement(ulong currentValue, ulong newValue)
|
||||
{
|
||||
ScheduledPopOutCurrentId++;
|
||||
|
||||
if (DisplayedCount < currentValue)
|
||||
DisplayedCount++;
|
||||
|
||||
DisplayedCountSpriteText.Show();
|
||||
|
||||
TransformPopOut(newValue);
|
||||
|
||||
uint newTaskId = ScheduledPopOutCurrentId;
|
||||
Scheduler.AddDelayed(delegate
|
||||
{
|
||||
ScheduledPopOutSmall(newTaskId);
|
||||
}, PopOutDuration);
|
||||
}
|
||||
|
||||
protected override void OnCountChange(ulong currentValue, ulong newValue)
|
||||
{
|
||||
ScheduledPopOutCurrentId++;
|
||||
|
||||
if (newValue == 0)
|
||||
DisplayedCountSpriteText.FadeOut();
|
||||
|
||||
base.OnCountChange(currentValue, newValue);
|
||||
}
|
||||
|
||||
protected override void OnDisplayedCountRolling(ulong currentValue, ulong newValue)
|
||||
{
|
||||
if (newValue == 0)
|
||||
DisplayedCountSpriteText.FadeOut(FadeOutDuration);
|
||||
else
|
||||
DisplayedCountSpriteText.Show();
|
||||
|
||||
if (CanPopOutWhileRolling)
|
||||
TransformPopOutRolling(newValue);
|
||||
else
|
||||
TransformNoPopOut(newValue);
|
||||
}
|
||||
|
||||
protected override void OnDisplayedCountChange(ulong newValue)
|
||||
{
|
||||
DisplayedCountSpriteText.FadeTo(newValue == 0 ? 0 : 1);
|
||||
|
||||
TransformNoPopOut(newValue);
|
||||
}
|
||||
|
||||
protected override void OnDisplayedCountIncrement(ulong newValue)
|
||||
{
|
||||
DisplayedCountSpriteText.Show();
|
||||
|
||||
TransformPopOutSmall(newValue);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Beatmaps.Objects;
|
||||
using osu.Game.Beatmaps.Objects.Osu;
|
||||
using osu.Game.Beatmaps.Objects.Osu.Drawable;
|
||||
|
||||
namespace osu.Game.GameModes.Play.Osu
|
||||
{
|
||||
public class OsuHitRenderer : HitRenderer<OsuBaseHit>
|
||||
{
|
||||
protected override HitObjectConverter<OsuBaseHit> Converter => new OsuConverter();
|
||||
|
||||
protected override Playfield CreatePlayfield() => new OsuPlayfield();
|
||||
|
||||
protected override DrawableHitObject GetVisualRepresentation(OsuBaseHit h)
|
||||
=> h is Circle ? new DrawableCircle(h as Circle) : null;
|
||||
}
|
||||
}
|
@ -1,59 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using OpenTK;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.GameModes.Play.Osu
|
||||
{
|
||||
public class OsuPlayfield : Playfield
|
||||
{
|
||||
protected override Container<Drawable> Content => hitObjectContainer;
|
||||
|
||||
private Container hitObjectContainer;
|
||||
|
||||
public override Vector2 Size
|
||||
{
|
||||
get
|
||||
{
|
||||
var parentSize = Parent.DrawSize;
|
||||
var aspectSize = parentSize.X * 0.75f < parentSize.Y ? new Vector2(parentSize.X, parentSize.X * 0.75f) : new Vector2(parentSize.Y * 4f / 3f, parentSize.Y);
|
||||
|
||||
return new Vector2(aspectSize.X / parentSize.X, aspectSize.Y / parentSize.Y) * base.Size;
|
||||
}
|
||||
}
|
||||
|
||||
public OsuPlayfield()
|
||||
{
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
Size = new Vector2(0.75f);
|
||||
|
||||
AddInternal(new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Colour = Color4.Black,
|
||||
Alpha = 0.5f,
|
||||
});
|
||||
|
||||
AddInternal(hitObjectContainer = new HitObjectContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
});
|
||||
}
|
||||
|
||||
class HitObjectContainer : Container
|
||||
{
|
||||
public override Vector2 ChildScale => new Vector2(0.625f);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Game.Beatmaps.Objects;
|
||||
|
||||
namespace osu.Game.GameModes.Play.Osu
|
||||
{
|
||||
class OsuRuleset : Ruleset
|
||||
{
|
||||
public override ScoreOverlay CreateScoreOverlay() => new ScoreOverlayOsu();
|
||||
|
||||
public override HitRenderer CreateHitRendererWith(List<HitObject> objects) => new OsuHitRenderer { Objects = objects };
|
||||
}}
|
@ -1,55 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using OpenTK;
|
||||
using OpenTK.Input;
|
||||
using osu.Game.Beatmaps.Objects;
|
||||
|
||||
namespace osu.Game.GameModes.Play.Osu
|
||||
{
|
||||
class ScoreOverlayOsu : ScoreOverlay
|
||||
{
|
||||
protected override PercentageCounter CreateAccuracyCounter() => new PercentageCounter()
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
Position = new Vector2(0, 45)
|
||||
};
|
||||
|
||||
protected override ScoreCounter CreateScoreCounter() => new ScoreCounter()
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
TextSize = 60
|
||||
};
|
||||
|
||||
protected override ComboCounter CreateComboCounter() => new OsuComboCounter()
|
||||
{
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
};
|
||||
|
||||
protected override KeyCounterCollection CreateKeyCounter() => new KeyCounterCollection
|
||||
{
|
||||
IsCounting = true,
|
||||
FadeTime = 50,
|
||||
Anchor = Anchor.BottomRight,
|
||||
Origin = Anchor.BottomRight,
|
||||
Position = new Vector2(10),
|
||||
Counters = new KeyCounter[]
|
||||
{
|
||||
new KeyCounterKeyboard(@"Z", Key.Z),
|
||||
new KeyCounterKeyboard(@"X", Key.X),
|
||||
new KeyCounterMouse(@"M1", MouseButton.Left),
|
||||
new KeyCounterMouse(@"M2", MouseButton.Right),
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Game.Beatmaps.Objects;
|
||||
using osu.Game.GameModes.Play.Catch;
|
||||
using osu.Game.GameModes.Play.Mania;
|
||||
using osu.Game.GameModes.Play.Osu;
|
||||
using osu.Game.GameModes.Play.Taiko;
|
||||
|
||||
namespace osu.Game.GameModes.Play
|
||||
{
|
||||
public abstract class Ruleset
|
||||
{
|
||||
public abstract ScoreOverlay CreateScoreOverlay();
|
||||
|
||||
public abstract HitRenderer CreateHitRendererWith(List<HitObject> objects);
|
||||
|
||||
public static Ruleset GetRuleset(PlayMode mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
default:
|
||||
return new OsuRuleset();
|
||||
case PlayMode.Catch:
|
||||
return new CatchRuleset();
|
||||
case PlayMode.Mania:
|
||||
return new ManiaRuleset();
|
||||
case PlayMode.Taiko:
|
||||
return new TaikoRuleset();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace osu.Game.GameModes.Play.Taiko
|
||||
{
|
||||
/// <summary>
|
||||
/// Allows tint and scaling animations. Used in osu!taiko.
|
||||
/// </summary>
|
||||
public class TaikoComboCounter : ComboCounter
|
||||
{
|
||||
protected virtual int AnimationDuration => 300;
|
||||
protected virtual float ScaleFactor => 2;
|
||||
protected virtual EasingTypes AnimationEasing => EasingTypes.None;
|
||||
protected virtual bool CanAnimateWhenBackwards => false;
|
||||
|
||||
public TaikoComboCounter()
|
||||
{
|
||||
DisplayedCountSpriteText.Origin = Framework.Graphics.Anchor.BottomCentre;
|
||||
DisplayedCountSpriteText.Anchor = Framework.Graphics.Anchor.BottomCentre;
|
||||
}
|
||||
|
||||
protected virtual void TransformAnimate(ulong newValue)
|
||||
{
|
||||
DisplayedCountSpriteText.Text = FormatCount(newValue);
|
||||
DisplayedCountSpriteText.ScaleTo(new Vector2(1, ScaleFactor));
|
||||
DisplayedCountSpriteText.ScaleTo(new Vector2(1, 1), AnimationDuration, AnimationEasing);
|
||||
}
|
||||
|
||||
protected virtual void TransformNotAnimate(ulong newValue)
|
||||
{
|
||||
DisplayedCountSpriteText.Text = FormatCount(newValue);
|
||||
DisplayedCountSpriteText.ScaleTo(1);
|
||||
}
|
||||
|
||||
protected override void OnDisplayedCountRolling(ulong currentValue, ulong newValue)
|
||||
{
|
||||
if (newValue == 0)
|
||||
DisplayedCountSpriteText.FadeOut(FadeOutDuration);
|
||||
else
|
||||
DisplayedCountSpriteText.Show();
|
||||
|
||||
TransformNotAnimate(newValue);
|
||||
}
|
||||
|
||||
protected override void OnDisplayedCountChange(ulong newValue)
|
||||
{
|
||||
DisplayedCountSpriteText.FadeTo(newValue == 0 ? 0 : 1);
|
||||
|
||||
TransformNotAnimate(newValue);
|
||||
}
|
||||
|
||||
protected override void OnDisplayedCountIncrement(ulong newValue)
|
||||
{
|
||||
DisplayedCountSpriteText.Show();
|
||||
|
||||
TransformAnimate(newValue);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Beatmaps.Objects;
|
||||
using osu.Game.Beatmaps.Objects.Taiko;
|
||||
using osu.Game.Beatmaps.Objects.Taiko.Drawable;
|
||||
|
||||
namespace osu.Game.GameModes.Play.Taiko
|
||||
{
|
||||
public class TaikoHitRenderer : HitRenderer<TaikoBaseHit>
|
||||
{
|
||||
protected override HitObjectConverter<TaikoBaseHit> Converter => new TaikoConverter();
|
||||
|
||||
protected override Playfield CreatePlayfield() => new TaikoPlayfield();
|
||||
|
||||
protected override DrawableHitObject GetVisualRepresentation(TaikoBaseHit h) => null;// new DrawableTaikoHit(h);
|
||||
}
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
|
||||
namespace osu.Game.GameModes.Play.Taiko
|
||||
{
|
||||
public class TaikoPlayfield : Playfield
|
||||
{
|
||||
public TaikoPlayfield()
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Size = new Vector2(1, 100);
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures)
|
||||
{
|
||||
Add(new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.5f });
|
||||
|
||||
Add(new Sprite
|
||||
{
|
||||
Texture = textures.Get(@"Menu/logo"),
|
||||
Origin = Anchor.Centre,
|
||||
Scale = new Vector2(0.2f),
|
||||
RelativePositionAxes = Axes.Both,
|
||||
Position = new Vector2(0.1f, 0.5f),
|
||||
Colour = Color4.Gray
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Game.Beatmaps.Objects;
|
||||
using osu.Game.GameModes.Play.Osu;
|
||||
|
||||
namespace osu.Game.GameModes.Play.Taiko
|
||||
{
|
||||
class TaikoRuleset : Ruleset
|
||||
{
|
||||
public override ScoreOverlay CreateScoreOverlay() => new ScoreOverlayOsu();
|
||||
|
||||
public override HitRenderer CreateHitRendererWith(List<HitObject> objects) => new TaikoHitRenderer { Objects = objects };
|
||||
}
|
||||
}
|
@ -7,6 +7,7 @@ using osu.Framework.Input;
|
||||
using osu.Framework.Threading;
|
||||
using OpenTK;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface.Volume
|
||||
{
|
||||
@ -21,8 +22,6 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
||||
private FlowContainer content;
|
||||
protected override Container<Drawable> Content => content;
|
||||
|
||||
public override bool Contains(Vector2 screenSpacePos) => true;
|
||||
|
||||
private void volumeChanged(object sender, EventArgs e)
|
||||
{
|
||||
Show();
|
||||
@ -40,7 +39,7 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.BottomRight,
|
||||
Origin = Anchor.BottomRight,
|
||||
Position = new Vector2(10, 30),
|
||||
Margin = new MarginPadding { Left = 10, Right = 10, Top = 30, Bottom = 30 },
|
||||
Spacing = new Vector2(15, 0),
|
||||
});
|
||||
}
|
||||
@ -69,13 +68,15 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
||||
base.Dispose(isDisposing);
|
||||
}
|
||||
|
||||
protected override bool OnWheel(InputState state)
|
||||
public void Adjust(InputState state)
|
||||
{
|
||||
if (!IsVisible)
|
||||
return false;
|
||||
{
|
||||
Show();
|
||||
return;
|
||||
}
|
||||
|
||||
volumeMeterMaster.TriggerWheel(state);
|
||||
return true;
|
||||
}
|
||||
|
||||
ScheduledDelegate popOutDelegate;
|
||||
|
@ -12,11 +12,11 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
||||
{
|
||||
class VolumeControlReceptor : Container
|
||||
{
|
||||
public Action ActivateRequested;
|
||||
public Action<InputState> ActionRequested;
|
||||
|
||||
protected override bool OnWheel(InputState state)
|
||||
{
|
||||
ActivateRequested?.Invoke();
|
||||
ActionRequested?.Invoke(state);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
||||
{
|
||||
case Key.Up:
|
||||
case Key.Down:
|
||||
ActivateRequested?.Invoke();
|
||||
ActionRequested?.Invoke(state);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2,15 +2,10 @@
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Beatmaps.Objects.Osu.Drawable;
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects
|
||||
namespace osu.Game.Modes.Objects.Drawables
|
||||
{
|
||||
public abstract class DrawableHitObject : Container, IStateful<ArmedState>
|
||||
{
|
@ -1,12 +1,10 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Game.Beatmaps.Objects.Osu;
|
||||
using osu.Game.Beatmaps.Samples;
|
||||
using osu.Game.GameModes.Play;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects
|
||||
namespace osu.Game.Modes.Objects
|
||||
{
|
||||
/// <summary>
|
||||
/// A hitobject describes a point in a beatmap
|
||||
@ -23,17 +21,5 @@ namespace osu.Game.Beatmaps.Objects
|
||||
public double Duration => EndTime - StartTime;
|
||||
|
||||
public HitSampleInfo Sample;
|
||||
|
||||
public static HitObject Parse(PlayMode mode, string val)
|
||||
{
|
||||
//TODO: move to modular HitObjectParser system rather than static parsing. (https://github.com/ppy/osu/pull/60/files#r83135780)
|
||||
switch (mode)
|
||||
{
|
||||
case PlayMode.Osu:
|
||||
return OsuBaseHit.Parse(val);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -4,13 +4,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects
|
||||
namespace osu.Game.Modes.Objects
|
||||
{
|
||||
public abstract class HitObjectConverter<T>
|
||||
where T : HitObject
|
||||
{
|
||||
public abstract List<T> Convert(List<HitObject> input);
|
||||
}
|
||||
|
||||
public class HitObjectConvertException : Exception
|
||||
{
|
||||
public HitObject Input { get; }
|
@ -7,9 +7,10 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace osu.Game.GameModes.Charts
|
||||
namespace osu.Game.Modes.Objects
|
||||
{
|
||||
class ChartInfo : GameModeWhiteBox
|
||||
public abstract class HitObjectParser
|
||||
{
|
||||
public abstract HitObject Parse(string text);
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace osu.Game.GameModes.Play
|
||||
namespace osu.Game.Modes
|
||||
{
|
||||
public enum PlayMode
|
||||
{
|
39
osu.Game/Modes/Ruleset.cs
Normal file
39
osu.Game/Modes/Ruleset.cs
Normal file
@ -0,0 +1,39 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Modes.Objects;
|
||||
using osu.Game.Modes.UI;
|
||||
using System.Reflection;
|
||||
using osu.Framework.Extensions;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Linq;
|
||||
|
||||
namespace osu.Game.Modes
|
||||
{
|
||||
public abstract class Ruleset
|
||||
{
|
||||
private static ConcurrentDictionary<PlayMode, Type> availableRulesets = new ConcurrentDictionary<PlayMode, Type>();
|
||||
|
||||
public abstract ScoreOverlay CreateScoreOverlay();
|
||||
|
||||
public abstract HitRenderer CreateHitRendererWith(List<HitObject> objects);
|
||||
|
||||
public abstract HitObjectParser CreateHitObjectParser();
|
||||
|
||||
public static void Register(Ruleset ruleset) => availableRulesets.TryAdd(ruleset.PlayMode, ruleset.GetType());
|
||||
|
||||
protected abstract PlayMode PlayMode { get; }
|
||||
|
||||
public static Ruleset GetRuleset(PlayMode mode)
|
||||
{
|
||||
Type type;
|
||||
|
||||
if (!availableRulesets.TryGetValue(mode, out type))
|
||||
return null;
|
||||
|
||||
return Activator.CreateInstance(type) as Ruleset;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,22 +1,13 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Framework.Timing;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Allocation;
|
||||
|
||||
namespace osu.Game.GameModes.Play
|
||||
namespace osu.Game.Modes.UI
|
||||
{
|
||||
public abstract class ComboCounter : Container
|
||||
{
|
@ -1,18 +1,13 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Framework.MathUtils;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace osu.Game.GameModes.Play
|
||||
namespace osu.Game.Modes.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to display combo with a roll-up animation in results screen.
|
@ -1,16 +1,16 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Beatmaps.Objects;
|
||||
using osu.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Modes.Objects;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
|
||||
namespace osu.Game.GameModes.Play
|
||||
namespace osu.Game.Modes.UI
|
||||
{
|
||||
public abstract class HitRenderer : Container
|
||||
{
|
@ -1,10 +1,9 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.GameModes.Play
|
||||
namespace osu.Game.Modes.UI
|
||||
{
|
||||
public class Playfield : Container
|
||||
{
|
@ -2,16 +2,12 @@
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Beatmaps.Objects;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Modes.Objects;
|
||||
|
||||
namespace osu.Game.GameModes.Play
|
||||
namespace osu.Game.Modes.UI
|
||||
{
|
||||
public abstract class ScoreOverlay : Container
|
||||
{
|
@ -8,7 +8,6 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Game.Online.Chat.Display.osu.Online.Social;
|
||||
using OpenTK;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
|
@ -1,75 +1,68 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Allocation;
|
||||
|
||||
namespace osu.Game.Online.Chat.Display
|
||||
{
|
||||
namespace osu.Online.Social
|
||||
public class ChatLine : Container
|
||||
{
|
||||
public class ChatLine : Container
|
||||
public readonly Message Message;
|
||||
|
||||
const float padding = 200;
|
||||
const float text_size = 20;
|
||||
|
||||
public ChatLine(Message message)
|
||||
{
|
||||
public readonly Message Message;
|
||||
this.Message = message;
|
||||
|
||||
const float padding = 200;
|
||||
const float text_size = 20;
|
||||
RelativeSizeAxes = Axes.X;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
|
||||
public ChatLine(Message message)
|
||||
Children = new Drawable[]
|
||||
{
|
||||
this.Message = message;
|
||||
|
||||
RelativeSizeAxes = Axes.X;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
|
||||
Children = new Drawable[]
|
||||
new Container
|
||||
{
|
||||
new Container
|
||||
Size = new Vector2(padding, text_size),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
Size = new Vector2(padding, text_size),
|
||||
Children = new Drawable[]
|
||||
new SpriteText
|
||||
{
|
||||
new SpriteText
|
||||
{
|
||||
Text = Message.Timestamp.LocalDateTime.ToLongTimeString(),
|
||||
TextSize = text_size,
|
||||
Colour = new Color4(128, 128, 128, 255)
|
||||
},
|
||||
new SpriteText
|
||||
{
|
||||
Text = Message.User.Name,
|
||||
TextSize = text_size,
|
||||
Origin = Anchor.TopRight,
|
||||
Anchor = Anchor.TopRight,
|
||||
}
|
||||
}
|
||||
},
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Padding = new MarginPadding { Left = padding + 10 },
|
||||
Children = new Drawable[]
|
||||
Text = Message.Timestamp.LocalDateTime.ToLongTimeString(),
|
||||
TextSize = text_size,
|
||||
Colour = new Color4(128, 128, 128, 255)
|
||||
},
|
||||
new SpriteText
|
||||
{
|
||||
new SpriteText
|
||||
{
|
||||
Text = Message.Content,
|
||||
TextSize = text_size,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
}
|
||||
Text = Message.User.Name,
|
||||
TextSize = text_size,
|
||||
Origin = Anchor.TopRight,
|
||||
Anchor = Anchor.TopRight,
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Padding = new MarginPadding { Left = padding + 10 },
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new SpriteText
|
||||
{
|
||||
Text = Message.Content,
|
||||
TextSize = text_size,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,22 +6,23 @@ using System.Threading;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.GameModes.Menu;
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.GameModes.Play;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Input;
|
||||
using OpenTK.Input;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.GameModes;
|
||||
using osu.Game.Graphics.UserInterface.Volume;
|
||||
using osu.Game.Database;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Screens;
|
||||
using osu.Game.Screens.Menu;
|
||||
using osu.Game.Screens.Play;
|
||||
|
||||
namespace osu.Game
|
||||
{
|
||||
@ -90,7 +91,7 @@ namespace osu.Game
|
||||
new VolumeControlReceptor
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
ActivateRequested = delegate { volume.Show(); }
|
||||
ActionRequested = delegate(InputState state) { volume.Adjust(state); }
|
||||
},
|
||||
mainContent = new Container
|
||||
{
|
||||
@ -120,8 +121,8 @@ namespace osu.Game
|
||||
|
||||
//overlay elements
|
||||
(chat = new ChatConsole(API) { Depth = 0 }).Preload(this, overlayContent.Add);
|
||||
(musicController = new MusicController()).Preload(this, overlayContent.Add);
|
||||
(Options = new OptionsOverlay { Depth = 1 }).Preload(this, overlayContent.Add);
|
||||
(musicController = new MusicController() { Depth = 3 }).Preload(this, overlayContent.Add);
|
||||
(Toolbar = new Toolbar
|
||||
{
|
||||
Depth = 2,
|
||||
@ -174,9 +175,10 @@ namespace osu.Game
|
||||
// - Frame limiter changes
|
||||
|
||||
//central game mode change logic.
|
||||
if ((newMode as OsuGameMode)?.ShowToolbar != true)
|
||||
if ((newMode as OsuGameMode)?.ShowOverlays != true)
|
||||
{
|
||||
Toolbar.State = Visibility.Hidden;
|
||||
musicController.State = Visibility.Hidden;
|
||||
chat.State = Visibility.Hidden;
|
||||
}
|
||||
else
|
||||
|
@ -49,6 +49,9 @@ namespace osu.Game
|
||||
|
||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome"));
|
||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont"));
|
||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Medium"));
|
||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-MediumItalic"));
|
||||
|
||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Regular"));
|
||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-RegularItalic"));
|
||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-SemiBold"));
|
||||
@ -57,8 +60,6 @@ namespace osu.Game
|
||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BoldItalic"));
|
||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Light"));
|
||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-LightItalic"));
|
||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Medium"));
|
||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-MediumItalic"));
|
||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Black"));
|
||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BlackItalic"));
|
||||
|
||||
|
@ -145,7 +145,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
MoveToY(-DrawSize.Y, transition_length, EasingTypes.InQuint);
|
||||
MoveToY(DrawSize.Y, transition_length, EasingTypes.InQuint);
|
||||
FadeOut(transition_length, EasingTypes.InQuint);
|
||||
}
|
||||
}
|
||||
|
@ -22,12 +22,13 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class MusicController : OverlayContainer
|
||||
{
|
||||
private static readonly Vector2 start_position = new Vector2(10, 60);
|
||||
private static readonly Vector2 start_position = new Vector2(0, 50);
|
||||
|
||||
private MusicControllerBackground backgroundSprite;
|
||||
private DragBar progress;
|
||||
@ -63,6 +64,8 @@ namespace osu.Game.Overlays
|
||||
Anchor = Anchor.TopRight;//placeholder
|
||||
Origin = Anchor.TopRight;
|
||||
Position = start_position;
|
||||
Margin = new MarginPadding(10);
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
title = new SpriteText
|
||||
@ -90,7 +93,7 @@ namespace osu.Game.Overlays
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.BottomCentre,
|
||||
Position = new Vector2(0, 30),
|
||||
Position = new Vector2(0, -30),
|
||||
Action = () =>
|
||||
{
|
||||
if (current?.Track == null) return;
|
||||
@ -115,7 +118,7 @@ namespace osu.Game.Overlays
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.BottomCentre,
|
||||
Position = new Vector2(-30, 30),
|
||||
Position = new Vector2(-30, -30),
|
||||
Action = prev,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
@ -133,7 +136,7 @@ namespace osu.Game.Overlays
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.BottomCentre,
|
||||
Position = new Vector2(30, 30),
|
||||
Position = new Vector2(30, -30),
|
||||
Action = next,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
@ -151,7 +154,7 @@ namespace osu.Game.Overlays
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.BottomRight,
|
||||
Position = new Vector2(20, 30),
|
||||
Position = new Vector2(20, -30),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
listButton = new TextAwesome
|
||||
@ -168,7 +171,7 @@ namespace osu.Game.Overlays
|
||||
Origin = Anchor.BottomCentre,
|
||||
Anchor = Anchor.BottomCentre,
|
||||
Height = 10,
|
||||
Colour = Color4.Orange,
|
||||
Colour = new Color4(255, 204, 34, 255),
|
||||
SeekRequested = seek
|
||||
}
|
||||
};
|
||||
@ -179,8 +182,8 @@ namespace osu.Game.Overlays
|
||||
protected override bool OnDrag(InputState state)
|
||||
{
|
||||
Vector2 change = (state.Mouse.Position - state.Mouse.PositionMouseDown.Value);
|
||||
change.X = -change.X;
|
||||
|
||||
// Diminish the drag distance as we go further to simulate "rubber band" feeling.
|
||||
change *= (float)Math.Pow(change.Length, 0.7f) / change.Length;
|
||||
|
||||
MoveTo(start_position + change);
|
||||
|
@ -1,10 +1,19 @@
|
||||
using System;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Input;
|
||||
|
||||
namespace osu.Game.Overlays.Options
|
||||
{
|
||||
public class CheckBoxOption : BasicCheckBox
|
||||
public class CheckBoxOption : CheckBox
|
||||
{
|
||||
private Bindable<bool> bindable;
|
||||
|
||||
@ -25,6 +34,50 @@ namespace osu.Game.Overlays.Options
|
||||
}
|
||||
}
|
||||
|
||||
public Color4 CheckedColor { get; set; } = Color4.Cyan;
|
||||
public Color4 UncheckedColor { get; set; } = Color4.White;
|
||||
public int FadeDuration { get; set; }
|
||||
|
||||
public string LabelText
|
||||
{
|
||||
get { return labelSpriteText?.Text; }
|
||||
set
|
||||
{
|
||||
if (labelSpriteText != null)
|
||||
labelSpriteText.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
public MarginPadding LabelPadding
|
||||
{
|
||||
get { return labelSpriteText?.Padding ?? new MarginPadding(); }
|
||||
set
|
||||
{
|
||||
if (labelSpriteText != null)
|
||||
labelSpriteText.Padding = value;
|
||||
}
|
||||
}
|
||||
|
||||
private Light light;
|
||||
private SpriteText labelSpriteText;
|
||||
|
||||
public CheckBoxOption()
|
||||
{
|
||||
AutoSizeAxes = Axes.Y;
|
||||
RelativeSizeAxes = Axes.X;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
labelSpriteText = new SpriteText(),
|
||||
light = new Light()
|
||||
{
|
||||
Anchor = Anchor.CentreRight,
|
||||
Origin = Anchor.CentreRight,
|
||||
Margin = new MarginPadding { Right = 5 },
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void bindableValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
State = bindable.Value ? CheckBoxState.Checked : CheckBoxState.Unchecked;
|
||||
@ -37,18 +90,116 @@ namespace osu.Game.Overlays.Options
|
||||
base.Dispose(isDisposing);
|
||||
}
|
||||
|
||||
protected override bool OnHover(InputState state)
|
||||
{
|
||||
light.Glowing = true;
|
||||
return base.OnHover(state);
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(InputState state)
|
||||
{
|
||||
light.Glowing = false;
|
||||
base.OnHoverLost(state);
|
||||
}
|
||||
|
||||
protected override void OnChecked()
|
||||
{
|
||||
if (bindable != null)
|
||||
bindable.Value = true;
|
||||
base.OnChecked();
|
||||
|
||||
light.State = CheckBoxState.Checked;
|
||||
}
|
||||
|
||||
protected override void OnUnchecked()
|
||||
{
|
||||
if (bindable != null)
|
||||
bindable.Value = false;
|
||||
base.OnUnchecked();
|
||||
|
||||
light.State = CheckBoxState.Unchecked;
|
||||
}
|
||||
|
||||
private class Light : Container, IStateful<CheckBoxState>
|
||||
{
|
||||
private Box fill;
|
||||
|
||||
const float border_width = 3;
|
||||
|
||||
Color4 hoverColour = new Color4(255, 221, 238, 255);
|
||||
Color4 defaultColour = new Color4(255, 102, 170, 255);
|
||||
Color4 glowColour = new Color4(187, 17, 119, 0);
|
||||
|
||||
public Light()
|
||||
{
|
||||
Size = new Vector2(40, 12);
|
||||
|
||||
Masking = true;
|
||||
|
||||
Colour = defaultColour;
|
||||
|
||||
EdgeEffect = new EdgeEffect
|
||||
{
|
||||
Colour = glowColour,
|
||||
Type = EdgeEffectType.Glow,
|
||||
Radius = 10,
|
||||
Roundness = 8,
|
||||
};
|
||||
|
||||
CornerRadius = Height / 2;
|
||||
Masking = true;
|
||||
BorderColour = Color4.White;
|
||||
BorderThickness = border_width;
|
||||
|
||||
Children = new[]
|
||||
{
|
||||
fill = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Alpha = 0.01f, //todo: remove once we figure why containers aren't drawing at all times
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
public bool Glowing
|
||||
{
|
||||
set
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
FadeColour(hoverColour, 500, EasingTypes.OutQuint);
|
||||
FadeGlowTo(1, 500, EasingTypes.OutQuint);
|
||||
}
|
||||
else
|
||||
{
|
||||
FadeGlowTo(0, 500);
|
||||
FadeColour(defaultColour, 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private CheckBoxState state;
|
||||
|
||||
public CheckBoxState State
|
||||
{
|
||||
get
|
||||
{
|
||||
return state;
|
||||
}
|
||||
set
|
||||
{
|
||||
state = value;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case CheckBoxState.Checked:
|
||||
fill.FadeIn(200, EasingTypes.OutQuint);
|
||||
break;
|
||||
case CheckBoxState.Unchecked:
|
||||
fill.FadeTo(0.01f, 200, EasingTypes.OutQuint); //todo: remove once we figure why containers aren't drawing at all times
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,9 @@ namespace osu.Game.Overlays.Options
|
||||
|
||||
public OptionsSection()
|
||||
{
|
||||
const int headerSize = 30, headerMargin = 25;
|
||||
Margin = new MarginPadding { Top = 20 };
|
||||
|
||||
const int headerSize = 26, headerMargin = 25;
|
||||
const int borderSize = 2;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
RelativeSizeAxes = Axes.X;
|
||||
@ -26,7 +28,7 @@ namespace osu.Game.Overlays.Options
|
||||
{
|
||||
new Box
|
||||
{
|
||||
Colour = new Color4(30, 30, 30, 255),
|
||||
Colour = new Color4(0, 0, 0, 255),
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = borderSize,
|
||||
},
|
||||
@ -34,7 +36,7 @@ namespace osu.Game.Overlays.Options
|
||||
{
|
||||
Padding = new MarginPadding
|
||||
{
|
||||
Top = 10 + borderSize,
|
||||
Top = 20 + borderSize,
|
||||
Left = OptionsOverlay.CONTENT_MARGINS,
|
||||
Right = OptionsOverlay.CONTENT_MARGINS,
|
||||
Bottom = 10,
|
||||
@ -53,7 +55,7 @@ namespace osu.Game.Overlays.Options
|
||||
{
|
||||
Margin = new MarginPadding { Top = headerSize + headerMargin },
|
||||
Direction = FlowDirection.VerticalOnly,
|
||||
Spacing = new Vector2(0, 25),
|
||||
Spacing = new Vector2(0, 50),
|
||||
AutoSizeAxes = Axes.Y,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
},
|
||||
|
@ -28,9 +28,9 @@ namespace osu.Game.Overlays.Options
|
||||
{
|
||||
new SpriteText
|
||||
{
|
||||
TextSize = 25,
|
||||
Text = Header,
|
||||
// TODO: Bold
|
||||
TextSize = 17,
|
||||
Text = Header.ToUpper(),
|
||||
Font = @"Exo2.0-Black",
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -85,7 +85,7 @@ namespace osu.Game.Overlays.Options
|
||||
Width = 5,
|
||||
Anchor = Anchor.CentreRight,
|
||||
Origin = Anchor.CentreRight,
|
||||
Colour = new Color4(233, 103, 161, 255)
|
||||
Colour = new Color4(247, 198, 35, 255)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ namespace osu.Game.Overlays
|
||||
},
|
||||
new SpriteText
|
||||
{
|
||||
Colour = new Color4(235, 117, 139, 255),
|
||||
Colour = new Color4(255, 102, 170, 255),
|
||||
Text = "Change the way osu! behaves",
|
||||
TextSize = 18,
|
||||
Margin = new MarginPadding { Left = CONTENT_MARGINS, Bottom = 30 },
|
||||
|
@ -9,10 +9,13 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.GameModes.Play;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Framework.Input;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
@ -27,6 +30,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
private ToolbarModeSelector modeSelector;
|
||||
private ToolbarButton userButton;
|
||||
private Box gradientBackground;
|
||||
|
||||
private const int transition_time = 200;
|
||||
|
||||
@ -42,6 +46,17 @@ namespace osu.Game.Overlays
|
||||
FadeOut(transition_time, EasingTypes.InQuint);
|
||||
}
|
||||
|
||||
protected override bool OnHover(InputState state)
|
||||
{
|
||||
gradientBackground.FadeIn(200);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(InputState state)
|
||||
{
|
||||
gradientBackground.FadeOut(200);
|
||||
}
|
||||
|
||||
public Toolbar()
|
||||
{
|
||||
Children = new Drawable[]
|
||||
@ -49,7 +64,20 @@ namespace osu.Game.Overlays
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = new Color4(0.1f, 0.1f, 0.1f, 0.4f)
|
||||
Colour = new Color4(0.1f, 0.1f, 0.1f, 0.6f)
|
||||
},
|
||||
gradientBackground = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Alpha = 0,
|
||||
Height = 90,
|
||||
ColourInfo = new ColourInfo {
|
||||
TopLeft = new Color4(0.1f, 0.1f, 0.1f, 0.5f),
|
||||
TopRight = new Color4(0.1f, 0.1f, 0.1f, 0.5f),
|
||||
BottomLeft = new Color4(0.1f, 0.1f, 0.1f, 0f),
|
||||
BottomRight = new Color4(0.1f, 0.1f, 0.1f, 0f),
|
||||
},
|
||||
},
|
||||
new FlowContainer
|
||||
{
|
||||
|
@ -98,7 +98,7 @@ namespace osu.Game.Overlays
|
||||
Direction = FlowDirection.VerticalOnly,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Position = new Vector2(5, -5),
|
||||
Position = new Vector2(5, 5),
|
||||
Alpha = 0,
|
||||
Children = new[]
|
||||
{
|
||||
@ -127,7 +127,9 @@ namespace osu.Game.Overlays
|
||||
Size = new Vector2(WIDTH + (DrawableText.IsVisible ? DrawableText.DrawSize.X : 0), 1);
|
||||
}
|
||||
|
||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs e)
|
||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
||||
|
||||
protected override bool OnClick(InputState state)
|
||||
{
|
||||
Action?.Invoke();
|
||||
HoverBackground.FlashColour(Color4.White, 400);
|
||||
@ -138,7 +140,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
HoverBackground.FadeTo(0.4f, 200);
|
||||
tooltipContainer.FadeIn(100);
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(InputState state)
|
||||
|
@ -2,11 +2,12 @@
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Game.GameModes.Play;
|
||||
using osu.Game.Graphics;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Screens.Play;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
|
@ -6,13 +6,14 @@ using System.Linq;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Game.GameModes.Play;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Caching;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Screens.Play;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
|
@ -2,20 +2,16 @@
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework;
|
||||
using System.Threading;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Framework.Input;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.GameModes
|
||||
namespace osu.Game.Screens
|
||||
{
|
||||
public abstract class BackgroundMode : GameMode, IEquatable<BackgroundMode>
|
||||
{
|
@ -3,7 +3,7 @@
|
||||
|
||||
using osu.Game.Graphics.Background;
|
||||
|
||||
namespace osu.Game.GameModes.Backgrounds
|
||||
namespace osu.Game.Screens.Backgrounds
|
||||
{
|
||||
public class BackgroundModeCustom : BackgroundMode
|
||||
{
|
@ -5,7 +5,7 @@ using osu.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Graphics.Background;
|
||||
|
||||
namespace osu.Game.GameModes.Backgrounds
|
||||
namespace osu.Game.Screens.Backgrounds
|
||||
{
|
||||
public class BackgroundModeDefault : BackgroundMode
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.GameModes.Backgrounds
|
||||
namespace osu.Game.Screens.Backgrounds
|
||||
{
|
||||
public class BackgroundModeEmpty : BackgroundMode
|
||||
{
|
@ -1,9 +1,9 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.Beatmaps.Objects.Mania
|
||||
namespace osu.Game.Screens.Charts
|
||||
{
|
||||
public class HoldNote : Note
|
||||
class ChartInfo : GameModeWhiteBox
|
||||
{
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace osu.Game.GameModes.Charts
|
||||
namespace osu.Game.Screens.Charts
|
||||
{
|
||||
class ChartListing : GameModeWhiteBox
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.GameModes.Direct
|
||||
namespace osu.Game.Screens.Direct
|
||||
{
|
||||
class OnlineListing : GameModeWhiteBox
|
||||
{
|
@ -3,9 +3,9 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
|
||||
namespace osu.Game.GameModes.Edit
|
||||
namespace osu.Game.Screens.Edit
|
||||
{
|
||||
class EditSongSelect : GameModeWhiteBox
|
||||
{
|
@ -1,16 +1,11 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.GameModes.Edit
|
||||
namespace osu.Game.Screens.Edit
|
||||
{
|
||||
class Editor : GameModeWhiteBox
|
||||
{
|
@ -9,13 +9,11 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
|
||||
namespace osu.Game.GameModes
|
||||
namespace osu.Game.Screens
|
||||
{
|
||||
public class GameModeWhiteBox : OsuGameMode
|
||||
{
|
@ -1,18 +1,16 @@
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using OpenTK.Input;
|
||||
using System;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Graphics;
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using OpenTK.Input;
|
||||
|
||||
namespace osu.Game.GameModes.Menu
|
||||
namespace osu.Game.Screens.Menu
|
||||
{
|
||||
/// <summary>
|
||||
/// Button designed specifically for the osu!next main menu.
|
@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
@ -13,10 +14,8 @@ using osu.Game.Graphics;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using OpenTK.Input;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
|
||||
namespace osu.Game.GameModes.Menu
|
||||
namespace osu.Game.Screens.Menu
|
||||
{
|
||||
public partial class ButtonSystem : Container, IStateful<MenuState>
|
||||
{
|
||||
@ -99,8 +98,6 @@ namespace osu.Game.GameModes.Menu
|
||||
}
|
||||
};
|
||||
|
||||
buttonFlow.Position = new Vector2(wedge_width * 2 - (button_width + osuLogo.SizeForFlow / 4), 0);
|
||||
|
||||
buttonsPlay.Add(new Button(@"solo", @"freeplay", FontAwesome.fa_user, new Color4(102, 68, 204, 255), () => OnSolo?.Invoke(), wedge_width, Key.P));
|
||||
buttonsPlay.Add(new Button(@"multi", @"multiplayer", FontAwesome.fa_users, new Color4(94, 63, 186, 255), () => OnMulti?.Invoke(), 0, Key.M));
|
||||
buttonsPlay.Add(new Button(@"chart", @"charts", FontAwesome.fa_osu_charts, new Color4(80, 53, 160, 255), () => OnChart?.Invoke()));
|
||||
@ -114,6 +111,14 @@ namespace osu.Game.GameModes.Menu
|
||||
buttonFlow.Add(buttonsTopLevel);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
// osuLogo.SizeForFlow relies on loading to be complete.
|
||||
buttonFlow.Position = new Vector2(wedge_width * 2 - (button_width + osuLogo.SizeForFlow / 4), 0);
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||
{
|
||||
switch (args.Key)
|
@ -1,8 +1,8 @@
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.GameModes.Menu
|
||||
namespace osu.Game.Screens.Menu
|
||||
{
|
||||
/// <summary>
|
||||
/// A flow container with an origin based on one of its contained drawables.
|
@ -1,19 +1,17 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Threading;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
|
||||
namespace osu.Game.GameModes.Menu
|
||||
namespace osu.Game.Screens.Menu
|
||||
{
|
||||
class Intro : OsuGameMode
|
||||
{
|
||||
@ -28,7 +26,7 @@ namespace osu.Game.GameModes.Menu
|
||||
private AudioSample welcome;
|
||||
private AudioTrack bgm;
|
||||
|
||||
internal override bool ShowToolbar => (ParentGameMode as OsuGameMode)?.ShowToolbar ?? false;
|
||||
internal override bool ShowOverlays => (ParentGameMode as OsuGameMode)?.ShowOverlays ?? false;
|
||||
|
||||
protected override BackgroundMode CreateBackground() => new BackgroundModeEmpty();
|
||||
|
@ -1,33 +1,29 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Framework.GameModes.Testing;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using osu.Game.GameModes.Charts;
|
||||
using osu.Game.GameModes.Direct;
|
||||
using osu.Game.GameModes.Edit;
|
||||
using osu.Game.GameModes.Multiplayer;
|
||||
using osu.Game.GameModes.Play;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using osu.Game.Screens.Charts;
|
||||
using osu.Game.Screens.Direct;
|
||||
using osu.Game.Screens.Edit;
|
||||
using osu.Game.Screens.Multiplayer;
|
||||
using osu.Game.Screens.Play;
|
||||
using OpenTK;
|
||||
using osu.Framework;
|
||||
using osu.Game.Overlays;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Framework.Allocation;
|
||||
|
||||
namespace osu.Game.GameModes.Menu
|
||||
namespace osu.Game.Screens.Menu
|
||||
{
|
||||
public class MainMenu : OsuGameMode
|
||||
{
|
||||
private ButtonSystem buttons;
|
||||
public override string Name => @"Main Menu";
|
||||
|
||||
internal override bool ShowToolbar => true;
|
||||
internal override bool ShowOverlays => true;
|
||||
|
||||
private BackgroundMode background;
|
||||
|
8
osu.Game/Screens/Menu/MenuVisualisation.cs
Normal file
8
osu.Game/Screens/Menu/MenuVisualisation.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using osu.Framework.Graphics;
|
||||
|
||||
namespace osu.Game.Screens.Menu
|
||||
{
|
||||
internal class MenuVisualisation : Drawable
|
||||
{
|
||||
}
|
||||
}
|
@ -2,17 +2,16 @@
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Framework.Graphics.Transformations;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework;
|
||||
using OpenTK;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
|
||||
namespace osu.Game.GameModes.Menu
|
||||
namespace osu.Game.Screens.Menu
|
||||
{
|
||||
/// <summary>
|
||||
/// osu! logo and its attachments (pulsing, visualiser etc.)
|
@ -3,11 +3,8 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace osu.Game.GameModes.Multiplayer
|
||||
namespace osu.Game.Screens.Multiplayer
|
||||
{
|
||||
class Lobby : GameModeWhiteBox
|
||||
{
|
@ -3,15 +3,12 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using osu.Game.GameModes.Play;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using osu.Game.Screens.Play;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.GameModes.Multiplayer
|
||||
namespace osu.Game.Screens.Multiplayer
|
||||
{
|
||||
class Match : GameModeWhiteBox
|
||||
{
|
@ -3,11 +3,8 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace osu.Game.GameModes.Multiplayer
|
||||
namespace osu.Game.Screens.Multiplayer
|
||||
{
|
||||
class MatchCreate : GameModeWhiteBox
|
||||
{
|
@ -1,16 +1,9 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
|
||||
namespace osu.Game.GameModes.Multiplayer
|
||||
namespace osu.Game.Screens.Multiplayer
|
||||
{
|
||||
class MatchSongSelect : GameModeWhiteBox
|
||||
{
|
@ -2,21 +2,13 @@
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics.Background;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.GameModes
|
||||
namespace osu.Game.Screens
|
||||
{
|
||||
public abstract class OsuGameMode : GameMode
|
||||
{
|
||||
@ -28,11 +20,11 @@ namespace osu.Game.GameModes
|
||||
/// </summary>
|
||||
protected virtual BackgroundMode CreateBackground() => null;
|
||||
|
||||
internal virtual bool ShowToolbar => true;
|
||||
internal virtual bool ShowOverlays => true;
|
||||
|
||||
protected new OsuGameBase Game => base.Game as OsuGameBase;
|
||||
|
||||
protected float ToolbarPadding => ShowToolbar ? (Game as OsuGame)?.Toolbar.DrawHeight ?? 0 : 0;
|
||||
protected float ToolbarPadding => ShowOverlays ? (Game as OsuGame)?.Toolbar.DrawHeight ?? 0 : 0;
|
||||
|
||||
private bool boundToBeatmap;
|
||||
private Bindable<WorkingBeatmap> beatmap;
|
@ -1,16 +1,11 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.GameModes.Play
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
class ModSelect : GameModeWhiteBox
|
||||
{
|
@ -2,29 +2,27 @@
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using osu.Framework;
|
||||
using osu.Game.Database;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using System.Linq;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Game.Beatmaps.Drawable;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Drawable;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.GameModes.Play
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
public class PlaySongSelect : OsuGameMode
|
||||
{
|
@ -1,28 +1,24 @@
|
||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Beatmaps.Objects;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using osu.Game.GameModes.Play.Catch;
|
||||
using osu.Game.GameModes.Play.Mania;
|
||||
using osu.Game.GameModes.Play.Osu;
|
||||
using osu.Game.GameModes.Play.Taiko;
|
||||
using osu.Framework;
|
||||
using osu.Game.Database;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Modes;
|
||||
using osu.Game.Modes.Objects;
|
||||
using osu.Game.Modes.Objects.Drawables;
|
||||
using osu.Game.Modes.UI;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using OpenTK.Input;
|
||||
using MouseState = osu.Framework.Input.MouseState;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
|
||||
namespace osu.Game.GameModes.Play
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
public class Player : OsuGameMode
|
||||
{
|
||||
@ -30,7 +26,7 @@ namespace osu.Game.GameModes.Play
|
||||
|
||||
protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4");
|
||||
|
||||
internal override bool ShowToolbar => false;
|
||||
internal override bool ShowOverlays => false;
|
||||
|
||||
public BeatmapInfo BeatmapInfo;
|
||||
|
@ -2,10 +2,10 @@
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Game.GameModes.Backgrounds;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.GameModes.Ranking
|
||||
namespace osu.Game.Screens.Ranking
|
||||
{
|
||||
class Results : GameModeWhiteBox
|
||||
{
|
@ -63,6 +63,7 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Modes\Objects\HitObjectParser.cs" />
|
||||
<Compile Include="Overlays\DragBar.cs" />
|
||||
<Compile Include="Overlays\MusicController.cs" />
|
||||
<Compile Include="Beatmaps\Beatmap.cs" />
|
||||
@ -71,28 +72,9 @@
|
||||
<Compile Include="Beatmaps\Drawable\BeatmapSetHeader.cs" />
|
||||
<Compile Include="Beatmaps\Drawable\DifficultyIcon.cs" />
|
||||
<Compile Include="Beatmaps\Drawable\Panel.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Catch\CatchConverter.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Catch\Drawable\DrawableFruit.cs" />
|
||||
<Compile Include="Beatmaps\Objects\DrawableHitObject.cs" />
|
||||
<Compile Include="Beatmaps\Objects\HitObject.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Catch\CatchBaseHit.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Catch\Droplet.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Catch\Fruit.cs" />
|
||||
<Compile Include="Beatmaps\Objects\HitObjectConverter.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Mania\Drawable\DrawableNote.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Mania\HoldNote.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Mania\ManiaBaseHit.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Mania\ManiaConverter.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Mania\Note.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Osu\Circle.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Osu\Drawable\DrawableCircle.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Osu\OsuBaseHit.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Osu\OsuConverter.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Osu\Slider.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Osu\Spinner.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Taiko\Drawable\DrawableTaikoHit.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Taiko\TaikoBaseHit.cs" />
|
||||
<Compile Include="Beatmaps\Objects\Taiko\TaikoConverter.cs" />
|
||||
<Compile Include="Modes\Objects\Drawables\DrawableHitObject.cs" />
|
||||
<Compile Include="Modes\Objects\HitObject.cs" />
|
||||
<Compile Include="Modes\Objects\HitObjectConverter.cs" />
|
||||
<Compile Include="Beatmaps\Samples\HitSampleInfo.cs" />
|
||||
<Compile Include="Beatmaps\Samples\SampleBank.cs" />
|
||||
<Compile Include="Beatmaps\Samples\SampleInfo.cs" />
|
||||
@ -102,56 +84,42 @@
|
||||
<Compile Include="Beatmaps\Timing\SampleChange.cs" />
|
||||
<Compile Include="Beatmaps\Timing\TimingChange.cs" />
|
||||
<Compile Include="Configuration\OsuConfigManager.cs" />
|
||||
<Compile Include="GameModes\BackgroundMode.cs" />
|
||||
<Compile Include="GameModes\Backgrounds\BackgroundModeCustom.cs" />
|
||||
<Compile Include="GameModes\Backgrounds\BackgroundModeDefault.cs" />
|
||||
<Compile Include="GameModes\Backgrounds\BackgroundModeEmpty.cs" />
|
||||
<Compile Include="GameModes\Charts\ChartInfo.cs" />
|
||||
<Compile Include="GameModes\Edit\Editor.cs" />
|
||||
<Compile Include="GameModes\GameModeWhiteBox.cs" />
|
||||
<Compile Include="GameModes\Menu\Button.cs" />
|
||||
<Compile Include="GameModes\Menu\FlowContainerWithOrigin.cs" />
|
||||
<Compile Include="GameModes\Menu\Intro.cs" />
|
||||
<Compile Include="GameModes\Menu\ButtonSystem.cs" />
|
||||
<Compile Include="GameModes\Menu\MainMenu.cs" />
|
||||
<Compile Include="GameModes\Menu\MenuVisualisation.cs" />
|
||||
<Compile Include="GameModes\Menu\OsuLogo.cs" />
|
||||
<Compile Include="GameModes\Multiplayer\Lobby.cs" />
|
||||
<Compile Include="GameModes\Multiplayer\Match.cs" />
|
||||
<Compile Include="GameModes\Multiplayer\MatchCreate.cs" />
|
||||
<Compile Include="GameModes\Multiplayer\MatchSongSelect.cs" />
|
||||
<Compile Include="GameModes\OsuGameMode.cs" />
|
||||
<Compile Include="GameModes\Play\Catch\CatchRuleset.cs" />
|
||||
<Compile Include="GameModes\Play\Mania\ManiaRuleset.cs" />
|
||||
<Compile Include="GameModes\Play\ModSelect.cs" />
|
||||
<Compile Include="GameModes\Play\Osu\OsuRuleset.cs" />
|
||||
<Compile Include="GameModes\Play\Osu\ScoreOverlayOsu.cs" />
|
||||
<Compile Include="Screens\BackgroundMode.cs" />
|
||||
<Compile Include="Screens\Backgrounds\BackgroundModeCustom.cs" />
|
||||
<Compile Include="Screens\Backgrounds\BackgroundModeDefault.cs" />
|
||||
<Compile Include="Screens\Backgrounds\BackgroundModeEmpty.cs" />
|
||||
<Compile Include="Screens\Charts\ChartInfo.cs" />
|
||||
<Compile Include="Screens\Edit\Editor.cs" />
|
||||
<Compile Include="Screens\GameModeWhiteBox.cs" />
|
||||
<Compile Include="Screens\Menu\Button.cs" />
|
||||
<Compile Include="Screens\Menu\FlowContainerWithOrigin.cs" />
|
||||
<Compile Include="Screens\Menu\Intro.cs" />
|
||||
<Compile Include="Screens\Menu\ButtonSystem.cs" />
|
||||
<Compile Include="Screens\Menu\MainMenu.cs" />
|
||||
<Compile Include="Screens\Menu\MenuVisualisation.cs" />
|
||||
<Compile Include="Screens\Menu\OsuLogo.cs" />
|
||||
<Compile Include="Screens\Multiplayer\Lobby.cs" />
|
||||
<Compile Include="Screens\Multiplayer\Match.cs" />
|
||||
<Compile Include="Screens\Multiplayer\MatchCreate.cs" />
|
||||
<Compile Include="Screens\Multiplayer\MatchSongSelect.cs" />
|
||||
<Compile Include="Screens\OsuGameMode.cs" />
|
||||
<Compile Include="Screens\Play\ModSelect.cs" />
|
||||
<Compile Include="Beatmaps\Drawable\BeatmapGroup.cs" />
|
||||
<Compile Include="Beatmaps\Drawable\BeatmapPanel.cs" />
|
||||
<Compile Include="GameModes\Play\Player.cs" />
|
||||
<Compile Include="GameModes\Charts\ChartListing.cs" />
|
||||
<Compile Include="GameModes\Play\PlayMode.cs" />
|
||||
<Compile Include="GameModes\Play\Ruleset.cs" />
|
||||
<Compile Include="GameModes\Play\Taiko\TaikoRuleset.cs" />
|
||||
<Compile Include="GameModes\Ranking\Results.cs" />
|
||||
<Compile Include="GameModes\Direct\OnlineListing.cs" />
|
||||
<Compile Include="GameModes\Play\PlaySongSelect.cs" />
|
||||
<Compile Include="GameModes\Play\Catch\CatchHitRenderer.cs" />
|
||||
<Compile Include="GameModes\Play\Catch\CatchPlayfield.cs" />
|
||||
<Compile Include="GameModes\Play\HitRenderer.cs" />
|
||||
<Compile Include="GameModes\Play\Mania\ManiaHitRenderer.cs" />
|
||||
<Compile Include="GameModes\Play\Mania\ManiaPlayfield.cs" />
|
||||
<Compile Include="GameModes\Play\Osu\OsuHitRenderer.cs" />
|
||||
<Compile Include="GameModes\Play\Osu\OsuPlayfield.cs" />
|
||||
<Compile Include="GameModes\Play\Playfield.cs" />
|
||||
<Compile Include="GameModes\Play\ScoreOverlay.cs" />
|
||||
<Compile Include="GameModes\Play\Taiko\TaikoHitRenderer.cs" />
|
||||
<Compile Include="GameModes\Play\Taiko\TaikoPlayfield.cs" />
|
||||
<Compile Include="GameModes\Edit\EditSongSelect.cs" />
|
||||
<Compile Include="GameModes\Play\ComboCounter.cs" />
|
||||
<Compile Include="GameModes\Play\ComboResultCounter.cs" />
|
||||
<Compile Include="Screens\Play\Player.cs" />
|
||||
<Compile Include="Screens\Charts\ChartListing.cs" />
|
||||
<Compile Include="Modes\PlayMode.cs" />
|
||||
<Compile Include="Modes\Ruleset.cs" />
|
||||
<Compile Include="Screens\Ranking\Results.cs" />
|
||||
<Compile Include="Screens\Direct\OnlineListing.cs" />
|
||||
<Compile Include="Screens\Play\PlaySongSelect.cs" />
|
||||
<Compile Include="Modes\UI\HitRenderer.cs" />
|
||||
<Compile Include="Modes\UI\Playfield.cs" />
|
||||
<Compile Include="Modes\UI\ScoreOverlay.cs" />
|
||||
<Compile Include="Screens\Edit\EditSongSelect.cs" />
|
||||
<Compile Include="Modes\UI\ComboCounter.cs" />
|
||||
<Compile Include="Modes\UI\ComboResultCounter.cs" />
|
||||
<Compile Include="Graphics\UserInterface\RollingCounter.cs" />
|
||||
<Compile Include="GameModes\Play\Taiko\TaikoComboCounter.cs" />
|
||||
<Compile Include="Graphics\UserInterface\Volume\VolumeControlReceptor.cs" />
|
||||
<Compile Include="Input\GlobalHotkeys.cs" />
|
||||
<Compile Include="Graphics\Background\Background.cs" />
|
||||
@ -159,15 +127,12 @@
|
||||
<Compile Include="Graphics\Cursor\OsuCursorContainer.cs" />
|
||||
<Compile Include="Graphics\Processing\RatioAdjust.cs" />
|
||||
<Compile Include="Graphics\TextAwesome.cs" />
|
||||
<Compile Include="GameModes\Play\Mania\ManiaComboCounter.cs" />
|
||||
<Compile Include="Graphics\UserInterface\KeyCounter.cs" />
|
||||
<Compile Include="Graphics\UserInterface\KeyCounterKeyboard.cs" />
|
||||
<Compile Include="Graphics\UserInterface\KeyCounterCollection.cs" />
|
||||
<Compile Include="Graphics\UserInterface\KeyCounterMouse.cs" />
|
||||
<Compile Include="Graphics\UserInterface\PercentageCounter.cs" />
|
||||
<Compile Include="Graphics\UserInterface\ScoreCounter.cs" />
|
||||
<Compile Include="GameModes\Play\Catch\CatchComboCounter.cs" />
|
||||
<Compile Include="GameModes\Play\Osu\OsuComboCounter.cs" />
|
||||
<Compile Include="Graphics\UserInterface\StarCounter.cs" />
|
||||
<Compile Include="IPC\BeatmapImporter.cs" />
|
||||
<Compile Include="Online\API\APIAccess.cs" />
|
||||
|
Reference in New Issue
Block a user