Add option to have actions in a milestone in mission UI

This commit is contained in:
Ylva Selling
2023-05-11 14:58:54 -04:00
parent fbf40a4d79
commit c1e9993c27
3 changed files with 8 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ struct Milestone {
std::optional<std::string> description;
std::optional<std::string> image;
std::optional<std::string> link;
std::optional<std::vector<std::string>> actions;
};
/**

View File

@@ -89,6 +89,9 @@ nlohmann::json MissionTopic::createPhaseJson(const MissionPhase& phase) const {
if (date.link.has_value()) {
jsonDate["link"] = *date.link;
}
if (date.actions.has_value()) {
jsonDate["actions"] = *date.actions;
}
milestones.push_back(std::move(jsonDate));
}

View File

@@ -70,6 +70,7 @@ namespace {
std::optional<std::string> description;
std::optional<std::string> image;
std::optional<std::string> link;
std::optional<std::vector<std::string>> actions;
};
std::optional<std::vector<Milestone>> milestones;
};
@@ -171,6 +172,9 @@ MissionPhase::MissionPhase(const ghoul::Dictionary& dictionary) {
}
if (milestone.link.has_value()) {
newDate.link = milestone.link.value();
}
if (milestone.actions.has_value()) {
newDate.actions = milestone.actions.value();
}
_milestones.emplace_back(newDate);
}