Remove per world default zoom, use per map instead
This commit is contained in:
parent
4473b35f7d
commit
625e44a048
@ -204,8 +204,6 @@ export default defineComponent({
|
|||||||
viewTarget.zoom = store.state.parsedUrl?.zoom;
|
viewTarget.zoom = store.state.parsedUrl?.zoom;
|
||||||
} else if(typeof store.state.currentMap?.defaultZoom !== 'undefined') { //Map default zoom
|
} else if(typeof store.state.currentMap?.defaultZoom !== 'undefined') { //Map default zoom
|
||||||
viewTarget.zoom = store.state.currentMap?.defaultZoom;
|
viewTarget.zoom = store.state.currentMap?.defaultZoom;
|
||||||
}else if(typeof newValue.defaultZoom !== 'undefined') { //World default zoom
|
|
||||||
viewTarget.zoom = newValue.defaultZoom;
|
|
||||||
} else { //Global default zoom
|
} else { //Global default zoom
|
||||||
viewTarget.zoom = store.state.configuration.defaultZoom;
|
viewTarget.zoom = store.state.configuration.defaultZoom;
|
||||||
}
|
}
|
||||||
@ -220,8 +218,6 @@ export default defineComponent({
|
|||||||
if(viewTarget.zoom == null) {
|
if(viewTarget.zoom == null) {
|
||||||
if(typeof store.state.currentMap?.defaultZoom !== 'undefined') { //Map default zoom
|
if(typeof store.state.currentMap?.defaultZoom !== 'undefined') { //Map default zoom
|
||||||
viewTarget.zoom = store.state.currentMap?.defaultZoom;
|
viewTarget.zoom = store.state.currentMap?.defaultZoom;
|
||||||
} else if(typeof newValue.defaultZoom !== 'undefined') { //World default zoom
|
|
||||||
viewTarget.zoom = newValue.defaultZoom;
|
|
||||||
} else { //Global default zoom
|
} else { //Global default zoom
|
||||||
viewTarget.zoom = store.state.configuration.defaultZoom;
|
viewTarget.zoom = store.state.configuration.defaultZoom;
|
||||||
}
|
}
|
||||||
|
4
src/index.d.ts
vendored
4
src/index.d.ts
vendored
@ -152,12 +152,10 @@ interface LiveAtlasSortedPlayers extends Array<LiveAtlasPlayer> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface LiveAtlasWorldDefinition {
|
interface LiveAtlasWorldDefinition {
|
||||||
seaLevel: number;
|
|
||||||
name: string;
|
name: string;
|
||||||
displayName: string;
|
displayName: string;
|
||||||
dimension: LiveAtlasDimension;
|
dimension: LiveAtlasDimension;
|
||||||
center: Coordinate;
|
seaLevel: number;
|
||||||
defaultZoom?: number;
|
|
||||||
maps: Set<LiveAtlasMapDefinition>;
|
maps: Set<LiveAtlasMapDefinition>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,6 @@ export default class OverviewerMapProvider extends MapProvider {
|
|||||||
displayName: world,
|
displayName: world,
|
||||||
dimension: guessWorldDimension(world),
|
dimension: guessWorldDimension(world),
|
||||||
seaLevel: 64,
|
seaLevel: 64,
|
||||||
center: {x: 0, y: 64, z: 0},
|
|
||||||
maps: new Set<LiveAtlasMapDefinition>(),
|
maps: new Set<LiveAtlasMapDefinition>(),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -176,8 +176,6 @@ export default class Pl3xmapMapProvider extends MapProvider {
|
|||||||
displayName: world.display_name || world.name,
|
displayName: world.display_name || world.name,
|
||||||
dimension,
|
dimension,
|
||||||
seaLevel: 0,
|
seaLevel: 0,
|
||||||
center: {x: worldResponse.spawn.x, y: 0, z: worldResponse.spawn.z},
|
|
||||||
defaultZoom: worldResponse.zoom.def || 1,
|
|
||||||
maps,
|
maps,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -198,7 +196,10 @@ export default class Pl3xmapMapProvider extends MapProvider {
|
|||||||
|
|
||||||
nativeZoomLevels: worldResponse.zoom.max || 1,
|
nativeZoomLevels: worldResponse.zoom.max || 1,
|
||||||
extraZoomLevels: worldResponse.zoom.extra,
|
extraZoomLevels: worldResponse.zoom.extra,
|
||||||
|
defaultZoom: worldResponse.zoom.def || 1,
|
||||||
tileUpdateInterval: worldResponse.tiles_update_interval ? worldResponse.tiles_update_interval * 1000 : undefined,
|
tileUpdateInterval: worldResponse.tiles_update_interval ? worldResponse.tiles_update_interval * 1000 : undefined,
|
||||||
|
|
||||||
|
center: {x: worldResponse.spawn.x, y: 0, z: worldResponse.spawn.z},
|
||||||
})));
|
})));
|
||||||
|
|
||||||
worlds.push(w);
|
worlds.push(w);
|
||||||
|
@ -98,11 +98,6 @@ export function buildWorlds(response: Configuration, config: DynmapUrlConfig): A
|
|||||||
displayName: world.title || '',
|
displayName: world.title || '',
|
||||||
dimension: guessWorldDimension(world.name),
|
dimension: guessWorldDimension(world.name),
|
||||||
seaLevel: world.sealevel || 64,
|
seaLevel: world.sealevel || 64,
|
||||||
center: {
|
|
||||||
x: world.center.x || 0,
|
|
||||||
y: world.center.y || 0,
|
|
||||||
z: world.center.z || 0
|
|
||||||
},
|
|
||||||
maps: new Set(),
|
maps: new Set(),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -148,6 +143,12 @@ export function buildWorlds(response: Configuration, config: DynmapUrlConfig): A
|
|||||||
backgroundDay: map.backgroundday || '#000000',
|
backgroundDay: map.backgroundday || '#000000',
|
||||||
backgroundNight: map.backgroundnight || '#000000',
|
backgroundNight: map.backgroundnight || '#000000',
|
||||||
|
|
||||||
|
center: {
|
||||||
|
x: world.center.x || 0,
|
||||||
|
y: world.center.y || 0,
|
||||||
|
z: world.center.z || 0
|
||||||
|
},
|
||||||
|
|
||||||
nativeZoomLevels,
|
nativeZoomLevels,
|
||||||
extraZoomLevels: map.mapzoomin
|
extraZoomLevels: map.mapzoomin
|
||||||
})) as LiveAtlasMapDefinition;
|
})) as LiveAtlasMapDefinition;
|
||||||
|
Loading…
Reference in New Issue
Block a user