Inventories: data for slots 6-7, JSON in save files

Weapon sets and combat-art slots 6-7 live in a shadow inventory per
inventory; the slot methods run the original code on it for slots >= 5,
so item references, icon resources and selection events stay the
game's own. Save games (cInventoryManager::Serialize) and hero files
(saveHero / loadHero) store inventories as JSON ("SRIJ" + length);
vanilla blocks are still read, which migrates old saves. Multiplayer
transfers keep the binary format. nlohmann/json fetched via git.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-15 00:26:35 +02:00
1 parent 37634c77ba
commit 998e315d98
7 files changed
+754 -4

No files matched your search

+4 -1
View File
@@ -17,6 +17,7 @@ set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
add_compile_definitions(WIN32_LEAN_AND_MEAN NOMINMAX _CRT_SECURE_NO_WARNINGS)
include(cmake/Detours.cmake)
include(cmake/Json.cmake)
set(SACRED_RE_CXX_FLAGS /W4 /permissive- /utf-8)
@@ -36,10 +37,12 @@ add_library(sacred_re SHARED
src/mods/wasd.cpp
src/mods/skillkeys.cpp
src/mods/input.cpp
src/mods/skillslots.cpp
src/mods/inventory_save.cpp
)
target_include_directories(sacred_re PRIVATE src)
target_compile_options(sacred_re PRIVATE ${SACRED_RE_CXX_FLAGS})
target_link_libraries(sacred_re PRIVATE detours)
target_link_libraries(sacred_re PRIVATE detours nlohmann_json::nlohmann_json)
# --- sacred_re.exe: launches sacred.exe with sacred_re.dll injected ----------
add_executable(sacred_re_launcher WIN32 src/launcher/main.cpp)