From 41caea6048c2674b25e401b292ad95b6d2d3b2df Mon Sep 17 00:00:00 2001 From: Vsevolod Kremianskii Date: Fri, 11 Jun 2021 16:57:21 +0700 Subject: [PATCH] Refactor BarkBubble and Container GUI to use control binding --- src/engine/game/gui/barkbubble.cpp | 33 +++++++++++++++--------------- src/engine/game/gui/barkbubble.h | 7 +++++++ src/engine/game/gui/container.cpp | 32 ++++++++++++++++------------- src/engine/game/gui/container.h | 15 +++++++++++++- 4 files changed, 55 insertions(+), 32 deletions(-) diff --git a/src/engine/game/gui/barkbubble.cpp b/src/engine/game/gui/barkbubble.cpp index ca0a6b32..8d409e5f 100644 --- a/src/engine/game/gui/barkbubble.cpp +++ b/src/engine/game/gui/barkbubble.cpp @@ -17,8 +17,6 @@ #include "barkbubble.h" -#include "../../gui/control/label.h" - #include "../game.h" using namespace std; @@ -29,8 +27,6 @@ namespace reone { namespace game { -static const char kBarkTextTag[] = "LBL_BARKTEXT"; - BarkBubble::BarkBubble(Game *game) : GameGUI(game) { _resRef = getResRef("barkbubble"); _scaling = ScalingMode::PositionRelativeToCenter; @@ -38,8 +34,14 @@ BarkBubble::BarkBubble(Game *game) : GameGUI(game) { void BarkBubble::load() { GUI::load(); + bindControls(); + _rootControl->setVisible(false); - hideControl(kBarkTextTag); + _binding.lblBarkText->setVisible(false); +} + +void BarkBubble::bindControls() { + _binding.lblBarkText = getControlPtr