From aeea53c4191cdc7a02375b75d5ca86c85c66ae84 Mon Sep 17 00:00:00 2001
From: MarcPladellorensPerez
<74015037+MarcPladellorensPerez@users.noreply.github.com>
Date: Fri, 12 Jun 2026 16:21:41 +0200
Subject: [PATCH] Add memory fragment collection & UI
Implements collectible memory fragments: adds fragment_id map property and reads it when spawning MemoryFragment entities. MemoryFragment notifies Player on collect; Player gains arrays to track collected/new fragments. SaveSystem persists hasMemoryFragment[0..2] to XML and restores them (new flags cleared on load). Scene: stores fragment persistence across map loads, loads/unloads collected variant textures, draws collected/new animations in the inventory, shows fragment markers on the minimap, and preserves fragment state during submap loads/unloads. Minor UI tweak (inventory portrait vertical offset) and initialization of timers/texture pointers included. MapTemplate.tmx updated with a default fragment_id property.
---
assets/maps/MapTemplate.tmx | 1 +
include/MemoryFragment.h | 2 +
include/Player.h | 10 ++
include/SaveSystem.h | 1 +
include/Scene.h | 10 ++
src/Map.cpp | 2 +
src/MemoryFragment.cpp | 11 +++
src/SaveSystem.cpp | 15 +++
src/Scene.cpp | 183 ++++++++++++++++++++++++------------
9 files changed, 176 insertions(+), 59 deletions(-)
diff --git a/assets/maps/MapTemplate.tmx b/assets/maps/MapTemplate.tmx
index dabb8d0..51d7004 100644
--- a/assets/maps/MapTemplate.tmx
+++ b/assets/maps/MapTemplate.tmx
@@ -423,6 +423,7 @@