Move player count/max into playersHeading

This commit is contained in:
James Lyne 2021-07-28 22:27:43 +01:00
parent 4350fae1d5
commit 4feb46c641
2 changed files with 7 additions and 3 deletions

View File

@ -16,7 +16,7 @@
<template> <template>
<CollapsibleSection name="players" class="players"> <CollapsibleSection name="players" class="players">
<template v-slot:heading>{{ messageHeading }} [{{ players.length }}/{{ maxPlayers }}]</template> <template v-slot:heading>{{ messageHeading }}</template>
<template v-slot:default> <template v-slot:default>
<div class="section__content"> <div class="section__content">
<input v-if="players && searchEnabled" id="players__search" type="text" name="search" <input v-if="players && searchEnabled" id="players__search" type="text" name="search"
@ -49,7 +49,11 @@ export default defineComponent({
setup() { setup() {
const store = useStore(), const store = useStore(),
messageHeading = computed(() => store.state.messages.playersHeading), messageHeading = computed(() => {
return store.state.messages.playersHeading
.replace('{cur}', players.value.length)
.replace('{max}', maxPlayers.value);
}),
messageSkeletonPlayers = computed(() => store.state.messages.playersSkeleton), messageSkeletonPlayers = computed(() => store.state.messages.playersSkeleton),
messageSkeletonPlayersSearch = computed(() => store.state.messages.playersSearchSkeleton), messageSkeletonPlayersSearch = computed(() => store.state.messages.playersSearchSkeleton),
messagePlayersSearchPlaceholder = computed(() => store.state.messages.playersSearchPlaceholder), messagePlayersSearchPlaceholder = computed(() => store.state.messages.playersSearchPlaceholder),

View File

@ -78,7 +78,7 @@ export default class DynmapMapProvider extends MapProvider {
chatErrorRequiresLogin: response['msg-chatrequireslogin'] || '', chatErrorRequiresLogin: response['msg-chatrequireslogin'] || '',
chatErrorCooldown: response.spammessage || '', chatErrorCooldown: response.spammessage || '',
worldsHeading: response['msg-maptypes'] || '', worldsHeading: response['msg-maptypes'] || '',
playersHeading: response['msg-players'] || '', playersHeading: response['msg-players'] ? `${response['msg-players']} ({cur}/{max})` : '',
} }
} }