mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpigui] Add option to reset UI on exit (#3463)
Also add wpiutil as a dependency for wpigui.
This commit is contained in:
committed by
GitHub
parent
a371235b0d
commit
d29acc90a2
@@ -15,6 +15,7 @@
|
||||
#include <imgui_internal.h>
|
||||
#include <implot.h>
|
||||
#include <stb_image.h>
|
||||
#include <wpi/fs.h>
|
||||
|
||||
#include "wpigui_internal.h"
|
||||
|
||||
@@ -290,6 +291,11 @@ void gui::Main() {
|
||||
ImPlot::DestroyContext();
|
||||
ImGui::DestroyContext();
|
||||
|
||||
// Delete the save file if requested.
|
||||
if (gContext->resetOnExit) {
|
||||
fs::remove(fs::path{gContext->iniPath});
|
||||
}
|
||||
|
||||
glfwDestroyWindow(gContext->window);
|
||||
glfwTerminate();
|
||||
}
|
||||
@@ -466,6 +472,8 @@ void gui::EmitViewMenu() {
|
||||
}
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
ImGui::MenuItem("Reset UI on Exit?", nullptr, &gContext->resetOnExit);
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user