From a5de0fb0de041923bb2941ec8ae25a1572284536 Mon Sep 17 00:00:00 2001 From: Robob27 Date: Thu, 2 Feb 2023 02:50:33 -0500 Subject: [PATCH] Add stockpile removal confirm --- plugins/confirm.cpp | 1 + plugins/lua/confirm.lua | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/plugins/confirm.cpp b/plugins/confirm.cpp index 9caf7c19d..752287749 100644 --- a/plugins/confirm.cpp +++ b/plugins/confirm.cpp @@ -594,6 +594,7 @@ DEFINE_CONFIRMATION(squad_disband, viewscreen_dwarfmodest); DEFINE_CONFIRMATION(order_remove, viewscreen_dwarfmodest); DEFINE_CONFIRMATION(zone_remove, viewscreen_dwarfmodest); DEFINE_CONFIRMATION(burrow_remove, viewscreen_dwarfmodest); +DEFINE_CONFIRMATION(stockpile_remove, viewscreen_dwarfmodest); // these are more complex to implement //DEFINE_CONFIRMATION(convict, viewscreen_dwarfmodest); diff --git a/plugins/lua/confirm.lua b/plugins/lua/confirm.lua index 5e03200b8..1d4955f99 100644 --- a/plugins/lua/confirm.lua +++ b/plugins/lua/confirm.lua @@ -125,6 +125,13 @@ end burrow_remove.title = "Remove burrow" burrow_remove.message = "Are you sure you want to remove this burrow?" +stockpile_remove = defconf('stockpile-remove') +function stockpile_remove.intercept_key(key) + return key == MOUSE_LEFT and df.global.game.main_interface.current_hover == 118 +end +stockpile_remove.title = "Remove stockpile" +stockpile_remove.message = "Are you sure you want to remove this stockpile?" + -- these confirmations have more complex button detection requirements --[[ trade = defconf('trade')