From fe937cf20a1eaaac38eda5b883d786f8d7882157 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 6 Oct 2022 13:46:15 +0200 Subject: [PATCH] color table dialog now allows adding more / removing colors --- config.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/config.cpp b/config.cpp index a0ea8cce..5e4abf14 100644 --- a/config.cpp +++ b/config.cpp @@ -2646,6 +2646,20 @@ EX void edit_color_table(colortable& ct, const reaction_t& r IS(reaction_t()), b }); } + dialog::addItem("add a color", 'A'); + dialog::add_action([&ct, r] { + ct.push_back(rand() & 0x1FFFFFF); + r(); + }); + + if(isize(ct) > 2) { + dialog::addItem("delete a color", 'D'); + dialog::add_action([&ct, r] { + ct.pop_back(); + r(); + }); + } + dialog::addBack(); dialog::display(); }