Move all settings to Windows64/Settings & Ensure the folder exists
This commit is contained in:
@@ -148,7 +148,8 @@ endif()
|
||||
# Copy redist files
|
||||
add_copyredist_target(Minecraft.Client)
|
||||
|
||||
# Make sure GameHDD exists on Windows
|
||||
# Make sure GameHDD & Settings exists in Windows64
|
||||
if(PLATFORM_NAME STREQUAL "Windows64")
|
||||
add_gamehdd_target(Minecraft.Client)
|
||||
add_settings_target(Minecraft.Client)
|
||||
endif()
|
||||
@@ -895,7 +895,7 @@ static void Win64_GetSettingsPath(char *outPath, DWORD size)
|
||||
GetModuleFileNameA(nullptr, outPath, size);
|
||||
char *lastSlash = strrchr(outPath, '\\');
|
||||
if (lastSlash) *(lastSlash + 1) = '\0';
|
||||
strncat_s(outPath, size, "settings.dat", _TRUNCATE);
|
||||
strncat_s(outPath, size, "/Windows64/Settings/settings.dat", _TRUNCATE);
|
||||
}
|
||||
static void Win64_SaveSettings(GAME_SETTINGS *gs)
|
||||
{
|
||||
|
||||
+12
-1
@@ -10,6 +10,18 @@ function(add_gamehdd_target TARGET_NAME)
|
||||
set_property(TARGET EnsureGameHDD_${TARGET_NAME} PROPERTY FOLDER "Build")
|
||||
endfunction()
|
||||
|
||||
# Make sure the Settings directory exists
|
||||
function(add_settings_target TARGET_NAME)
|
||||
add_custom_target(EnsureSettings_${TARGET_NAME} ALL
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-E make_directory "$<TARGET_FILE_DIR:${TARGET_NAME}>/Windows64/Settings"
|
||||
COMMENT "Ensuring Settings directory exists..."
|
||||
VERBATIM
|
||||
)
|
||||
add_dependencies(${TARGET_NAME} EnsureSettings_${TARGET_NAME})
|
||||
set_property(TARGET EnsureSettings_${TARGET_NAME} PROPERTY FOLDER "Build")
|
||||
endfunction()
|
||||
|
||||
# Copy any needed redist files to the output directory
|
||||
function(add_copyredist_target TARGET_NAME)
|
||||
set(COPY_SCRIPT "${CMAKE_SOURCE_DIR}/cmake/CopyFolderScript.cmake")
|
||||
@@ -22,7 +34,6 @@ function(add_copyredist_target TARGET_NAME)
|
||||
COMMENT "Copying redist files..."
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_dependencies(${TARGET_NAME} CopyRedist_${TARGET_NAME})
|
||||
set_property(TARGET CopyRedist_${TARGET_NAME} PROPERTY FOLDER "Build")
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user