From c20d99b81d2867193f7f971b230b0d59d1358991 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sun, 2 Mar 2008 15:59:52 +0000 Subject: [PATCH] added option to delete quads --- src/game/editor/ed_popups.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/game/editor/ed_popups.cpp b/src/game/editor/ed_popups.cpp index 72dcb972a..4a1248b49 100644 --- a/src/game/editor/ed_popups.cpp +++ b/src/game/editor/ed_popups.cpp @@ -212,6 +212,23 @@ int popup_quad(RECT view) QUAD *quad = editor.get_selected_quad(); RECT button; + + // delete button + ui_hsplit_b(&view, 12.0f, &view, &button); + static int delete_button = 0; + if(do_editor_button(&delete_button, "Delete", 0, &button, draw_editor_button, 0, "Deletes the current quad")) + { + LAYER_QUADS *layer = (LAYER_QUADS *)editor.get_selected_layer_type(0, LAYERTYPE_QUADS); + if(layer) + { + layer->quads.removebyindex(editor.selected_quad); + editor.selected_quad--; + } + return 1; + } + + // square button + ui_hsplit_b(&view, 10.0f, &view, &button); ui_hsplit_b(&view, 12.0f, &view, &button); static int sq_button = 0; if(do_editor_button(&sq_button, "Square", 0, &button, draw_editor_button, 0, "Squares the current quad")) @@ -236,8 +253,6 @@ int popup_quad(RECT view) return 1; } - //ui_vsplit_b(&toolbar, 2.0f, &button, &toolbar); - enum {