Add context menu options for editable palette in Canvas; implement BeginCanvas and EndCanvas functions for improved canvas management.
This commit is contained in:
@@ -167,6 +167,11 @@ void Canvas::DrawContextMenu() {
|
||||
}
|
||||
EndMenu();
|
||||
}
|
||||
if (BeginMenu("View Palette")) {
|
||||
DisplayEditablePalette(*bitmap_->mutable_palette(), "Palette", true, 8);
|
||||
EndMenu();
|
||||
}
|
||||
|
||||
if (BeginMenu("Bitmap Palette")) {
|
||||
if (rom()->is_loaded()) {
|
||||
gui::TextWithSeparators("ROM Palette");
|
||||
@@ -801,6 +806,20 @@ void Canvas::DrawLayeredElements() {
|
||||
}
|
||||
}
|
||||
|
||||
void BeginCanvas(Canvas &canvas, ImVec2 child_size) {
|
||||
gui::BeginPadding(1);
|
||||
ImGui::BeginChild(canvas.canvas_id().c_str(), child_size, true);
|
||||
canvas.DrawBackground();
|
||||
gui::EndPadding();
|
||||
canvas.DrawContextMenu();
|
||||
}
|
||||
|
||||
void EndCanvas(Canvas &canvas) {
|
||||
canvas.DrawGrid();
|
||||
canvas.DrawOverlay();
|
||||
ImGui::EndChild();
|
||||
}
|
||||
|
||||
void GraphicsBinCanvasPipeline(int width, int height, int tile_size,
|
||||
int num_sheets_to_load, int canvas_id,
|
||||
bool is_loaded, gfx::BitmapTable &graphics_bin) {
|
||||
|
||||
Reference in New Issue
Block a user