From 8756b8e27a3a027f76ff2a5b8e57c48bd9212c53 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 17 Jan 2019 01:15:28 +0100 Subject: [PATCH] racing::standard_centering --- config.cpp | 1 + hyper.h | 2 +- hypgraph.cpp | 2 +- racing.cpp | 12 +++++++++--- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/config.cpp b/config.cpp index 6469ed40..e2a83d38 100644 --- a/config.cpp +++ b/config.cpp @@ -354,6 +354,7 @@ void initConfig() { addsaver(racing::ghosts_to_save, "race_ghosts_to_save"); addsaver(racing::guiding, "race_guiding"); addsaver(racing::player_relative, "race_player_relative"); + addsaver(racing::standard_centering, "race_standard_centering"); #if CAP_SHMUP shmup::initConfig(); diff --git a/hyper.h b/hyper.h index 1c30430a..53f695ab 100644 --- a/hyper.h +++ b/hyper.h @@ -4687,7 +4687,7 @@ ld sintick(int period, ld phase = 0); #if CAP_RACING namespace racing { - extern bool on, player_relative, track_ready, guiding; + extern bool on, player_relative, track_ready, guiding, standard_centering; extern ld race_advance, race_angle; extern int ghosts_to_show, ghosts_to_save; void generate_track(); diff --git a/hypgraph.cpp b/hypgraph.cpp index 747007d8..684caee4 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -1004,7 +1004,7 @@ void centerpc(ld aspd) { crystal::centerrug(aspd); #if CAP_RACING - if(racing::on) { + if(racing::on && !racing::standard_centering) { racing::set_view(); return; } diff --git a/racing.cpp b/racing.cpp index 8bbc86db..55b20104 100644 --- a/racing.cpp +++ b/racing.cpp @@ -15,6 +15,7 @@ bool guiding = false; bool on; bool player_relative = false; +bool standard_centering = false; bool track_ready; bool official_race = false; @@ -904,8 +905,8 @@ void race_projection() { }); if(pmodel == mdDisk) { - dialog::addSelItem(XLAT("point of view"), player_relative ? "player" : "track", 'p'); - if(quotient) + dialog::addSelItem(XLAT("point of view"), XLAT(player_relative ? "player" : "track"), 'p'); + if(quotient || racing::standard_centering) dialog::lastItem().value = XLAT("N/A"); dialog::add_action([] () { player_relative = !player_relative; @@ -928,6 +929,11 @@ void race_projection() { dialog::editNumber(race_advance, 0, 360, 0.1, 1, XLAT("show more in front"), ""); }); + dialog::addBoolItem(XLAT("do not use special centering for racing"), standard_centering, 'C'); + dialog::add_action([] () { + standard_centering = !standard_centering; + }); + dialog::addBack(); dialog::display(); } @@ -1197,7 +1203,7 @@ void markers() { for(int j=0; j<5; j++) queueline(m->pat * xpush0(j), m->pat * xpush0(j+1), multi::scs[i].uicolor, 2); } - if(racing::player_relative) { + if(racing::player_relative || racing::standard_centering) { using namespace racing; cell *goal = NULL; for(cell *c: track) if(inscreenrange(c)) goal = c;