From 64cc246358a8a0c20c2d6946fd92ca03a70da431 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Sat, 13 May 2023 18:00:14 +0300 Subject: [PATCH] Fix positioning of console log overlay --- client/adventureMap/CInGameConsole.cpp | 2 +- client/battle/BattleFieldController.cpp | 5 +++++ client/battle/BattleFieldController.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/client/adventureMap/CInGameConsole.cpp b/client/adventureMap/CInGameConsole.cpp index b56ae1fe2..29d5be8f0 100644 --- a/client/adventureMap/CInGameConsole.cpp +++ b/client/adventureMap/CInGameConsole.cpp @@ -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++; } diff --git a/client/battle/BattleFieldController.cpp b/client/battle/BattleFieldController.cpp index 0d2c4f7ce..7b0068994 100644 --- a/client/battle/BattleFieldController.cpp +++ b/client/battle/BattleFieldController.cpp @@ -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() diff --git a/client/battle/BattleFieldController.h b/client/battle/BattleFieldController.h index ec2e8b830..e427efebb 100644 --- a/client/battle/BattleFieldController.h +++ b/client/battle/BattleFieldController.h @@ -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;