racing::standard_centering

This commit is contained in:
Zeno Rogue 2019-01-17 01:15:28 +01:00
parent 294d287518
commit 8756b8e27a
4 changed files with 12 additions and 5 deletions

View File

@ -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();

View File

@ -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();

View File

@ -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;
}

View File

@ -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;