1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-04-15 11:46:56 +02:00

Fix positioning of console log overlay

This commit is contained in:
Ivan Savenko 2023-05-13 18:00:14 +03:00
parent 5e90d40e8b
commit 64cc246358
3 changed files with 7 additions and 1 deletions

View File

@ -52,7 +52,7 @@ void CInGameConsole::show(SDL_Surface * to)
Point leftBottomCorner(0, pos.h); Point leftBottomCorner(0, pos.h);
Point textPosition(leftBottomCorner.x + 50, leftBottomCorner.y - texts.size() * 20 - 80 + number * 20); 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++; number++;
} }

View File

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

View File

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