Difference between revisions of "Template:PersonalCollectionIcon"

From Dragalia Lost Wiki
Jump to navigation Jump to search
>FlareKyn
>FlareKyn
 
(160 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
<includeonly><!--
 
<includeonly><!--
 +
-->{{#switch:{{{Size|}}}
 +
|big
 +
|Big
 +
|large
 +
|Large={{#vardefine:Size|1.5}}
 +
|giant
 +
|Giant={{#vardefine:Size|2}}
 +
|medium
 +
|Medium
 +
|normal
 +
|Normal={{#vardefine:Size|1}}
 +
|#default={{#vardefine:Size|0.5}}
 +
}}<!--
 +
-->{{#vardefine:Unbind|{{#ifexpr:{{{Unbind|0}}}>4|4|{{{Unbind|0}}}}}}}<!--
 +
-->{{#vardefine:bottomRightContent|margin-top:-6%;margin-right:-2.9%;">[[File:{{#var:Unbind}} Unbind.png|{{#expr:{{#var:Size}}*54}}px]]}}<!--
 +
-->{{#vardefine:Augments|{{#ifexpr:{{{Augments|0}}}>=200|200|{{{Augments|0}}}}}}}<!--
 +
-->{{#vardefine:cyan|#36f2f1}}<!--
 +
-->{{#vardefine:gold|#f8c933}}<!--
 
-->{{#switch: {{{1|}}}
 
-->{{#switch: {{{1|}}}
 
|Adventurer=
 
|Adventurer=
{{#vardefine:c1|{{#cargo_query:tables=Adventurers|where=_pageName="{{#titleparts:{{{2}}}}}" OR FullName="{{#titleparts:{{{2}}}}}"|fields=CONCAT('[[File:', Id, ' 0', VariationId, ' r0', {{{Rarity|Rarity}}}, '.png|link=',{{{link|_pageName}}},']]')|group by=_pageName}}}}
+
  {{#invoke:CargoQuery|main
{{#vardefine:c5|{{{Nodes|}}}}}
+
      |q?tables=Adventurers
 +
      |q?where=FullName="{{#titleparts:{{{2}}}}}"
 +
      |q?fields=MaxLimitBreakCount,CONCAT(Id, ' 0', VariationId, ' r0', {{{Rarity|Rarity}}})=bgIcon,CONCAT({{{Rarity|Rarity}}})=derivedRarity
 +
      |?groupBy=_pageName
 +
      |template=vardefine}}<!--
 +
-->{{#vardefine:overlayStyles|}}<!--
 +
-->{{#vardefine:HardMaxNodes|{{#ifexpr:{{#var:MaxLimitBreakCount}} = 5|{{#ifeq:{{{3|}}}|Spiral|70|99}}|50}}}}<!--
 +
-->{{#vardefine:SoftMaxNodes|{{#ifeq:{{{3|}}}|Spiral|70|{{#expr:{{#var:derivedRarity}}*10}}}}}}<!--
 +
-->{{#vardefine:Nodes|{{#ifexpr:{{{Nodes|0}}}>={{#var:SoftMaxNodes}}|{{#var:SoftMaxNodes}}|{{{Nodes|0}}}}}}}<!--
 +
-->{{#vardefine:HardMaxLevel|{{#ifexpr:{{#var:MaxLimitBreakCount}} = 5|100|80}}}}<!--
 +
-->{{#vardefine:SoftMaxLevel|{{#ifeq:{{{3|}}}|Spiral
 +
      |{{#switch: {{#Nodes}}
 +
        | 50 = 85
 +
        | #default = {{#invoke:Adventurer|effectiveMaxLevel|{{{2}}}|{{#var:Nodes}}|{{#var:derivedRarity}}}}
 +
      }}
 +
      |{{#expr:{{#var:derivedRarity}}*10+30}}}}}}<!--
 +
-->{{#vardefine:nodeColor|{{#switch: {{#var:Nodes}}
 +
    | {{#var:HardMaxNodes}} = {{#var:cyan}}
 +
    | {{#var:SoftMaxNodes}} = {{#var:gold}}
 +
    | #fff
 +
    }}}}<!--
 +
-->{{#vardefine:bottomRightContent|<!--
 +
    -->color:{{#var:nodeColor}};display:flex;justify-content:center;font-size:{{#var:Size}}em">[[File:Icon CircleRelease 02.png|x{{#expr:{{#var:Size}}*22}}px|link=]]{{#var:Nodes}}}}
 
|Weapon=
 
|Weapon=
{{#vardefine:c1|{{#cargo_query:tables=Weapons|where=_pageName="{{#titleparts:{{{2}}}}}" OR WeaponName="{{#titleparts:{{{2}}}}}"|fields=CONCAT('[[File:', BaseId, ' 01 ', FormId, '.png|link=',{{{link|_pageName}}},']]')|group by=_pageName}}}}
+
  {{#invoke:CargoQuery|main
{{#vardefine:c5|[[File:{{{Unbind|}}} Unbind.png]]}}
+
      |q?tables=Weapons
 +
      |q?where=_pageName="{{#titleparts:{{{2}}}}}" OR WeaponName="{{#titleparts:{{{2}}}}}"
 +
      |q?fields=CONCAT(BaseId, ' 01 ', FormId)=bgIcon,Rarity=derivedRarity
 +
      |?groupBy=_pageName
 +
      |template=vardefine}}<!--
 +
-->{{#vardefine:overlayStyles|border-radius: 0 0 6% 6%/39%;}}<!--
 +
-->{{#switch: {{#var:derivedRarity}}
 +
    |6={{#vardefine:HardMaxLevel|200}} {{#vardefine:SoftMaxLevel|{{#expr:100+({{#var:Unbind}}*25)}}}}
 +
    |5={{#vardefine:HardMaxLevel|100}} {{#vardefine:SoftMaxLevel|{{#expr:80+({{#var:Unbind}}*5)}}}}
 +
    |4={{#vardefine:HardMaxLevel|70}} {{#vardefine:SoftMaxLevel|{{#expr:50+({{#var:Unbind}}*5)}}}}
 +
    |3={{#vardefine:HardMaxLevel|40}} {{#vardefine:SoftMaxLevel|{{#expr:20+({{#var:Unbind}}*5)}}}}
 +
    |2={{#vardefine:HardMaxLevel|30}} {{#vardefine:SoftMaxLevel|{{#expr:10+({{#var:Unbind}}*5)}}}}
 +
  }}
 
|Wyrmprint=
 
|Wyrmprint=
{{#vardefine:c1|{{#cargo_query:tables=Wyrmprints|where=_pageName="{{#titleparts:{{{2}}}}}" OR Name="{{#titleparts:{{{2}}}}}"|fields=CONCAT('[[File:', BaseId, ' 0{{#ifexpr:{{{Unbind|}}}>1|2|1}}.png|link=',{{{link|_pageName}}},']]')|group by=_pageName}}}}
+
  {{#invoke:CargoQuery|main
{{#vardefine:c5|[[File:{{{Unbind|}}} Unbind.png]]}}
+
      |q?tables=Wyrmprints
 +
      |q?where=_pageName="{{#titleparts:{{{2}}}}}" OR Name="{{#titleparts:{{{2}}}}}"
 +
      |q?fields=CONCAT(BaseId, ' 0{{#ifexpr:{{#var:Unbind}}>1|2|1}}')=bgIcon,Rarity=derivedRarity
 +
      |?groupBy=_pageName
 +
      |template=vardefine}}<!--
 +
-->{{#vardefine:overlayStyles|border-radius: 0 0 6% 6%/39%;}}<!--
 +
-->{{#switch: {{#var:derivedRarity}}
 +
    |5={{#vardefine:HardMaxLevel|100}} {{#vardefine:SoftMaxLevel|{{#expr:40+({{#var:Unbind}}*15)}}}}
 +
    |4={{#vardefine:HardMaxLevel|80}} {{#vardefine:SoftMaxLevel|{{#ifexpr:{{#var:Unbind}}<2|{{#expr:30+({{#var:Unbind}}*10)}}|{{#expr:30+20+({{#var:Unbind}}-2)*15)}}}}}}
 +
    |3={{#vardefine:HardMaxLevel|60}} {{#vardefine:SoftMaxLevel|{{#expr:20+({{#var:Unbind}}*10)}}}}
 +
    |2={{#vardefine:HardMaxLevel|30}} {{#vardefine:SoftMaxLevel|{{#expr:10+({{#var:Unbind}}*5)}}}}
 +
  }}
 
|Dragon=
 
|Dragon=
{{#vardefine:c1|{{#cargo_query:tables=Dragons|where=_pageName="{{#titleparts:{{{2}}}}}" OR FullName="{{#titleparts:{{{2}}}}}"|fields=CONCAT('[[File:', BaseId, ' 01.png|link=',{{{link|_pageName}}},']]')|group by=_pageName}}}}
+
  {{#invoke:CargoQuery|main
{{#vardefine:c5|[[File:{{{Unbind|}}} Unbind.png]]}}
+
      |q?tables=Dragons
 +
      |q?where=_pageName="{{#titleparts:{{{2}}}}}" OR FullName="{{#titleparts:{{{2}}}}}"
 +
      |q?fields=CONCAT(BaseId, ' 0', VariationId)=bgIcon,Rarity=derivedRarity
 +
      |?groupBy=_pageName
 +
      |template=vardefine}}<!--
 +
-->{{#vardefine:overlayStyles|
 +
      clip-path:polygon(0 0, 100% 0, 100% 75%, 95.5% 75%, 95.5% 100%, 4% 100%, 4% 75%, 0 75%);
 +
      height:13.75‬%;}}<!--
 +
-->{{#switch: {{#var:derivedRarity}}
 +
    |5={{#vardefine:HardMaxLevel|100}} {{#vardefine:SoftMaxLevel|{{#expr:40+({{#var:Unbind}}*15)}}}}
 +
    |4={{#vardefine:HardMaxLevel|80}} {{#vardefine:SoftMaxLevel|{{#ifexpr:{{#var:Unbind}}<2|{{#expr:30+({{#var:Unbind}}*10)}}|{{#expr:30+20+(({{#var:Unbind}}-2)*15)}}}}}}
 +
    |3={{#vardefine:HardMaxLevel|60}} {{#vardefine:SoftMaxLevel|{{#expr:20+({{#var:Unbind}}*10)}}}}
 +
  }}
 
}}<!--
 
}}<!--
 +
-->{{#vardefine:Level|{{#ifexpr:{{{Level|0}}}>={{#var:SoftMaxLevel}}|{{#var:SoftMaxLevel}}|{{{Level|0}}}}}}}<!--
 +
-->{{#vardefine:levelColor|{{#switch: {{#var:Level}}
 +
  |{{#var:HardMaxLevel}}={{#var:cyan}}
 +
  |{{#var:SoftMaxLevel}}={{#var:gold}}
 +
  |#fff
 +
}}}}<!--
  
-->{{#ifeq:{{{1|}}}|Dragon|
+
--><div style="display:inline-block;position:relative;"><!--
{{#invoke:Superimpose|main
+
-->[[File:{{#var:bgIcon}}.png|link={{{2|}}}|{{#expr:{{#var:Size}}*160}}px]]<!--
| c1={{#var:c1}}
+
--><div style="pointer-events:none;font-weight:900;"><!--
| c2=<div style="background-color: rgba(0, 0, 0, 0.6); width: 140px; ; height: 16px; text-align: center"><p style="opacity: 1; color: #000000; font-weight:bold;">&#8203;</p></div>
+
  --><div style="background:rgba(0,0,0,0.6);width:87.5%;padding:‭1px 0px;
| x2=10
+
                position:absolute;bottom:6.25%;left:6.25%;
| y2=121
+
                display:grid;grid-template-columns:1fr 1fr;text-align:center;align-items:center;
| c3=<div style="background-color: rgba(0, 0, 0, 0.6); width: 128px; height: 6px; text-align: center"><p style="opacity: 1; color: #000000; font-weight:bold;">&#8203;</p></div>
+
                {{#var:overlayStyles}}"><!--
| x3=16
+
  --><div style="color:{{#var:levelColor}};font-size:{{#var:Size}}em;margin-right:-15%;">Lv. {{#var:Level}}</div><!--
| y3=137
+
  --><div style="font-size:{{#var:Size}}em;{{#var:bottomRightContent}}</div><!--
| c4=<p style="opacity: 1; color: #ffffff; font-weight:bold">Lv. {{{Level|}}}</p>
+
--></div><!--
| x4=23
+
-->{{#ifexpr:{{{Augments|0}}} > 0 |
| y4=121
+
      <div style="color:{{#ifeq:{{#var:Augments}}|200|{{#var:cyan}}|{{#var:gold}}}};
| c5=<p style="opacity: 1; color: #ffffff; font-weight:bold">{{#var:c5}}</p>
+
                text-shadow:-1px -1px black,1px -1px black,-1px 1px black,1px 1px black;
| x5=88
+
                position:absolute;bottom:17.5%;right:12.5%;
| y5=119
+
                text-align:right;font-size:{{#expr:{{#var:Size}}*1.5}}em;">+{{#var:Augments}}</div>}}<!--
| c6=<p style="opacity: 1; color: {{#ifexpr:{{{Augments|}}}>199|#3de1e0|#f5c831}}; font-weight:bold; -webkit-text-stroke: 1px black; position: absolute; right:0;"><big>+{{{Augments|}}}</big></p>
+
--></div><!--
| x6=143
+
--></div><!--
| y6=100}}
+
--></includeonly><noinclude>{{Doc}}</noinclude>
|{{#invoke:Superimpose|main
 
| c1={{#var:c1}}
 
| c2=<div style="background-color: rgba(0, 0, 0, 0.6); width: 140px; text-align: center; {{#ifeq:{{{1|}}}|Adventurer||border-radius: 0px 0px 7px 7px;}}"><p style="opacity: 1; color: #ffffff; font-weight:bold; >&#8203;</p></div>
 
| x2=10
 
| y2=121
 
| c3={{#ifeq:{{{1|}}}|Adventurer|[[File:Icon CircleRelease 02.png|22x23px]]}}
 
| x3=95
 
| y3=127
 
| c4=<p style="opacity: 1; color: #ffffff; font-weight:bold">Lv. {{{Level|}}}</p>
 
| x4=23
 
| y4=121
 
| c5=<p style="opacity: 1; color: #ffffff; font-weight:bold">{{#var:c5}}</p>
 
| x5={{#ifeq:{{{1|}}}|Adventurer|117|88}}
 
| y5={{#ifeq:{{{1|}}}|Adventurer|121|119}}
 
| c6=<p style="opacity: 1; color: {{#ifexpr:{{{Augments|}}}>199|#3de1e0|#f5c831}}; font-weight:bold; -webkit-text-stroke: 1px black; position: absolute; right:0;"><big>+{{{Augments|}}}</big></p>
 
| x6=143
 
| y6=100}}
 
}}<!--
 
--></includeonly>
 
<noinclude>{{doc}}</noinclude>
 

Latest revision as of 04:39, 5 May 2020

50px Documentation

Details

A template to create icons for personal collections. Still a work in progress, but it's usable as it is.

Text will be colored like how it is in game.
Level and Nodes: Blue if hard capped, orange if soft capped, white otherwise.
Augments: Blue if capped, orange otherwise.

Examples

{{PersonalCollectionIcon|Adventurer|Elisanne}}
Lua error: Error: Table Adventurers not found..
80px
Lv. Expression error: Unexpected < operator.
Icon CircleRelease 02.pngExpression error: Unexpected < operator.
{{PersonalCollectionIcon|Adventurer|Laxi|Rarity=5|Level=80|Nodes=50|Augments=3}}
Lua error: Error: Table Adventurers not found..
80px
Lv. Expression error: Unexpected < operator.
Icon CircleRelease 02.pngExpression error: Unexpected < operator.
+3
{{PersonalCollectionIcon|Adventurer|Cleo|Rarity=5|Level=80|Nodes=50|Augments=18|Size=Normal}}
Lua error: Error: Table Adventurers not found..
160px
Lv. Expression error: Unexpected < operator.
Icon CircleRelease 02.pngExpression error: Unexpected < operator.
+18
{{PersonalCollectionIcon|Adventurer|Su Fang|Rarity=5|Level=80|Nodes=50|Spiral|Size=Big}}
Lua error: Error: Table Adventurers not found..
240px
Lv. -1
Icon CircleRelease 02.png50
{{PersonalCollectionIcon|Adventurer|The Prince|Rarity=5|Level=95|Nodes=64|Spiral|Augments=200|Size=Giant}}
Lua error: Error: Table Adventurers not found..
320px
Lv. -1
Icon CircleRelease 02.png64
+200
{{PersonalCollectionIcon|Weapon|Absolute Crimson|Level=95|Unbind=3|Augments=52|Size=Large}}
Lua error: Error: Table Weapons not found..
240px
Lv. -1
3 Unbind.png
+52
{{PersonalCollectionIcon|Wyrmprint|Valiant Crown|Level=9|Unbind=1|Augments=1|Size=Medium}}
Lua error: Error: Table Wyrmprints not found..
160px
Lv. -1
1 Unbind.png
+1
{{PersonalCollectionIcon|Wyrmprint|Valiant Crown|Level=100|Unbind=4|Augments=122}}
Lua error: Error: Table Wyrmprints not found..
80px
Lv. -1
4 Unbind.png
+122
{{PersonalCollectionIcon|Dragon|Cerberus|Level=100|Unbind=4|Augments=200}}
Lua error: Error: Table Dragons not found..
80px
Lv. -1
4 Unbind.png
+200