From 9273c177c19a080ba4ee7d8df00cd78e31ba86d8 Mon Sep 17 00:00:00 2001 From: lethosor Date: Wed, 11 Nov 2015 23:14:58 -0500 Subject: [PATCH] Add "confirm uniform-delete" --- plugins/confirm.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/plugins/confirm.cpp b/plugins/confirm.cpp index e3e8308a4..3b3771956 100644 --- a/plugins/confirm.cpp +++ b/plugins/confirm.cpp @@ -416,6 +416,21 @@ public: }; IMPLEMENT_CONFIRMATION_HOOKS(squad_disband_confirmation); +class uniform_delete_confirmation : public confirmation { +public: + virtual bool intercept_key (df::interface_key key) + { + return screen->page == df::viewscreen_layer_militaryst::T_page::Uniforms && + !screen->equip.uniforms.empty() && + !screen->equip.in_name_uniform && + key == df::interface_key::D_MILITARY_DELETE_UNIFORM; + } + virtual string get_id() { return "uniform-delete"; } + virtual string get_title() { return "Delete uniform"; } + virtual string get_message() { return "Are you sure you want to delete this uniform?"; } +}; +IMPLEMENT_CONFIRMATION_HOOKS(uniform_delete_confirmation); + class note_delete_confirmation : public confirmation { public: virtual bool intercept_key (df::interface_key key)