clear text buffer when input is handled by the overlay

develop
Myk Taylor 2023-08-14 16:56:01 -07:00
parent 7544641377
commit 614bc546a8
No known key found for this signature in database
1 changed files with 4 additions and 0 deletions

@ -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)();