Template:ItemLink: Difference between revisions
Streetclaw (talk | contribs) (Optimized) |
Streetclaw (talk | contribs) (Food icons added) |
||
Line 25: | Line 25: | ||
Check if level set or level exist (levelList) | Check if level set or level exist (levelList) | ||
-->{{#ifeq:{{#expr:{{#if:{{{level|}}}|1|0}} or {{#if:{{ItemLink/levelList|{{{1}}}}}|1|0}}}}|1|<div style="text-align: center; background-color: #E7E7E7; border: 1px solid #aaa; border-radius: 6px; color: #6D6D6D; display: inline-block; width: 28px; height: 22px; margin-right: 2px; line-height: 22px; font-size: 10px">LV<sub style="margin-left: 1px">{{#if:{{{level|}}}|{{{level}}}|{{ItemLink/levelList|{{{1}}}}}}}</sub></div>}}}}<!-- | -->{{#ifeq:{{#expr:{{#if:{{{level|}}}|1|0}} or {{#if:{{ItemLink/levelList|{{{1}}}}}|1|0}}}}|1|<div style="text-align: center; background-color: #E7E7E7; border: 1px solid #aaa; border-radius: 6px; color: #6D6D6D; display: inline-block; width: 28px; height: 22px; margin-right: 2px; line-height: 22px; font-size: 10px">LV<sub style="margin-left: 1px">{{#if:{{{level|}}}|{{{level}}}|{{ItemLink/levelList|{{{1}}}}}}}</sub></div>}}}}<!-- | ||
3. icon | 3. food icon | ||
-->{{#ifeq:{{WsBool|{{{noFoodIcon}}}}}|0|<!-- | |||
Check if foodIcon set or food icon exist (foodIconList) | |||
-->{{#ifeq:{{#expr:{{#if:{{{foodIcon|}}}|1|0}} or {{#if:{{ItemLink/foodIconList|{{{1}}}}}|1|0}}}}|1|<div style="display: inline-block; margin-right: 2px">{{#if:{{{foodIcon|}}}|{{{foodIcon}}}|{{ItemLink/foodIconList|{{{1}}}}}}}</div>}}}}<!-- | |||
4. icon | |||
-->{{#ifeq:{{WsBool|{{{noIcon}}}}}|0|<div style="display: inline-block; margin-right: 2px">{{ItemLink/iconList|{{{1}}}}}</div>}}<!-- | -->{{#ifeq:{{WsBool|{{{noIcon}}}}}|0|<div style="display: inline-block; margin-right: 2px">{{ItemLink/iconList|{{{1}}}}}</div>}}<!-- | ||
5. rename category | |||
-->{{#ifeq:{{#expr:{{WsBool|{{{noRename}}}}} or {{#if:{{{showName|}}}|1|0}}}}|0|{{#ifeq:{{ItemLink/nameList|{{{1}}}}}|{{{1}}}||[[Category:AutoRenamedItem]]}}}}<!-- | -->{{#ifeq:{{#expr:{{WsBool|{{{noRename}}}}} or {{#if:{{{showName|}}}|1|0}}}}|0|{{#ifeq:{{ItemLink/nameList|{{{1}}}}}|{{{1}}}||[[Category:AutoRenamedItem]]}}}}<!-- | ||
6. link start | |||
-->{{#ifeq:{{WsBool|{{{noLink}}}}}|0|{{lo}}{{ItemLink/linkList|{{{1}}}}}{{ItemLink/anchorList|{{{1}}}}}{{!}}}}<!-- | -->{{#ifeq:{{WsBool|{{{noLink}}}}}|0|{{lo}}{{ItemLink/linkList|{{{1}}}}}{{ItemLink/anchorList|{{{1}}}}}{{!}}}}<!-- | ||
7. name | |||
-->{{#if:{{{showName|}}}|{{{showName}}}|{{#ifeq:{{WsBool|{{{noRename}}}}}|1|{{{1}}}|{{#ifeq:{{ItemLink/nameList|{{{1}}}}}|{{{1}}}|{{{1}}}|{{ItemLink/nameList|{{{1}}}}}<sub>r</sub>}}}}}}<!-- | -->{{#if:{{{showName|}}}|{{{showName}}}|{{#ifeq:{{WsBool|{{{noRename}}}}}|1|{{{1}}}|{{#ifeq:{{ItemLink/nameList|{{{1}}}}}|{{{1}}}|{{{1}}}|{{ItemLink/nameList|{{{1}}}}}<sub>r</sub>}}}}}}<!-- | ||
8. link end | |||
-->{{#ifeq:{{WsBool|{{{noLink}}}}}|0|{{lc}}}}<!-- | -->{{#ifeq:{{WsBool|{{{noLink}}}}}|0|{{lc}}}}<!-- | ||
9. nowrap end | |||
-->{{#ifeq:{{WsBool|{{{nowrap}}}|1}}|1|</span>}}<!-- | -->{{#ifeq:{{WsBool|{{{nowrap}}}|1}}|1|</span>}}<!-- | ||
(end) ------------------ | (end) ------------------ | ||
-->}}}}}}</includeonly> | -->}}}}}}</includeonly> |
Revision as of 09:18, 15 July 2017
File:Lua logo.svg | This template uses Lua: |
This is a template for adding links to items.
About
Add a link to the Item. There are many possibitities to customize the behavior.
Parameter
Item name
Do not use named parameter for 1
... x
. The first Parameter will be automatically marked as 1
, the second as 2
and so on.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Item Name | 1
|
Item name
|
String | Required |
Name Override | showName
|
Shows the defined name/Overrides the Item-Name (alternative Name)
|
String | Optional |
See Template:TemplateData and Template:TemplateData/entry for more information about the parameter list and DDNCode for more information about types and the DDN Notation
Hide and show elements
Do not use named parameter for 1
... x
. The first Parameter will be automatically marked as 1
, the second as 2
and so on.
Parameter | Description | Type | Status | |
---|---|---|---|---|
No Icon | noIcon
|
Hides the Icon
|
Boolean | Optional |
No Link | noLink
|
Removes the link
|
Boolean | Optional |
No level | noLevel
|
Hides the level
|
Boolean | Optional |
Show Food Icon | showFoodIcon
|
Show the food icon
|
Boolean | Optional |
See Template:TemplateData and Template:TemplateData/entry for more information about the parameter list and DDNCode for more information about types and the DDN Notation
Wrap behavior
Do not use named parameter for 1
... x
. The first Parameter will be automatically marked as 1
, the second as 2
and so on.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Disable brakes | nowrap
|
disable or enable Nowrap (prevent line breaks)
|
Boolean | Optional |
See Template:TemplateData and Template:TemplateData/entry for more information about the parameter list and DDNCode for more information about types and the DDN Notation
Custom Level
The associated equipment level is shown by default. Use the option only for an deviating equipment level or for adding a level to non equipment items.
Do not use named parameter for 1
... x
. The first Parameter will be automatically marked as 1
, the second as 2
and so on.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Level override | level
|
Set a custom level to display.
|
[ Number | "ascended" ] | Optional |
See Template:TemplateData and Template:TemplateData/entry for more information about the parameter list and DDNCode for more information about types and the DDN Notation
Custom Food icon
The food icon is hidden by default see Hide and show elements for showing the associated food icon.
Do not use named parameter for 1
... x
. The first Parameter will be automatically marked as 1
, the second as 2
and so on.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Food icon override | foodIcon
|
Set a custom food icon
|
String | Optional |
See Template:TemplateData and Template:TemplateData/entry for more information about the parameter list and DDNCode for more information about types and the DDN Notation
Disable auto-rename
Do not use named parameter for 1
... x
. The first Parameter will be automatically marked as 1
, the second as 2
and so on.
Parameter | Description | Type | Status | |
---|---|---|---|---|
No Rename | noRename
|
disable or enable noRename (prevent auto-rename)
|
Boolean | Optional |
See Template:TemplateData and Template:TemplateData/entry for more information about the parameter list and DDNCode for more information about types and the DDN Notation
Return information (internal use)
Do not use named parameter for 1
... x
. The first Parameter will be automatically marked as 1
, the second as 2
and so on.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Level return (Data override) | levelOverride
|
disable or enable levelOverride (return the level)
|
Boolean | Optional |
Level return (allow ascended) | allowAscended
|
Allow returning
|
Boolean | Optional |
See Template:TemplateData and Template:TemplateData/entry for more information about the parameter list and DDNCode for more information about types and the DDN Notation
Special Items
Code | Result |
---|---|
{{ItemLink|Health Pickup}} |
[[Template:ItemLink/linkListTemplate:ItemLink/anchorList|Health Pickup]] |
Invalid Item
If an item is misspelled, does not exist or simply has not been added to the template will show a broken icon.
Name
Names containing special characters (#
) are not supported. Remove them and use showName
for this characters.
It is possible that the name appears different than that entered one:
{{ItemLink|Rauser}}Rauser will be displayed as
* {{ItemLink|Rauser}} * {{ItemLink|-Rauser}} * {{ItemLink|Rauser|showName=No Rauser}} * {{ItemLink|Rauser|noRename=1}}
- LV01[[Template:ItemLink/linkListTemplate:ItemLink/anchorList|-Rauserr]]
- LV01[[Template:ItemLink/linkListTemplate:ItemLink/anchorList|-Rauser]]
- LV01[[Template:ItemLink/linkListTemplate:ItemLink/anchorList|No Rauser]]
- LV01[[Template:ItemLink/linkListTemplate:ItemLink/anchorList|Rauser]]
Wikimedia supports linktrail which allows to add specific characters to an link:
[[Hedgehag]]s
{{ItemLink|Veggie Set}}sresults in [[Template:ItemLink/linkListTemplate:ItemLink/anchorList|Veggie Set]]s
Under specific conditions (parameter nowrap=0 is needed) Linktrail is supported by ItemLink:
{{ItemLink|Veggie Set|nowrap=0}}s[[Template:ItemLink/linkListTemplate:ItemLink/anchorList|Veggie Set]]s
If nowrap is necessary:
{{Nowrap|{{ItemLink|Veggie Set|nowrap=0}}s}}[[Template:ItemLink/linkListTemplate:ItemLink/anchorList|Veggie Set]]s
Linktrail and renamed Items:
{{ItemLink|Rauser|nowrap=0}}s
Item Lists
List | Description |
---|---|
Module:ItemLink/nameList | Contains all Items which should be Renamed |
Module:ItemLink/levelList | Contains all Level data |
Module:ItemLink/foodIconList | Contains all Food icons |
Rules for the Item Lists
- All Items should be sorted by Id (That ist the position of the Entry inside the item-database.json. Alternative: ItemViewer on Github) - Path to item-database.json:
- Mac OS
- Open the .app package (Context Menu - show package)
- Navigate to Contents/Resources/app.nw/data/item-database.json
- Windows
- Create a copy of your Game (.exe)
- Rename .exe to .zip
- Unpack the zip file
- Navigate to Contents/Resources/app.nw/data/item-database.json
- Mac OS
- Only subsections should be editied
- Achor Nameing rules:
- Whitspace = _
- English Item-names only
- Only use the special characters _ and -
- Remove all other special Chars like ' . , # ; < > ( ) { } / \
- Remove all - if they are at first position: -Item -> Item
- Don't be shy. If there is a missing Item, add it.
Examples
Code | Result |
---|---|
{{ItemLink|Winterclaw}} |
LV26 [[Template:ItemLink/linkListTemplate:ItemLink/anchorList|Winterclaw]]
|
{{ItemLink|Geo-Data 3469|showName=Geo-Data #3469}} |
[[Template:ItemLink/linkListTemplate:ItemLink/anchorList|Geo-Data #3469]] |
{{ItemLink|Recruit's Scope}} |
LV11 [[Template:ItemLink/linkListTemplate:ItemLink/anchorList|Recruit's Scope]]
|
{{ItemLink|Ginger Tom. Salad|showName=Blattsalat|noLink=1}} |
Blattsalat |
Raw Example text
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum. [[Template:ItemLink/linkListTemplate:ItemLink/anchorList|Thief's Key]] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmodtempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
No description.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Item Name | 1 | Item name
| String | required |
Name Override | showName | Shows the defined name/Overrides the Item-Name (alternative Name)
| String | optional |
No Icon | noIcon | Hides the Icon
| Boolean | optional |
No Link | noLink | Removes the link
| Boolean | optional |
No level | noLevel | Hides the level
| Boolean | optional |
Show Food Icon | showFoodIcon | Show the food icon
| Boolean | optional |
Disable brakes | nowrap | disable or enable Nowrap (prevent line breaks)
| Boolean | optional |
Level override | level | Set a custom level to display.
| Content | optional |
Food icon override | foodIcon | Set a custom food icon
| String | optional |
No Rename | noRename | disable or enable noRename (prevent auto-rename)
| Boolean | optional |
Level return (Data override) | levelOverride | disable or enable levelOverride (return the level)
| Boolean | optional |
Level return (allow ascended) | allowAscended | Allow returning <code>ascended</code> when <code>levelOverride</code> is <code>1</code>.<br />Lua modules should use <code>[[mw:Extension:Scribunto/Lua_reference_manual#mw.loadData|mw.loadData]]("[[Module:ItemLink/levelList]]")</code> directly.
| Boolean | optional |