1
0
forked from noxious/client

Merge remote-tracking branch 'origin/main' into feature/151-broken-zoom

This commit is contained in:
Dennis Postma 2024-09-28 20:30:36 +02:00
commit 9e96b2b32a
3 changed files with 29 additions and 1 deletions

View File

@ -4,6 +4,24 @@ WORKDIR /usr/src/app
COPY package*.json ./
RUN npm ci
COPY . .
# Set environment variables
ARG VITE_NAME=${VITE_NAME}
ENV VITE_NAME=${VITE_NAME}
ARG VITE_DEVELOPMENT=${VITE_DEVELOPMENT}
ENV VITE_DEVELOPMENT=${VITE_DEVELOPMENT}
ARG VITE_SERVER_ENDPOINT=${VITE_SERVER_ENDPOINT}
ENV VITE_SERVER_ENDPOINT=${VITE_SERVER_ENDPOINT}
ARG VITE_TILE_SIZE_X=${VITE_TILE_SIZE_X}
ENV VITE_TILE_SIZE_X=${VITE_TILE_SIZE_X}
ARG VITE_TILE_SIZE_Y=${VITE_TILE_SIZE_Y}
ENV VITE_TILE_SIZE_Y=${VITE_TILE_SIZE_Y}
# Build the application
RUN npm run build-ntc
# Production stage

View File

@ -60,7 +60,7 @@ const gameConfig = {
name: 'New Quest',
width: window.innerWidth,
height: window.innerHeight,
type: Phaser.WEBGL, // AUTO, CANVAS, WEBGL, HEADLESS
type: Phaser.AUTO, // AUTO, CANVAS, WEBGL, HEADLESS
mode: Phaser.Scale.RESIZE,
resolution: 3,
render: { pixelArt: true, antialias: false }
@ -73,6 +73,15 @@ const createGame = (game: Phaser.Game) => {
addEventListener('resize', () => {
game.scale.resize(window.innerWidth, window.innerHeight)
})
// We don't support canvas mode, only WebGL
if (game.renderer.type === Phaser.CANVAS) {
gameStore.addNotification({
title: 'Warning',
message: 'Your browser does not support WebGL. Please use a modern browser like Chrome, Firefox, or Edge.'
})
gameStore.disconnectSocket()
}
}
const preloadScene = async (scene: Phaser.Scene) => {

View File

@ -1,5 +1,6 @@
export type Notification = {
id?: string
title?: string
message?: string
}