yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
sprite_label_fields.h
Go to the documentation of this file.
1#ifndef YAZE_CLI_UTIL_SPRITE_LABEL_FIELDS_H_
2#define YAZE_CLI_UTIL_SPRITE_LABEL_FIELDS_H_
3
6
7namespace yaze {
8namespace cli {
9namespace util {
10
11// Adds "name" (project name when the project renames the slot), "name_source"
12// ("project" or "vanilla") and, for renamed slots, "vanilla_name".
13// Project names come from --project-context labels, e.g. Oracle $52 is
14// "Collectible" where the vanilla slot is "ZoraKing".
16 int sprite_id) {
17 const auto label = zelda3::ResolveSpriteLabel(sprite_id);
18 formatter.AddField("name", label.name);
19 formatter.AddField("name_source", label.from_project ? "project" : "vanilla");
20 if (label.from_project) {
21 formatter.AddField("vanilla_name", label.default_name);
22 }
23}
24
25} // namespace util
26} // namespace cli
27} // namespace yaze
28
29#endif // YAZE_CLI_UTIL_SPRITE_LABEL_FIELDS_H_
Utility for consistent output formatting across commands.
void AddField(const std::string &key, const std::string &value)
Add a key-value pair.
void AddSpriteNameFields(resources::OutputFormatter &formatter, int sprite_id)
ResolvedLabel ResolveSpriteLabel(int id)
Convenience function to resolve a sprite label with its default name.