From 7f7bc412b48108ed79421b929c6def1afd0538a6 Mon Sep 17 00:00:00 2001 From: Vsevolod Kremianskii Date: Sat, 12 Jun 2021 18:20:10 +0700 Subject: [PATCH] Refactor SaveLoad and PartySelection GUI to use control binding --- src/engine/game/gui/partyselect.cpp | 65 +++++++++++++++++++++--- src/engine/game/gui/partyselect.h | 77 +++++++++++++++++++++++++---- src/engine/game/gui/saveload.cpp | 71 ++++++++++++++++---------- src/engine/game/gui/saveload.h | 35 +++++++++++-- src/engine/gui/control/control.cpp | 54 ++++++++++---------- src/engine/gui/control/control.h | 30 +++++------ src/engine/gui/control/listbox.cpp | 2 +- src/engine/gui/control/listbox.h | 2 +- 8 files changed, 246 insertions(+), 90 deletions(-) diff --git a/src/engine/game/gui/partyselect.cpp b/src/engine/game/gui/partyselect.cpp index 7270a9c9..6308a721 100644 --- a/src/engine/game/gui/partyselect.cpp +++ b/src/engine/game/gui/partyselect.cpp @@ -17,8 +17,6 @@ #include "partyselect.h" -#include "../../gui/control/label.h" -#include "../../gui/control/togglebutton.h" #include "../../graphics/texture/textures.h" #include "../../resource/resources.h" #include "../../resource/strings.h" @@ -63,6 +61,7 @@ PartySelection::PartySelection(Game *game) : GameGUI(game) { void PartySelection::load() { GUI::load(); + bindControls(); for (int i = 0; i < kNpcCount; ++i) { ToggleButton &button = getNpcButton(i); @@ -72,6 +71,62 @@ void PartySelection::load() { } } +void PartySelection::bindControls() { + _binding.btnAccept = getControlPtr