Add option to disable marker UI
This commit is contained in:
parent
bc71650ec4
commit
9bac5f601d
@ -177,6 +177,9 @@
|
||||
|
||||
// Disable the map right click menu
|
||||
disableContextMenu: false,
|
||||
|
||||
// Disable the markers button and list
|
||||
disableMarkerUI: false,
|
||||
},
|
||||
|
||||
// Config version. Do not modify.
|
||||
|
@ -24,7 +24,7 @@
|
||||
@click="handleSectionClick" @keydown="handleSectionKeydown">
|
||||
<SvgIcon :name="mapCount > 1 ? 'maps' : 'servers'"></SvgIcon>
|
||||
</button>
|
||||
<button class="button--markers" data-section="markers"
|
||||
<button v-if="markerUIEnabled" class="button--markers" data-section="markers"
|
||||
:title="messageMarkers"
|
||||
:aria-label="messageMarkers"
|
||||
:aria-expanded="markersVisible"
|
||||
@ -93,6 +93,7 @@ export default defineComponent({
|
||||
messageMarkers = computed(() => store.state.messages.markersHeading),
|
||||
messagePlayers = computed(() => store.getters.playersHeading),
|
||||
|
||||
markerUIEnabled = computed(() => store.getters.markerUIEnabled),
|
||||
playerMakersEnabled = computed(() => store.getters.playerMarkersEnabled),
|
||||
|
||||
playersVisible = computed(() => currentlyVisible.value.has('players')),
|
||||
@ -165,6 +166,7 @@ export default defineComponent({
|
||||
markersVisible,
|
||||
followVisible,
|
||||
playerMakersEnabled,
|
||||
markerUIEnabled,
|
||||
|
||||
handleSidebarKeydown,
|
||||
handleSectionKeydown,
|
||||
|
1
src/index.d.ts
vendored
1
src/index.d.ts
vendored
@ -124,6 +124,7 @@ interface LiveAtlasUIConfig {
|
||||
playersSearch: boolean;
|
||||
compactPlayerMarkers: boolean;
|
||||
disableContextMenu: boolean;
|
||||
disableMarkerUI: boolean;
|
||||
}
|
||||
|
||||
export type LiveAtlasUIElement = 'layers' | 'chat' | LiveAtlasSidebarSection;
|
||||
|
@ -20,6 +20,7 @@ import {getMinecraftTime, getUrlForLocation} from "@/util";
|
||||
|
||||
export type Getters = {
|
||||
playerMarkersEnabled(state: State): boolean;
|
||||
markerUIEnabled(state: State): boolean;
|
||||
coordinatesControlEnabled(state: State): boolean;
|
||||
clockControlEnabled(state: State): boolean;
|
||||
loginEnabled(state: State): boolean;
|
||||
@ -35,6 +36,10 @@ export const getters: GetterTree<State, State> & Getters = {
|
||||
return state.components.players.markers !== undefined;
|
||||
},
|
||||
|
||||
markerUIEnabled(state: State): boolean {
|
||||
return !state.ui.disableMarkerUI;
|
||||
},
|
||||
|
||||
coordinatesControlEnabled(state: State): boolean {
|
||||
return state.components.coordinatesControl !== undefined;
|
||||
},
|
||||
|
@ -134,6 +134,10 @@ export const mutations: MutationTree<State> & Mutations = {
|
||||
state.ui.disableContextMenu = uiConfig.disableContextMenu;
|
||||
}
|
||||
|
||||
if(typeof uiConfig.disableMarkerUI === 'boolean') {
|
||||
state.ui.disableMarkerUI = uiConfig.disableMarkerUI;
|
||||
}
|
||||
|
||||
if(typeof uiConfig.playersSearch === 'boolean') {
|
||||
state.ui.playersSearch = uiConfig.playersSearch;
|
||||
}
|
||||
|
@ -87,6 +87,7 @@ export type State = {
|
||||
playersSearch: boolean;
|
||||
compactPlayerMarkers: boolean;
|
||||
disableContextMenu: boolean;
|
||||
disableMarkerUI: boolean;
|
||||
|
||||
screenWidth: number;
|
||||
screenHeight: number;
|
||||
@ -228,6 +229,7 @@ export const state: State = {
|
||||
playersSearch: true,
|
||||
compactPlayerMarkers: false,
|
||||
disableContextMenu: false,
|
||||
disableMarkerUI: false,
|
||||
|
||||
screenWidth: window.innerWidth,
|
||||
screenHeight: window.innerHeight,
|
||||
|
Loading…
Reference in New Issue
Block a user