Compare commits
No commits in common. "16b8807eb7f628680d4e32fdee92e254a3c35ea7" and "6cb52761be7b960a27d0e383879bca1b7bfb3513" have entirely different histories.
16b8807eb7
...
6cb52761be
7 changed files with 115 additions and 99 deletions
|
@ -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 OFF CACHE BOOL "" FORCE)
|
set(CORRADE_WITH_INTERCONNECT ON 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,11 +98,10 @@ 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 OFF CACHE BOOL "" FORCE)
|
set(ENABLE_DEBUG ON 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)
|
||||||
|
|
|
@ -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.4.0-pre)
|
set(SAVETOOL_PROJECT_VERSION 1.3.5)
|
||||||
|
|
||||||
find_package(Corrade REQUIRED Main Containers Utility)
|
find_package(Corrade REQUIRED Main Containers Utility Interconnect)
|
||||||
find_package(Magnum REQUIRED GL Sdl2Application)
|
find_package(Magnum REQUIRED GL Sdl2Application)
|
||||||
find_package(MagnumIntegration REQUIRED ImGui)
|
find_package(MagnumIntegration REQUIRED ImGui)
|
||||||
|
|
||||||
|
@ -101,14 +101,12 @@ 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
|
||||||
|
@ -166,17 +164,14 @@ 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(
|
add_compile_definitions(SAVETOOL_VERSION="${SAVETOOL_PROJECT_VERSION}"
|
||||||
SAVETOOL_VERSION="${SAVETOOL_PROJECT_VERSION}"
|
SAVETOOL_CODENAME="Dickish Cyclops"
|
||||||
SAVETOOL_CODENAME="Enigmatic Ellenier"
|
SUPPORTED_GAME_VERSION="0.8.6")
|
||||||
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})
|
||||||
|
@ -191,6 +186,7 @@ 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
|
||||||
|
@ -201,5 +197,4 @@ target_link_libraries(MassBuilderSaveTool PRIVATE
|
||||||
zip
|
zip
|
||||||
libcurl
|
libcurl
|
||||||
imm32
|
imm32
|
||||||
wtsapi32
|
wtsapi32)
|
||||||
)
|
|
||||||
|
|
|
@ -172,6 +172,7 @@ 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);
|
||||||
|
|
||||||
|
|
|
@ -166,16 +166,23 @@ 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.
|
||||||
ImGui::BeginDisabled(game_state != GameState::NotRunning);
|
if(!_unsafeMode && 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(_gameState != GameState::NotRunning) {
|
if(!_unsafeMode && _gameState != GameState::NotRunning) {
|
||||||
ImGui::TextDisabled(text, std::forward<Args>(args)...);
|
ImGui::TextDisabled(text, std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -269,6 +276,7 @@ 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;
|
||||||
|
|
|
@ -54,6 +54,13 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(game_state != GameState::NotRunning ||
|
if((!_unsafeMode && 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(game_state != GameState::NotRunning ||
|
if((!_unsafeMode && 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(_gameState != GameState::NotRunning) {
|
if(!_unsafeMode && _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(_gameState == GameState::NotRunning && ImGui::BeginDragDropTarget()) {
|
if((_unsafeMode || _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",
|
||||||
|
|
|
@ -103,6 +103,12 @@ 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")) {
|
||||||
|
|
Loading…
Reference in a new issue