housekeeping

This commit is contained in:
scawful
2024-07-14 19:52:01 -04:00
parent 0c66c2946e
commit d1c4a4699b
2 changed files with 5 additions and 9 deletions

View File

@@ -95,10 +95,8 @@ absl::Status PaletteEditor::Update() {
TableHeadersRow();
TableNextRow();
TableNextColumn();
if (gui::SnesColorEdit4("Color Picker", &current_color_,
ImGuiColorEditFlags_NoAlpha)) {
// TODO: Implement new update color function
}
gui::SnesColorEdit4("Current Color Picker", &current_color_,
ImGuiColorEditFlags_NoAlpha);
Separator();
DisplayCategoryTable();
@@ -110,7 +108,7 @@ absl::Status PaletteEditor::Update() {
Separator();
static std::string palette_notes = "Notes about the palette";
ImGui::InputTextMultiline("Notes", palette_notes.data(), 1024,
ImVec2(-1, ImGui::GetTextLineHeight() * 16),
ImVec2(-1, ImGui::GetTextLineHeight() * 4),
ImGuiInputTextFlags_AllowTabInput);
EndTable();
@@ -224,7 +222,6 @@ absl::Status PaletteEditor::DrawPaletteGroup(int category) {
if (gui::SnesColorButton(popup_id, *palette->mutable_color(n),
palette_button_flags)) {
ASSIGN_OR_RETURN(current_color_, palette->GetColor(n));
// EditColorInPalette(*palette, n);
}
if (BeginPopupContextItem(popup_id.c_str())) {
@@ -265,7 +262,7 @@ absl::Status PaletteEditor::HandleColorPopup(gfx::SnesPalette& palette, int i,
if (Selectable(buf)) SetClipboardText(buf);
// SNES Format
CustomFormatString(buf, IM_ARRAYSIZE(buf), "0x%04X",
CustomFormatString(buf, IM_ARRAYSIZE(buf), "$%04X",
ConvertRGBtoSNES(ImVec4(col[0], col[1], col[2], 1.0f)));
if (Selectable(buf)) SetClipboardText(buf);

View File

@@ -25,8 +25,7 @@ ImVec4 ConvertSNESColorToImVec4(const SnesColor& color) {
IMGUI_API bool SnesColorButton(absl::string_view id, SnesColor& color,
ImGuiColorEditFlags flags,
const ImVec2& size_arg) {
// Convert the SNES color values to ImGui color values (normalized to 0-1
// range)
// Convert the SNES color values to ImGui color values
ImVec4 displayColor = ConvertSNESColorToImVec4(color);
// Call the original ImGui::ColorButton with the converted color