18 ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
19 ImGui::InputTextWithHint(
"##SongFilter",
ICON_MD_SEARCH " Search songs...",
29 " Oracle of Secrets expanded music detected");
31 ImGui::TextDisabled(
"Expanded bank at $%06X, Aux at $%06X",
32 info.main_rom_offset, info.aux_rom_offset);
37 static const char* bank_names[] = {
"Overworld",
"Dungeon",
"Credits",
38 "Expanded",
"Auxiliary"};
46 for (
int i = 0; i < num_banks; ++i) {
48 if (space.total_bytes == 0)
53 if (space.is_critical) {
54 bar_color = ImVec4(0.9f, 0.2f, 0.2f, 1.0f);
55 }
else if (space.is_warning) {
56 bar_color = ImVec4(0.9f, 0.7f, 0.2f, 1.0f);
58 bar_color = ImVec4(0.3f, 0.7f, 0.3f, 1.0f);
61 ImGui::Text(
"%s:", bank_names[i]);
65 ImGui::PushStyleColor(ImGuiCol_PlotHistogram, bar_color);
66 float fraction = space.usage_percent / 100.0f;
68 absl::StrFormat(
"%d / %d bytes (%.1f%%)", space.used_bytes,
69 space.total_bytes, space.usage_percent);
70 ImGui::ProgressBar(fraction, ImVec2(-1, 0), overlay.c_str());
71 ImGui::PopStyleColor();
74 if (space.is_critical) {
75 ImGui::TextColored(ImVec4(0.9f, 0.3f, 0.3f, 1.0f),
ICON_MD_ERROR " %s",
76 space.recommendation.c_str());
77 }
else if (space.is_warning) {
78 ImGui::TextColored(ImVec4(0.9f, 0.7f, 0.2f, 1.0f),
86 ImGui::TextColored(ImVec4(0.9f, 0.3f, 0.3f, 1.0f),
88 ImGui::TextDisabled(
"Songs won't fit in ROM. Remove or shorten songs.");
90 ImGui::TextColored(ImVec4(0.4f, 0.8f, 0.4f, 1.0f),
94 ImGui::Unindent(8.0f);
117 ImGui::BeginChild(
"SongList", ImVec2(0, 0),
true);
121 ImGuiTreeNodeFlags_DefaultOpen)) {
123 const auto* song = bank.
GetSong(
static_cast<int>(i));
124 if (!song || !bank.
IsVanilla(
static_cast<int>(i)))
128 std::string display_name = absl::StrFormat(
"%02X: %s", i + 1, song->name);
136 if (ImGui::Selectable(label.c_str(), is_selected)) {
144 if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(0)) {
151 if (ImGui::BeginPopupContextItem()) {
177 if (ImGui::CollapsingHeader(
ICON_MD_EDIT " Custom Songs",
178 ImGuiTreeNodeFlags_DefaultOpen)) {
179 bool has_custom =
false;
181 const auto* song = bank.
GetSong(
static_cast<int>(i));
182 if (!song || bank.
IsVanilla(
static_cast<int>(i)))
188 std::string display_name = absl::StrFormat(
"%02X: %s", i + 1, song->name);
198 ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.6f, 0.9f, 0.6f, 1.0f));
199 if (ImGui::Selectable(label.c_str(), is_selected)) {
205 ImGui::PopStyleColor();
208 if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(0)) {
215 if (ImGui::BeginPopupContextItem()) {
257 ImGui::TextDisabled(
"No custom songs yet");
258 ImGui::TextDisabled(
"Click 'New Song' or duplicate a vanilla song");
270 std::string lower_name = name;
272 std::transform(lower_name.begin(), lower_name.end(), lower_name.begin(),
274 std::transform(lower_search.begin(), lower_search.end(), lower_search.begin(),
277 return lower_name.find(lower_search) != std::string::npos;