From 6e47d3d9f17478ad7f73a5b202a31c2a64a0dbce Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Tue, 14 Nov 2023 10:57:55 +0100 Subject: [PATCH 1/2] Fix full score but no lifes left - Will introduce a warning message that one may still lose lifes even if one has achieved full score. Will fix end screen that showed the success message (because one achieved full score) even though all lifes were lost --- language/.en.json | 8 ++++++++ language/de.json | 8 ++++++++ language/es-mx.json | 10 +++++++++- language/es.json | 10 +++++++++- language/eu.json | 8 ++++++++ language/gl.json | 10 +++++++++- language/zh-cn.json | 10 +++++++++- language/zh-hans.json | 10 +++++++++- language/zh.json | 10 +++++++++- semantics.json | 14 +++++++++++++- src/scripts/components/main.js | 8 ++++++-- .../components/mixins/main-user-confirmation.js | 8 +++++++- 12 files changed, 104 insertions(+), 10 deletions(-) diff --git a/language/.en.json b/language/.en.json index fe46a6a..709db15 100644 --- a/language/.en.json +++ b/language/.en.json @@ -405,6 +405,10 @@ "label": "Completed the map", "default": "You have completed the map!" }, + { + "label": "Full score, but no lives left", + "default": "You have achieved full score, but lost all your lifes!" + }, { "label": "Dialog header finish map", "default": "Finish map?" @@ -478,6 +482,10 @@ "label": "Dialog text full score", "default": "You have collected enough points to finish this map with a full score, but you are free to explore the rest if you wish to." }, + { + "label": "Dialog text full score (amendment, if lives are set)", + "default": "But beware! You may still lose lives!" + }, { "label": "OK", "default": "OK" diff --git a/language/de.json b/language/de.json index b484364..a5db05f 100644 --- a/language/de.json +++ b/language/de.json @@ -405,6 +405,10 @@ "label": "Karte abgeschlossen", "default": "Du hast die Karte abgeschlossen!" }, + { + "label": "Volle Punktzahl, aber keine Leben mehr", + "default": "Du hast die volle Punktzahl erreicht, aber alle deine Leben verloren!" + }, { "label": "Dialogüberschrift Karte abgeschlossen", "default": "Karte beenden?" @@ -478,6 +482,10 @@ "label": "Dialogtext Volle Punktzahl", "default": "Du hast genügend Punkte gesammelt, um die Karte mit voller Punktzahl abzuschließen, aber du darfst gerne den Rest der Karte erkunden, wenn du möchtest." }, + { + "label": "Dialogtext Volle Punktzahl (Erweiterung, falls Leben eingestellt sind)", + "default": "Aber Vorsicht! Du kannst immer noch Leben verlieren!" + }, { "label": "OK", "default": "OK" diff --git a/language/es-mx.json b/language/es-mx.json index b9597af..2dedd5a 100644 --- a/language/es-mx.json +++ b/language/es-mx.json @@ -405,6 +405,10 @@ "label": "Completado el mapa", "default": "¡Usted ha completado el mapa!" }, + { + "label": "Full score, but no lives left", + "default": "You have achieved full score, but lost all your lifes!" + }, { "label": "Encabezado de diálogo de mapa terminado", "default": "¿Terminar mapa?" @@ -478,6 +482,10 @@ "label": "Texto de diálogo puntaje completo", "default": "Usted ha reunido suficientes puntos para terminar este mapa con un puntaje completo, pero usted es libre de explorar el resto si así lo desea." }, + { + "label": "Dialog text full score (amendment, if lives are set)", + "default": "But beware! You may still lose lives!" + }, { "label": "OK", "default": "OK" @@ -588,4 +596,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/language/es.json b/language/es.json index fb98c89..b1e9af1 100644 --- a/language/es.json +++ b/language/es.json @@ -405,6 +405,10 @@ "label": "Completó el mapa", "default": "¡Has completado el mapa!" }, + { + "label": "Full score, but no lives left", + "default": "You have achieved full score, but lost all your lifes!" + }, { "label": "Encabezado del cuadro de diálogo de finalización de mapa", "default": "¿Terminar mapa?" @@ -478,6 +482,10 @@ "label": "Texto del diálogo de puntuación completa", "default": "Has acumulado suficientes puntos para terminar este mapa con la puntuación completa, pero eres libre de explorar el resto si lo deseas." }, + { + "label": "Dialog text full score (amendment, if lives are set)", + "default": "But beware! You may still lose lives!" + }, { "label": "OK", "default": "OK" @@ -588,4 +596,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/language/eu.json b/language/eu.json index d54e4f0..c8b5a93 100644 --- a/language/eu.json +++ b/language/eu.json @@ -405,6 +405,10 @@ "label": "Completed the map", "default": "You have completed the map!" }, + { + "label": "Full score, but no lives left", + "default": "You have achieved full score, but lost all your lifes!" + }, { "label": "Dialog header finish map", "default": "Finish map?" @@ -478,6 +482,10 @@ "label": "Dialog text full score", "default": "You have collected enough points to finish this map with a full score, but you are free to explore the rest if you wish to." }, + { + "label": "Dialog text full score (amendment, if lives are set)", + "default": "But beware! You may still lose lives!" + }, { "label": "OK", "default": "OK" diff --git a/language/gl.json b/language/gl.json index 0fada4a..689024e 100644 --- a/language/gl.json +++ b/language/gl.json @@ -405,6 +405,10 @@ "label": "Completado o mapa", "default": "Completaches o mapa!" }, + { + "label": "Full score, but no lives left", + "default": "You have achieved full score, but lost all your lifes!" + }, { "label": "Cabeceira do diálogo do mapa de finalización", "default": "Rematar o mapa?" @@ -478,6 +482,10 @@ "label": "Texto do diálogo de puntuación completa", "default": "Acumulaches puntos suficientes para rematar este mapa cunha puntuación completa, pero podes explorar o resto se queres." }, + { + "label": "Dialog text full score (amendment, if lives are set)", + "default": "But beware! You may still lose lives!" + }, { "label": "OK", "default": "OK" @@ -588,4 +596,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/language/zh-cn.json b/language/zh-cn.json index 2497275..304a5b4 100644 --- a/language/zh-cn.json +++ b/language/zh-cn.json @@ -405,6 +405,10 @@ "label": "完成地图", "default": "您已完成地图!" }, + { + "label": "Full score, but no lives left", + "default": "You have achieved full score, but lost all your lifes!" + }, { "label": "完成地图对话框标题", "default": "完成地图?" @@ -478,6 +482,10 @@ "label": "满分对话框文本", "default": "您已经得到了足够的分数,以满分完成了这张地图。如果您愿意,您可以自由探索其余部分。" }, + { + "label": "Dialog text full score (amendment, if lives are set)", + "default": "But beware! You may still lose lives!" + }, { "label": "OK", "default": "OK" @@ -588,4 +596,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/language/zh-hans.json b/language/zh-hans.json index 2497275..304a5b4 100644 --- a/language/zh-hans.json +++ b/language/zh-hans.json @@ -405,6 +405,10 @@ "label": "完成地图", "default": "您已完成地图!" }, + { + "label": "Full score, but no lives left", + "default": "You have achieved full score, but lost all your lifes!" + }, { "label": "完成地图对话框标题", "default": "完成地图?" @@ -478,6 +482,10 @@ "label": "满分对话框文本", "default": "您已经得到了足够的分数,以满分完成了这张地图。如果您愿意,您可以自由探索其余部分。" }, + { + "label": "Dialog text full score (amendment, if lives are set)", + "default": "But beware! You may still lose lives!" + }, { "label": "OK", "default": "OK" @@ -588,4 +596,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/language/zh.json b/language/zh.json index 2497275..304a5b4 100644 --- a/language/zh.json +++ b/language/zh.json @@ -405,6 +405,10 @@ "label": "完成地图", "default": "您已完成地图!" }, + { + "label": "Full score, but no lives left", + "default": "You have achieved full score, but lost all your lifes!" + }, { "label": "完成地图对话框标题", "default": "完成地图?" @@ -478,6 +482,10 @@ "label": "满分对话框文本", "default": "您已经得到了足够的分数,以满分完成了这张地图。如果您愿意,您可以自由探索其余部分。" }, + { + "label": "Dialog text full score (amendment, if lives are set)", + "default": "But beware! You may still lose lives!" + }, { "label": "OK", "default": "OK" @@ -588,4 +596,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/semantics.json b/semantics.json index 81601ac..5fb6170 100644 --- a/semantics.json +++ b/semantics.json @@ -913,6 +913,12 @@ "label": "Completed the map", "default": "You have completed the map!" }, + { + "name": "fullScoreButnoLivesLeft", + "type": "text", + "label": "Full score, but no lives left", + "default": "You have achieved full score, but lost all your lifes!" + }, { "name": "confirmFinishHeader", "type": "text", @@ -1022,6 +1028,12 @@ "label": "Dialog text full score", "default": "You have collected enough points to finish this map with a full score, but you are free to explore the rest if you wish to." }, + { + "name": "confirmFullScoreDialogLoseLivesAmendmend", + "type": "text", + "label": "Dialog text full score (amendment, if lives are set)", + "default": "But beware! You may still lose lives!" + }, { "name": "ok", "type": "text", @@ -1199,4 +1211,4 @@ } ] } -] +] \ No newline at end of file diff --git a/src/scripts/components/main.js b/src/scripts/components/main.js index 1292f62..26a688d 100644 --- a/src/scripts/components/main.js +++ b/src/scripts/components/main.js @@ -248,7 +248,7 @@ export default class Main { const defaultTitle = `

${this.params.dictionary.get('l10n.completedMap')}

`; - if (score === maxScore) { + if (score >= maxScore && this.livesLeft > 0) { const success = endscreenParams.success; this.endScreen.setMedium(success.endScreenMediumSuccess); @@ -266,10 +266,14 @@ export default class Main { const noSuccess = endscreenParams.noSuccess; this.endScreen.setMedium(noSuccess.endScreenMediumNoSuccess); - const html = Util.isHTMLWidgetFilled(noSuccess.endScreenTextNoSuccess) ? + let html = Util.isHTMLWidgetFilled(noSuccess.endScreenTextNoSuccess) ? noSuccess.endScreenTextNoSuccess : defaultTitle; + if (this.livesLeft === 0 && score >= maxScore) { + html = `${html}

${this.params.dictionary.get('l10n.fullScoreButnoLivesLeft')}

`; + } + this.endScreen.setIntroduction(html); if (!this.isShowingSolutions) { this.params.jukebox.play('endscreenNoSuccess'); diff --git a/src/scripts/components/mixins/main-user-confirmation.js b/src/scripts/components/mixins/main-user-confirmation.js index b0d34dd..11f4113 100644 --- a/src/scripts/components/mixins/main-user-confirmation.js +++ b/src/scripts/components/mixins/main-user-confirmation.js @@ -161,10 +161,16 @@ export default class MainUserConfirmation { showFullScoreConfirmation() { this.toolbar.disableButton('finish'); + let dialogText = this.params.dictionary.get('l10n.confirmFullScoreDialog'); + + if (this.livesLeft !== Infinity) { + dialogText = `${dialogText} ${this.params.dictionary.get('l10n.confirmFullScoreDialogLoseLivesAmendmend')}`; + } + this.confirmationDialog.update( { headerText: this.params.dictionary.get('l10n.confirmFullScoreHeader'), - dialogText: this.params.dictionary.get('l10n.confirmFullScoreDialog'), + dialogText: dialogText, confirmText: this.params.dictionary.get('l10n.ok'), hideCancel: true }, { From bb90d1392640efe334daf2eedbb1bb17e0b7ffa2 Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Tue, 14 Nov 2023 10:58:28 +0100 Subject: [PATCH 2/2] Bump patch version --- library.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library.json b/library.json index 977207f..29da3a9 100644 --- a/library.json +++ b/library.json @@ -3,7 +3,7 @@ "description": "Let your students choose their exercises on a game map.", "majorVersion": 1, "minorVersion": 1, - "patchVersion": 1, + "patchVersion": 2, "runnable": 1, "author": "Oliver Tacke", "license": "MIT", diff --git a/package-lock.json b/package-lock.json index c410437..e959283 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "h5p-game-map", - "version": "1.1.1", + "version": "1.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "h5p-game-map", - "version": "1.1.1", + "version": "1.1.2", "license": "MIT", "dependencies": { "color": "^4.2.3", diff --git a/package.json b/package.json index 9283d31..36941ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "h5p-game-map", - "version": "1.1.1", + "version": "1.1.2", "description": "Let your students choose their exercises on a game map.", "private": true, "scripts": {