From 614bc546a869b0a342cdf704a9e79c7bb96689b2 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Mon, 14 Aug 2023 16:56:01 -0700 Subject: [PATCH] clear text buffer when input is handled by the overlay --- plugins/overlay.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/overlay.cpp b/plugins/overlay.cpp index 5dc9ed327..9c75e6951 100644 --- a/plugins/overlay.cpp +++ b/plugins/overlay.cpp @@ -1,3 +1,4 @@ +#include "df/enabler.h" #include "df/viewscreen_adopt_regionst.h" #include "df/viewscreen_choose_game_typest.h" #include "df/viewscreen_choose_start_sitest.h" @@ -29,6 +30,7 @@ DFHACK_PLUGIN("overlay"); DFHACK_PLUGIN_IS_ENABLED(is_enabled); REQUIRE_GLOBAL(world); +REQUIRE_GLOBAL(enabler); namespace DFHack { DBG_DECLARE(overlay, control, DebugCategory::LINFO); @@ -82,6 +84,8 @@ struct viewscreen_overlay : T { }); if (!input_is_handled) INTERPOSE_NEXT(feed)(input); + else + enabler->last_text_input[0] = '\0'; } DEFINE_VMETHOD_INTERPOSE(void, render, ()) { INTERPOSE_NEXT(render)();