Wynncraft Wiki
(Undo revision 141967 by FrozenEarth (talk))
Tag: Undo
(testing fix to also coordinate input to also generate map links)
Line 1: Line 1:
 
<includeonly>
 
<includeonly>
{{#vardefine:x| {{#explode: {{{coordinates|}}} |,| 0 }} }}{{#vardefine:y| {{#explode: {{{coordinates|}}} |,| 1 }} }}{{#vardefine:z| {{#explode: {{{coordinates|}}} |,| 2 }} }}{{#vardefine: mapZoom | {{#iferror: {{#expr: {{{mapZoom|2}}}}} | {{{mapZoom|2}}} | -{{{mapZoom|2}}}}}}} <!-- Checks if the mapZoom is a number and puts a negative sign infront if it is
+
{{#vardefine:x| {{{x|}}}{{#explode: {{{coordinates|}}} |,| 0 }} }}{{#vardefine:y| {{{y|}}}{{#explode: {{{coordinates|}}} |,| 1 }} }}{{#vardefine:z| {{{z|}}}{{#explode: {{{coordinates|}}} |,| 2 }} }}{{#vardefine: mapZoom | {{#iferror: {{#expr: {{{mapZoom|2}}}}} | {{{mapZoom|2}}} | -{{{mapZoom|2}}}}}}} <!-- Checks if the mapZoom is a number and puts a negative sign infront if it is
-->{{#vardefine: mapLink | [https://map.wynncraft.com/#/{{{x|}}}{{#var:x|}}/{{{y|50}}}{{#var:y|}}/{{{z|}}}{{#var:z|}}/{{#var: mapZoom}}/wynn-main/Wynncraft {{{mapLabel|Wynncraft Map}}}]}} <!-- Creates the map link
+
-->{{#vardefine: mapLink | [https://map.wynncraft.com/#/{{#var:x|}}/{{#var:y|50}}/{{#var:z|}}/{{#var: mapZoom}}/wynn-main/Wynncraft {{{mapLabel|Wynncraft Map}}}]}} <!-- Creates the map link
 
-->{| class="wikitable" cellpadding="2" cellspacing="0"
 
-->{| class="wikitable" cellpadding="2" cellspacing="0"
 
{{#if:{{{location|}}}|{{!}} style="background: #5f9433; color: #FFFFFF; text-shadow: 0 1px 2px #89d44a; font-size: 0.8em;" {{!}} &nbsp;{{{locationLabel|Location}}}&nbsp;
 
{{#if:{{{location|}}}|{{!}} style="background: #5f9433; color: #FFFFFF; text-shadow: 0 1px 2px #89d44a; font-size: 0.8em;" {{!}} &nbsp;{{{locationLabel|Location}}}&nbsp;
 
{{!}} style="font-size: 1.0em;" {{!}} &nbsp;'''{{{location|}}}'''&nbsp;}}
 
{{!}} style="font-size: 1.0em;" {{!}} &nbsp;'''{{{location|}}}'''&nbsp;}}
{{!}} style="{{#if:{{{x|}}}{{#var:x|}}| |display: none;}} user-select: none; background: #5f9433; color: #FFFFFF; text-shadow: 0 1px 2px #89d44a; font-size: 0.8em;" {{!}} &nbsp;X&nbsp;
+
{{!}} style="{{#if:{{#var:x|}}| |display: none;}} user-select: none; background: #5f9433; color: #FFFFFF; text-shadow: 0 1px 2px #89d44a; font-size: 0.8em;" {{!}} &nbsp;X&nbsp;
{{!}} style="{{#if:{{{x|}}}{{#var:x|}}| |display: none;}} font-size: 1.0em;" {{!}} &nbsp;{{{x|}}}{{#var:x}}
+
{{!}} style="{{#if:{{#var:x|}}| |display: none;}} font-size: 1.0em;" {{!}} &nbsp;{{#var:x}}
{{!}} style="{{#if:{{{y|}}}{{#var:y|}}| |display: none;}} user-select: none; background: #5f9433; color: #FFFFFF; text-shadow: 0 1px 2px #89d44a; font-size: 0.8em;" {{!}} &nbsp;Y&nbsp;
+
{{!}} style="{{#if:{{#var:y|}}| |display: none;}} user-select: none; background: #5f9433; color: #FFFFFF; text-shadow: 0 1px 2px #89d44a; font-size: 0.8em;" {{!}} &nbsp;Y&nbsp;
{{!}} style="{{#if:{{{y|}}}{{#var:y|}}| |display: none;}} font-size: 1.0em;" {{!}} &nbsp;{{{y|}}}{{#var:y}}
+
{{!}} style="{{#if:{{#var:y|}}| |display: none;}} font-size: 1.0em;" {{!}} &nbsp;{{#var:y}}
{{!}} style="{{#if:{{{z|}}}{{#var:z|}}| |display: none;}} user-select: none; background: #5f9433; color: #FFFFFF; text-shadow: 0 1px 2px #89d44a; font-size: 0.8em;" {{!}} &nbsp;Z&nbsp;
+
{{!}} style="{{#if:{{#var:z|}}| |display: none;}} user-select: none; background: #5f9433; color: #FFFFFF; text-shadow: 0 1px 2px #89d44a; font-size: 0.8em;" {{!}} &nbsp;Z&nbsp;
{{!}} style="{{#if:{{{z|}}}{{#var:z|}}| |display: none;}} font-size: 1.0em;" {{!}} &nbsp;{{{z|}}}{{#var:z}}
+
{{!}} style="{{#if:{{#var:z|}}| |display: none;}} font-size: 1.0em;" {{!}} &nbsp;{{#var:z}}
{{!}} style="{{#ifexpr: {{{mapZoom|2}}} != 0 and {{{x|10000}}} < 1600 and {{{x|-10000}}} > -2400 and {{{z|10000}}} > -5900 and {{{z|-10000}}} < 0 | |display: none;}} font-size: 1.0em;" {{!}} &nbsp;{{#var: mapLink}}&nbsp;
+
{{!}} style="{{#ifexpr: {{{mapZoom|2}}} != 0 and {{#var:x|10000}} < 1600 and {{#var:x|-10000}} > -2400 and {{#var:z|10000}} > -5900 and {{#var:z|-10000}} < 0 | |display: none;}} font-size: 1.0em;" {{!}} &nbsp;{{#var: mapLink}}&nbsp;
 
|}</includeonly><noinclude>[[Category:Table templates]]{{Doc}}</noinclude>
 
|}</includeonly><noinclude>[[Category:Table templates]]{{Doc}}</noinclude>

Revision as of 02:08, 31 July 2021

Template-info.png Documentation

Description

A location and co-ordinate template, for quickly and easily placing Wynncraft co-ordinates onto a page in a style that matches the rest of the site. It also provides a link to the official Wynncraft map at the provided coordinates. The map link will show if the following rules are met:

  • x is between -2400 and 1600
  • z is between 0 and -5900
  • mapZoom is not 0

Usage

{{Location
| locationLabel =
| location =
| x =
| y =
| z =
| mapZoom =
| mapLabel =
}}


Argument Description Default Value
locationLabel The label used for the location header (Used for translation purposes) Location
location The location name to be displayed
x The X coordinate to be displayed
y The Y coordinate to be displayed
z The Z coordinate to be displayed
mapZoom Specifies the map link zoom level 2
  • Possible Values: max, 1, 2, 3, 4, 5.
  • Requires x and z values to also be set for the map link to work.
mapLabel The label used for the map hyperlink (Used for translation purposes) Wynncraft Map


Examples

{{Location
|location=Almuj
}}

Produces:

 Location   Almuj   X     Y     Z     Wynncraft Map 
{{Location
|x=978
|y=70
|z=-1927
}}

Produces:

 X   978  Y   70  Z   -1927  Wynncraft Map 
{{Location
|x=978
|y=70
|z=-1927
|mapZoom=max
}}

Produces:

 X   978  Y   70  Z   -1927  Wynncraft Map 
{{Location
|location=Almuj
|x=978
|z=-1927
}}

Produces:

 Location   Almuj   X   978  Y     Z   -1927  Wynncraft Map 
{{Location
|location=Almuj
|x=978
|z=-1927
|mapZoom=0
}}

Produces:

 Location   Almuj   X   978  Y     Z   -1927  Wynncraft Map 
{{Location|
location=Almuj
|locationlabel=Emplacement
|x=978
|z=-1927
|mapZoom=2
|mapLabel=Wynncraft Carte
}}

Produces:

 Location   Almuj   X   978  Y     Z   -1927  Wynncraft Carte