Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TransitionFade user message #3

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}");
}
}
}