Skip to content

Commit

Permalink
feat: sar_rhythmgame_font
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAdvDev authored and ThisAMJ committed Oct 20, 2024
1 parent 96b7cb2 commit d81fb1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/cvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@
|sar_render_vcodec|h264|Video codec used in renders (h264, hevc, vp8, vp9, dnxhd)|
|sar_rhythmgame|0|Show a HUD indicating your groundframes as rhythm game like popups.|
|sar_rhythmgame_combo|1|Show a combo counter on the rhythm game HUD.|
|sar_rhythmgame_font|64|The font to use for the rhythm game HUD.|
|sar_rng_load|cmd|sar_rng_load [filename] - load RNG seed data on next session start. If filename isn't given, use last TAS script path|
|sar_rng_save|cmd|sar_rng_save [filename] - save RNG seed data to the specified file. If filename isn't given, use last TAS script path|
|sar_ruler_add|cmd|sar_ruler_add \<x> \<y> \<z> \<x> \<y> \<z> - adds a ruler to a set of currently drawn rulers.|
Expand Down
5 changes: 3 additions & 2 deletions src/Features/Hud/RhythmGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Variable sar_rhythmgame("sar_rhythmgame", "0", "Show a HUD indicating your groun

// Customization
Variable sar_rhythmgame_combo("sar_rhythmgame_combo", "1", "Show a combo counter on the rhythm game HUD.\n");
Variable sar_rhythmgame_font("sar_rhythmgame_font", "64", "The font to use for the rhythm game HUD.\n");

bool RhythmGameHud::ShouldDraw() {
return sar_rhythmgame.GetBool();
Expand All @@ -30,7 +31,7 @@ void RhythmGameHud::HandleGroundframeLogic(int slot, bool grounded) {
}

void RhythmGameHud::Paint(int slot) {
auto font = scheme->GetFontByID(49);
auto font = scheme->GetFontByID(sar_rhythmgame_font.GetInt());
float fh = surface->GetFontHeight(font);

for (unsigned i = 0; i < popups.size(); i++) {
Expand Down Expand Up @@ -91,7 +92,7 @@ void RhythmGameHud::OnJump(int slot) {
int screenWidth, screenHeight;
engine->GetScreenSize(nullptr, screenWidth, screenHeight);

auto font = scheme->GetFontByID(49);
auto font = scheme->GetFontByID(sar_rhythmgame_font.GetInt());

int x = Math::RandomNumber(0, screenWidth - surface->GetFontLength(font, "PERFECT"));
int y = screenHeight - 200;
Expand Down

0 comments on commit d81fb1f

Please sign in to comment.