variable max polyo size

This commit is contained in:
2025-03-31 14:12:36 +02:00
parent 6bff555cbc
commit 1a95765877
9 changed files with 87 additions and 35 deletions

View File

@@ -12,7 +12,7 @@ GameDistributionAppMenu::GameDistributionAppMenu(std::shared_ptr<MenuStack> menu
AppMenu(menuStack, settings, renderWindow),
playerCursor({1}) {
for (int i = 1; i <= MAXIMUM_PIECES_SIZE; i++) {
for (int i = 1; i <= this->settings->getMaximumPiecesSize(); i++) {
this->playerCursor.addRow(i, 1);
}
}
@@ -65,7 +65,7 @@ void GameDistributionAppMenu::drawFrame() const {
const DistributionMode distributionMode = this->settings->getMenu().readPiecesList().getDistributionMode();
const std::vector<int>& distributions = this->settings->getDistributions();
int firstElem = std::clamp(((int) this->playerCursor.getPosition().y) - 1, 0, MAXIMUM_PIECES_SIZE - 3);
int firstElem = std::clamp(((int) this->playerCursor.getPosition().y) - 1, 0, this->settings->getMaximumPiecesSize() - 3);
if (firstElem == 0) {
this->placeText(text, this->playerCursor, "< DISTRIBUTION MODE: " + getPiecesDistributionName(distributionMode) + " >", 5.f, 15.f, sf::Vector2u{0, 0});
}