28#include <unordered_map>
216 const std::string&
rootDir =
"GameData")
const;
352 std::unordered_map<std::string, std::shared_ptr<Resource>>
m_resources_;
362 const std::string&
rootDir)
const;
365 const std::string&
rootDir)
const;
ComponentTypeID GetComponentTypeID_Static()
Centralized file picker modal for all file selection operations (Phase 40).
Centralized Save As modal for all file save operations (Phase 40 Enhancement).
static std::string BuildGameDataPath(const std::string &videogameName, const std::string &objectName)
std::string FindResourceRecursive_Unix(const std::string &filename, const std::string &rootDir) const
static DataManager & Get()
bool PreloadSystemResources(const std::string &configFilePath)
Sprite * GetSprite(const std::string &id, const std::string &path, ResourceCategory category=ResourceCategory::GameEntity)
PreloadStats PreloadSprites(const std::vector< std::string > &paths, ResourceCategory category=ResourceCategory::GameEntity, bool enableFallbackScan=true)
std::string GetSelectedFileFromModal() const
Retrieves the selected file from the file picker modal.
bool IsFilePickerModalOpen() const
Checks if the file picker modal is currently visible.
PreloadStats PreloadTextures(const std::vector< std::string > &paths, ResourceCategory category=ResourceCategory::Level, bool enableFallbackScan=true)
std::string OpenFilePickerModal(Olympe::FilePickerType fileType, const std::string ¤tPath="")
Opens a centralized file picker modal for the specified file type.
bool m_enableFallbackScan
std::string SelectBehaviorTreeFile(const std::string ¤tPath="") const
Opens a file browser dialog for selecting a behavior tree file.
Sprite * GetTexture(const std::string &id) const
bool EnsureDirectoryExists(const std::string &dirpath) const
std::string FindResourceRecursive(const std::string &filename, const std::string &rootDir="GameData") const
bool SaveTextFile(const std::string &filepath, const std::string &content) const
static DataManager & GetInstance()
std::vector< std::string > ListResourcesByType(ResourceType type) const
void CloseSaveFilePickerModal()
Closes the Save As file picker modal.
bool HasResource(const std::string &id) const
bool LoadJSONForObject(const std::string &videogameName, const std::string &objectName, std::string &outJson) const
void CloseFilePickerModal()
Closes the file picker modal without user selection.
std::unordered_map< std::string, std::shared_ptr< Resource > > m_resources_
bool PreloadTexture(const std::string &id, const std::string &path, ResourceCategory category=ResourceCategory::System)
PreloadStats PreloadTilesets(const std::vector< TilesetInfo > &tilesets, bool enableFallbackScan=true)
bool SaveJSONForObject(const std::string &videogameName, const std::string &objectName, const std::string &jsonContent) const
bool ReleaseResource(const std::string &id)
PreloadStats PreloadAudioFiles(const std::vector< std::string > &paths, bool enableFallbackScan=true)
void RenderSaveFilePickerModal()
Renders the Save As file picker modal UI.
std::unique_ptr< Olympe::SaveFilePickerModal > m_saveFilePickerModal
bool LoadTextFile(const std::string &filepath, std::string &outContent) const
bool PreloadSprite(const std::string &id, const std::string &path, ResourceCategory category=ResourceCategory::GameEntity)
bool IsSaveFilePickerModalOpen() const
Checks if the Save As file picker modal is currently visible.
void RenderFilePickerModal()
Renders the file picker modal if one is open.
std::string ResolveFilePath(const std::string &relativePath) const
std::vector< std::string > GetBehaviorTreeFiles(const std::string &directory="./Gamedata") const
Lists all .bt.json behavior tree files in a directory.
std::vector< std::string > ListResourcesByCategory(ResourceCategory category) const
void OpenSaveFilePickerModal(Olympe::SaveFileType fileType, const std::string &directory, const std::string &suggestedFilename="")
Opens the Save As file picker modal.
std::string GetSelectedSaveFile() const
Retrieves the selected file from the Save As modal.
bool GetSprite_data(const std::string &id, const std::string &path, VisualSprite_data &outData)
bool GetSpriteEditor_data(const std::string &id, const std::string &path, VisualEditor_data &outData)
std::unique_ptr< Olympe::FilePickerModal > m_filePickerModal
FilePickerType
Supported file types for the centralized file picker modal.
SaveFileType
Supported file types for the centralized save modal.
int GetTotalFailed() const
int GetTotalLoaded() const
std::vector< std::string > failedPaths
std::map< std::string, std::string > fallbackPaths
float GetSuccessRate() const
std::vector< std::string > individualImages
ResourceCategory category