Skip to content

Commit

Permalink
add buttons, scrolls, and anglediff to huddata_t
Browse files Browse the repository at this point in the history
  • Loading branch information
rtldg committed Jun 12, 2022
1 parent 6bba207 commit 8e0e5ec
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions addons/sourcemod/scripting/include/shavit/hud.inc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ enum struct huddata_t
float fClosestVelocityDifference;
int iMapTier;
float fClosestReplayLength;

int iButtons;
int iScrolls;
int iScrollsPrev;
float fAngleDiff;
}

/**
Expand Down
14 changes: 14 additions & 0 deletions addons/sourcemod/scripting/shavit-hud.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1757,6 +1757,20 @@ void UpdateMainHUD(int client)
huddata.iPreviousSpeed = gI_PreviousSpeed[client];
huddata.iMapTier = gB_Rankings ? Shavit_GetMapTier() : 0;

if (IsValidClient(target))
{
huddata.fAngleDiff = gF_AngleDiff[target];
huddata.iButtons = gI_Buttons[target];
huddata.iScrolls = gI_ScrollCount[target];
huddata.iScrollsPrev = gI_LastScrollCount[target];
}
else
{
huddata.iButtons = Shavit_GetReplayButtons(target, huddata.fAngleDiff);
huddata.iScrolls = -1;
huddata.iScrollsPrev = -1;
}

huddata.fClosestReplayTime = -1.0;
huddata.fClosestVelocityDifference = 0.0;
huddata.fClosestReplayLength = 0.0;
Expand Down

0 comments on commit 8e0e5ec

Please sign in to comment.