From 481cd89dc8392b3246989f5bd66f900fc43a4da9 Mon Sep 17 00:00:00 2001 From: Michael <13953785+Laserlicht@users.noreply.github.com> Date: Sat, 12 Aug 2023 18:20:44 +0200 Subject: [PATCH] drawing --- client/lobby/OptionsTab.cpp | 25 ++++++++++++++++++++++++- client/lobby/OptionsTab.h | 1 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/client/lobby/OptionsTab.cpp b/client/lobby/OptionsTab.cpp index 628c6d7aa..1211ac9e1 100644 --- a/client/lobby/OptionsTab.cpp +++ b/client/lobby/OptionsTab.cpp @@ -448,14 +448,37 @@ void OptionsTab::SelectionWindow::apply() { close(); - CSH->setPlayerOption(LobbyChangePlayerOption::TOWN, 1, color); + setSelection(); } } +void OptionsTab::SelectionWindow::setSelection() +{ + int selectedFractionPos = -1; + for(int i = 0; isetPlayerOption(LobbyChangePlayerOption::TOWN, deltatown > 0 ? 1 : -1, color); +} + void OptionsTab::SelectionWindow::redraw() { + OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE; + components.clear(); + GH.windows().totalRedraw(); + genContentTitle(); genContentCastles(); genContentHeroes(); diff --git a/client/lobby/OptionsTab.h b/client/lobby/OptionsTab.h index 826e8c11d..014f8d04b 100644 --- a/client/lobby/OptionsTab.h +++ b/client/lobby/OptionsTab.h @@ -123,6 +123,7 @@ public: void apply(); void redraw(); + void setSelection(); FactionID getElementCastle(const Point & cursorPosition); HeroTypeID getElementHero(const Point & cursorPosition); int getElementBonus(const Point & cursorPosition);