44 if (ImGui::Button(tr(
"Reload catalog")))
48 ImGui::TextDisabled(tr(
"Project reference"));
50 ImGui::TextWrapped(
"%s", std::string(
catalog_status_.message()).c_str());
56 ImGui::SetNextItemWidth(-1);
57 ImGui::InputTextWithHint(
"##PaletteCatalogSearch",
58 tr(
"Search names, sprites or sources"),
60 static constexpr const char* worlds[] = {
61 "",
"light_world",
"dark_world",
"underworld",
"special",
"shared"};
62 static constexpr const char* uses[] = {
"",
"link_items",
"npcs",
63 "enemies",
"bosses",
"environment",
64 "hud",
"effects",
"mixed"};
65 const float width = ImGui::GetContentRegionAvail().x;
66 ImGui::SetNextItemWidth(width * 0.48f);
69 "All worlds\0Light World\0Dark World\0Underworld\0Special\0Shared\0");
70 ImGui::SetNextItemWidth(width * 0.48f);
74 "items\0NPCs\0Enemies\0Bosses\0Environment\0HUD\0Effects\0Mixed\0");
77 ImGui::TextDisabled(tr(
"%zu palette entries"), entries.size());
78 ImGui::BeginChild(
"PaletteCatalogEntries");
79 for (
const auto* entry : entries) {
80 ImGui::PushID(entry->key.c_str());
81 if (ImGui::CollapsingHeader(entry->name.c_str())) {
82 ImGui::Text(
"%s[%d] | %s | %s", entry->group.c_str(), entry->index,
83 entry->world.c_str(), entry->use.c_str());
84 ImGui::TextWrapped(
"%s", entry->description.c_str());
85 if (entry->ownership ==
"asm")
87 tr(
"Source-owned colors: a ROM palette edit may be replaced by the "
89 ImGui::TextWrapped(tr(
"Provenance: %s"), entry->provenance.c_str());
90 for (
const auto& usage : entry->usages) {
92 ImGui::Text(
"%s | OBJ row %d | %s", usage.name.c_str(),
93 usage.obj_row, usage.use.c_str());
94 ImGui::TextWrapped(tr(
"Context: %s"), usage.context.c_str());
95 ImGui::TextUnformatted(tr(
"Sprite sheet values / Yaze gfx indices:"));
96 for (
const int sheet : usage.sprite_sheets) {
97 ImGui::BulletText(
"$%02X / $%02X", sheet, sheet + 0x73);
99 ImGui::TextWrapped(tr(
"Source: %s"), usage.source.c_str());
103 if (ImGui::Button(tr(
"Open palette"))) {
108 ImGui::EndDisabled();
110 ImGui::TextDisabled(tr(
"This palette group has no editing panel."));