Difference between revisions of "Template:Weapon Display"

From Dungeon Defenders 2 Wiki
Jump to: navigation, search
m
(Reworking this template to be self contained in a div)
Line 1: Line 1:
<includeonly>
+
<!-- <includeonly><div style="display:flex; justify-content: center; text-align: center;"> -->
{{#tag: gallery |
+
<includeonly><div style="text-align: center;"><!---
{{#if: {{{image|}}}
+
--->{{#tag: gallery |
  | {{{image}}}
+
        {{#if: {{{image|}}}
  | File:{{{name}}}.png
+
        | {{{image}}}
}}|heights = 200px | style = transform: rotate({{{rotation|0}}}deg)
+
        | File:{{{name}}}.png
}}
+
        }}|heights = 200px | style = transform: rotate({{{rotation|0}}}deg)
{{#if: {{{icon|}}}
+
    }}<!---
  | [[{{{icon}}}|35px]]
+
--->{{#if: {{{icon|}}} | [[{{{icon}}}|35px]] | [[File:{{{name}}} Icon.png|35px]]}} '''{{{name|Weapon Name?}}}'''<br><!---
  | [[File:{{{name}}} Icon.png|35px]]
+
--->{{#if: {{{note|}}} | <sub>''{{{note}}}''</sub><br>}}<!---
}} '''{{{name|Weapon Name?}}}'''<br>
+
--->{{#if: {{{shot_types|}}} | <sub>'''''Shot types:''' {{{shot_types}}}''</sub><br>}}<!---
{{#if: {{{note|}}}
+
---><sub class="currency-included">'''''Acquired From:'''<br>{{{acquisition|Standard Loot Drops}}}''</sub>
  | <sub>''{{{note}}}''</sub><br>
+
</div></includeonly><noinclude><!---
}}
+
===========================================================================================================================
{{#if: {{{shot_types|}}}
+
--->===Technical Details===
  | <sub>'''''Shot types:''' {{{shot_types}}}''</sub><br>
 
}}
 
<sub class="currency-included">'''''Acquired From:'''<br>{{{acquisition|Standard Loot Drops}}}''</sub><!--
 
--></includeonly><noinclude>
 
* '''This Template may not produce the desired output if not placed in a table with text align set to center. Refer to weapons pages such as [[Polearms]] for examples.'''<br>
 
 
* If '''image''' and '''icon''' are not provided, they will be inferred from the '''name'''.
 
* If '''image''' and '''icon''' are not provided, they will be inferred from the '''name'''.
** '''The automatic detection for image and icon will stop working after 50 uses of this template on a single page, due to limitations with the #ifexist function that this template uses.'''
 
  
 
===Parameters===
 
===Parameters===
Line 42: Line 36:
 
|}
 
|}
  
===Example===
+
===Examples===
{| style="width:80%;"
+
{| style="width:95%;"
 
! style="font-size:150%; width: 50%;" | Wiki Text
 
! style="font-size:150%; width: 50%;" | Wiki Text
 
! style="font-size:150%; width: 50%;" | Result
 
! style="font-size:150%; width: 50%;" | Result
 
|-
 
|-
|<div style="display: flex; justify-content: center;"><!---
+
|<code class="tempdoc-code-block"><nowiki>
---><code style="display: table; white-space: pre-wrap;"><!---
+
{{Weapon Display
    ---><nowiki>
+
| name = Protean Staff
 
+
| rotation = 40
      {| style="text-align:center;"
+
| note = Comes with Shrinkinator Unique Enemy Kill Animation
      |-
+
| shot_types = Burst Shot
      |
+
| acquisition = The Emporium for 250 gems
      {{Weapon Display
+
}}
      | name = Protean Staff
 
      | rotation = 40
 
      | note = Comes with Shrinkinator Unique Enemy Kill Animation
 
      | shot_types = Burst Shot
 
      | acquisition = The Emporium for 250 gems
 
      }}
 
      |}
 
  
        </nowiki><!---
+
</nowiki></code>
---></code>
 
</div>
 
|<div style="display: flex; justify-content: center;">
 
<div>
 
{| style="text-align:center;"
 
|-
 
 
|
 
|
 +
<div style="display:flex; justify-content: center;">
 
{{Weapon Display
 
{{Weapon Display
 
| name = Protean Staff
 
| name = Protean Staff
Line 78: Line 60:
 
| acquisition = The Emporium for 250 gems
 
| acquisition = The Emporium for 250 gems
 
}}
 
}}
|}
 
</div>
 
 
</div>
 
</div>
 
|}
 
|}
 +
 
__NOEDITSECTION__
 
__NOEDITSECTION__
 
</noinclude>
 
</noinclude>

Revision as of 22:25, 3 April 2025

Technical Details

  • If image and icon are not provided, they will be inferred from the name.

Parameters

Parameter Required Description Default
name TickGreen.png The name of the weapon. Weapon Name?
image CrossWhite.png The image for the weapon. File:{{{name}}}.png
rotation CrossWhite.png How many degrees to rotate the weapon image display by. 0
icon CrossWhite.png The icon for the weapon. File:{{{name}}} Icon.png
note CrossWhite.png Additional notes about the weapon. Nothing
shot_types CrossWhite.png Valid shot types for the weapon. Nothing
acquisition CrossWhite.png Acquisition for the weapon. "Standard Loot Drops"

Examples

Wiki Text Result
{{Weapon Display | name = Protean Staff | rotation = 40 | note = Comes with Shrinkinator Unique Enemy Kill Animation | shot_types = Burst Shot | acquisition = The Emporium for 250 gems }}
Protean Staff.pngProtean Staff Icon.png Protean Staff
Comes with Shrinkinator Unique Enemy Kill Animation
Shot types: Burst Shot
Acquired From:
The Emporium for 250 gems