Compare commits

..

No commits in common. "445d7323b35a05ddcf1b45e65c584ce2f9a028ae" and "d0eee0caebe5ffde5327d982930330e2d51582c2" have entirely different histories.

5 changed files with 27 additions and 50 deletions

View file

@ -89,7 +89,7 @@ set(EFSW_INSTALL OFF CACHE BOOL "" FORCE)
add_subdirectory(third-party/efsw EXCLUDE_FROM_ALL)
set(CPR_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(CMAKE_USE_LIBSSH2 OFF CACHE BOOL "" FORCE) # For some reason, even when HTTP_ONLY is set to ON, libcurl will try to link to libssh2.
set(CMAKE_USE_LIBSSH2 OFF CACHE BOOL "" FORCE)
add_subdirectory(third-party/cpr EXCLUDE_FROM_ALL)
add_subdirectory(src)

View file

@ -131,16 +131,10 @@ SaveTool::SaveTool(const Arguments& arguments):
exit(EXIT_FAILURE);
return;
}
initialiseConfiguration();
}
SaveTool::~SaveTool() {
SDL_RemoveTimer(_gameCheckTimerId);
_conf.setValue("unsafe_mode", _unsafeMode);
_conf.setValue("startup_update_check", _checkUpdatesOnStartup);
_conf.save();
}
void SaveTool::handleFileAction(efsw::WatchID watch_id,
@ -289,24 +283,6 @@ void SaveTool::updateCheckEvent(SDL_Event& event) {
// TODO: implement
}
void SaveTool::initialiseConfiguration() {
if(_conf.hasValue("unsafe_mode")) {
_unsafeMode = _conf.value<bool>("unsafe_mode");
}
else {
_conf.setValue("unsafe_mode", _unsafeMode);
}
if(_conf.hasValue("startup_update_check")) {
_checkUpdatesOnStartup = _conf.value<bool>("startup_update_check");
}
else {
_conf.setValue("startup_update_check", _checkUpdatesOnStartup);
}
_conf.save();
}
void SaveTool::initialiseGui() {
ImGui::CreateContext();

View file

@ -19,7 +19,6 @@
#include <thread>
#include <Corrade/Containers/Pointer.h>
#include <Corrade/Utility/Configuration.h>
#include <Corrade/Utility/Resource.h>
#include <Magnum/Platform/Sdl2Application.h>
@ -74,7 +73,6 @@ class SaveTool: public Platform::Sdl2Application, public efsw::FileWatchListener
void updateCheckEvent(SDL_Event& event);
// Initialisation methods
void initialiseConfiguration();
void initialiseGui();
void initialiseManager();
auto findGameDataDirectory() -> bool;
@ -141,7 +139,6 @@ class SaveTool: public Platform::Sdl2Application, public efsw::FileWatchListener
void checkForUpdates();
Utility::Configuration _conf{"MassBuilderSaveTool.ini"};
Utility::Resource _rs{"assets"};
// GUI-related members
@ -194,6 +191,5 @@ class SaveTool: public Platform::Sdl2Application, public efsw::FileWatchListener
};
Containers::StaticArray<2, efsw::WatchID> _watchIDs;
bool _checkUpdatesOnStartup{true};
bool _unsafeMode{false};
};

View file

@ -42,6 +42,12 @@ void SaveTool::drawManager() {
return;
}
if(ImGui::BeginTable("##TopRow", 2)) {
ImGui::TableSetupColumn("##ProfileInfo", ImGuiTableColumnFlags_WidthStretch);
ImGui::TableSetupColumn("##Unsafe", ImGuiTableColumnFlags_WidthFixed);
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
ImGui::AlignTextToFramePadding();
ImGui::Text("Current profile: %s (%s)",
_currentProfile->companyName().c_str(),
@ -54,6 +60,14 @@ void SaveTool::drawManager() {
_uiState = UiState::ProfileManager;
}
ImGui::TableSetColumnIndex(1);
ImGui::Checkbox("Unsafe mode", &_unsafeMode);
drawTooltip("Enabling this allows interactions deemed to be unsafe to do while the game is running.",
Float(windowSize().x()) * 0.35f);
ImGui::EndTable();
}
if(ImGui::BeginChild("##ProfileInfo",
{ImGui::GetContentRegionAvailWidth() * 0.60f, 0.0f},
true, ImGuiWindowFlags_MenuBar))

View file

@ -54,17 +54,8 @@ void SaveTool::drawMainMenu() {
ImGui::Separator();
if(ImGui::BeginMenu(ICON_FA_COG " Settings")) {
ImGui::Checkbox("Unsafe mode", &_unsafeMode);
ImGui::SameLine();
drawHelpMarker("This allows changing the state of save files in the game's save folder even when the game is running.",
Float(windowSize().x()) * 0.4f);
ImGui::Checkbox("Check for updates on startup", &_checkUpdatesOnStartup);
ImGui::SameLine();
ImGui::Button(ICON_FA_SYNC_ALT " Check now");
ImGui::EndMenu();
if(ImGui::MenuItem(ICON_FA_SYNC_ALT " Check for updates", nullptr, false, false)) {
// TODO: implement
}
ImGui::Separator();