From a8ac3b2ff7630fba394a9ef4b1d95d796729cd0b Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 15 Sep 2020 19:11:19 +0200 Subject: [PATCH] tour:: an option to print --- commandline.cpp | 3 +++ tour.cpp | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/commandline.cpp b/commandline.cpp index c78d5f81..deb2e542 100644 --- a/commandline.cpp +++ b/commandline.cpp @@ -222,6 +222,9 @@ int arg::readCommon() { PHASEFROM(2); tour::texts = false; start_game(); tour::start(); } + else if(argis("-print-tour")) { + tour::print(); + } #endif else if(argis("-draw")) { PHASE(3); start_game(); drawscreen(); diff --git a/tour.cpp b/tour.cpp index 2f40010f..bde5ffcd 100644 --- a/tour.cpp +++ b/tour.cpp @@ -476,6 +476,21 @@ EX void initialize_slides() { if(slides[currentslide].flags & FINALSLIDE) break; } } + +EX void print() { + dynamicval cs(currentslide, 0); + for(currentslide=0;; currentslide++) { + auto& sl = slides[currentslide]; + println(hlog, sl.name); + string str = sl.name; + for(char& c: str) c = '='; + println(hlog, str); + println(hlog); + println(hlog, sl.help); + println(hlog); + if(slides[currentslide].flags & FINALSLIDE) break; + } + } EX void start() { currentslide = 0;