From 629e94cbb153d7116d7711253c84b4bf8f3ce0e9 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 12 Mar 2019 02:44:01 +0100 Subject: [PATCH] tour:: replaced 'a'+i to allow longer presentations --- tour.cpp | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/tour.cpp b/tour.cpp index bed7ca6f..22c87660 100644 --- a/tour.cpp +++ b/tour.cpp @@ -280,24 +280,16 @@ namespace ss { slideshows.push_back(ss); } - int sssize; + string slidechars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ23456789!@#$%^&*("; void showMenu() { if(!wts) wts = slides; dialog::init(XLAT("slides"), forecolor, 150, 100); - for(sssize=0;; sssize++) { - int i = sssize; - dialog::addBoolItem(XLAT(wts[i].name), wts == slides && i == currentslide, 'a'+i); - if(wts[i].flags & FINALSLIDE) break; - } - dialog::addBreak(50); - if(isize(slideshows) > 1) dialog::addItem(XLAT("change slideshow"), '1'); - dialog::addBack(); - dialog::display(); - keyhandler = [] (int sym, int uni) { - if(uni >= 'a' && uni < 'a' + sssize) { + for(int i=0;; i++) { + dialog::addBoolItem(XLAT(wts[i].name), wts == slides && i == currentslide, slidechars[i]); + dialog::add_action([i] { if(geometry || CHANGED_VARIATION) { pop_game(); presentation(pmGeometryReset); @@ -308,20 +300,26 @@ namespace ss { tour::start(); } presentation(pmStop); - currentslide = uni - 'a'; + currentslide = i; popScreenAll(); presentation(pmStart); slidehelp(); - } - else if(uni == '1') { + }); + if(wts[i].flags & FINALSLIDE) break; + } + dialog::addBreak(50); + if(isize(slideshows) > 1) { + dialog::addItem(XLAT("change slideshow"), '1'); + dialog::add_action([] { list(wts); for(int i=0; i