1
0
forked from noxious/client

Merge remote-tracking branch 'origin/main' into feature/#321

This commit is contained in:
Colin Kallemein 2025-02-07 19:59:58 +01:00
commit b35794d6d3
8 changed files with 14 additions and 14 deletions

View File

@ -1,5 +1,5 @@
VITE_NAME=Noxious VITE_NAME=Noxious
VITE_DEVELOPMENT=true VITE_ENVIRONMENT=development
VITE_SERVER_ENDPOINT=http://localhost:4000 VITE_SERVER_ENDPOINT=http://localhost:4000
VITE_TILE_SIZE_WIDTH=64 VITE_TILE_SIZE_WIDTH=64
VITE_TILE_SIZE_HEIGHT=32 VITE_TILE_SIZE_HEIGHT=32

View File

@ -9,17 +9,17 @@ COPY . .
ARG VITE_NAME=${VITE_NAME} ARG VITE_NAME=${VITE_NAME}
ENV VITE_NAME=${VITE_NAME} ENV VITE_NAME=${VITE_NAME}
ARG VITE_DEVELOPMENT=${VITE_DEVELOPMENT} ARG VITE_ENVIRONMENT=${VITE_ENVIRONMENT}
ENV VITE_DEVELOPMENT=${VITE_DEVELOPMENT} ENV VITE_ENVIRONMENT=${VITE_ENVIRONMENT}
ARG VITE_SERVER_ENDPOINT=${VITE_SERVER_ENDPOINT} ARG VITE_SERVER_ENDPOINT=${VITE_SERVER_ENDPOINT}
ENV VITE_SERVER_ENDPOINT=${VITE_SERVER_ENDPOINT} ENV VITE_SERVER_ENDPOINT=${VITE_SERVER_ENDPOINT}
ARG VITE_TILE_SIZE_X=${VITE_TILE_SIZE_X} ARG VITE_TILE_SIZE_WIDTH=${VITE_TILE_SIZE_WIDTH}
ENV VITE_TILE_SIZE_X=${VITE_TILE_SIZE_X} ENV VITE_TILE_SIZE_WIDTH=${VITE_TILE_SIZE_WIDTH}
ARG VITE_TILE_SIZE_Y=${VITE_TILE_SIZE_Y} ARG VITE_TILE_SIZE_HEIGHT=${VITE_TILE_SIZE_HEIGHT}
ENV VITE_TILE_SIZE_Y=${VITE_TILE_SIZE_Y} ENV VITE_TILE_SIZE_HEIGHT=${VITE_TILE_SIZE_HEIGHT}
# Build the application # Build the application
RUN npm run build-ntc RUN npm run build-ntc

View File

@ -1,6 +1,6 @@
export default { export default {
name: import.meta.env.VITE_NAME, name: import.meta.env.VITE_NAME,
development: import.meta.env.VITE_DEVELOPMENT === 'true', environment: import.meta.env.VITE_ENVIRONMENT,
server_endpoint: import.meta.env.VITE_SERVER_ENDPOINT, server_endpoint: import.meta.env.VITE_SERVER_ENDPOINT,
tile_size: { tile_size: {
width: Number(import.meta.env.VITE_TILE_SIZE_WIDTH), width: Number(import.meta.env.VITE_TILE_SIZE_WIDTH),

View File

@ -49,7 +49,7 @@ const handleFileUpload = (e: Event) => {
if (!files) return if (!files) return
gameStore.connection?.emit('gm:mapObject:upload', files, (response: boolean) => { gameStore.connection?.emit('gm:mapObject:upload', files, (response: boolean) => {
if (!response) { if (!response) {
if (config.development) console.error('Failed to upload object') if (config.environment === 'development') console.error('Failed to upload map object')
return return
} }

View File

@ -42,7 +42,7 @@ const elementToScroll = ref()
function newButtonClickHandler() { function newButtonClickHandler() {
gameStore.connection?.emit('gm:sprite:create', {}, (response: boolean) => { gameStore.connection?.emit('gm:sprite:create', {}, (response: boolean) => {
if (!response) { if (!response) {
if (config.development) console.error('Failed to create new sprite') if (config.environment === 'development') console.error('Failed to create new sprite')
return return
} }

View File

@ -49,7 +49,7 @@ const handleFileUpload = (e: Event) => {
if (!files) return if (!files) return
gameStore.connection?.emit('gm:tile:upload', files, (response: boolean) => { gameStore.connection?.emit('gm:tile:upload', files, (response: boolean) => {
if (!response) { if (!response) {
if (config.development) console.error('Failed to upload tile') if (config.environment === 'development') console.error('Failed to upload tile')
return return
} }

View File

@ -26,11 +26,11 @@
</div> </div>
<div class="form-field-half"> <div class="form-field-half">
<label for="originX">Origin X</label> <label for="originX">Origin X</label>
<input class="input-field" v-model="mapObjectOriginX" name="originX" id="originX" type="number" min="0.0" step="0.1" /> <input class="input-field" v-model="mapObjectOriginX" name="originX" id="originX" type="number" min="0.0" step="0.01" />
</div> </div>
<div class="form-field-half"> <div class="form-field-half">
<label for="originY">Origin Y</label> <label for="originY">Origin Y</label>
<input class="input-field" v-model="mapObjectOriginY" name="originY" id="originY" type="number" min="0.0" step="0.1" /> <input class="input-field" v-model="mapObjectOriginY" name="originY" id="originY" type="number" min="0.0" step="0.01" />
</div> </div>
</div> </div>
<button class="btn-cyan px-4 py-1.5 min-w-24" @click="handleUpdate">Save</button> <button class="btn-cyan px-4 py-1.5 min-w-24" @click="handleUpdate">Save</button>

View File

@ -74,7 +74,7 @@ export const useGameStore = defineStore('game', {
}, },
initConnection() { initConnection() {
this.connection = io(config.server_endpoint, { this.connection = io(config.server_endpoint, {
secure: !config.development, secure: !config.environment.includes('development'),
withCredentials: true, withCredentials: true,
transports: ['websocket'], transports: ['websocket'],
reconnectionAttempts: 5 reconnectionAttempts: 5