Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added resources/images/OfmWintersLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion resources/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,13 @@
"exit": "Exit Game",
"keep": "Keep Playing",
"spectate": "Spectate",
"wishlist": "Wishlist on Steam!"
"wishlist": "Wishlist on Steam!",
"ofm_winter": "OpenFront Masters Winter Tournament!",
"ofm_winter_description": "Join the competitive tournament and compete against the best players",
"join_tournament": "Join Tournament",
"join_discord": "Join Our Discord Community!",
"discord_description": "Connect with other players, get updates, and share strategies",
"join_server": "Join Server"
},
"leaderboard": {
"title": "Leaderboard",
Expand Down
63 changes: 61 additions & 2 deletions src/client/graphics/layers/WinModal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { LitElement, TemplateResult, html } from "lit";
import { customElement, state } from "lit/decorators.js";
import ofmWintersLogo from "../../../../resources/images/OfmWintersLogo.png";
import { isInIframe, translateText } from "../../../client/Utils";
import { ColorPalette, Pattern } from "../../../core/CosmeticSchemas";
import { EventBus } from "../../../core/EventBus";
Expand Down Expand Up @@ -100,10 +101,19 @@ export class WinModal extends LitElement implements Layer {
}

innerHtml() {
if (isInIframe() || this.rand < 0.25) {
if (isInIframe()) {
return this.steamWishlist();
}
return this.renderPatternButton();

if (this.rand < 0.25) {
return this.steamWishlist();
} else if (this.rand < 0.5) {
return this.ofmDisplay();
} else if (this.rand < 0.75) {
return this.discordDisplay();
} else {
return this.renderPatternButton();
}
}

renderPatternButton() {
Expand Down Expand Up @@ -190,6 +200,55 @@ export class WinModal extends LitElement implements Layer {
</p>`;
}

ofmDisplay(): TemplateResult {
return html`
<div class="text-center mb-6 bg-black/30 p-2.5 rounded">
<h3 class="text-xl font-semibold text-white mb-3">
${translateText("win_modal.ofm_winter")}
</h3>
<div class="mb-3">
<img
src=${ofmWintersLogo}
alt="OpenFront Masters Winter"
class="mx-auto max-w-full h-auto max-h-[200px] rounded"
/>
</div>
<p class="text-white mb-3">
${translateText("win_modal.ofm_winter_description")}
</p>
<a
href="https://discord.gg/wXXJshB8Jt"
target="_blank"
rel="noopener noreferrer"
class="inline-block px-6 py-3 bg-green-600 text-white rounded font-semibold transition-all duration-200 hover:bg-green-700 hover:-translate-y-px no-underline"
>
${translateText("win_modal.join_tournament")}
</a>
</div>
`;
}

discordDisplay(): TemplateResult {
return html`
<div class="text-center mb-6 bg-black/30 p-2.5 rounded">
<h3 class="text-xl font-semibold text-white mb-3">
${translateText("win_modal.join_discord")}
</h3>
<p class="text-white mb-3">
${translateText("win_modal.discord_description")}
</p>
<a
href="https://discord.com/invite/openfront"
target="_blank"
rel="noopener noreferrer"
class="inline-block px-6 py-3 bg-indigo-600 text-white rounded font-semibold transition-all duration-200 hover:bg-indigo-700 hover:-translate-y-px no-underline"
>
${translateText("win_modal.join_server")}
</a>
</div>
`;
}

async show() {
await this.loadPatternContent();
this.isVisible = true;
Expand Down
Loading