add spawn ads (#1228)

## Description:

Adds a bottom rail add during the spawn phase if player has played over
5 games.
Also only show the death screen ad if player has played a couple of
games.

This keeps the experience ad-free for the first few games.
<img width="1003" alt="74fb6676-273d-4b58-9fcb-50ec438c4e27"
src="https://github.com/user-attachments/assets/fedca20f-7b31-4a06-be57-bde5bd0118f0"
/>

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:
evan

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
evanpelle
2025-06-19 10:36:46 -07:00
committed by GitHub
co-authored by coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
parent 51eccf512b
commit e58bc89b67
6 changed files with 60 additions and 42 deletions
+6 -8
View File
@@ -16,7 +16,6 @@ import { GutterAdModal } from "./layers/GutterAdModal";
import { HeadsUpMessage } from "./layers/HeadsUpMessage";
import { Layer } from "./layers/Layer";
import { Leaderboard } from "./layers/Leaderboard";
import { LeftInGameAd } from "./layers/LeftInGameAd";
import { MainRadialMenu } from "./layers/MainRadialMenu";
import { MultiTabModal } from "./layers/MultiTabModal";
import { NameLayer } from "./layers/NameLayer";
@@ -24,6 +23,7 @@ import { OptionsMenu } from "./layers/OptionsMenu";
import { PlayerInfoOverlay } from "./layers/PlayerInfoOverlay";
import { PlayerPanel } from "./layers/PlayerPanel";
import { ReplayPanel } from "./layers/ReplayPanel";
import { SpawnAd } from "./layers/SpawnAd";
import { SpawnTimer } from "./layers/SpawnTimer";
import { StructureLayer } from "./layers/StructureLayer";
import { TeamStats } from "./layers/TeamStats";
@@ -198,13 +198,11 @@ export function createRenderer(
unitInfoModal.structureLayer = structureLayer;
// unitInfoModal.eventBus = eventBus;
const leftInGameAd = document.querySelector(
"left-in-game-ad",
) as LeftInGameAd;
if (!(leftInGameAd instanceof LeftInGameAd)) {
console.error("left in game ad not found");
const spawnAd = document.querySelector("spawn-ad") as SpawnAd;
if (!(spawnAd instanceof SpawnAd)) {
console.error("spawn ad not found");
}
leftInGameAd.g = game;
spawnAd.g = game;
const gutterAdModal = document.querySelector(
"gutter-ad-modal",
@@ -249,7 +247,7 @@ export function createRenderer(
headsUpMessage,
unitInfoModal,
multiTabModal,
leftInGameAd,
spawnAd,
gutterAdModal,
];