Move grayHiddenPlayers to playerMarkers component

This commit is contained in:
James Lyne 2021-07-28 23:52:03 +01:00
parent 7bff12b729
commit b3f186a197
3 changed files with 3 additions and 2 deletions

View File

@ -44,7 +44,7 @@ export default defineComponent({
setup(props) {
const store = useStore(),
otherWorld = computed(() => {
return store.state.configuration.grayHiddenPlayers
return store.state.components.playerMarkers?.grayHiddenPlayers
&& !props.player.hidden
&& (!store.state.currentWorld || store.state.currentWorld.name !== props.player.location.world);
}),

1
src/index.d.ts vendored
View File

@ -280,6 +280,7 @@ interface LiveAtlasPartialComponentConfig {
}
interface LiveAtlasPlayerMarkerConfig {
grayHiddenPlayers: boolean;
hideByDefault: boolean;
layerName: string;
layerPriority: number;

View File

@ -56,7 +56,6 @@ export default class DynmapMapProvider extends MapProvider {
private static buildServerConfig(response: any): LiveAtlasServerConfig {
return {
grayHiddenPlayers: response.grayplayerswhenhidden || false,
defaultMap: response.defaultmap || undefined,
defaultWorld: response.defaultworld || undefined,
defaultZoom: response.defaultzoom || 0,
@ -172,6 +171,7 @@ export default class DynmapMapProvider extends MapProvider {
case "playermarkers":
components.playerMarkers = {
grayHiddenPlayers: response.grayplayerswhenhidden || false,
hideByDefault: component.hidebydefault || false,
layerName: component.label || "Players",
layerPriority: component.layerprio || 0,