1#ifndef YAZE_CORE_PROJECT_H
2#define YAZE_CORE_PROJECT_H
9#include <unordered_map>
12#include "absl/status/status.h"
13#include "absl/status/statusor.h"
14#include "absl/strings/string_view.h"
44 std::vector<std::string>
tags;
208 for (
const auto& section :
sections) {
209 for (
const auto& line : section.lines) {
247 std::vector<std::pair<std::string, std::string>>
defines;
275#ifndef __EMSCRIPTEN__
279 absl::string_view contents,
280 bool replace_existing);
352 std::unordered_map<std::string, std::unordered_map<std::string, std::string>>
435 absl::Status
Create(
const std::string& project_name,
436 const std::string& base_path);
437 absl::Status
Open(
const std::string& project_path);
442 const std::string& project_path);
447 absl::Status
SaveAs(
const std::string& new_path);
458 const std::unordered_map<std::string,
459 std::unordered_map<std::string, std::string>>&
461 std::string
GetLabel(
const std::string& resource_type,
int id,
462 const std::string& default_value =
"")
const;
520#ifdef YAZE_ENABLE_JSON_PROJECT_FORMAT
521 absl::Status LoadFromJsonFormat(
const std::string& project_path);
522 absl::Status SaveToJsonFormat();
547 const std::string& template_name,
const std::string& project_name,
548 const std::string& base_path);
552 const std::string& directory);
558 const std::string& target_path,
572 void EditLabel(
const std::string& type,
const std::string& key,
573 const std::string& newValue);
575 const std::string& key,
576 const std::string& defaultValue);
577 std::string
GetLabel(
const std::string& type,
const std::string& key);
578 std::string
CreateOrGetLabel(
const std::string& type,
const std::string& key,
579 const std::string& defaultValue);
588 std::unordered_map<std::string, std::unordered_map<std::string, std::string>>
Loads and queries the hack manifest JSON for yaze-ASM integration.
Enhanced project management with templates and validation.
static std::vector< std::string > FindProjectsInDirectory(const std::string &directory)
static absl::Status ValidateProjectStructure(const YazeProject &project)
static absl::StatusOr< YazeProject > CreateFromTemplate(const std::string &template_name, const std::string &project_name, const std::string &base_path)
static std::vector< std::string > GetRecommendedFixesForProject(const YazeProject &project)
static std::vector< ProjectTemplate > GetProjectTemplates()
static absl::Status RestoreProject(const std::string &backup_path)
static absl::Status ConvertProject(const std::string &source_path, const std::string &target_path, ProjectFormat target_format)
static absl::Status BackupProject(const YazeProject &project)
void RemoveFile(const std::string &file_path)
std::string GetFilePath() const
void AddFile(const std::string &file_path)
static RecentFilesManager & GetInstance()
std::uint64_t GetGeneration() const
Bumps when recent file list changes (add/remove/clear/load).
const std::vector< std::string > & GetRecentFiles() const
RecentFilesManager(const RecentFilesManager &)=delete
std::vector< std::string > recent_files_
RecentFilesManager & operator=(const RecentFilesManager &)=delete
std::uint64_t generation_
std::string RomRoleToString(RomRole role)
absl::Status WriteProjectFileAtomically(absl::string_view target_path, absl::string_view contents, bool replace_existing)
RomRole ParseRomRole(absl::string_view value)
const std::string kRecentFilesFilename
ProjectFormat
Supported project file formats.
RomWritePolicy ParseRomWritePolicy(absl::string_view value)
std::string RomWritePolicyToString(RomWritePolicy policy)
Atlas map views ([atlas]).
std::vector< std::string > annotations
std::string export_folder
bool operator==(const AtlasSettings &other) const
Dungeon overlay configuration (per-project).
std::vector< uint16_t > track_object_ids
std::vector< uint16_t > minecart_sprite_ids
std::vector< uint16_t > track_stop_tiles
std::vector< uint16_t > track_tiles
std::vector< uint16_t > track_switch_tiles
Project rules for graphics sheets ([graphics_sheets]).
std::vector< uint16_t > reserved_sheets
std::map< uint16_t, std::vector< uint16_t > > reserved_blocks
std::vector< uint16_t > flagged_sheets
Planning editor sidecar ([planning]).
bool operator==(const PlanningSettings &other) const
std::vector< Line > lines
Lines of a .yaze file that this build does not model.
std::vector< Section > sections
YazeProject template_project
std::string display_description
std::string CreateOrGetLabel(const std::string &type, const std::string &key, const std::string &defaultValue)
void DisplayLabels(bool *p_open)
std::string GetLabel(const std::string &type, const std::string &key)
void EditLabel(const std::string &type, const std::string &key, const std::string &newValue)
bool LoadLabels(const std::string &filename)
void SelectableLabelWithNameEdit(bool selected, const std::string &type, const std::string &key, const std::string &defaultValue)
std::unordered_map< std::string, std::unordered_map< std::string, std::string > > labels_
Consolidated workspace and UI settings.
int backup_keep_daily_days
std::string last_layout_preset
std::map< std::string, std::string > custom_keybindings
std::string window_layout_data
int backup_retention_count
std::vector< std::string > saved_layouts
std::map< std::string, bool > editor_visibility
float autosave_interval_secs
std::vector< std::string > recent_files
std::string custom_system_prompt
std::string gemini_api_key
bool enable_tool_emulator
bool enable_tool_memory_inspector
std::vector< std::string > favorite_models
bool enable_tool_resources
bool enable_tool_messages
std::vector< std::string > model_chain
std::string builder_blueprint_path
bool enable_tool_dialogue
bool enable_tool_overworld
std::string last_saved_at
bool persist_custom_music
Modern project structure with comprehensive settings consolidation.
std::string rom_backup_folder
std::unordered_map< int, std::vector< std::string > > custom_object_files
YazeProject & operator=(YazeProject &&)=default
absl::Status ResetToDefaults()
std::string custom_objects_folder
absl::Status RepairProject()
std::string MakeStorageKey(absl::string_view suffix) const
static std::string ResolveBundleRoot(const std::string &path)
struct yaze::project::YazeProject::MusicPersistence music_persistence
YazeProject & operator=(const YazeProject &)=default
bool project_opened() const
std::string sprite_catalog_file
absl::StatusOr< std::string > SerializeToString() const
std::string zscream_project_file
absl::Status ExportForZScream(const std::string &target_path)
absl::Status SaveToYazeFormat(bool replace_existing=true)
absl::Status ImportZScreamProject(const std::string &zscream_project_path)
absl::Status SaveAllSettings()
absl::Status LoadFromString(const std::string &content, const std::string &project_path)
void NormalizePathsToAbsolute()
absl::Status ImportLabelsFromZScreamContent(const std::string &content)
Import labels from ZScream format content directly.
std::string git_repository
core::HackManifest hack_manifest
void InitializeResourceLabelProvider()
Initialize the global ResourceLabelProvider with this project's labels.
absl::Status ParseFromString(const std::string &content)
std::string cutscene_shots
std::vector< std::string > additional_roms
bool HasZ3dkConfig() const
std::string terrain_catalog_file
std::string patches_folder
absl::Status LoadFromYazeFormat(const std::string &project_path)
std::unordered_map< std::string, std::unordered_map< std::string, std::string > > resource_labels
std::vector< std::string > AtlasAnnotationPaths() const
std::string GenerateProjectId() const
absl::Status Create(const std::string &project_name, const std::string &base_path)
std::string assets_folder
void ReloadHackManifest()
GraphicsSheetSettings graphics_sheets
std::string AtlasSymbolsPath() const
YazeProject(const YazeProject &)=default
absl::Status LoadAllSettings()
std::string labels_filename
std::vector< std::string > asm_sources
std::string hack_manifest_file
std::string GetDisplayName() const
PlanningSettings planning
std::string PlanningFilePath() const
std::vector< std::string > GetMissingFiles() const
WorkspaceSettings workspace_settings
std::string GetZ3dkArtifactPath(absl::string_view artifact_name) const
std::string output_folder
std::string asm_entry_point
std::string GetRelativePath(const std::string &absolute_path) const
std::vector< SpriteAssetBinding > sprite_assets
absl::Status InitializeEmbeddedLabels(const std::unordered_map< std::string, std::unordered_map< std::string, std::string > > &labels)
ProjectFilePassthrough file_passthrough
absl::Status SaveAs(const std::string &new_path)
struct yaze::project::YazeProject::AgentSettings agent_settings
std::string custom_collision_json
DungeonOverlaySettings dungeon_overlay
std::string palette_catalog_file
absl::Status ImportFromZScreamFormat(const std::string &project_path)
void InitializeDefaults()
std::string GetAbsolutePath(const std::string &relative_path) const
std::string overworld_graphics_preview
std::string GetLabel(const std::string &resource_type, int id, const std::string &default_value="") const
std::string sprite_source_root
absl::Status Open(const std::string &project_path)
absl::Status ImportLabelsFromZScream(const std::string &filepath)
Import labels from a ZScream DefaultNames.txt file.
YazeProject(YazeProject &&)=default
std::string last_build_hash
void TryLoadHackManifest()
std::map< std::string, std::string > zscream_mappings
std::string dungeon_tile_patterns
absl::Status Validate() const
core::FeatureFlags::Flags feature_flags
std::vector< std::string > build_configurations
void ReloadZ3dkSettings()
core::RomAddressOverrides rom_address_overrides
std::string symbols_filename
Z3dkSettings z3dk_settings
std::string annotations_json
std::string sourcemap_json
std::vector< std::string > include_paths
std::string std_includes_path
std::vector< std::string > main_files
std::vector< std::string > emits
std::vector< std::pair< std::string, std::string > > defines
std::string symbols_format
Z3dkArtifactPaths artifact_paths
bool warn_branch_outside_bank
std::optional< bool > lsp_log_enabled
bool warn_unauthorized_hook
std::vector< Z3dkMemoryRange > prohibited_memory_ranges
std::string std_defines_path