1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

dialog:: find_highlight

This commit is contained in:
Zeno Rogue 2022-11-03 19:29:23 +01:00
parent 1482a7aca2
commit 3ab4915ff4
2 changed files with 6 additions and 1 deletions

View File

@ -388,8 +388,12 @@ EX namespace dialog {
EX string highlight_text; EX string highlight_text;
EX int highlight_key; EX int highlight_key;
EX bool is_highlight(item& I) { return I.body == highlight_text && I.key == highlight_key; } EX bool is_highlight(item& I) { return I.body == highlight_text && among(highlight_key, I.key, PSEUDOKEY_SELECT); }
EX void set_highlight(item& I) { highlight_text = I.body; highlight_key = I.key; } EX void set_highlight(item& I) { highlight_text = I.body; highlight_key = I.key; }
EX void find_highlight(const string& s) {
println(hlog, "highlight_text set to ", s);
highlight_text = s; highlight_key = PSEUDOKEY_SELECT;
}
EX void measure() { EX void measure() {
tothei = 0; tothei = 0;

View File

@ -244,6 +244,7 @@
#define PSEUDOKEY_MENU 2505 #define PSEUDOKEY_MENU 2505
#define PSEUDOKEY_NOHINT 2506 #define PSEUDOKEY_NOHINT 2506
#define PSEUDOKEY_LIST_SLIDER 2507 #define PSEUDOKEY_LIST_SLIDER 2507
#define PSEUDOKEY_SELECT 2508
#ifndef CAP_PNG #ifndef CAP_PNG
#define CAP_PNG (!ISMOBWEB) #define CAP_PNG (!ISMOBWEB)