mirror of
https://github.com/QuasarApp/Hanoi-Towers.git
synced 2025-04-26 09:44:32 +00:00
commit
84cfae8f7b
@ -5,6 +5,7 @@
|
||||
* of this license document, but changing it is not allowed.
|
||||
*/
|
||||
|
||||
#include "gamestate.h"
|
||||
#include "gamestate.h"
|
||||
|
||||
int GameState::getMaxValueOfLoadedSaves() {
|
||||
@ -28,6 +29,11 @@ void GameState::unlockNextLvl() {
|
||||
_lvl = static_cast<short>(maxValueOfLoadedSave);
|
||||
}
|
||||
|
||||
void GameState::unlockLvlTo(int toLevel) {
|
||||
maxValueOfLoadedSave = toLevel;
|
||||
_lvl = static_cast<short>(maxValueOfLoadedSave);
|
||||
}
|
||||
|
||||
bool GameState::fSavedGame() const {
|
||||
for (const auto &tower: qAsConst(save) ) {
|
||||
if (tower.size()) {
|
||||
|
@ -33,6 +33,7 @@ public:
|
||||
Q_INVOKABLE void setStep(int value);
|
||||
|
||||
Q_INVOKABLE void unlockNextLvl();
|
||||
Q_INVOKABLE void unlockLvlTo(int toLevel);
|
||||
|
||||
friend bool operator == (const GameState& left, const GameState& right);
|
||||
|
||||
|
@ -317,6 +317,16 @@ void HanoiTowers::handleAcceptUserData(QSharedPointer<LocalUser> data) {
|
||||
|
||||
loadOldSaves();
|
||||
|
||||
#ifdef Q_OS_ANDROID
|
||||
#ifndef HANOI_ADMOD
|
||||
|
||||
if (_profile.gameState()->lvl() < 15) {
|
||||
_profile.gameState()->unlockLvlTo(15);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
emit profileChanged();
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user