From be0c5e4a393bcfefdababafe2e3e015dcbaf95c6 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 5 Sep 2018 15:19:51 +0200 Subject: [PATCH] help extensions now can use addSelItem and color --- help.cpp | 9 +++++++-- hyper.h | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/help.cpp b/help.cpp index 07b03ad2..7054a8d0 100644 --- a/help.cpp +++ b/help.cpp @@ -928,8 +928,13 @@ void showHelp() { dialog::addHelp(help); } - for(auto& he: help_extensions) - dialog::addItem(he.text, he.key); + for(auto& he: help_extensions) { + if(he.subtext != "") + dialog::addSelItem(he.text, he.subtext, he.key); + else + dialog::addItem(he.text, he.key); + dialog::lastItem().color = he.color; + } dialog::display(); diff --git a/hyper.h b/hyper.h index bd969131..4d8f1470 100644 --- a/hyper.h +++ b/hyper.h @@ -3868,7 +3868,11 @@ extern ld scalef; struct help_extension { char key; string text; + string subtext; + color_t color; reaction_t action; + help_extension() { color = forecolor; } + help_extension(char k, string t, reaction_t a) : key(k), text(t), action(a) { color = forecolor; } }; extern vector help_extensions; @@ -4020,5 +4024,7 @@ void virtualRebaseSimple(heptagon*& base, transmatrix& at); extern bool game_active, playerfound; +string bygen(reaction_t h); + }