Skip to content
16 changes: 10 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,21 @@
<div
class="left-0 bottom-0 sm:left-4 sm:bottom-4 w-full flex-col-reverse sm:flex-row z-50 md:w-[320px] fixed pointer-events-none"
>
<div
class="w-full md:w-2/3 md:fixed sm:right-0 md:bottom-0 md:flex flex-col items-end pointer-events-none"
>
<chat-display></chat-display>
<events-display></events-display>
</div>
<div>
<control-panel></control-panel>
</div>
</div>

<div
class="fixed right-0 bottom-0 sm:right-4 sm:bottom-4 z-50 flex flex-row items-end pointer-events-none"
>
<alliance-request-panel></alliance-request-panel>
<div class="flex flex-col items-end">
<chat-display></chat-display>
<events-display></events-display>
</div>
</div>

<!-- Game modals and overlays -->
<emoji-table></emoji-table>
<build-menu></build-menu>
Expand Down
11 changes: 11 additions & 0 deletions src/client/graphics/GameRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { TransformHandler } from "./TransformHandler";
import { UIState } from "./UIState";
import { AdTimer } from "./layers/AdTimer";
import { AlertFrame } from "./layers/AlertFrame";
import { AllianceRequestPanel } from "./layers/AllianceRequestPanel";
import { BuildMenu } from "./layers/BuildMenu";
import { ChatDisplay } from "./layers/ChatDisplay";
import { ChatModal } from "./layers/ChatModal";
Expand Down Expand Up @@ -122,6 +123,15 @@ export function createRenderer(
eventsDisplay.game = game;
eventsDisplay.uiState = uiState;

const allianceRequestPanel = document.querySelector(
"alliance-request-panel",
) as AllianceRequestPanel;
if (!(allianceRequestPanel instanceof AllianceRequestPanel)) {
console.error("alliance request panel not found");
}
allianceRequestPanel.eventBus = eventBus;
allianceRequestPanel.game = game;

const chatDisplay = document.querySelector("chat-display") as ChatDisplay;
if (!(chatDisplay instanceof ChatDisplay)) {
console.error("chat display not found");
Expand Down Expand Up @@ -261,6 +271,7 @@ export function createRenderer(
new DynamicUILayer(game, transformHandler, eventBus),
new NameLayer(game, transformHandler, eventBus),
eventsDisplay,
allianceRequestPanel,
chatDisplay,
buildMenu,
new MainRadialMenu(
Expand Down
Loading
Loading