Skip to content

Commit 614bc54

Browse files
committed
clear text buffer when input is handled by the overlay
1 parent 7544641 commit 614bc54

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

plugins/overlay.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "df/enabler.h"
12
#include "df/viewscreen_adopt_regionst.h"
23
#include "df/viewscreen_choose_game_typest.h"
34
#include "df/viewscreen_choose_start_sitest.h"
@@ -29,6 +30,7 @@ DFHACK_PLUGIN("overlay");
2930
DFHACK_PLUGIN_IS_ENABLED(is_enabled);
3031

3132
REQUIRE_GLOBAL(world);
33+
REQUIRE_GLOBAL(enabler);
3234

3335
namespace DFHack {
3436
DBG_DECLARE(overlay, control, DebugCategory::LINFO);
@@ -82,6 +84,8 @@ struct viewscreen_overlay : T {
8284
});
8385
if (!input_is_handled)
8486
INTERPOSE_NEXT(feed)(input);
87+
else
88+
enabler->last_text_input[0] = '\0';
8589
}
8690
DEFINE_VMETHOD_INTERPOSE(void, render, ()) {
8791
INTERPOSE_NEXT(render)();

0 commit comments

Comments
 (0)