23 running_child_idx_(-1),
24 previously_executed_idx_(-1)
43 if (children_count == 0)
48 bool repeat_last =
false;
91 win = newwin(6, 70, 1, 1);
93 mvwprintw(win, 0, 0,
"No children.");
94 mvwprintw(win, 1, 0,
"Press: S to return SUCCESFULL,");
95 mvwprintw(win, 2, 0,
" F to return FAILURE, or");
96 mvwprintw(win, 3, 0,
" R to return RUNNING.");
107 if (ch ==
's' || ch ==
'S')
112 else if (ch ==
'f' || ch ==
'F')
117 else if (ch ==
'r' || ch ==
'R')
135 std::vector<std::string> list;
136 list.reserve(children_count);
143 for (
const auto& str : list)
145 width = std::max(width, str.size() + 2);
152 win = newwin(children_count + 6, 70, 1, 1);
154 mvwprintw(win, 0, 0,
"Use UP/DOWN arrow to select the child, Enter to confirm.");
155 mvwprintw(win, 1, 0,
"Press: S to skip and return SUCCESFULL,");
156 mvwprintw(win, 2, 0,
" F to skip and return FAILURE, or");
157 mvwprintw(win, 3, 0,
" R to skip and return RUNNING.");
160 for (
size_t i = 0; i < list.size(); i++)
162 mvwprintw(win, i + 5, 0,
"%2ld. %s", i + 1, list[i].c_str());
175 wattroff(win, A_STANDOUT);
176 mvwprintw(win, row + 5, 4,
"%s", list[row].c_str());
180 row = (row == children_count - 1) ? 0 : row + 1;
182 else if (ch == KEY_UP)
184 row = (row == 0) ? (children_count - 1) : row - 1;
186 else if (ch == KEY_ENTER || ch == 10)
190 else if (ch ==
's' || ch ==
'S')
195 else if (ch ==
'f' || ch ==
'F')
200 else if (ch ==
'r' || ch ==
'R')
207 wattron(win, A_STANDOUT);
208 mvwprintw(win, row + 5, 4,
"%s", list[row].c_str());
virtual void halt() override
const TreeNode * child(size_t index) const
std::vector< TreeNode * > children_nodes_
int previously_executed_idx_
virtual void halt() override
static constexpr const char * REPEAT_LAST_SELECTION
uint8_t selectChild() const
ManualSelectorNode(const std::string &name, const NodeConfiguration &config)
const std::string & name() const
Name of the instance, not the type.
Result getInput(const std::string &key, T &destination) const
NodeStatus selectStatus() const
void setRegistrationID(StringView ID)
virtual BT::NodeStatus tick() override
Method to be implemented by the user.
void setStatus(NodeStatus new_status)