From 4a0d542b5e90f82ed478551fb8508c2dcde7132e Mon Sep 17 00:00:00 2001 From: Robob27 Date: Thu, 2 Feb 2023 00:33:27 -0500 Subject: [PATCH] Add more confirms --- plugins/confirm.cpp | 5 ++++- plugins/lua/confirm.lua | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/confirm.cpp b/plugins/confirm.cpp index eecbaa83d..87f8e4555 100644 --- a/plugins/confirm.cpp +++ b/plugins/confirm.cpp @@ -317,8 +317,9 @@ public: if (paused) { - if (paused_focus != "" && (input->count(df::interface_key::LEAVESCREEN) || mouseExit)) + if (paused_focus != "" && (input->count(df::interface_key::LEAVESCREEN) || mouseExit)) { conf_lua::api::unpause(NULL); + } return false; } else if (state == INACTIVE) @@ -372,6 +373,7 @@ public: df::global::enabler->mouse_rbut_down = 0; } set_state(INACTIVE); + Screen::invalidate(); } else if (input->count(df::interface_key::SELECT)) set_state(SELECTED); else if (input->count(df::interface_key::CUSTOM_P)) @@ -600,6 +602,7 @@ DEFINE_CONFIRMATION(depot_remove, viewscreen_dwarfmodest); DEFINE_CONFIRMATION(squad_disband, viewscreen_dwarfmodest); DEFINE_CONFIRMATION(order_remove, viewscreen_dwarfmodest); DEFINE_CONFIRMATION(zone_remove, viewscreen_dwarfmodest); +DEFINE_CONFIRMATION(burrow_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 00a144466..5e03200b8 100644 --- a/plugins/lua/confirm.lua +++ b/plugins/lua/confirm.lua @@ -118,6 +118,13 @@ end zone_remove.title = "Remove zone" zone_remove.message = "Are you sure you want to remove this zone?" +burrow_remove = defconf('burrow-remove') +function burrow_remove.intercept_key(key) + return key == MOUSE_LEFT and df.global.game.main_interface.current_hover == 171 +end +burrow_remove.title = "Remove burrow" +burrow_remove.message = "Are you sure you want to remove this burrow?" + -- these confirmations have more complex button detection requirements --[[ trade = defconf('trade')