forked from noxious/client
#165 : Show message if player runs in canvas mode, then disconnect
This commit is contained in:
parent
2a34c7eea9
commit
8eec2e12ce
@ -60,7 +60,7 @@ const gameConfig = {
|
|||||||
name: 'New Quest',
|
name: 'New Quest',
|
||||||
width: window.innerWidth,
|
width: window.innerWidth,
|
||||||
height: window.innerHeight,
|
height: window.innerHeight,
|
||||||
type: Phaser.WEBGL, // AUTO, CANVAS, WEBGL, HEADLESS
|
type: Phaser.AUTO, // AUTO, CANVAS, WEBGL, HEADLESS
|
||||||
mode: Phaser.Scale.RESIZE,
|
mode: Phaser.Scale.RESIZE,
|
||||||
resolution: 3,
|
resolution: 3,
|
||||||
render: { pixelArt: true, antialias: false }
|
render: { pixelArt: true, antialias: false }
|
||||||
@ -73,6 +73,15 @@ const createGame = (game: Phaser.Game) => {
|
|||||||
addEventListener('resize', () => {
|
addEventListener('resize', () => {
|
||||||
game.scale.resize(window.innerWidth, window.innerHeight)
|
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) => {
|
const preloadScene = async (scene: Phaser.Scene) => {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
export type Notification = {
|
export type Notification = {
|
||||||
id?: string
|
id?: string
|
||||||
|
title?: string
|
||||||
message?: string
|
message?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user