1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Fix status bar activation via click

This commit is contained in:
Ivan Savenko 2023-01-19 19:00:18 +02:00
parent fd05036f3b
commit 8aebe404e3
2 changed files with 5 additions and 4 deletions

View File

@ -392,6 +392,8 @@ CGStatusBar::CGStatusBar(std::shared_ptr<CPicture> background_, EFonts Font, ETe
: CLabel(background_->pos.x, background_->pos.y, Font, Align, Color, "")
, enteringText(false)
{
addUsedEvents(LCLICK);
background = background_;
addChild(background.get());
pos = background->pos;
@ -403,6 +405,8 @@ CGStatusBar::CGStatusBar(int x, int y, std::string name, int maxw)
: CLabel(x, y, FONT_SMALL, ETextAlignment::CENTER)
, enteringText(false)
{
addUsedEvents(LCLICK);
OBJECT_CONSTRUCTION_CAPTURING(255 - DISPOSE);
background = std::make_shared<CPicture>(name);
pos = background->pos;
@ -428,7 +432,7 @@ void CGStatusBar::init()
void CGStatusBar::clickLeft(tribool down, bool previousState)
{
if(!down && onClick)
if(!down)
{
if(LOCPLINT && LOCPLINT->cingconsole->active)
LOCPLINT->cingconsole->startEnteringText();

View File

@ -137,9 +137,6 @@ protected:
void clickLeft(tribool down, bool previousState) override;
private:
std::function<void()> onClick;
public:
template<typename ...Args>
static std::shared_ptr<CGStatusBar> create(Args... args)