Ultradude25 (vitalap | szerkesztései) (Adding empty feature.) |
Magiczocker (vitalap | szerkesztései) aNincs szerkesztési összefoglaló |
||
(9 közbenső módosítás, amit 5 másik szerkesztő végzett, nincs mutatva) | |||
1. sor: | 1. sor: | ||
− | <includeonly>{{ |
+ | <includeonly>{{ |
− | + | #if: {{{value|}}} |
|
+ | | {{ |
||
− | -->{{#ifexpr: {{{value}}} > 1 | [[File:{{{icon_full}}}|{{{size}}}]] | {{#ifexpr: {{{value}}} > 0 | [[File:{{{icon_half}}}|{{{size}}}]]}}}}<!-- |
||
+ | #iferror: {{ #expr: {{{value}}} }} |
||
− | -->{{#ifexpr: {{{value}}} > 3 | [[File:{{{icon_full}}}|{{{size}}}]] | {{#ifexpr: {{{value}}} > 2 | [[File:{{{icon_half}}}|{{{size}}}]]}}}}<!-- |
||
+ | | <strong class="error">Error: the value must be a number!</strong><!-- any ideas for a better error message? --> |
||
− | -->{{#ifexpr: {{{value}}} > 5 | [[File:{{{icon_full}}}|{{{size}}}]] | {{#ifexpr: {{{value}}} > 4 | [[File:{{{icon_half}}}|{{{size}}}]]}}}}<!-- |
||
− | - |
+ | | <span style="white-space: nowrap;" title="{{ #if: {{{title|}}} | {{{title}}} | {{ #expr: floor( abs( {{{value}}} ) ) }} }}">{{ |
+ | #ifeq: {{ #expr: floor( abs( {{{value}}} ) ) }} | 0<!-- empty bar --> |
||
− | -->{{#ifexpr: {{{value}}} > 9 | [[File:{{{icon_full}}}|{{{size}}}]] | {{#ifexpr: {{{value}}} > 8 | [[File:{{{icon_half}}}|{{{size}}}]]}}}}<!-- |
||
+ | | {{ |
||
− | -->{{#ifexpr: {{{value}}} > 11 | [[File:{{{icon_full}}}|{{{size}}}]] | {{#ifexpr: {{{value}}} > 10 | [[File:{{{icon_half}}}|{{{size}}}]]}}}}<!-- |
||
+ | #if: {{{empty|}}} |
||
− | -->{{#ifexpr: {{{value}}} > 13 | [[File:{{{icon_full}}}|{{{size}}}]] | {{#ifexpr: {{{value}}} > 12 | [[File:{{{icon_half}}}|{{{size}}}]]}}}}<!-- |
||
− | + | | [[File:{{{empty}}}{{ #if: {{{size|}}} | {{!}}{{{size}}} }}]] |
|
+ | }} |
||
− | -->{{#ifexpr: {{{value}}} > 17 | [[File:{{{icon_full}}}|{{{size}}}]] | {{#ifexpr: {{{value}}} > 16 | [[File:{{{icon_half}}}|{{{size}}}]]}}}}<!-- |
||
+ | | {{ |
||
− | -->{{#ifexpr: {{{value}}} > 19 | [[File:{{{icon_full}}}|{{{size}}}]] | {{#ifexpr: {{{value}}} > 18 | [[File:{{{icon_half}}}|{{{size}}}]]}}}} |
||
+ | #if: {{{reverse|}}}<!-- reversed bar, if we have an odd number of units --> |
||
+ | | {{ |
||
+ | #ifexpr: floor( abs( {{{value}}} ) ) mod 2 = 1 |
||
+ | | [[File:{{{half}}}{{ #if: {{{size|}}} | {{!}}{{{size}}} }}]] |
||
+ | }} |
||
+ | }}{{<!-- |
||
+ | here be magic |
||
+ | attribution: this is adapted from [[wikia:c:yugioh:Template:Repeat]] (a concept by others that I spun out and perfected =D ) |
||
+ | --> |
||
+ | padleft: |
||
+ | | {{ |
||
+ | #expr: floor( abs( {{{value}}} ) / 2 ) * {{ #len: [[File:{{{full}}}{{ #if: {{{size|}}} | {{!}}{{{size}}} }}]] }} |
||
+ | }} |
||
+ | | [[File:{{{full}}}{{ #if: {{{size|}}} | {{!}}{{{size}}} }}]] |
||
+ | }}{{ |
||
+ | #if: {{{reverse|}}}<!-- non-reversed bar, if we have an odd number of units --> |
||
+ | || {{ |
||
+ | #ifexpr: floor( abs( {{{value}}} ) ) mod 2 = 1 |
||
+ | | [[File:{{{half}}}{{ #if: {{{size|}}} | {{!}}{{{size}}} }}]] |
||
+ | }} |
||
+ | }} |
||
+ | }}</span> |
||
⚫ | |||
+ | | <strong class="error">Error: a value must be provided!</strong><!-- same here: ideas for a better message? --> |
||
}}</includeonly><noinclude> |
}}</includeonly><noinclude> |
||
+ | {{documentation}} |
||
− | ==Documentation== |
||
− | This template creates a bar made of icons. |
||
⚫ | |||
− | <pre> |
||
+ | [[fr:Modèle:Barre]] |
||
− | {{healthbar |
||
− | |value= |
||
− | |size= |
||
− | |icon_full= |
||
− | |icon_half= |
||
− | |icon_empty= |
||
⚫ | |||
− | </pre> |
||
− | |||
− | {| class="wikitable" |
||
− | ! Parameter |
||
− | ! Function |
||
− | ! Default value |
||
− | |- |
||
− | | <code>value</code> || Integer value between 0 and 20. Half icon = 1, full icon = 2, full icon + half icon = 3 and so on. || 0 |
||
− | |- |
||
− | | <code>size</code> || Width of each icon in CSS units like "px" or "em". || ''None'' |
||
− | |- |
||
− | | <code>icon_full</code> || Icon used for even values like 2, 4, 6, etc. || ''None'' |
||
− | |- |
||
− | | <code>icon_half</code> || Icon used at the end of the bar for uneven values like 1, 3, 5, etc. || ''None'' |
||
− | |- |
||
− | | <code>icon_empty</code> || Icon used if value is 0 || ''None'' |
||
− | |} |
||
− | |||
⚫ | |||
</noinclude> |
</noinclude> |
A lap jelenlegi, 2019. április 19., 07:27-kori változata
[create | laptörténet | purge]Dokumentáció
Ez a(z) sablon nem rendelkezik dokumentációval. Ha ismered ezen sablon használatát, akkor kérlek, hozd létre!