File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818#include " stdafx.h"
1919#include " ConfigManager.h"
2020#include " MessageFormatter.h"
21+ #include " ESEHandler.h"
2122#include < string>
2223#include < sstream>
2324#include < fstream>
@@ -132,6 +133,24 @@ namespace DiscordEuroScope_Configuration
132133
133134 void ConfigManager::LoadRadioCallsigns ()
134135 {
136+ if (json_document.HasMember (" load_from_ese" )) {
137+ if (json_document[" load_from_ese" ].IsBool () && json_document[" load_from_ese" ].GetBool () && json_document[" path_to_ese" ].IsString ())
138+ {
139+ std::string relative_to_full_path;
140+ std::string relative_path = json_document[" path_to_ese" ].GetString ();
141+ if (relative_path[1 ] == ' :' )
142+ relative_to_full_path = relative_path;
143+ else
144+ relative_to_full_path = this ->file_path .substr (0 , this ->file_path .find_last_of (' \\ ' ) + 1 ) + relative_path;
145+ if (ESEHandler::LocateESEFile (relative_to_full_path))
146+ {
147+ int p = ESEHandler::ParsePositions ();
148+ ESEHandler::GetRadioCallsigns (data.RadioCallsigns );
149+ return ;
150+ }
151+ }
152+ }
153+
135154 assert (json_document[" radio_callsigns" ].IsObject ());
136155 data.RadioCallsigns .clear ();
137156 for (auto & it : json_document[" radio_callsigns" ].GetObject ())
You can’t perform that action at this time.
0 commit comments