Skip to content

Commit

Permalink
add missing effect flags
Browse files Browse the repository at this point in the history
  • Loading branch information
flustix committed Oct 13, 2024
1 parent b9d6bc9 commit 9426866
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 20 deletions.
6 changes: 5 additions & 1 deletion fluXis.Game/Graphics/Sprites/FluXisIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,9 @@ public enum FluXisIconType
PlayfieldFade,
Shake,
Shader,
BeatPulse
BeatPulse,
HitObjectFade,
HitObjectEase,
ScrollMultiply,
TimeOffset
}
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ private GimmickIcon[] getIcons()
if (effects.HasFlag(MapEffectType.PlayfieldScale))
icons.Add(new GimmickIcon(FluXisIconType.PlayfieldScale, "Contains playfield scales"));

if (effects.HasFlag(MapEffectType.PlayfieldRotate))
icons.Add(new GimmickIcon(FluXisIconType.PlayfieldRotate, "Contains playfield rotates"));

if (effects.HasFlag(MapEffectType.PlayfieldFade))
icons.Add(new GimmickIcon(FluXisIconType.PlayfieldFade, "Contains playfield fades"));

Expand All @@ -333,6 +336,18 @@ private GimmickIcon[] getIcons()
if (effects.HasFlag(MapEffectType.BeatPulse))
icons.Add(new GimmickIcon(FluXisIconType.BeatPulse, "Contains beat pulses"));

if (effects.HasFlag(MapEffectType.HitObjectFade))
icons.Add(new GimmickIcon(FluXisIconType.HitObjectFade, "Contains hitobject fades"));

if (effects.HasFlag(MapEffectType.HitObjectEase))
icons.Add(new GimmickIcon(FluXisIconType.HitObjectEase, "Contains hitobject eases"));

if (effects.HasFlag(MapEffectType.ScrollMultiply))
icons.Add(new GimmickIcon(FluXisIconType.ScrollMultiply, "Contains scroll multipliers"));

if (effects.HasFlag(MapEffectType.TimeOffset))
icons.Add(new GimmickIcon(FluXisIconType.TimeOffset, "Contains time offsets"));

return icons.ToArray();
}

Expand Down
22 changes: 14 additions & 8 deletions fluXis.Game/Utils/MapUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,8 @@ public static RealmMapFilters UpdateFilters(this RealmMapFilters filters, MapInf
filters.BPMMax = Math.Max(filters.BPMMax, timingPoint.BPM);
}

foreach (var scrollVelocity in map.ScrollVelocities)
{
if (scrollVelocity.Multiplier != 1)
{
filters.Effects |= MapEffectType.ScrollVelocity;
break;
}
}
if (map.ScrollVelocities.Count >= 20)
filters.Effects |= MapEffectType.ScrollVelocity;

if (events != null)
filters.Effects = getEffects(events);
Expand Down Expand Up @@ -194,6 +188,18 @@ private static MapEffectType getEffects(MapEvents events)
if (events.BeatPulseEvents.Count > 0)
effects |= MapEffectType.BeatPulse;

if (events.HitObjectFadeEvents.Count > 0)
effects |= MapEffectType.HitObjectFade;

if (events.HitObjectEaseEvents.Count > 0)
effects |= MapEffectType.HitObjectEase;

if (events.ScrollMultiplyEvents.Count > 0)
effects |= MapEffectType.ScrollMultiply;

if (events.TimeOffsetEvents.Count > 0)
effects |= MapEffectType.TimeOffset;

return effects;
}

Expand Down
26 changes: 15 additions & 11 deletions fluXis.Shared/Components/Maps/MapEffectType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@
[Flags]
public enum MapEffectType : ulong
{
ScrollVelocity = 1 << 0, // 1
LaneSwitch = 1 << 1, // 2
Flash = 1 << 2, // 4
Pulse = 1 << 3, // 8
PlayfieldMove = 1 << 4, // 16
PlayfieldScale = 1 << 5, // 32
PlayfieldRotate = 1 << 6, // 64
PlayfieldFade = 1 << 7, // 128
Shake = 1 << 8, // 256
Shader = 1 << 9, // 512
BeatPulse = 1 << 10, // 1024
ScrollVelocity = 1 << 0,
LaneSwitch = 1 << 1,
Flash = 1 << 2,
Pulse = 1 << 3,
PlayfieldMove = 1 << 4,
PlayfieldScale = 1 << 5,
PlayfieldRotate = 1 << 6,
PlayfieldFade = 1 << 7,
Shake = 1 << 8,
Shader = 1 << 9,
BeatPulse = 1 << 10,
HitObjectFade = 1 << 11,
HitObjectEase = 1 << 12,
ScrollMultiply = 1 << 13,
TimeOffset = 1 << 14
}

0 comments on commit 9426866

Please sign in to comment.