yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::project::YazeProject Struct Reference

Modern project structure with comprehensive settings consolidation. More...

#include <project.h>

Classes

struct  AgentSettings
 
struct  MusicPersistence
 

Public Member Functions

absl::Status Create (const std::string &project_name, const std::string &base_path)
 
absl::Status Open (const std::string &project_path)
 
absl::Status Save ()
 
absl::Status SaveAs (const std::string &new_path)
 
absl::Status ImportZScreamProject (const std::string &zscream_project_path)
 
absl::Status ExportForZScream (const std::string &target_path)
 
absl::Status LoadAllSettings ()
 
absl::Status SaveAllSettings ()
 
absl::Status ResetToDefaults ()
 
absl::Status InitializeEmbeddedLabels (const std::unordered_map< std::string, std::unordered_map< std::string, std::string > > &labels)
 
std::string GetLabel (const std::string &resource_type, int id, const std::string &default_value="") const
 
absl::Status ImportLabelsFromZScream (const std::string &filepath)
 Import labels from a ZScream DefaultNames.txt file.
 
absl::Status ImportLabelsFromZScreamContent (const std::string &content)
 Import labels from ZScream format content directly.
 
void InitializeResourceLabelProvider ()
 Initialize the global ResourceLabelProvider with this project's labels.
 
absl::Status Validate () const
 
std::vector< std::string > GetMissingFiles () const
 
absl::Status RepairProject ()
 
std::string GetDisplayName () const
 
std::string GetRelativePath (const std::string &absolute_path) const
 
std::string GetAbsolutePath (const std::string &relative_path) const
 
bool IsEmpty () const
 
std::string MakeStorageKey (absl::string_view suffix) const
 
bool project_opened () const
 

Public Attributes

ProjectMetadata metadata
 
std::string name
 
std::string filepath
 
ProjectFormat format = ProjectFormat::kYazeNative
 
std::string rom_filename
 
std::string rom_backup_folder
 
std::vector< std::string > additional_roms
 
std::string code_folder
 
std::string assets_folder
 
std::string patches_folder
 
std::string labels_filename
 
std::string symbols_filename
 
std::string custom_objects_folder
 
core::FeatureFlags::Flags feature_flags
 
WorkspaceSettings workspace_settings
 
std::unordered_map< std::string, std::unordered_map< std::string, std::string > > resource_labels
 
bool use_embedded_labels = true
 
std::string build_script
 
std::string output_folder
 
std::vector< std::string > build_configurations
 
std::string build_target
 
std::string asm_entry_point
 
std::vector< std::string > asm_sources
 
std::string git_repository
 
bool track_changes = true
 
std::string last_build_hash
 
int build_number = 0
 
struct yaze::project::YazeProject::AgentSettings agent_settings
 
std::string zscream_project_file
 
std::map< std::string, std::string > zscream_mappings
 
struct yaze::project::YazeProject::MusicPersistence music_persistence
 

Private Member Functions

absl::StatusOr< std::string > SerializeToString () const
 
absl::Status ParseFromString (const std::string &content)
 
absl::Status LoadFromYazeFormat (const std::string &project_path)
 
absl::Status SaveToYazeFormat ()
 
absl::Status ImportFromZScreamFormat (const std::string &project_path)
 
void InitializeDefaults ()
 
std::string GenerateProjectId () const
 

Detailed Description

Modern project structure with comprehensive settings consolidation.

Definition at line 84 of file project.h.

Member Function Documentation

◆ Create()

◆ Open()

◆ Save()

◆ SaveAs()

absl::Status yaze::project::YazeProject::SaveAs ( const std::string & new_path)

Definition at line 198 of file project.cc.

References filepath, and Save().

Referenced by yaze::editor::ProjectManager::SaveProjectToFile().

Here is the call graph for this function:

◆ ImportZScreamProject()

absl::Status yaze::project::YazeProject::ImportZScreamProject ( const std::string & zscream_project_path)
Todo
Implement actual ZScream format parsing when format is known

Definition at line 677 of file project.cc.

References format, InitializeDefaults(), yaze::project::kZScreamCompat, name, zscream_mappings, and zscream_project_file.

Referenced by yaze::editor::ProjectManager::ImportProject().

Here is the call graph for this function:

◆ ExportForZScream()

absl::Status yaze::project::YazeProject::ExportForZScream ( const std::string & target_path)

◆ LoadAllSettings()

absl::Status yaze::project::YazeProject::LoadAllSettings ( )

Definition at line 722 of file project.cc.

References filepath, and LoadFromYazeFormat().

Here is the call graph for this function:

◆ SaveAllSettings()

absl::Status yaze::project::YazeProject::SaveAllSettings ( )

Definition at line 728 of file project.cc.

References SaveToYazeFormat().

Here is the call graph for this function:

◆ ResetToDefaults()

absl::Status yaze::project::YazeProject::ResetToDefaults ( )

Definition at line 733 of file project.cc.

References InitializeDefaults(), and Save().

Here is the call graph for this function:

◆ InitializeEmbeddedLabels()

absl::Status yaze::project::YazeProject::InitializeEmbeddedLabels ( const std::unordered_map< std::string, std::unordered_map< std::string, std::string > > & labels)

◆ GetLabel()

std::string yaze::project::YazeProject::GetLabel ( const std::string & resource_type,
int id,
const std::string & default_value = "" ) const

Definition at line 1393 of file project.cc.

References resource_labels.

◆ ImportLabelsFromZScream()

absl::Status yaze::project::YazeProject::ImportLabelsFromZScream ( const std::string & filepath)

Import labels from a ZScream DefaultNames.txt file.

Parameters
filepathPath to the DefaultNames.txt file
Returns
Status indicating success or parse errors

Definition at line 1408 of file project.cc.

References filepath, and ImportLabelsFromZScreamContent().

Here is the call graph for this function:

◆ ImportLabelsFromZScreamContent()

absl::Status yaze::project::YazeProject::ImportLabelsFromZScreamContent ( const std::string & content)

Import labels from ZScream format content directly.

Parameters
contentThe file content to parse
Returns
Status indicating success or parse errors

Definition at line 1428 of file project.cc.

References yaze::zelda3::GetResourceLabels(), LOG_DEBUG, yaze::project::WorkspaceSettings::prefer_hmagic_names, resource_labels, and workspace_settings.

Referenced by yaze::editor::ProjectFileEditor::ImportLabelsFromZScream(), and ImportLabelsFromZScream().

Here is the call graph for this function:

◆ InitializeResourceLabelProvider()

void yaze::project::YazeProject::InitializeResourceLabelProvider ( )

Initialize the global ResourceLabelProvider with this project's labels.

Definition at line 1451 of file project.cc.

References yaze::zelda3::GetResourceLabels(), LOG_DEBUG, yaze::project::WorkspaceSettings::prefer_hmagic_names, resource_labels, and workspace_settings.

Referenced by yaze::editor::EditorManager::LoadProjectWithRom().

Here is the call graph for this function:

◆ Validate()

absl::Status yaze::project::YazeProject::Validate ( ) const

◆ GetMissingFiles()

std::vector< std::string > yaze::project::YazeProject::GetMissingFiles ( ) const

Definition at line 773 of file project.cc.

References GetAbsolutePath(), labels_filename, rom_filename, and symbols_filename.

Referenced by yaze::project::ProjectManager::GetRecommendedFixesForProject().

Here is the call graph for this function:

◆ RepairProject()

absl::Status yaze::project::YazeProject::RepairProject ( )

Definition at line 794 of file project.cc.

References assets_folder, code_folder, GetAbsolutePath(), labels_filename, output_folder, patches_folder, and rom_backup_folder.

Referenced by yaze::editor::EditorManager::RepairCurrentProject().

Here is the call graph for this function:

◆ GetDisplayName()

◆ GetRelativePath()

std::string yaze::project::YazeProject::GetRelativePath ( const std::string & absolute_path) const

◆ GetAbsolutePath()

◆ IsEmpty()

bool yaze::project::YazeProject::IsEmpty ( ) const

Definition at line 865 of file project.cc.

References code_folder, name, and rom_filename.

◆ MakeStorageKey()

std::string yaze::project::YazeProject::MakeStorageKey ( absl::string_view suffix) const

◆ project_opened()

◆ SerializeToString()

absl::StatusOr< std::string > yaze::project::YazeProject::SerializeToString ( ) const
private

Definition at line 226 of file project.cc.

References additional_roms, agent_settings, yaze::project::YazeProject::AgentSettings::ai_model, yaze::project::YazeProject::AgentSettings::ai_provider, asm_entry_point, asm_sources, assets_folder, yaze::project::ProjectMetadata::author, yaze::project::WorkspaceSettings::autosave_enabled, yaze::project::WorkspaceSettings::autosave_interval_secs, yaze::project::WorkspaceSettings::backup_on_save, build_configurations, build_number, build_script, build_target, yaze::project::YazeProject::AgentSettings::builder_blueprint_path, yaze::project::YazeProject::AgentSettings::chain_mode, code_folder, yaze::project::ProjectMetadata::created_by, yaze::project::ProjectMetadata::created_date, yaze::project::WorkspaceSettings::custom_keybindings, custom_objects_folder, yaze::project::YazeProject::AgentSettings::custom_system_prompt, yaze::project::WorkspaceSettings::dark_mode, yaze::project::ProjectMetadata::description, yaze::project::WorkspaceSettings::editor_visibility, yaze::project::YazeProject::AgentSettings::enable_tool_dialogue, yaze::project::YazeProject::AgentSettings::enable_tool_dungeon, yaze::project::YazeProject::AgentSettings::enable_tool_emulator, yaze::project::YazeProject::AgentSettings::enable_tool_gui, yaze::project::YazeProject::AgentSettings::enable_tool_messages, yaze::project::YazeProject::AgentSettings::enable_tool_music, yaze::project::YazeProject::AgentSettings::enable_tool_overworld, yaze::project::YazeProject::AgentSettings::enable_tool_resources, yaze::project::YazeProject::AgentSettings::enable_tool_sprite, yaze::project::YazeProject::AgentSettings::favorite_models, feature_flags, yaze::project::WorkspaceSettings::font_global_scale, yaze::project::YazeProject::AgentSettings::gemini_api_key, GetRelativePath(), git_repository, yaze::core::FeatureFlags::Flags::Overworld::kApplyZSCustomOverworldASM, yaze::core::FeatureFlags::Flags::kEnableCustomObjects, yaze::core::FeatureFlags::Flags::Overworld::kLoadCustomOverworld, yaze::core::FeatureFlags::Flags::kSaveDungeonMaps, yaze::core::FeatureFlags::Flags::kSaveGraphicsSheet, labels_filename, last_build_hash, yaze::project::WorkspaceSettings::last_layout_preset, yaze::project::ProjectMetadata::last_modified, yaze::project::YazeProject::MusicPersistence::last_saved_at, yaze::project::ProjectMetadata::license, yaze::project::YazeProject::AgentSettings::max_output_tokens, yaze::project::YazeProject::AgentSettings::max_retry_attempts, yaze::project::YazeProject::AgentSettings::max_tool_iterations, metadata, yaze::project::YazeProject::AgentSettings::model_chain, music_persistence, name, yaze::project::YazeProject::AgentSettings::ollama_host, output_folder, yaze::core::FeatureFlags::Flags::overworld, patches_folder, yaze::project::YazeProject::MusicPersistence::persist_custom_music, yaze::project::WorkspaceSettings::prefer_hmagic_names, yaze::project::ProjectMetadata::project_id, yaze::project::WorkspaceSettings::recent_files, resource_labels, rom_backup_folder, rom_filename, yaze::project::WorkspaceSettings::saved_layouts, yaze::project::WorkspaceSettings::show_collision, yaze::project::WorkspaceSettings::show_grid, yaze::project::YazeProject::AgentSettings::show_reasoning, yaze::project::YazeProject::MusicPersistence::storage_key, yaze::project::YazeProject::AgentSettings::stream_responses, symbols_filename, yaze::project::ProjectMetadata::tags, yaze::project::YazeProject::AgentSettings::temperature, yaze::project::YazeProject::AgentSettings::top_p, track_changes, yaze::project::WorkspaceSettings::ui_theme, yaze::project::YazeProject::AgentSettings::use_custom_prompt, yaze::project::YazeProject::AgentSettings::verbose, yaze::project::ProjectMetadata::version, workspace_settings, yaze::project::ProjectMetadata::yaze_version, zscream_mappings, and zscream_project_file.

Referenced by SaveToYazeFormat().

Here is the call graph for this function:

◆ ParseFromString()

absl::Status yaze::project::YazeProject::ParseFromString ( const std::string & content)
private

Definition at line 413 of file project.cc.

References additional_roms, agent_settings, yaze::project::YazeProject::AgentSettings::ai_model, yaze::project::YazeProject::AgentSettings::ai_provider, asm_entry_point, asm_sources, assets_folder, yaze::project::ProjectMetadata::author, yaze::project::WorkspaceSettings::autosave_enabled, yaze::project::WorkspaceSettings::autosave_interval_secs, yaze::project::WorkspaceSettings::backup_on_save, build_configurations, build_number, build_script, build_target, yaze::project::YazeProject::AgentSettings::builder_blueprint_path, yaze::project::YazeProject::AgentSettings::chain_mode, code_folder, yaze::project::ProjectMetadata::created_by, yaze::project::ProjectMetadata::created_date, yaze::project::WorkspaceSettings::custom_keybindings, custom_objects_folder, yaze::project::YazeProject::AgentSettings::custom_system_prompt, yaze::project::WorkspaceSettings::dark_mode, yaze::project::ProjectMetadata::description, yaze::project::WorkspaceSettings::editor_visibility, yaze::project::YazeProject::AgentSettings::enable_tool_dialogue, yaze::project::YazeProject::AgentSettings::enable_tool_dungeon, yaze::project::YazeProject::AgentSettings::enable_tool_emulator, yaze::project::YazeProject::AgentSettings::enable_tool_gui, yaze::project::YazeProject::AgentSettings::enable_tool_messages, yaze::project::YazeProject::AgentSettings::enable_tool_music, yaze::project::YazeProject::AgentSettings::enable_tool_overworld, yaze::project::YazeProject::AgentSettings::enable_tool_resources, yaze::project::YazeProject::AgentSettings::enable_tool_sprite, yaze::project::YazeProject::AgentSettings::favorite_models, feature_flags, yaze::project::WorkspaceSettings::font_global_scale, yaze::project::YazeProject::AgentSettings::gemini_api_key, GenerateProjectId(), git_repository, yaze::core::FeatureFlags::Flags::Overworld::kApplyZSCustomOverworldASM, yaze::core::FeatureFlags::Flags::kEnableCustomObjects, yaze::core::FeatureFlags::Flags::Overworld::kLoadCustomOverworld, yaze::core::FeatureFlags::Flags::kSaveDungeonMaps, yaze::core::FeatureFlags::Flags::kSaveGraphicsSheet, labels_filename, last_build_hash, yaze::project::WorkspaceSettings::last_layout_preset, yaze::project::ProjectMetadata::last_modified, yaze::project::YazeProject::MusicPersistence::last_saved_at, yaze::project::ProjectMetadata::license, MakeStorageKey(), yaze::project::YazeProject::AgentSettings::max_output_tokens, yaze::project::YazeProject::AgentSettings::max_retry_attempts, yaze::project::YazeProject::AgentSettings::max_tool_iterations, metadata, yaze::project::YazeProject::AgentSettings::model_chain, music_persistence, name, yaze::project::YazeProject::AgentSettings::ollama_host, output_folder, yaze::core::FeatureFlags::Flags::overworld, patches_folder, yaze::project::YazeProject::MusicPersistence::persist_custom_music, yaze::project::WorkspaceSettings::prefer_hmagic_names, yaze::project::ProjectMetadata::project_id, yaze::project::WorkspaceSettings::recent_files, resource_labels, rom_backup_folder, rom_filename, yaze::project::WorkspaceSettings::saved_layouts, yaze::project::WorkspaceSettings::show_collision, yaze::project::WorkspaceSettings::show_grid, yaze::project::YazeProject::AgentSettings::show_reasoning, yaze::project::YazeProject::MusicPersistence::storage_key, yaze::project::YazeProject::AgentSettings::stream_responses, symbols_filename, yaze::project::ProjectMetadata::tags, yaze::project::YazeProject::AgentSettings::temperature, yaze::project::YazeProject::AgentSettings::top_p, track_changes, yaze::project::WorkspaceSettings::ui_theme, yaze::project::YazeProject::AgentSettings::use_custom_prompt, yaze::project::YazeProject::AgentSettings::verbose, yaze::project::ProjectMetadata::version, workspace_settings, yaze::project::ProjectMetadata::yaze_version, zscream_mappings, and zscream_project_file.

Referenced by LoadFromYazeFormat(), and Open().

Here is the call graph for this function:

◆ LoadFromYazeFormat()

absl::Status yaze::project::YazeProject::LoadFromYazeFormat ( const std::string & project_path)
private

Definition at line 622 of file project.cc.

References MakeStorageKey(), and ParseFromString().

Referenced by LoadAllSettings().

Here is the call graph for this function:

◆ SaveToYazeFormat()

absl::Status yaze::project::YazeProject::SaveToYazeFormat ( )
private

◆ ImportFromZScreamFormat()

absl::Status yaze::project::YazeProject::ImportFromZScreamFormat ( const std::string & project_path)
private
Todo
Implement ZScream format parsing when format specification is

Definition at line 869 of file project.cc.

References InitializeDefaults(), name, and zscream_project_file.

Referenced by Open().

Here is the call graph for this function:

◆ InitializeDefaults()

◆ GenerateProjectId()

std::string yaze::project::YazeProject::GenerateProjectId ( ) const
private

Definition at line 924 of file project.cc.

Referenced by Create(), InitializeDefaults(), and ParseFromString().

Member Data Documentation

◆ metadata

◆ name

◆ filepath

◆ format

ProjectFormat yaze::project::YazeProject::format = ProjectFormat::kYazeNative

Definition at line 89 of file project.h.

Referenced by ImportZScreamProject(), and Open().

◆ rom_filename

◆ rom_backup_folder

std::string yaze::project::YazeProject::rom_backup_folder

Definition at line 93 of file project.h.

Referenced by Create(), ParseFromString(), RepairProject(), and SerializeToString().

◆ additional_roms

std::vector<std::string> yaze::project::YazeProject::additional_roms

Definition at line 94 of file project.h.

Referenced by ParseFromString(), and SerializeToString().

◆ code_folder

◆ assets_folder

std::string yaze::project::YazeProject::assets_folder

◆ patches_folder

std::string yaze::project::YazeProject::patches_folder

◆ labels_filename

◆ symbols_filename

◆ custom_objects_folder

std::string yaze::project::YazeProject::custom_objects_folder

◆ feature_flags

◆ workspace_settings

◆ resource_labels

◆ use_embedded_labels

◆ build_script

std::string yaze::project::YazeProject::build_script

◆ output_folder

std::string yaze::project::YazeProject::output_folder

◆ build_configurations

std::vector<std::string> yaze::project::YazeProject::build_configurations

Definition at line 117 of file project.h.

Referenced by InitializeDefaults(), ParseFromString(), and SerializeToString().

◆ build_target

◆ asm_entry_point

std::string yaze::project::YazeProject::asm_entry_point

Definition at line 119 of file project.h.

Referenced by InitializeDefaults(), ParseFromString(), and SerializeToString().

◆ asm_sources

std::vector<std::string> yaze::project::YazeProject::asm_sources

Definition at line 120 of file project.h.

Referenced by InitializeDefaults(), ParseFromString(), and SerializeToString().

◆ git_repository

◆ track_changes

bool yaze::project::YazeProject::track_changes = true

◆ last_build_hash

std::string yaze::project::YazeProject::last_build_hash

◆ build_number

int yaze::project::YazeProject::build_number = 0

Definition at line 126 of file project.h.

Referenced by InitializeDefaults(), ParseFromString(), and SerializeToString().

◆ agent_settings

struct yaze::project::YazeProject::AgentSettings yaze::project::YazeProject::agent_settings

◆ zscream_project_file

std::string yaze::project::YazeProject::zscream_project_file

◆ zscream_mappings

std::map<std::string, std::string> yaze::project::YazeProject::zscream_mappings

Definition at line 162 of file project.h.

Referenced by ImportZScreamProject(), ParseFromString(), and SerializeToString().

◆ music_persistence


The documentation for this struct was generated from the following files: