Skip to content

Commit 07715e4

Browse files
committed
Save all datarefs and commands that were found to a preferences file.
This is functionality from DRT version 1 that was accidentally removed.
1 parent b68d1a6 commit 07715e4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/plugin/drt_plugin.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,18 @@ void DRTPlugin::savePrefs() {
175175
}
176176
}
177177

178+
void DRTPlugin::saveAllRefs() {
179+
char system_path_c[1000];
180+
XPLMGetSystemPath(system_path_c);
181+
lb::filesystem::path system_path(system_path_c);
182+
lb::filesystem::path output_dir = system_path / "Output" / "preferences";
183+
184+
refs.saveToFile(output_dir / "drt_last_run_datarefs.txt", output_dir / "drt_last_run_commandrefs.txt");
185+
}
186+
178187
DRTPlugin::~DRTPlugin() {
179188
savePrefs();
189+
saveAllRefs();
180190
}
181191

182192
void DRTPlugin::openAboutWindow() {

src/plugin/drt_plugin.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ class DRTPlugin: public Plugin {
5858
void handleMessage(intptr_t inMessage, void * inParam);
5959

6060
RefRecords & getRefs() { return refs; }
61+
62+
void saveAllRefs();
6163
};
6264

6365
extern std::unique_ptr<DRTPlugin> plugin;

0 commit comments

Comments
 (0)