mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-02 04:18:29 +00:00
fixed bug
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
},
|
||||
{
|
||||
"key": "gold",
|
||||
"text": "Please give me golds!",
|
||||
"text": "Please give me gold!",
|
||||
"requiresPlayer": false
|
||||
},
|
||||
{
|
||||
@@ -133,5 +133,32 @@
|
||||
"text": "When will my PR finally get merged...?",
|
||||
"requiresPlayer": false
|
||||
}
|
||||
],
|
||||
"warnings": [
|
||||
{
|
||||
"key": "strong",
|
||||
"text": "[P1] is strong.",
|
||||
"requiresPlayer": true
|
||||
},
|
||||
{
|
||||
"key": "weak",
|
||||
"text": "[P1] is weak.",
|
||||
"requiresPlayer": true
|
||||
},
|
||||
{
|
||||
"key": "mirv_soon",
|
||||
"text": "[P1] can launch a MIRV soon!",
|
||||
"requiresPlayer": true
|
||||
},
|
||||
{
|
||||
"key": "number1_warning",
|
||||
"text": "The #1 player will win soon unless we team up!",
|
||||
"requiresPlayer": false
|
||||
},
|
||||
{
|
||||
"key": "stalemate",
|
||||
"text": "Let's make peace. This is a stalemate, we will both lose.",
|
||||
"requiresPlayer": false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ export function createRenderer(
|
||||
eventsDisplay.clientID = clientID;
|
||||
|
||||
const chatDisplay = document.querySelector("chat-display") as ChatDisplay;
|
||||
if (!(eventsDisplay instanceof ChatDisplay)) {
|
||||
if (!(chatDisplay instanceof ChatDisplay)) {
|
||||
consolex.error("chat display not found");
|
||||
}
|
||||
chatDisplay.eventBus = eventBus;
|
||||
|
||||
@@ -26,6 +26,8 @@ export class ChatDisplay extends LitElement implements Layer {
|
||||
public game: GameView;
|
||||
public clientID: ClientID;
|
||||
|
||||
private active: boolean = false;
|
||||
|
||||
private updateMap = new Map([
|
||||
[GameUpdateType.DisplayEvent, (u) => this.onDisplayMessageEvent(u)],
|
||||
]);
|
||||
@@ -78,6 +80,7 @@ export class ChatDisplay extends LitElement implements Layer {
|
||||
init() {}
|
||||
|
||||
tick() {
|
||||
this.active = true;
|
||||
const updates = this.game.updatesSinceLastTick();
|
||||
const messages = updates[GameUpdateType.DisplayEvent] as
|
||||
| DisplayMessageUpdate[]
|
||||
@@ -109,6 +112,8 @@ export class ChatDisplay extends LitElement implements Layer {
|
||||
if (this.chatEvents.length > 100) {
|
||||
this.chatEvents = this.chatEvents.slice(-100);
|
||||
}
|
||||
|
||||
this.requestUpdate();
|
||||
}
|
||||
|
||||
private getChatContent(
|
||||
@@ -120,6 +125,9 @@ export class ChatDisplay extends LitElement implements Layer {
|
||||
}
|
||||
|
||||
render() {
|
||||
if (!this.active) {
|
||||
return html``;
|
||||
}
|
||||
return html`
|
||||
<div
|
||||
class="${this._hidden
|
||||
|
||||
@@ -62,6 +62,7 @@ export class ChatModal extends LitElement {
|
||||
{ id: "defend", name: "Defend" },
|
||||
{ id: "greet", name: "Greetings" },
|
||||
{ id: "misc", name: "Miscellaneous" },
|
||||
{ id: "warnings", name: "Warnings" },
|
||||
];
|
||||
|
||||
private getPhrasesForCategory(categoryId: string) {
|
||||
|
||||
Reference in New Issue
Block a user