change volume to start timer

This commit is contained in:
2025-03-29 11:49:19 +01:00
parent e0de2b5f90
commit ec40495328
6 changed files with 34 additions and 28 deletions

View File

@@ -49,9 +49,9 @@ void Settings::loadSettingsFromFile() {
settingsFile.get(byte);
this->windowSizeMode = byte;
// master volume
// start timer length
settingsFile.get(byte);
this->masterVolume = byte;
this->startTimerLength = byte;
// gamemode
settingsFile.get(byte);
@@ -114,8 +114,8 @@ void Settings::saveSettingsToFile() const {
byte = this->windowSizeMode;
settingsFile.write(&byte, 1);
// master volume
byte = this->masterVolume;
// start timer length
byte = this->startTimerLength;
settingsFile.write(&byte, 1);
// gamemode
@@ -188,17 +188,17 @@ void Settings::changeVideoMode(sf::RenderWindow& window) const {
window.setPosition(sf::Vector2i((desktopSize.x / 2) - (windowSize.x / 2), (desktopSize.y / 2) - (windowSize.y / 2)));
}
bool Settings::raiseMasterVolume() {
if (this->masterVolume < 100) {
this->masterVolume = std::min(this->masterVolume + 5, 100);
bool Settings::lengthenStartTimer() {
if (this->startTimerLength < 4) {
this->startTimerLength++;
return true;
}
return false;
}
bool Settings::lowerMasterVolume() {
if (this->masterVolume > 0) {
this->masterVolume = std::max(this->masterVolume - 5, 0);
bool Settings::shortenStartTimer() {
if (this->startTimerLength > 0) {
this->startTimerLength--;
return true;
}
return false;
@@ -260,8 +260,8 @@ int Settings::getWindowSizeMultiplier() const {
return WINDOW_SIZE_MULTIPLIERS[this->windowSizeMode];
}
int Settings::getMasterVolume() const {
return this->masterVolume;
int Settings::getStartTimerLength() const {
return this->startTimerLength;
}
const std::vector<std::pair<PiecesType, int>>& Settings::getSelectedPieces() const {