Support Pl3xmap custom world icons
This commit is contained in:
parent
ca1d90a739
commit
8f794d044f
@ -23,7 +23,8 @@
|
||||
v-bind:value="[world.name,map.name]" v-model="currentMap"
|
||||
:aria-labelledby="`${name}-${world.name}-${key}-label`">
|
||||
<label :id="`${name}-${world.name}-${key}-label`" class="map" :for="`${name}-${world.name}-${key}`" :title="`${world.displayName} - ${map.displayName}`">
|
||||
<SvgIcon :name="map.getIcon()"></SvgIcon>
|
||||
<img v-if="map.hasCustomIcon()" :src="map.getIcon()" alt="" />
|
||||
<SvgIcon v-else :name="map.getIcon()"></SvgIcon>
|
||||
</label>
|
||||
</template>
|
||||
</div>
|
||||
@ -110,7 +111,7 @@ export default defineComponent({
|
||||
height: 3.2rem;
|
||||
margin-right: 0.5rem;
|
||||
|
||||
.svg-icon {
|
||||
.svg-icon, img {
|
||||
top: 0.2rem !important;
|
||||
right: 0.2rem !important;
|
||||
bottom: 0.2rem !important;
|
||||
|
@ -91,10 +91,18 @@ export default class LiveAtlasMapDefinition {
|
||||
: {x: latLng.lng / this.scale, y: y, z: -latLng.lat / this.scale};
|
||||
}
|
||||
|
||||
hasCustomIcon(): boolean {
|
||||
return !!this.icon;
|
||||
}
|
||||
|
||||
getIcon(): string {
|
||||
let worldType: string,
|
||||
mapType: string;
|
||||
|
||||
if(this.icon) {
|
||||
return this.icon;
|
||||
}
|
||||
|
||||
switch(this.world.dimension) {
|
||||
case 'nether':
|
||||
worldType = 'nether';
|
||||
|
@ -142,7 +142,7 @@ export default class Pl3xmapMapProvider extends MapProvider {
|
||||
background: 'transparent',
|
||||
backgroundDay: 'transparent',
|
||||
backgroundNight: 'transparent',
|
||||
icon: undefined,
|
||||
icon: world.icon ? `${this.config.pl3xmap}images/icon/${world.icon}.png` : undefined,
|
||||
imageFormat: 'png',
|
||||
name: 'flat',
|
||||
displayName: 'Flat',
|
||||
|
@ -42,7 +42,7 @@
|
||||
line-height: 2rem;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
|
||||
.svg-icon {
|
||||
.svg-icon, img {
|
||||
display: inline-block;
|
||||
max-width: 3rem;
|
||||
max-height: 3rem;
|
||||
|
Loading…
Reference in New Issue
Block a user