Skip to content

Commit 029144c

Browse files
committed
quick-letter updated
1 parent 2af989c commit 029144c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

quick-letter/index.b7a05eb9.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239044,6 +239044,7 @@ Config.INPUT_FIELD_Y = 400;
239044239044
Config.INPUT_FIELD_FONT_SIZE = "42px";
239045239045
Config.INPUT_FIELD_FONT_COLOR = (0, _colorKeysDefault.default).WHITE;
239046239046
Config.INPUT_FIELD_FONT_COLOR_INCORRECT = (0, _colorKeysDefault.default).RED_MILD;
239047+
// 🗨️ Speech Bubble
239047239048
Config.SPEECH_BUBBLE_HEIGHT = 70;
239048239049
// 🎲 Game
239049239050
Config.AI_PROMPT_VALIDATE_ANSWER = "Du bist ein Spielleiter einer Partie Stadt Land Fluss. Die Kategorie lautet: {{category}}. Der Spieler hat die Antwort {{answer}} gegeben. Ist die Antwort korrekt? Antworte mit ja oder nein.";
@@ -239673,7 +239674,7 @@ class GameMasterFace {
239673239674
fontSize: "32px",
239674239675
color: (0, _colorKeysDefault.default).BLACK
239675239676
}).setOrigin(0, 0);
239676-
this.message.setWordWrapWidth(this.mainScene.sys.canvas.width - (0, _configDefault.default).GAME_MASTER_MESSAGE_X, true);
239677+
this.message.setWordWrapWidth(this.mainScene.sys.canvas.width - (0, _configDefault.default).GAME_MASTER_MESSAGE_X - 50, true);
239677239678
// Set the alpha to 0 of message and speech bubble so it is invisible at the beginning
239678239679
this.message.setAlpha(0);
239679239680
this.speechBubble.setAlpha(0);
@@ -239730,8 +239731,11 @@ class GameMasterFace {
239730239731
});
239731239732
}
239732239733
_redrawSpeechBubble(graphicsObject, message, color, offsetX, offsetY) {
239733-
const speechBubbleMinWidth = 50; // Minimum width of the speech bubble
239734-
const speechBubbleWidth = speechBubbleMinWidth + message.text.length * 19; // 19px per character is a good amount
239734+
const speechBubbleMinWidth = 50;
239735+
const pixelPerCharacter = 19; // 19px per character is a good amount
239736+
const speechBubbleMaxWidth = this.mainScene.sys.canvas.width - 200;
239737+
const speechBubbleExtraWidth = message.text.length * pixelPerCharacter < speechBubbleMaxWidth ? message.text.length * pixelPerCharacter : speechBubbleMaxWidth;
239738+
const speechBubbleWidth = speechBubbleMinWidth + speechBubbleExtraWidth;
239735239739
const speechBubbleExtraHeight = message.height > 50 ? message.height : 0;
239736239740
graphicsObject.clear();
239737239741
graphicsObject.fillStyle(color, 1);

quick-letter/index.b7a05eb9.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)