Skip to content
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
3 changes: 3 additions & 0 deletions Game.Server/BaseEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1886,6 +1886,9 @@ public void EntityText(int text_offset, ReadOnlySpan<char> text, float duration,
DebugOverlay.EntityTextAtPosition(origin, text_offset, text, duration, r, g, b, a);
}

public virtual void DrawDebugGeometryOverlays() {
// todo
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto for DrawDebugGeometryOverlays

public virtual int DrawDebugTextOverlays() {
int offset = 1;
if ((DebugOverlays & DebugOverlayBits.Text) != 0) {
Expand Down
2 changes: 1 addition & 1 deletion Game.Server/HL2/HL2_Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ bool TestHitboxes(Ray ray, uint fContentsMask, Trace tr) {
throw new NotImplementedException();
}

void DrawDebugGeometryOverlays() { }
public override void DrawDebugGeometryOverlays() { }

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we have the stuff yet for this, and that's a whole rabbithole; I just caught this was supposed to be an override


public void ExitLadder() { }

Expand Down
16 changes: 16 additions & 0 deletions Game.Server/PathTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using Source;
using Source.Common;
using Source.Common.Engine;
using Source.Common.Mathematics;

using System.Numerics;
Expand Down Expand Up @@ -182,6 +183,21 @@ public void TogglePath() {
return path;
}

public static PathTrack? Instance(Edict ent) {
BaseEntity? entity = BaseEntity.Instance(ent);
if (FClassnameIs(entity, "path_track"))
return (PathTrack?)entity;
return null;
}

public override void DrawDebugGeometryOverlays() {
if ((DebugOverlays & (DebugOverlayBits.BBox | DebugOverlayBits.AbsBox)) != 0)
if (Next.IsValid())
DebugOverlay.Line(GetAbsOrigin(), Next.Get()!.GetAbsOrigin(), 255, 100, 100, true, 0.0f);

base.DrawDebugGeometryOverlays();
}

void Project(PathTrack? start, PathTrack? end, ref Vector3 origin, float dist) {
if (start != null && end != null) {
Vector3 dir = end.GetLocalOrigin() - start.GetLocalOrigin();
Expand Down
16 changes: 16 additions & 0 deletions Game.Server/Triggers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,22 @@ public void Enable() {
}
}

public override int DrawDebugTextOverlays() {
int text_offset = base.DrawDebugTextOverlays();

if ((DebugOverlays & DebugOverlayBits.Text) != 0) {
Span<char> tempstr = stackalloc char[255];
if (IsSolidFlagSet(SolidFlags.Trigger))
strcpy(tempstr, "State: Enabled");
else
strcpy(tempstr, "State: Disabled");
EntityText(text_offset, tempstr, 0);
text_offset++;
}

return text_offset;
}

//------------------------------------------------------------------------------
// Purpose :
//------------------------------------------------------------------------------
Expand Down
Loading