1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Merge pull request #2152 from IvanSavenko/fix_console

Fix console activation via mouse click / touch
This commit is contained in:
Ivan Savenko 2023-05-14 13:02:53 +03:00 committed by GitHub
commit 0a874cd89e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 2 deletions

View File

@ -52,7 +52,7 @@ void CInGameConsole::show(SDL_Surface * to)
Point leftBottomCorner(0, pos.h);
Point textPosition(leftBottomCorner.x + 50, leftBottomCorner.y - texts.size() * 20 - 80 + number * 20);
graphics->fonts[FONT_MEDIUM]->renderTextLeft(to, text.text, Colors::GREEN, textPosition );
graphics->fonts[FONT_MEDIUM]->renderTextLeft(to, text.text, Colors::GREEN, pos.topLeft() + textPosition );
number++;
}

View File

@ -69,7 +69,12 @@ BattleFieldController::BattleFieldController(BattleInterface & owner):
updateAccessibleHexes();
addUsedEvents(LCLICK | RCLICK | MOVE);
}
void BattleFieldController::activate()
{
LOCPLINT->cingconsole->pos = this->pos;
CIntObject::activate();
}
void BattleFieldController::createHeroes()

View File

@ -66,6 +66,7 @@ class BattleFieldController : public CIntObject
void mouseMoved(const Point & cursorPosition) override;
void clickLeft(tribool down, bool previousState) override;
void clickRight(tribool down, bool previousState) override;
void activate() override;
void showAll(SDL_Surface * to) override;
void show(SDL_Surface * to) override;

View File

@ -456,7 +456,7 @@ void CGStatusBar::clickLeft(tribool down, bool previousState)
void CGStatusBar::activate()
{
GH.statusbar = shared_from_this();
CIntObject::deactivate();
CIntObject::activate();
}
void CGStatusBar::deactivate()