From d65c41db12e83d045b004e912569b8855889e3ad Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 23 Dec 2018 13:10:46 +0100 Subject: [PATCH] racing::add_debug --- debug.cpp | 2 +- hyper.h | 1 + racing.cpp | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/debug.cpp b/debug.cpp index 6b8387fc..82733802 100644 --- a/debug.cpp +++ b/debug.cpp @@ -431,7 +431,7 @@ struct debugScreen { } dialog::addBack(); dialog::display(); - + keyhandler = [this, what] (int sym, int uni) { handlePanning(sym, uni); dialog::handleNavigation(sym, uni); diff --git a/hyper.h b/hyper.h index 72d3614a..c8ea5357 100644 --- a/hyper.h +++ b/hyper.h @@ -4698,6 +4698,7 @@ namespace racing { void race_won(); void apply_seed(); string racetimeformat(int t); + void add_debug(cell *c); } bool subscreen_split(reaction_t for_each_subscreen); diff --git a/racing.cpp b/racing.cpp index 354d00bb..296f38a5 100644 --- a/racing.cpp +++ b/racing.cpp @@ -887,6 +887,16 @@ int get_percentage(int i) { return min(get_info(shmup::pc[i]->base).completion * 100 / (isize(track) - DROP), 100); } +void add_debug(cell *c) { + if(racing::on && racing::rti_id[c]) { + auto& r = racing::get_info(c); + dialog::addSelItem("from_track", its(r.from_track), 0); + dialog::addSelItem("from_start", its(r.from_start), 0); + dialog::addSelItem("from_goal", its(r.from_goal), 0); + dialog::addSelItem("completion", its(r.completion), 0); + } + } + } bool subscreen_split(reaction_t what) {