Compare commits

...

5 Commits

Author SHA1 Message Date
Guillaume Jacquemin 16b8807eb7 SaveTool: remove unsafe mode.
It was just not good at all.
2022-11-21 09:20:21 +01:00
Guillaume Jacquemin f1ea2bda25 CMakeLists: officially start work on version 1.4. 2022-11-21 09:20:21 +01:00
Guillaume Jacquemin 42cec59c71 CMakeLists: improve formatting. 2022-11-21 09:20:21 +01:00
Guillaume Jacquemin 5c6a83c03b CMakeLists: improve libcurl builds. 2022-11-21 09:20:21 +01:00
Guillaume Jacquemin 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_UNIQUE_GLOBALS 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_TESTSUITE OFF 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)
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_SHARED_LIBS OFF 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(HTTP_ONLY 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_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(MagnumIntegration REQUIRED ImGui)
@ -101,12 +101,14 @@ add_library(UESaveFile STATIC EXCLUDE_FROM_ALL
UESaveFile/BinaryWriter.h
UESaveFile/BinaryWriter.cpp
UESaveFile/PropertySerialiser.h
UESaveFile/PropertySerialiser.cpp)
UESaveFile/PropertySerialiser.cpp
)
target_link_libraries(UESaveFile PRIVATE
Corrade::Containers
Corrade::Utility
Magnum::Magnum)
Magnum::Magnum
)
add_executable(MassBuilderSaveTool WIN32
main.cpp
@ -164,14 +166,17 @@ add_executable(MassBuilderSaveTool WIN32
FontAwesome/IconsFontAwesome5.h
FontAwesome/IconsFontAwesome5Brands.h
resource.rc
${Assets})
${Assets}
)
if(CMAKE_BUILD_TYPE STREQUAL Debug)
add_compile_definitions(SAVETOOL_DEBUG_BUILD)
endif()
add_compile_definitions(SAVETOOL_VERSION="${SAVETOOL_PROJECT_VERSION}"
SAVETOOL_CODENAME="Dickish Cyclops"
SUPPORTED_GAME_VERSION="0.8.6")
add_compile_definitions(
SAVETOOL_VERSION="${SAVETOOL_PROJECT_VERSION}"
SAVETOOL_CODENAME="Enigmatic Ellenier"
SUPPORTED_GAME_VERSION="0.9.x"
)
if(CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(MassBuilderSaveTool PROPERTIES OUTPUT_NAME MassBuilderSaveTool-${SAVETOOL_PROJECT_VERSION})
@ -186,7 +191,6 @@ endif()
target_link_libraries(MassBuilderSaveTool PRIVATE
Corrade::Containers
Corrade::Utility
Corrade::Interconnect
Corrade::Main
Magnum::Magnum
Magnum::GL
@ -197,4 +201,5 @@ target_link_libraries(MassBuilderSaveTool PRIVATE
zip
libcurl
imm32
wtsapi32)
wtsapi32
)

View File

@ -172,7 +172,6 @@ SaveTool::~SaveTool() {
Utility::Debug{} << "Saving the configuration...";
_conf.setValue("cheat_mode"_s, _cheatMode);
_conf.setValue("unsafe_mode"_s, _unsafeMode);
_conf.setValue("startup_update_check"_s, _checkUpdatesOnStartup);
_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>
auto drawUnsafeWidget(Functor func, Args... args) -> bool {
GameState game_state = _gameState; // Copying the value to reduce the risk of a data race.
if(!_unsafeMode && game_state != GameState::NotRunning) {
ImGui::BeginDisabled();
}
ImGui::BeginDisabled(game_state != GameState::NotRunning);
bool result = func(std::forward<Args>(args)...);
if(!_unsafeMode && game_state != GameState::NotRunning) {
ImGui::EndDisabled();
}
return result;
} // 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...
template<typename... Args>
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)...);
}
else {
@ -276,7 +269,6 @@ class SaveTool: public Platform::Sdl2Application, public efsw::FileWatchListener
bool _skipDisclaimer{false};
bool _checkUpdatesOnStartup{true};
bool _unsafeMode{false};
bool _updateAvailable{false};
Containers::String _latestVersion;

View File

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