adds version control to orderlist exporting

pull/679/head
lucaFiorini 1 month ago
parent 192a3b4e70
commit 0019e84188

@ -1049,7 +1049,7 @@ public:
void DebugCheckSanity() const;
#endif
bool CheckOrderListIndexing() const;
inline std::vector<DispatchSchedule> &GetScheduledDispatchScheduleSet() { return this->dispatch_schedules; }
inline const std::vector<DispatchSchedule> &GetScheduledDispatchScheduleSet() const { return this->dispatch_schedules; }

@ -43,6 +43,7 @@
#include "date_func.h"
#include "3rdparty/nlohmann/json.hpp"
#include "command_aux.h"
#include "rev.h"
#include "table/strings.h"
@ -925,9 +926,13 @@ void OrderList::MoveOrder(int from, int to)
std::string OrderList::ToJSONString()
{
nlohmann::json json;
auto& SD_data = this->GetScheduledDispatchScheduleSet();
json["version"] = ORDERLIST_JSON_OUTPUT_VERSION;
json["source"] = std::string(_openttd_revision);
auto& SD_data = this->GetScheduledDispatchScheduleSet();
auto& headJson = json["head"];
for (unsigned int i = 0; auto &SD : SD_data) {

@ -313,6 +313,8 @@ enum CloneOptions {
CO_UNSHARE = 2
};
const uint8_t ORDERLIST_JSON_OUTPUT_VERSION = 1;
struct Order;
struct OrderList;

Loading…
Cancel
Save