Compare commits

...

5 commits

Author SHA1 Message Date
16b8807eb7 SaveTool: remove unsafe mode.
It was just not good at all.
2022-11-21 09:20:21 +01:00
f1ea2bda25 CMakeLists: officially start work on version 1.4. 2022-11-21 09:20:21 +01:00
42cec59c71 CMakeLists: improve formatting. 2022-11-21 09:20:21 +01:00
5c6a83c03b CMakeLists: improve libcurl builds. 2022-11-21 09:20:21 +01:00
e6c597ffbc Disable Interconnect.
Nope, it's just not needed.
2022-11-21 09:20:02 +01:00
7 changed files with 99 additions and 115 deletions

View file

@ -26,7 +26,7 @@ set(CORRADE_BUILD_STATIC ON CACHE BOOL "" FORCE)
set(CORRADE_BUILD_STATIC_PIC ON CACHE BOOL "" FORCE) set(CORRADE_BUILD_STATIC_PIC ON CACHE BOOL "" FORCE)
set(CORRADE_BUILD_STATIC_UNIQUE_GLOBALS OFF CACHE BOOL "" FORCE) set(CORRADE_BUILD_STATIC_UNIQUE_GLOBALS OFF CACHE BOOL "" FORCE)
set(CORRADE_BUILD_TESTS OFF CACHE BOOL "" FORCE) set(CORRADE_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(CORRADE_WITH_INTERCONNECT ON CACHE BOOL "" FORCE) set(CORRADE_WITH_INTERCONNECT OFF CACHE BOOL "" FORCE)
set(CORRADE_WITH_PLUGINMANAGER OFF CACHE BOOL "" FORCE) set(CORRADE_WITH_PLUGINMANAGER OFF CACHE BOOL "" FORCE)
set(CORRADE_WITH_TESTSUITE OFF CACHE BOOL "" FORCE) set(CORRADE_WITH_TESTSUITE OFF CACHE BOOL "" FORCE)
set(CORRADE_WITH_MAIN ON CACHE BOOL "" FORCE) set(CORRADE_WITH_MAIN ON CACHE BOOL "" FORCE)
@ -98,10 +98,11 @@ set(BUILD_TEST_APP OFF CACHE BOOL "" FORCE)
set(EFSW_INSTALL OFF CACHE BOOL "" FORCE) set(EFSW_INSTALL OFF CACHE BOOL "" FORCE)
add_subdirectory(third-party/efsw EXCLUDE_FROM_ALL) add_subdirectory(third-party/efsw EXCLUDE_FROM_ALL)
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
set(BUILD_CURL_EXE OFF CACHE BOOL "" FORCE) set(BUILD_CURL_EXE OFF CACHE BOOL "" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(ENABLE_UNICODE ON CACHE BOOL "" FORCE) set(ENABLE_UNICODE ON CACHE BOOL "" FORCE)
set(ENABLE_DEBUG ON CACHE BOOL "" FORCE) set(ENABLE_DEBUG OFF CACHE BOOL "" FORCE)
set(ENABLE_THREADED_RESOLVER OFF CACHE BOOL "" FORCE) set(ENABLE_THREADED_RESOLVER OFF CACHE BOOL "" FORCE)
set(HTTP_ONLY ON CACHE BOOL "" FORCE) set(HTTP_ONLY ON CACHE BOOL "" FORCE)
set(CURL_USE_SCHANNEL ON CACHE BOOL "" FORCE) set(CURL_USE_SCHANNEL ON CACHE BOOL "" FORCE)

View file

@ -18,9 +18,9 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
set(SAVETOOL_PROJECT_VERSION 1.3.5) set(SAVETOOL_PROJECT_VERSION 1.4.0-pre)
find_package(Corrade REQUIRED Main Containers Utility Interconnect) find_package(Corrade REQUIRED Main Containers Utility)
find_package(Magnum REQUIRED GL Sdl2Application) find_package(Magnum REQUIRED GL Sdl2Application)
find_package(MagnumIntegration REQUIRED ImGui) find_package(MagnumIntegration REQUIRED ImGui)
@ -101,12 +101,14 @@ add_library(UESaveFile STATIC EXCLUDE_FROM_ALL
UESaveFile/BinaryWriter.h UESaveFile/BinaryWriter.h
UESaveFile/BinaryWriter.cpp UESaveFile/BinaryWriter.cpp
UESaveFile/PropertySerialiser.h UESaveFile/PropertySerialiser.h
UESaveFile/PropertySerialiser.cpp) UESaveFile/PropertySerialiser.cpp
)
target_link_libraries(UESaveFile PRIVATE target_link_libraries(UESaveFile PRIVATE
Corrade::Containers Corrade::Containers
Corrade::Utility Corrade::Utility
Magnum::Magnum) Magnum::Magnum
)
add_executable(MassBuilderSaveTool WIN32 add_executable(MassBuilderSaveTool WIN32
main.cpp main.cpp
@ -164,14 +166,17 @@ add_executable(MassBuilderSaveTool WIN32
FontAwesome/IconsFontAwesome5.h FontAwesome/IconsFontAwesome5.h
FontAwesome/IconsFontAwesome5Brands.h FontAwesome/IconsFontAwesome5Brands.h
resource.rc resource.rc
${Assets}) ${Assets}
)
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
add_compile_definitions(SAVETOOL_DEBUG_BUILD) add_compile_definitions(SAVETOOL_DEBUG_BUILD)
endif() endif()
add_compile_definitions(SAVETOOL_VERSION="${SAVETOOL_PROJECT_VERSION}" add_compile_definitions(
SAVETOOL_CODENAME="Dickish Cyclops" SAVETOOL_VERSION="${SAVETOOL_PROJECT_VERSION}"
SUPPORTED_GAME_VERSION="0.8.6") SAVETOOL_CODENAME="Enigmatic Ellenier"
SUPPORTED_GAME_VERSION="0.9.x"
)
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(MassBuilderSaveTool PROPERTIES OUTPUT_NAME MassBuilderSaveTool-${SAVETOOL_PROJECT_VERSION}) set_target_properties(MassBuilderSaveTool PROPERTIES OUTPUT_NAME MassBuilderSaveTool-${SAVETOOL_PROJECT_VERSION})
@ -186,7 +191,6 @@ endif()
target_link_libraries(MassBuilderSaveTool PRIVATE target_link_libraries(MassBuilderSaveTool PRIVATE
Corrade::Containers Corrade::Containers
Corrade::Utility Corrade::Utility
Corrade::Interconnect
Corrade::Main Corrade::Main
Magnum::Magnum Magnum::Magnum
Magnum::GL Magnum::GL
@ -197,4 +201,5 @@ target_link_libraries(MassBuilderSaveTool PRIVATE
zip zip
libcurl libcurl
imm32 imm32
wtsapi32) wtsapi32
)

View file

@ -172,7 +172,6 @@ SaveTool::~SaveTool() {
Utility::Debug{} << "Saving the configuration..."; Utility::Debug{} << "Saving the configuration...";
_conf.setValue("cheat_mode"_s, _cheatMode); _conf.setValue("cheat_mode"_s, _cheatMode);
_conf.setValue("unsafe_mode"_s, _unsafeMode);
_conf.setValue("startup_update_check"_s, _checkUpdatesOnStartup); _conf.setValue("startup_update_check"_s, _checkUpdatesOnStartup);
_conf.setValue("skip_disclaimer"_s, _skipDisclaimer); _conf.setValue("skip_disclaimer"_s, _skipDisclaimer);

View file

@ -166,23 +166,16 @@ class SaveTool: public Platform::Sdl2Application, public efsw::FileWatchListener
template<typename Functor, typename... Args> template<typename Functor, typename... Args>
auto drawUnsafeWidget(Functor func, Args... args) -> bool { auto drawUnsafeWidget(Functor func, Args... args) -> bool {
GameState game_state = _gameState; // Copying the value to reduce the risk of a data race. GameState game_state = _gameState; // Copying the value to reduce the risk of a data race.
if(!_unsafeMode && game_state != GameState::NotRunning) { ImGui::BeginDisabled(game_state != GameState::NotRunning);
ImGui::BeginDisabled();
}
bool result = func(std::forward<Args>(args)...); bool result = func(std::forward<Args>(args)...);
if(!_unsafeMode && game_state != GameState::NotRunning) {
ImGui::EndDisabled(); ImGui::EndDisabled();
}
return result; return result;
} // Obviously, should only be used with ImGui widgets that return a bool. } // Obviously, should only be used with ImGui widgets that return a bool.
// Also, func should be a lambda if there are any default arguments, like ImGui::Button(), etc... // Also, func should be a lambda if there are any default arguments, like ImGui::Button(), etc...
template<typename... Args> template<typename... Args>
void drawUnsafeText(Containers::StringView text, Args... args) { // Alternative to the above, for ImGui::Text*() variants. void drawUnsafeText(Containers::StringView text, Args... args) { // Alternative to the above, for ImGui::Text*() variants.
if(!_unsafeMode && _gameState != GameState::NotRunning) { if(_gameState != GameState::NotRunning) {
ImGui::TextDisabled(text, std::forward<Args>(args)...); ImGui::TextDisabled(text, std::forward<Args>(args)...);
} }
else { else {
@ -276,7 +269,6 @@ class SaveTool: public Platform::Sdl2Application, public efsw::FileWatchListener
bool _skipDisclaimer{false}; bool _skipDisclaimer{false};
bool _checkUpdatesOnStartup{true}; bool _checkUpdatesOnStartup{true};
bool _unsafeMode{false};
bool _updateAvailable{false}; bool _updateAvailable{false};
Containers::String _latestVersion; Containers::String _latestVersion;

View file

@ -54,13 +54,6 @@ void SaveTool::initialiseConfiguration() {
_conf.setValue("cheat_mode"_s, _cheatMode); _conf.setValue("cheat_mode"_s, _cheatMode);
} }
if(_conf.hasValue("unsafe_mode"_s)) {
_unsafeMode = _conf.value<bool>("unsafe_mode"_s);
}
else {
_conf.setValue("unsafe_mode"_s, _unsafeMode);
}
if(_conf.hasValue("startup_update_check"_s)) { if(_conf.hasValue("startup_update_check"_s)) {
_checkUpdatesOnStartup = _conf.value<bool>("startup_update_check"_s); _checkUpdatesOnStartup = _conf.value<bool>("startup_update_check"_s);
} }

View file

@ -146,7 +146,7 @@ auto SaveTool::drawRenamePopup(Containers::ArrayView<char> name_view) -> bool {
callback, nullptr); callback, nullptr);
ImGui::SameLine(); ImGui::SameLine();
GameState game_state = _gameState; GameState game_state = _gameState;
if((!_unsafeMode && game_state != GameState::NotRunning) || if(game_state != GameState::NotRunning ||
!(len >= 6 && len <= 32) || !(len >= 6 && len <= 32) ||
!(name_view[0] != ' ' && name_view[len - 1] != ' ')) !(name_view[0] != ' ' && name_view[len - 1] != ' '))
{ {
@ -158,7 +158,7 @@ auto SaveTool::drawRenamePopup(Containers::ArrayView<char> name_view) -> bool {
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }
if((!_unsafeMode && game_state != GameState::NotRunning) || if(game_state != GameState::NotRunning ||
!(len >= 6 && len <= 32) || !(len >= 6 && len <= 32) ||
!(name_view[0] != ' ' && name_view[len - 1] != ' ')) !(name_view[0] != ' ' && name_view[len - 1] != ' '))
{ {
@ -249,7 +249,7 @@ void SaveTool::drawGeneralInfo() {
} }
drawTooltip("Story progress directly affects unlocked levels."); drawTooltip("Story progress directly affects unlocked levels.");
if(ImGui::BeginPopup("StoryProgressMenu")) { if(ImGui::BeginPopup("StoryProgressMenu")) {
if(!_unsafeMode && _gameState != GameState::NotRunning) { if(_gameState != GameState::NotRunning) {
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }
for(const auto& sp : story_progress) { for(const auto& sp : story_progress) {
@ -473,7 +473,7 @@ void SaveTool::drawMassManager() {
ImGui::EndDragDropSource(); ImGui::EndDragDropSource();
} }
if((_unsafeMode || _gameState == GameState::NotRunning) && ImGui::BeginDragDropTarget()) { if(_gameState == GameState::NotRunning && ImGui::BeginDragDropTarget()) {
if(const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("StagedMass")) { if(const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("StagedMass")) {
if(payload->DataSize != sizeof(Containers::String)) { if(payload->DataSize != sizeof(Containers::String)) {
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal error", SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal error",

View file

@ -103,12 +103,6 @@ void SaveTool::drawMainMenu() {
drawHelpMarker("This gives access to save edition features that can be considered cheats.", drawHelpMarker("This gives access to save edition features that can be considered cheats.",
Float(windowSize().x()) * 0.4f); Float(windowSize().x()) * 0.4f);
ImGui::Checkbox("Unsafe mode", &_unsafeMode);
ImGui::SameLine();
ImGui::AlignTextToFramePadding();
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::Checkbox("Check for updates on startup", &_checkUpdatesOnStartup);
ImGui::SameLine(); ImGui::SameLine();
if(ImGui::Button(ICON_FA_SYNC_ALT " Check now")) { if(ImGui::Button(ICON_FA_SYNC_ALT " Check now")) {