mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-05 19:19:39 -06:00
Add option to have actions in a milestone in mission UI
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user