1#ifndef YAZE_ZELDA3_RESOURCE_LABELS_H
2#define YAZE_ZELDA3_RESOURCE_LABELS_H
7#include <unordered_map>
10#include "absl/status/status.h"
47inline constexpr char kRoomOverrideLabelType[] =
"room_override";
82 using LabelMap = std::unordered_map<std::string, std::string>;
126 std::string
GetLabel(
const std::string& type_str,
int id)
const;
Loads and queries the hack manifest JSON for yaze-ASM integration.
Unified interface for accessing resource labels with project overrides.
std::string ExportToZScreamFormat() const
Export project labels to ZScream DefaultNames.txt format.
void SetProjectLabel(ResourceType type, int id, const std::string &label)
Set a project-specific label override.
bool HasProjectLabel(ResourceType type, int id) const
Check if a project-specific label exists.
const ProjectLabels * GetAllProjectLabels() const
Get all project labels (read-only)
void ClearAllProjectLabels()
Clear all project labels.
int GetResourceCount(ResourceType type) const
Get the count of resources for a given type.
std::unordered_map< std::string, std::string > LabelMap
const core::HackManifest * hack_manifest_
ProjectLabels * project_labels_
bool PreferHMagicNames() const
Get whether Hyrule Magic names are preferred.
std::string GetDefaultLabel(ResourceType type, int id) const
Get the label without project overrides (steps 4-5 above)
const core::HackManifest * hack_manifest() const
ResolvedLabel ResolveLabel(ResourceType type, int id) const
Get the label and the default name it replaces.
std::string GetLabel(ResourceType type, int id) const
Get a label for a resource by type and ID.
void RestoreState(const State &state)
bool ParseZScreamLine(const std::string &line, const std::string §ion, int &line_index)
void SetPreferHMagicNames(bool prefer)
Set whether to prefer Hyrule Magic sprite names.
std::unordered_map< std::string, LabelMap > ProjectLabels
absl::Status ImportFromZScreamFormat(const std::string &content)
Import labels from ZScream DefaultNames.txt format.
std::string GetVanillaLabel(ResourceType type, int id) const
Get the vanilla (default) label for a resource.
ResourceLabelProvider()=default
const LabelMap * GetProjectLabelsForType(ResourceType type) const
Get all project labels for a given type.
std::string GetHMagicLabel(ResourceType type, int id) const
Get the Hyrule Magic label for a resource (sprites only)
State SnapshotState() const
void SetHackManifest(const core::HackManifest *manifest)
Set the hack manifest reference for ASM-defined labels.
void SetProjectLabels(ProjectLabels *labels)
Set the project labels reference (typically from YazeProject)
void ClearProjectLabel(ResourceType type, int id)
Clear a project-specific label (revert to default)
absl::Status ImportOracleSpriteRegistry(const std::string &csv_content)
Import sprite labels from Oracle of Secrets registry.csv format.
ResourceType
Enumeration of all supported resource types for labeling.
const char * GetItemReceiptLabelSource(uint8_t id, const ResourceLabelProvider::ProjectLabels *project_labels)
std::string GetRoomTagLabel(int id)
Convenience function to get a room tag label.
std::string GetSpriteLabel(int id)
Convenience function to get a sprite label.
ResolvedLabel ResolveSpriteLabel(int id)
Convenience function to resolve a sprite label with its default name.
std::string GetEntranceLabel(int id)
Convenience function to get an entrance label.
std::string GetRoomLabel(int id)
Convenience function to get a room label.
std::string GetItemReceiptLabel(uint8_t id, const ResourceLabelProvider::ProjectLabels *project_labels)
std::string GetOverlordLabel(int id)
Convenience function to get an overlord label.
std::string GetItemLabel(int id)
Convenience function to get an item label.
std::string GetOverworldMapLabel(int id)
Convenience function to get an overworld map label.
std::string ResourceTypeToString(ResourceType type)
Convert ResourceType enum to string key for storage.
ResourceType StringToResourceType(const std::string &type_str)
Convert string key to ResourceType enum.
std::string GetMusicLabel(int id)
Convenience function to get a music track label.
ResourceLabelProvider & GetResourceLabels()
Get the global ResourceLabelProvider instance.
A label plus the name it replaces.
std::string Display() const
Provider wiring, saved and restored around a scoped project.
const core::HackManifest * hack_manifest
ProjectLabels * project_labels