Skip to content

Commit

Permalink
refactor: style
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisAMJ committed Aug 28, 2024
1 parent 516115d commit 028ef3b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions docs/cvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,8 @@
|sar_velocitygraph_font_index|21|Font index of velocity graph.|
|sar_velocitygraph_rainbow|0|Rainbow mode of velocity graph text.|
|sar_velocitygraph_show_speed_on_graph|1|Show speed between jumps.|
|sar_velocitygraph_x|-250|Velocity graph x axis offset.|
|sar_velocitygraph_y|-175|Velocity graph y axis offset.|
|sar_vphys_hud|0|Enables or disables the vphys HUD.|
|sar_vphys_hud_font|1|Sets font of the vphys HUD.|
|sar_vphys_hud_precision|3|Sets decimal precision of the vphys HUD.|
Expand Down
12 changes: 6 additions & 6 deletions src/Features/Hud/VelocityGraph.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#include "VelocityGraph.hpp"

#include "Event.hpp"
#include "Features/Session.hpp"
#include "Modules/Client.hpp"
#include "Modules/Engine.hpp"
#include "Modules/Scheme.hpp"
#include "Modules/Surface.hpp"
#include "Features/Session.hpp"
#include "Utils/SDK/FixedQueue.hpp"
#include "Variable.hpp"

#include "Utils/SDK/FixedQueue.hpp"
#include <vector>
#include <cmath>
#include <vector>

Variable sar_velocitygraph("sar_velocitygraph", "0", "Shows velocity graph.\n");
Variable sar_velocitygraph_font_index("sar_velocitygraph_font_index", "21", 0, "Font index of velocity graph.\n"); // 21 looks pretty good
Expand All @@ -33,7 +33,7 @@ struct VelocityData {
}
};

std::vector<FixedQueue<VelocityData>> velocityStamps(2, FixedQueue(500, VelocityData()));
std::vector<FixedQueue<VelocityData>> velocityStamps(2, FixedQueue(500, VelocityData()));

static int last_vel[2] = {0, 0};
static int tick_prev[2] = {0, 0};
Expand All @@ -57,7 +57,7 @@ void ClearData(int slot) {
}

void VelocityGraph::GatherData(int slot, bool on_ground) {
auto player = client->GetPlayer(slot + 1); //not sure how to get it properly with event
auto player = client->GetPlayer(slot + 1);
if (!player) return;

auto vel = client->GetLocalVelocity(player);
Expand Down Expand Up @@ -142,4 +142,4 @@ ON_EVENT(PROCESS_MOVEMENT) {
velocityGraph->GatherData(event.slot, event.grounded);
}

VelocityGraph *velocityGraph = new VelocityGraph();
VelocityGraph *velocityGraph = new VelocityGraph();
2 changes: 1 addition & 1 deletion src/Features/Hud/VelocityGraph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ extern Variable sar_velocitygraph_x;
extern Variable sar_velocitygraph_y;
extern Variable sar_velocitygraph_background;
extern Variable sar_velocitygraph_show_speed_on_graph;
extern Variable sar_velocitygraph_rainbow;
extern Variable sar_velocitygraph_rainbow;

0 comments on commit 028ef3b

Please sign in to comment.