From 41692740f62dbce61cd2dddb0bce5e536980b7b8 Mon Sep 17 00:00:00 2001 From: Shawdooow Date: Thu, 22 Mar 2018 10:07:57 -0400 Subject: [PATCH] updates --- .../HitObjects/DrawableSymcolHitObject.cs | 4 ++++ .../Beatmaps/ShapeBeatmapProcessor.cs | 18 +----------------- .../Beatmaps/VitaruBeatmapProcessor.cs | 18 +----------------- .../Objects/Characters/Enemy.cs | 2 +- .../Objects/Characters/Pieces/Totem.cs | 2 +- .../Objects/Characters/VitaruPlayer.cs | 3 +-- .../Objects/Drawables/DrawablePatterns.cs | 9 ++++----- .../Drawables/DrawableVitaruHitObject.cs | 13 +++++++++++++ .../Objects/Drawables/Pieces/BulletPiece.cs | 6 +++--- .../Objects/Drawables/Pieces/LaserPiece.cs | 2 +- .../Drawables/Pieces/SeekingBulletPiece.cs | 4 ++-- osu.Game.Rulesets.Vitaru/Objects/Pattern.cs | 11 +++++------ .../Objects/VitaruHitObject.cs | 13 +++++++++++-- .../osu.Game.Rulesets.Vitaru.csproj | 1 + 14 files changed, 49 insertions(+), 57 deletions(-) diff --git a/Symcol.Rulesets.Core/HitObjects/DrawableSymcolHitObject.cs b/Symcol.Rulesets.Core/HitObjects/DrawableSymcolHitObject.cs index 789bc27430..0f97df13ab 100644 --- a/Symcol.Rulesets.Core/HitObjects/DrawableSymcolHitObject.cs +++ b/Symcol.Rulesets.Core/HitObjects/DrawableSymcolHitObject.cs @@ -14,6 +14,10 @@ namespace Symcol.Rulesets.Core.HitObjects public abstract class DrawableSymcolHitObject : DrawableHitObject where TObject : HitObject { + //Future prep? + public override void ClearTransformsAfter(double time, bool propagateChildren = false, string targetMember = null) { } + public override void ApplyTransformsAt(double time, bool propagateChildren = false) { } + protected virtual Container Content => new Container(); public IReadOnlyList Children diff --git a/osu.Game.Rulesets.Shape/Beatmaps/ShapeBeatmapProcessor.cs b/osu.Game.Rulesets.Shape/Beatmaps/ShapeBeatmapProcessor.cs index 6d028f4616..ab1606b09e 100644 --- a/osu.Game.Rulesets.Shape/Beatmaps/ShapeBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Shape/Beatmaps/ShapeBeatmapProcessor.cs @@ -7,23 +7,7 @@ namespace osu.Game.Rulesets.Shape.Beatmaps { public override void PostProcess(Beatmap beatmap) { - if (beatmap.ComboColours.Count == 0) - return; - - int comboIndex = 0; - int colourIndex = 0; - - foreach (var obj in beatmap.HitObjects) - { - if (obj.NewCombo) - { - comboIndex = 0; - colourIndex = (colourIndex + 1) % beatmap.ComboColours.Count; - } - - obj.ComboIndex = comboIndex++; - obj.ComboColour = beatmap.ComboColours[colourIndex]; - } + base.PostProcess(beatmap); } } } diff --git a/osu.Game.Rulesets.Vitaru/Beatmaps/VitaruBeatmapProcessor.cs b/osu.Game.Rulesets.Vitaru/Beatmaps/VitaruBeatmapProcessor.cs index d6423a4c23..2ae613cf28 100644 --- a/osu.Game.Rulesets.Vitaru/Beatmaps/VitaruBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Vitaru/Beatmaps/VitaruBeatmapProcessor.cs @@ -7,23 +7,7 @@ namespace osu.Game.Rulesets.Vitaru.Beatmaps { public override void PostProcess(Beatmap beatmap) { - if (beatmap.ComboColours.Count == 0) - return; - - int comboIndex = 0; - int colourIndex = 0; - - foreach (var obj in beatmap.HitObjects) - { - if (obj.NewCombo) - { - comboIndex = 0; - colourIndex = (colourIndex + 1) % beatmap.ComboColours.Count; - } - - obj.ComboIndex = comboIndex++; - obj.ComboColour = beatmap.ComboColours[colourIndex]; - } + base.PostProcess(beatmap); } } } diff --git a/osu.Game.Rulesets.Vitaru/Objects/Characters/Enemy.cs b/osu.Game.Rulesets.Vitaru/Objects/Characters/Enemy.cs index 9009060700..85886cd2a5 100644 --- a/osu.Game.Rulesets.Vitaru/Objects/Characters/Enemy.cs +++ b/osu.Game.Rulesets.Vitaru/Objects/Characters/Enemy.cs @@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Characters AlwaysPresent = true; CharacterName = "enemy"; Team = 1; - CharacterColor = pattern.ComboColour; + CharacterColor = drawablePattern.AccentColour; HitboxWidth = 27; } diff --git a/osu.Game.Rulesets.Vitaru/Objects/Characters/Pieces/Totem.cs b/osu.Game.Rulesets.Vitaru/Objects/Characters/Pieces/Totem.cs index c00de25746..153aa86893 100644 --- a/osu.Game.Rulesets.Vitaru/Objects/Characters/Pieces/Totem.cs +++ b/osu.Game.Rulesets.Vitaru/Objects/Characters/Pieces/Totem.cs @@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Characters.Pieces Team = ParentCharacter.Team, BulletSpeed = 0.8f, BulletDamage = 5, - ComboColour = ParentCharacter.CharacterColor, + ColorOverride = ParentCharacter.CharacterColor, StartAngle = StartAngle, })); s.MoveTo(ToSpaceOfOtherDrawable(new Vector2(0, 0), s)); diff --git a/osu.Game.Rulesets.Vitaru/Objects/Characters/VitaruPlayer.cs b/osu.Game.Rulesets.Vitaru/Objects/Characters/VitaruPlayer.cs index cc345067dd..ad3a4dfcfa 100644 --- a/osu.Game.Rulesets.Vitaru/Objects/Characters/VitaruPlayer.cs +++ b/osu.Game.Rulesets.Vitaru/Objects/Characters/VitaruPlayer.cs @@ -688,7 +688,6 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Characters { LaserSize = new Vector2(80, 400), Team = Team, - ComboColour = CharacterColor, StartTime = Time.Current, EndTime = Time.Current + 2000 })); @@ -1148,11 +1147,11 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Characters StartTime = Time.Current, Cs = 1.2f, DummyMode = true, - ComboColour = color, BulletAngleRadian = angle, BulletSpeed = speed, BulletDiameter = 16, BulletDamage = 20 * damageMultiplier, + ColorOverride = color, Team = Team, Ghost = currentCharacter == Characters.YuyukoSaigyouji | currentCharacter == Characters.AliceMuyart })); diff --git a/osu.Game.Rulesets.Vitaru/Objects/Drawables/DrawablePatterns.cs b/osu.Game.Rulesets.Vitaru/Objects/Drawables/DrawablePatterns.cs index 978d6617cc..faa52fb0ea 100644 --- a/osu.Game.Rulesets.Vitaru/Objects/Drawables/DrawablePatterns.cs +++ b/osu.Game.Rulesets.Vitaru/Objects/Drawables/DrawablePatterns.cs @@ -81,7 +81,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables Size = new Vector2(30), CornerRadius = 30f / 2, BorderThickness = 10, - BorderColour = pattern.ComboColour, + BorderColour = AccentColour, Children = new Drawable[] { new Box @@ -92,7 +92,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, - Colour = pattern.ComboColour.Opacity(0.5f), + Colour = AccentColour.Opacity(0.5f), Radius = Width / 2, } }; @@ -109,7 +109,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables Origin = Anchor.Centre, Size = new Vector2(20), BorderThickness = 6, - BorderColour = pattern.ComboColour, + BorderColour = AccentColour, Children = new Drawable[] { new Box @@ -120,7 +120,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, - Colour = pattern.ComboColour.Opacity(0.5f), + Colour = AccentColour.Opacity(0.5f), Radius = Width / 2, } }; @@ -141,7 +141,6 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables foreach (var o in pattern.NestedHitObjects) { var b = (Bullet)o; - b.ComboColour = pattern.ComboColour; DrawableBullet drawableBullet = new DrawableBullet(ParentContainer, b, this); ParentContainer.Add(drawableBullet); AddNested(drawableBullet); diff --git a/osu.Game.Rulesets.Vitaru/Objects/Drawables/DrawableVitaruHitObject.cs b/osu.Game.Rulesets.Vitaru/Objects/Drawables/DrawableVitaruHitObject.cs index 1304613faa..2db7ec2ffd 100644 --- a/osu.Game.Rulesets.Vitaru/Objects/Drawables/DrawableVitaruHitObject.cs +++ b/osu.Game.Rulesets.Vitaru/Objects/Drawables/DrawableVitaruHitObject.cs @@ -1,6 +1,9 @@ using osu.Game.Rulesets.Objects.Drawables; using Symcol.Rulesets.Core.HitObjects; using System.ComponentModel; +using osu.Game.Rulesets.Objects.Types; +using osu.Game.Skinning; +using OpenTK.Graphics; namespace osu.Game.Rulesets.Vitaru.Objects.Drawables { @@ -12,6 +15,16 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables public readonly Framework.Graphics.Containers.Container ParentContainer; + protected override void SkinChanged(ISkinSource skin, bool allowFallback) + { + base.SkinChanged(skin, allowFallback); + + if (HitObject is IHasComboInformation combo && HitObject.ColorOverride == Color4.White) + AccentColour = skin.GetValue(s => s.ComboColours.Count > 0 ? s.ComboColours[combo.ComboIndex % s.ComboColours.Count] : (Color4?)null) ?? Color4.White; + else + AccentColour = HitObject.ColorOverride; + } + public DrawableVitaruHitObject(VitaruHitObject hitObject, Framework.Graphics.Containers.Container parent) : base(hitObject) { ParentContainer = parent; diff --git a/osu.Game.Rulesets.Vitaru/Objects/Drawables/Pieces/BulletPiece.cs b/osu.Game.Rulesets.Vitaru/Objects/Drawables/Pieces/BulletPiece.cs index d2f6af7097..4df6ea7b0b 100644 --- a/osu.Game.Rulesets.Vitaru/Objects/Drawables/Pieces/BulletPiece.cs +++ b/osu.Game.Rulesets.Vitaru/Objects/Drawables/Pieces/BulletPiece.cs @@ -78,7 +78,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables.Pieces Alpha = 0, Origin = Anchor.Centre, Anchor = Anchor.Centre, - Colour = drawableBullet.Bullet.ComboColour, + Colour = drawableBullet.AccentColour, Texture = VitaruRuleset.VitaruTextures.Get("bulletKiai"), }; @@ -88,7 +88,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables.Pieces Origin = Anchor.Centre, Alpha = 1, RelativeSizeAxes = Axes.Both, - BorderColour = drawableBullet.Bullet.ComboColour, + BorderColour = drawableBullet.AccentColour, BorderThickness = 6, Masking = true, @@ -103,7 +103,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables.Pieces { Radius = drawableBullet.Bullet.BulletDiameter, Type = EdgeEffectType.Shadow, - Colour = drawableBullet.Bullet.ComboColour.Opacity(0.2f) + Colour = drawableBullet.AccentColour.Opacity(0.2f) }; if (drawableBullet.Bullet.Ghost && currentCharacter == Characters.Characters.YuyukoSaigyouji | currentCharacter == Characters.Characters.AliceMuyart) diff --git a/osu.Game.Rulesets.Vitaru/Objects/Drawables/Pieces/LaserPiece.cs b/osu.Game.Rulesets.Vitaru/Objects/Drawables/Pieces/LaserPiece.cs index ecb84f3162..580f43a7ee 100644 --- a/osu.Game.Rulesets.Vitaru/Objects/Drawables/Pieces/LaserPiece.cs +++ b/osu.Game.Rulesets.Vitaru/Objects/Drawables/Pieces/LaserPiece.cs @@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables.Pieces CornerRadius = 16; BorderThickness = 8; - BorderColour = drawableLaser.Laser.ComboColour; + BorderColour = drawableLaser.AccentColour; Child = new Box { diff --git a/osu.Game.Rulesets.Vitaru/Objects/Drawables/Pieces/SeekingBulletPiece.cs b/osu.Game.Rulesets.Vitaru/Objects/Drawables/Pieces/SeekingBulletPiece.cs index 83b1bd4ca3..6efce0d481 100644 --- a/osu.Game.Rulesets.Vitaru/Objects/Drawables/Pieces/SeekingBulletPiece.cs +++ b/osu.Game.Rulesets.Vitaru/Objects/Drawables/Pieces/SeekingBulletPiece.cs @@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables.Pieces Anchor = Anchor.Centre; BorderThickness = 4; AlwaysPresent = true; - BorderColour = seekingBullet.SeekingBullet.ComboColour; + BorderColour = seekingBullet.AccentColour; CornerRadius = 4; Child = new Box @@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Vitaru.Objects.Drawables.Pieces { Type = EdgeEffectType.Shadow, Radius = 8, - Colour = seekingBullet.SeekingBullet.ComboColour.Opacity(0.25f), + Colour = seekingBullet.AccentColour.Opacity(0.25f), }; } diff --git a/osu.Game.Rulesets.Vitaru/Objects/Pattern.cs b/osu.Game.Rulesets.Vitaru/Objects/Pattern.cs index 52e8ffbb17..95be7245de 100644 --- a/osu.Game.Rulesets.Vitaru/Objects/Pattern.cs +++ b/osu.Game.Rulesets.Vitaru/Objects/Pattern.cs @@ -182,6 +182,11 @@ namespace osu.Game.Rulesets.Vitaru.Objects b.Cs = Cs; b.StackHeight = StackHeight; + b.NewCombo = NewCombo; + b.IndexInCurrentCombo = IndexInCurrentCombo; + b.ComboIndex = ComboIndex; + b.LastInCombo = LastInCombo; + b.ShootPlayer = shootPlayer; AddNested(b); @@ -238,7 +243,6 @@ namespace osu.Game.Rulesets.Vitaru.Objects { StartTime = StartTime, Position = Position, - ComboColour = ComboColour, BulletSpeed = PatternSpeed, BulletAngleRadian = angle, BulletDiameter = diameter, @@ -262,7 +266,6 @@ namespace osu.Game.Rulesets.Vitaru.Objects { StartTime = StartTime, Position = Position, - ComboColour = ComboColour, BulletSpeed = speed, BulletAngleRadian = patternAngleRadian, BulletDiameter = diameter, @@ -288,7 +291,6 @@ namespace osu.Game.Rulesets.Vitaru.Objects { StartTime = StartTime, Position = Position, - ComboColour = ComboColour, BulletSpeed = PatternSpeed, BulletAngleRadian = angle, BulletDiameter = diameter, @@ -320,7 +322,6 @@ namespace osu.Game.Rulesets.Vitaru.Objects { StartTime = StartTime, Position = Position, - ComboColour = ComboColour, BulletSpeed = speed, BulletAngleRadian = angle, BulletDiameter = diameter, @@ -351,7 +352,6 @@ namespace osu.Game.Rulesets.Vitaru.Objects { StartTime = StartTime, Position = Position, - ComboColour = ComboColour, BulletSpeed = speed, BulletAngleRadian = patternAngleRadian, BulletDiameter = diameter, @@ -375,7 +375,6 @@ namespace osu.Game.Rulesets.Vitaru.Objects { StartTime = StartTime, Position = Position, - ComboColour = ComboColour, BulletSpeed = PatternSpeed, BulletAngleRadian = patternAngleRadian, BulletDiameter = diameter, diff --git a/osu.Game.Rulesets.Vitaru/Objects/VitaruHitObject.cs b/osu.Game.Rulesets.Vitaru/Objects/VitaruHitObject.cs index f27ec8544e..a2a29bfd0f 100644 --- a/osu.Game.Rulesets.Vitaru/Objects/VitaruHitObject.cs +++ b/osu.Game.Rulesets.Vitaru/Objects/VitaruHitObject.cs @@ -3,10 +3,12 @@ using OpenTK; using OpenTK.Graphics; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Beatmaps; +using osu.Game.Rulesets.Objects.Types; +using System; namespace osu.Game.Rulesets.Vitaru.Objects { - public abstract class VitaruHitObject : HitObject + public abstract class VitaruHitObject : HitObject, IHasComboInformation { public float BPM; @@ -30,10 +32,17 @@ namespace osu.Game.Rulesets.Vitaru.Objects public abstract HitObjectType Type { get; } - public Color4 ComboColour { get; set; } + //TODO: make null != White + public Color4 ColorOverride { get; set; } = Color4.White; + public virtual bool NewCombo { get; set; } + + public int IndexInCurrentCombo { get; set; } + public int ComboIndex { get; set; } + public bool LastInCombo { get; set; } + protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty) { base.ApplyDefaultsToSelf(controlPointInfo, difficulty); diff --git a/osu.Game.Rulesets.Vitaru/osu.Game.Rulesets.Vitaru.csproj b/osu.Game.Rulesets.Vitaru/osu.Game.Rulesets.Vitaru.csproj index 1e2e72743f..570618d938 100644 --- a/osu.Game.Rulesets.Vitaru/osu.Game.Rulesets.Vitaru.csproj +++ b/osu.Game.Rulesets.Vitaru/osu.Game.Rulesets.Vitaru.csproj @@ -40,6 +40,7 @@ +