[nostalgia/core/studio] Show Palette page names in TileSheetEditor
All checks were successful
Build / build (push) Successful in 2m31s

This commit is contained in:
Gary Talent 2024-09-07 00:12:15 -05:00
parent 686db99d5b
commit 4d63a65fbd

View File

@ -441,12 +441,14 @@ void TileSheetEditorImGui::drawPaletteSelector() noexcept {
auto const pages = m_model.pal().pages.size();
if (pages > 1) {
ImGui::Indent(20);
auto numStr = ox::itoa(m_model.palettePage() + 1);
using Str = ox::IString<55>;
auto numStr = ox::sfmt<Str>(
"{} - {}", m_model.palettePage() + 1, m_model.pal().pages[m_model.palettePage()].name);
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x - comboWidthSub);
if (ImGui::BeginCombo("Page", numStr.c_str(), 0)) {
for (auto n = 0u; n < pages; ++n) {
auto const selected = (m_model.palettePage() == n);
numStr = ox::itoa(n + 1);
numStr = ox::sfmt<Str>("{} - {}", n + 1, m_model.pal().pages[n].name);
if (ImGui::Selectable(numStr.c_str(), selected) && m_model.palettePage() != n) {
m_model.setPalettePage(n);
}