浏览代码

Added ability to get char from int/choose value.

Steve Thielemann 4 年之前
父节点
当前提交
f9bc41c24d
共有 2 个文件被更改,包括 3 次插入0 次删除
  1. 1 0
      door.h
  2. 2 0
      panel.cpp

+ 1 - 0
door.h

@@ -638,6 +638,7 @@ public:
   */
 
   int choose(Door &door);
+  char which(int d);
 
   static renderFunction makeRender(ANSIColor c1, ANSIColor c2, ANSIColor c3,
                                    ANSIColor c4);

+ 2 - 0
panel.cpp

@@ -410,6 +410,8 @@ void Menu::addSelection(char c, const char *line) {
 
 void Menu::defaultSelection(int d) { chosen = d; }
 
+char Menu::which(int d) { return options[d]; }
+
 /*
 void Menu::setColorizer(bool selected,
                         std::function<void(Door &d, std::string &)> colorizer)