Skip to content

Commit

Permalink
Add TransitionFade user message
Browse files Browse the repository at this point in the history
  • Loading branch information
pektezol authored and UncraftedName committed Sep 25, 2023
1 parent 3ba4242 commit aee4c74
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions DemoParser/src/Parser/Components/Abstract/UserMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ public static class SvcUserMessageFactory {
UserMessageType.HapPunch => new HapPunch (dRef, val),
UserMessageType.SPHapWeapEvent => new SpHapWeaponEvent (dRef, val),
UserMessageType.WitchBloodSplatter => new WitchBloodSplatter(dRef, val),
UserMessageType.TransitionFade => new TransitionFade (dRef, val),
UserMessageType.ScoreboardTempUpdate => new ScoreboardTempUpdate(dRef, val),
_ => null // I do a check for this so that I don't have to allocate the unknown type twice
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using DemoParser.Parser.Components.Abstract;
using DemoParser.Utils;
using DemoParser.Utils.BitStreams;

namespace DemoParser.Parser.Components.Messages.UserMessages {

public class TransitionFade : UserMessage {

public float Seconds;


public TransitionFade(SourceDemo? demoRef, byte value) : base(demoRef, value) {}


protected override void Parse(ref BitStreamReader bsr) {
Seconds = bsr.ReadFloat();
}


public override void PrettyWrite(IPrettyWriter pw) {
pw.Append($"seconds: {Seconds}");
}
}
}

0 comments on commit aee4c74

Please sign in to comment.