20 connect(menu->addAction(tr(
"Delete")), &QAction::triggered, [
this] () {
myParent->
removeChild(
this); });
39 QList<QStringList> ret;
42 quest_write_condition(buf,
sizeof(buf), condition);
43 ret.append(QString(buf).split(
' '));
44 Q_ASSERT(ret.back().size() == 2);
51 quest_destroy_condition(cond);
56 auto cond = quest_create_condition();
57 if (!quest_condition_from_string(cond, single.join(
' ').toStdString().data())) {
79 if (index >= 0 && index <
static_cast<int>(
myWrappedItem->steps.size())) {
86 for (
int index = 0; index < static_cast<int>(
myWrappedItem->steps.size()); index++) {
104 std::vector<quest_step_definition *> &steps(
myWrappedItem->steps);
105 if (steps.size() < 2) {
114 for (
auto single : dropped) {
115 if (single.first !=
code()) {
119 if (single.second < 0 || single.second >=
static_cast<int>(steps.size()) || single.second == row) {
124 auto step = steps[single.second];
125 steps.erase(steps.begin() + single.second);
127 if (row > single.second) {
132 steps.insert(steps.begin() + row, step);
141 connect(menu->addAction(tr(
"Add step")), &QAction::triggered, [
this] () {
addStep(); });
146 [] (
const auto &left,
const auto &right) { return left->step < right->step; });
147 auto ns = quest_create_step();
148 ns->step = (max ==
myWrappedItem->steps.end() ? 0 : (*max)->step) + 10;
162 quest_destroy_step(step);