Merge tag 'v0.24.11' into main

This commit is contained in:
Scott Anderson
2025-08-01 00:27:29 -04:00
10 changed files with 58 additions and 54 deletions
+9
View File
@@ -6,6 +6,7 @@ import { GameView, PlayerView } from "../../../core/game/GameView";
import quickChatData from "../../../../resources/QuickChat.json";
import { EventBus } from "../../../core/EventBus";
import { CloseViewEvent } from "../../InputHandler";
import { SendQuickChatEvent } from "../../Transport";
import { translateText } from "../../Utils";
@@ -172,6 +173,14 @@ export class ChatModal extends LitElement {
`;
}
initEventBus() {
this.eventBus.on(CloseViewEvent, (e) => {
if (!this.hidden) {
this.close();
}
});
}
private selectCategory(categoryId: string) {
this.selectedCategory = categoryId;
this.selectedPhraseText = null;
+6 -1
View File
@@ -5,7 +5,7 @@ import { AllPlayers } from "../../../core/game/Game";
import { GameView, PlayerView } from "../../../core/game/GameView";
import { TerraNulliusImpl } from "../../../core/game/TerraNulliusImpl";
import { emojiTable, flattenedEmojiTable } from "../../../core/Util";
import { ShowEmojiMenuEvent } from "../../InputHandler";
import { CloseViewEvent, ShowEmojiMenuEvent } from "../../InputHandler";
import { SendEmojiIntentEvent } from "../../Transport";
import { TransformHandler } from "../TransformHandler";
@@ -48,6 +48,11 @@ export class EmojiTable extends LitElement {
this.hideTable();
});
});
this.eventBus.on(CloseViewEvent, (e) => {
if (!this.hidden) {
this.hideTable();
}
});
}
private onEmojiClicked: (emoji: string) => void = () => {};
+5 -1
View File
@@ -13,7 +13,7 @@ import { AllPlayers, PlayerActions } from "../../../core/game/Game";
import { TileRef } from "../../../core/game/GameMap";
import { GameView, PlayerView } from "../../../core/game/GameView";
import { flattenedEmojiTable } from "../../../core/Util";
import { MouseUpEvent } from "../../InputHandler";
import { CloseViewEvent, MouseUpEvent } from "../../InputHandler";
import {
SendAllianceRequestIntentEvent,
SendBreakAllianceIntentEvent,
@@ -167,6 +167,10 @@ export class PlayerPanel extends LitElement implements Layer {
init() {
this.eventBus.on(MouseUpEvent, () => this.hide());
this.eventBus.on(CloseViewEvent, (e) => {
this.hide();
});
this.ctModal = document.querySelector("chat-modal") as ChatModal;
}
+4
View File
@@ -1,6 +1,7 @@
import * as d3 from "d3";
import backIcon from "../../../../resources/images/BackIconWhite.svg";
import { EventBus, GameEvent } from "../../../core/EventBus";
import { CloseViewEvent } from "../../InputHandler";
import { Layer } from "./Layer";
import {
CenterButtonElement,
@@ -102,6 +103,9 @@ export class RadialMenu implements Layer {
init() {
this.createMenuElement();
this.createTooltipElement();
this.eventBus.on(CloseViewEvent, (e) => {
this.hideRadialMenu();
});
}
private createMenuElement() {
+2 -35
View File
@@ -1,6 +1,5 @@
import { LitElement, css, html } from "lit";
import { customElement, state } from "lit/decorators.js";
import logo from "../../../../resources/images/ofm/logo_MASTER_2025.png";
import { translateText } from "../../../client/Utils";
import { EventBus } from "../../../core/EventBus";
import { GameUpdateType } from "../../../core/game/GameUpdates";
@@ -22,9 +21,6 @@ export class WinModal extends LitElement implements Layer {
@state()
showButtons = false;
@state()
private showSteamContent = Math.random() > 0.5;
private _title: string;
// Override to prevent shadow DOM creation
@@ -142,9 +138,7 @@ export class WinModal extends LitElement implements Layer {
return html`
<div class="win-modal ${this.isVisible ? "visible" : ""}">
<h2>${this._title || ""}</h2>
${this.showSteamContent
? this.steamWishlist()
: this.openfrontMasters()}
${this.innerHtml()}
<div
class="button-container ${this.showButtons ? "visible" : "hidden"}"
>
@@ -159,7 +153,7 @@ export class WinModal extends LitElement implements Layer {
`;
}
steamWishlist() {
innerHtml() {
return html`<p>
<a
href="https://store.steampowered.com/app/3560670"
@@ -180,33 +174,6 @@ export class WinModal extends LitElement implements Layer {
</p>`;
}
openfrontMasters() {
return html`<p>
<img
src="${logo}"
alt="OpenFront Masters"
style="max-width: 100%; height: auto; margin-bottom: 16px;"
/>
<a
href="https://discord.gg/gStsGh5vWR"
target="_blank"
rel="noopener noreferrer"
style="
color: #4a9eff;
text-decoration: underline;
font-weight: 500;
transition: color 0.2s ease;
font-size: 24px;
"
onmouseover="this.style.color='#6db3ff'"
onmouseout="this.style.color='#4a9eff'"
>
Watch the best compete in the
<span style="font-weight: bold;">OpenFront Masters</span>
</a>
</p>`;
}
show() {
this.eventBus.emit(new GutterAdModalEvent(true));
setTimeout(() => {