Add setting for displaying players above/below other markers (Fixes #14)

This commit is contained in:
James Lyne 2021-07-20 20:27:07 +01:00
parent 2598f1794e
commit fbe252472f
4 changed files with 10 additions and 10 deletions

View File

@ -57,7 +57,7 @@ function buildServerConfig(response: any): DynmapServerConfig {
} }
function buildMessagesConfig(response: any): LiveAtlasMessageConfig { function buildMessagesConfig(response: any): LiveAtlasMessageConfig {
const liveAtlasMessages = window.liveAtlasConfig ? window.liveAtlasConfig.messages || {} : {}; const liveAtlasMessages = window.liveAtlasConfig?.messages || {};
return { return {
chatPlayerJoin: response.joinmessage || '', chatPlayerJoin: response.joinmessage || '',

View File

@ -42,12 +42,17 @@ export default defineComponent({
playerPane = props.leaflet.createPane('players'), playerPane = props.leaflet.createPane('players'),
players = computed(() => store.state.players), players = computed(() => store.state.players),
playerCount = computed(() => store.state.players.size), playerCount = computed(() => store.state.players.size),
playersAboveMarkers = computed(() => store.state.ui.playersAboveMarkers),
componentSettings = computed(() => store.state.components.playerMarkers), componentSettings = computed(() => store.state.components.playerMarkers),
layerGroup = new LayerGroup([],{ layerGroup = new LayerGroup([],{
pane: 'players' pane: 'players'
}); });
watch(playerCount, (newValue) => playerPane.classList.toggle('no-animations', newValue > 150)) watch(playerCount, (newValue) => playerPane.classList.toggle('no-animations', newValue > 150));
if(playersAboveMarkers.value) {
playerPane.style.zIndex = '600';
}
return { return {
players, players,
@ -80,7 +85,3 @@ export default defineComponent({
} }
}) })
</script> </script>
<style scoped>
</style>

View File

@ -15,7 +15,3 @@
} }
} }
} }
.leaflet-players-pane {
z-index: 600;
}

View File

@ -69,6 +69,7 @@ export type State = {
updateTimestamp: Date; updateTimestamp: Date;
ui: { ui: {
playersAboveMarkers: boolean;
smallScreen: boolean; smallScreen: boolean;
visibleElements: Set<LiveAtlasUIElement>; visibleElements: Set<LiveAtlasUIElement>;
previouslyVisibleElements: Set<LiveAtlasUIElement>; previouslyVisibleElements: Set<LiveAtlasUIElement>;
@ -221,6 +222,8 @@ export const state: State = {
updateTimestamp: new Date(), updateTimestamp: new Date(),
ui: { ui: {
playersAboveMarkers: window.liveAtlasConfig?.ui?.playersAboveMarkers || false,
smallScreen: false, smallScreen: false,
visibleElements: new Set(), visibleElements: new Set(),
previouslyVisibleElements: new Set(), previouslyVisibleElements: new Set(),