add right side palette display mode to pal editor
This commit is contained in:
@@ -163,8 +163,7 @@ void PaletteEditor::DisplayCategoryTable() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TableSetColumnIndex(2);
|
TableSetColumnIndex(2);
|
||||||
status_ = DrawPaletteGroup(PaletteCategory::kGlobalSprites);
|
status_ = DrawPaletteGroup(PaletteCategory::kGlobalSprites, true);
|
||||||
TreePop();
|
|
||||||
|
|
||||||
TableSetColumnIndex(3);
|
TableSetColumnIndex(3);
|
||||||
status_ = DrawPaletteGroup(PaletteCategory::kSpritesAux1);
|
status_ = DrawPaletteGroup(PaletteCategory::kSpritesAux1);
|
||||||
@@ -194,14 +193,13 @@ void PaletteEditor::DisplayCategoryTable() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TableSetColumnIndex(7);
|
TableSetColumnIndex(7);
|
||||||
status_ = DrawPaletteGroup(PaletteCategory::kDungeons);
|
status_ = DrawPaletteGroup(PaletteCategory::kDungeons, true);
|
||||||
TreePop();
|
|
||||||
|
|
||||||
EndTable();
|
EndTable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
absl::Status PaletteEditor::DrawPaletteGroup(int category) {
|
absl::Status PaletteEditor::DrawPaletteGroup(int category, bool right_side) {
|
||||||
if (!rom()->is_loaded()) {
|
if (!rom()->is_loaded()) {
|
||||||
return absl::NotFoundError("ROM not open, no palettes to display");
|
return absl::NotFoundError("ROM not open, no palettes to display");
|
||||||
}
|
}
|
||||||
@@ -218,7 +216,11 @@ absl::Status PaletteEditor::DrawPaletteGroup(int category) {
|
|||||||
|
|
||||||
for (int n = 0; n < pal_size; n++) {
|
for (int n = 0; n < pal_size; n++) {
|
||||||
PushID(n);
|
PushID(n);
|
||||||
if ((n % 7) != 0) SameLine(0.0f, GetStyle().ItemSpacing.y);
|
if (!right_side) {
|
||||||
|
if ((n % 7) != 0) SameLine(0.0f, GetStyle().ItemSpacing.y);
|
||||||
|
} else {
|
||||||
|
if ((n % 15) != 0) SameLine(0.0f, GetStyle().ItemSpacing.y);
|
||||||
|
}
|
||||||
|
|
||||||
auto popup_id =
|
auto popup_id =
|
||||||
absl::StrCat(kPaletteCategoryNames[category].data(), j, "_", n);
|
absl::StrCat(kPaletteCategoryNames[category].data(), j, "_", n);
|
||||||
@@ -238,6 +240,7 @@ absl::Status PaletteEditor::DrawPaletteGroup(int category) {
|
|||||||
rom()->resource_label()->SelectableLabelWithNameEdit(
|
rom()->resource_label()->SelectableLabelWithNameEdit(
|
||||||
false, palette_group_name.data(), /*key=*/std::to_string(j),
|
false, palette_group_name.data(), /*key=*/std::to_string(j),
|
||||||
"Unnamed Palette");
|
"Unnamed Palette");
|
||||||
|
if (right_side) Separator();
|
||||||
}
|
}
|
||||||
return absl::OkStatus();
|
return absl::OkStatus();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ class PaletteEditor : public SharedRom, public Editor {
|
|||||||
const gfx::SnesPalette& originalPalette);
|
const gfx::SnesPalette& originalPalette);
|
||||||
void DisplayPalette(gfx::SnesPalette& palette, bool loaded);
|
void DisplayPalette(gfx::SnesPalette& palette, bool loaded);
|
||||||
void DrawPortablePalette(gfx::SnesPalette& palette);
|
void DrawPortablePalette(gfx::SnesPalette& palette);
|
||||||
absl::Status DrawPaletteGroup(int category);
|
absl::Status DrawPaletteGroup(int category, bool right_side = false);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
absl::Status HandleColorPopup(gfx::SnesPalette& palette, int i, int j, int n);
|
absl::Status HandleColorPopup(gfx::SnesPalette& palette, int i, int j, int n);
|
||||||
|
|||||||
Reference in New Issue
Block a user