support unsupported sizes
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <stack>
|
||||
#include <memory>
|
||||
#include <algorithm>
|
||||
#include <SFML/Graphics.hpp>
|
||||
|
||||
|
||||
@@ -13,7 +14,7 @@ StartUpAppMenu::StartUpAppMenu(std::shared_ptr<MenuStack> menuStack, std::shared
|
||||
AppMenu(menuStack, settings, renderWindow),
|
||||
playerCursor({LOADED_PIECES_SIZE + 1}) {
|
||||
|
||||
this->playerCursor.goToPosition({MINIMUM_PIECES_SIZE, 0});
|
||||
this->playerCursor.goToPosition({(unsigned int) std::clamp(this->settings->getMaximumPiecesSize(), MINIMUM_PIECES_SIZE, LOADED_PIECES_SIZE), 0u});
|
||||
}
|
||||
|
||||
void StartUpAppMenu::computeFrame() {
|
||||
@@ -30,7 +31,7 @@ void StartUpAppMenu::computeFrame() {
|
||||
}
|
||||
|
||||
if (this->enterReleased) {
|
||||
*this->settings = Settings(this->playerCursor.getPosition().x);
|
||||
this->settings->loadSettingsFromFile(true, {this->playerCursor.getPosition().x});
|
||||
this->menuStack->pop();
|
||||
|
||||
if (this->settings->hasLoadedPieces()) {
|
||||
|
||||
Reference in New Issue
Block a user