started working on fixing typescript errors
This commit is contained in:
parent
f6ea46a3b5
commit
f038b6787f
@ -6,6 +6,7 @@
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "run-p type-check \"build-only {@}\" --",
|
||||
"build-ntc": "run-p \"build-only {@}\" --",
|
||||
"preview": "vite preview",
|
||||
"test:unit": "vitest",
|
||||
"build-only": "vite build",
|
||||
|
@ -34,8 +34,8 @@ let mapData = new Phaser.Tilemaps.MapData({
|
||||
format: Phaser.Tilemaps.Formats.ARRAY_2D,
|
||||
});
|
||||
let tileMap = new Phaser.Tilemaps.Tilemap(scene, mapData);
|
||||
let tileset: (Tileset|null) = tileMap.addTilesetImage('default', 'tiles');
|
||||
let layer = tileMap.createBlankLayer('layer', tileset, 0, config.tile_size.y);
|
||||
let tileset: any = tileMap.addTilesetImage('default', 'tiles');
|
||||
let layer: (typeof TilemapLayer|null) = tileMap.createBlankLayer('layer', tileset, 0, config.tile_size.y);
|
||||
|
||||
// center camera
|
||||
const centerY = (tileMap.height * tileMap.tileHeight) / 2
|
||||
|
@ -1,6 +1,6 @@
|
||||
export default {
|
||||
name: 'New Quest',
|
||||
server_endpoint: 'http://localhost:3000',
|
||||
server_endpoint: 'https://680760d68d724d.lhr.life',
|
||||
development: true,
|
||||
width: 960,
|
||||
height: 540,
|
||||
@ -16,4 +16,4 @@ export default {
|
||||
TALK: 110000,
|
||||
TRANSITION: 900000
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ export default class Map implements IMap {
|
||||
}
|
||||
|
||||
public addPlayer(player: Player) {
|
||||
// @ts-ignore
|
||||
this.players.push(player);
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@ import { defineStore } from 'pinia';
|
||||
export const useMapStore = defineStore('gameMap', {
|
||||
state: () => ({
|
||||
loaded: false,
|
||||
tiles: null,
|
||||
tiles: undefined,
|
||||
players: {}
|
||||
}),
|
||||
getters: {
|
||||
|
@ -5,6 +5,7 @@
|
||||
* https://pinia.vuejs.org/
|
||||
*/
|
||||
import { defineStore } from 'pinia';
|
||||
import {useMapStore} from '@/stores/map'
|
||||
import { io, Socket } from 'socket.io-client';
|
||||
import config from '@/config';
|
||||
import axios from 'axios';
|
||||
@ -70,16 +71,5 @@ export const useSocketStore = defineStore('socket', {
|
||||
this.socket = null;
|
||||
}
|
||||
},
|
||||
|
||||
getMap() {
|
||||
if (this.socket) {
|
||||
this.socket.emit('get_map');
|
||||
this.socket.on('map', (map) => {
|
||||
const mapStore = useMapStore();
|
||||
// Get map from server
|
||||
mapStore.setMap(map);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -9,7 +9,8 @@
|
||||
],
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"noEmit": true,
|
||||
"noEmit": false,
|
||||
"noEmitOnError": false,
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
||||
|
||||
"module": "ESNext",
|
||||
|
2
vite.config.d.ts
vendored
Normal file
2
vite.config.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
declare const _default: import("vite").UserConfig;
|
||||
export default _default;
|
16
vite.config.js
Normal file
16
vite.config.js
Normal file
@ -0,0 +1,16 @@
|
||||
import { fileURLToPath, URL } from 'node:url';
|
||||
import { defineConfig } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import VueDevTools from 'vite-plugin-vue-devtools';
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
vue(),
|
||||
VueDevTools(),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
}
|
||||
}
|
||||
});
|
2
vitest.config.d.ts
vendored
Normal file
2
vitest.config.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
declare const _default: Record<string, any>;
|
||||
export default _default;
|
10
vitest.config.js
Normal file
10
vitest.config.js
Normal file
@ -0,0 +1,10 @@
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { mergeConfig, defineConfig, configDefaults } from 'vitest/config';
|
||||
import viteConfig from './vite.config';
|
||||
export default mergeConfig(viteConfig, defineConfig({
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
exclude: [...configDefaults.exclude, 'e2e/*'],
|
||||
root: fileURLToPath(new URL('./', import.meta.url))
|
||||
}
|
||||
}));
|
Loading…
x
Reference in New Issue
Block a user