From 7846bbb513d8f7ce4dd8865b34fb1951176e9593 Mon Sep 17 00:00:00 2001 From: goynov Date: Sat, 6 Jun 2026 18:08:21 +0300 Subject: [PATCH] allow texts to appear on interactive object finish event --- .../InteractiveObjects/ClassicPuzzle/ClassicPuzzle.vue | 1 + src/components/InteractiveObjects/InteractiveObject.js | 5 +++++ src/plugins/lang.js | 2 ++ 3 files changed, 8 insertions(+) diff --git a/src/components/InteractiveObjects/ClassicPuzzle/ClassicPuzzle.vue b/src/components/InteractiveObjects/ClassicPuzzle/ClassicPuzzle.vue index 15a4869..c6c836a 100644 --- a/src/components/InteractiveObjects/ClassicPuzzle/ClassicPuzzle.vue +++ b/src/components/InteractiveObjects/ClassicPuzzle/ClassicPuzzle.vue @@ -2,6 +2,7 @@
+
{{ modelValue.title }}
diff --git a/src/components/InteractiveObjects/InteractiveObject.js b/src/components/InteractiveObjects/InteractiveObject.js index 8b3cada..181b242 100644 --- a/src/components/InteractiveObjects/InteractiveObject.js +++ b/src/components/InteractiveObjects/InteractiveObject.js @@ -77,6 +77,11 @@ class InteractiveObject extends EventManager{ engine.tm?.setGameObject(obj.id); }) } + if (this.emits?.includes('finish') && obj.outroText){ + this.io.once('finish', ()=>{ + engine.dashboard.updateText(obj.outroText, {hideOnFinish: true}); + }) + } ['minPoints', 'maxPoints'].filter(p=>this.io[p] !== undefined).forEach(p=> this[p] = this.io[p] ) break; } diff --git a/src/plugins/lang.js b/src/plugins/lang.js index eaa2925..6d166a5 100644 --- a/src/plugins/lang.js +++ b/src/plugins/lang.js @@ -59,6 +59,7 @@ const lang = { advanced: 'Complex (not implemented)' }, dimensions: 'Dimensions', + outroText: 'Text on finish', elementsCount: 'Number of elements', particleWidth: 'Particle width', particleHeight: 'Particle height', @@ -229,6 +230,7 @@ const lang = { advanced: 'С голяма точност (not implemented)' }, dimensions: 'Размери', + outroText: 'Текст при изпълнение', elementsCount: 'Брой елементи', particleWidth: 'Ширина на частиците', particleHeight: 'Височина на частиците',