Ordentliche GameEnded-Seite

This commit is contained in:
silas
2018-09-22 01:02:55 +02:00
parent aa3e6e8629
commit a6f7fa8c3e
14 changed files with 38 additions and 18 deletions

View File

@@ -1,3 +1,3 @@
<div>
<div data-translation="game-ended"></div>
<div class = 'max-height flex-center'>
<div data-translation="game-ended" class = 'center'></div>
</div>

View File

@@ -13,9 +13,10 @@
<div class='child-container'></div>
</div>
<!-- Site Content -->
<div class='max-height'>
<div class='max-height fill-me'>
<!--<div class = 'max-width'>-->
<div class="text-right max-width">
<button class="button right show-while-playing" id='help-button' data-translation="help"></button>
<button class="button show-while-playing" id='help-button' data-translation="help"></button>
</div>
<div class='height-20 show-when-won center flex-center fill-me'>
<div class = 'grow max-width'>
@@ -27,7 +28,7 @@
</div>
</div>
</div>
<div class="flex-center level-container">
<div class="flex-center level-container grow">
<div id='level'>
</div>
</div>

View File

@@ -136,7 +136,7 @@ export class LevelSite extends WordRotatorBaseSite {
const db = WordRotatorDb.getInstance();
const nextLevelJson = await db.loadNextLevel([20, 40, 60, 100, 120, 140, 160]);
// const nextLevelJson = await db.loadNextLevel([120]);
if (nextLevelJson === null) {
this.startSite(EndSite);
return;
@@ -214,7 +214,6 @@ export class LevelSite extends WordRotatorBaseSite {
audio.addEventListener('loadeddata', r);
})
]);
console.log(Helper.basePath("sound/single_coin_fall_on_concrete_.mp3"));
audio.src = Helper.basePath("sound/single_coin_fall_on_concrete_.mp3");
for (let i = 0; i < coinsPerLevel; i++) {

View File

@@ -1,4 +1,4 @@
import {Helper} from "../../../../../js/lib/pwa-lib";
import {FlashMessenger, Helper} from "../../../../../js/lib/pwa-lib";
import {DataManager} from "../../../../../js/lib/pwa-core";
import {WordRotatorDb} from "../WordRotatorDb";
import {LevelSite} from "./LevelSite";
@@ -34,6 +34,8 @@ export class SynchronizeSite extends WordRotatorBaseSite {
"dateLastSync": dateLastSync
}));
if (!res["success"]) {
FlashMessenger.addMessage("sync-error", null, 6000);
newLastSync = null;
break;
}
res = res["result"];

View File

@@ -3,5 +3,8 @@
"continue":"Weiter",
"help": "?",
"not-enough-coins":"Du hast zu wenig Münzen!"
"not-enough-coins":"Du hast zu wenig Münzen!",
"sync-error":"Es gab einen Fehler beim Aktualisieren der Level. Bitte stelle sicher, dass du eine aktive Internetverbindung hast und versuche es später erneut.",
"game-ended":"<b>Oh nein!</b> <br/>Es sieht so aus, als ob du schon alle Level gespielt hast... <br/>Schau später noch einmal rein, evtl gibt es dann neue Level."
}

View File

@@ -104,6 +104,7 @@ class SyncController extends JsonController
public function getLevelsAction()
{
// fdhsdh
$request = $this->getRequest();
$currentRun = (int)$request->getQuery("currentRun", null);