Difference between revisions of "Template:SkillRow"

From ChatWars Wiki
Jump to: navigation, search
 
(173 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{#vardefine: startRange | 0 }} {{#vardefine: endRange | 0 }}
 +
{{#vardefine: i | 4 }}
 +
{{#vardefine: firstOutput | 1 }}
 +
{{#vardefine: backgroundColorModifier | }}
 +
{{#vardefine: strLen | 0 }}
 +
{{#vardefine: subStr | }}
 
<includeonly>
 
<includeonly>
  | {{{1|}}}
+
<!-- write and style skill name and description-->
| {{{2|}}}
+
  |style="{{#if: {{{2}}} | background-color: lightgrey; }} text-align: left"| {{{1|}}}
{{#vardefine: nrLevels | 20 }}
+
|style="text-align: left"| {{{3|}}}
{{#vardefine: initialOffset | 3 }}
+
<!-- iterate through entire skill cap range given by the #ask-->
{{#vardefine: offset | initialOffset }}
 
{{#vardefine: i | 0 }}
 
 
{{#while:
 
{{#while:
   | {{#ifexpr: i < nrLevels | true | false}}
+
   | {{#if: {{{ {{#var: i}} |}}} | true }}
   | {{#while:
+
    <!-- iterate over a range (same numbers in skill caps-->
       | {{#ifeq: {{{ #expr:{{ {{#var: i}} + {{#var: offset}} }}} | {{{ #expr:{{ {{#var: i}} + {{#var: offset}} + 1}} }}} | true | false}}
+
   | {{#vardefine: startRange | {{#var: i}} }}
       |
+
    {{#while:
 +
       | {{#if: {{{ {{#expr: {{#var: i}} }} |}}} | {{#ifeq: {{{ {{#expr: {{#var: i}} }} |}}} | {{{ {{#expr: {{#var: i}} + 1}} |}}} | true}} }}
 +
       | {{#vardefine: i | {{#expr: {{#var: i}} + 1}} }}
 
     }}
 
     }}
  | colspan="{{#expr: {{#var: i}} - offset}}" {{!}} {{{ {{#var: i}} |}}}
+
    {{#vardefine: endRange | {{#var: i}} }}
  | {{#vardefine: offset | i }}
+
 
 +
    <!-- mark "unknown" and "?" as red-->
 +
    {{#switch: {{{ {{#var: i}} |}}}
 +
      | Unknown | ? = {{#vardefine: backgroundColorModifier | style="background-color: red" }}
 +
      | #default = {{#vardefine: backgroundColorModifier | }}
 +
    }}
 +
 
 +
    <!-- check if there's a number and a "*" in the skill cap string and mark it as blue-->
 +
    {{#vardefine: strLen | {{#len:{{{ {{#var: i}} |}}} }} }}
 +
    {{#ifexpr: {{#var: strLen}} > 1 | {{#vardefine: subStr | {{#sub:{{{ {{#var: i}} |}}}|-1}} }} }}
 +
    {{#ifeq: {{#var: subStr}} | * | {{#vardefine: backgroundColorModifier | style="background-color: lightblue" }} }}
 +
 
 +
    <!-- check if it's the first cap range being displayed (in that case only write 1x "{{!}}", otherwise write 2x "{{!}}")-->
 +
    {{#ifeq: {{#var: firstOutput}} | 1 | {{!}} colspan="{{#expr: {{#var: endRange}} - {{#var: startRange}} + 1 }}" {{#var: backgroundColorModifier}} {{!}} {{{ {{#expr: {{#var: i}} }} |}}} | {{!}}{{!}} colspan="{{#expr: {{#var: endRange}} - {{#var: startRange}} + 1 }}" {{#var: backgroundColorModifier}} {{!}} {{{ {{#expr: {{#var: i}} }} |}}} }}
 +
 
 +
    <!-- reset some variables and increment i-->
 +
    {{#vardefine: backgroundColorModifier | }}
 +
    {{#vardefine: subStr | }}
 +
    {{#vardefine: firstOutput | 0 }}
 +
    {{#vardefine: i | {{#expr: {{#var: i}} + 1}} }}
 
}}
 
}}
<!--
 
| {{#ifeq: {{{3|}}}|{{{4|}}} | {{#ifeq: {{{4|}}}|{{{5|}}} | {{#ifeq: {{{5|}}}|{{{6|}}} | {{#ifeq: {{{6|}}}|{{{7|}}} |  | colspan="4" }} | colspan="3" }} | colspan="2" }} | colspan="1" {{!}} {{{3|}}} }}| 
 
| {{{4|}}}
 
| {{{5|}}}
 
| {{{6|}}}
 
| {{{7|}}}
 
| {{{8|}}}
 
| {{{9|}}}
 
| {{{10|}}}
 
| {{{11|}}}
 
| {{{12|}}}
 
| {{{13|}}}
 
| {{{14|}}}
 
| {{{15|}}}
 
| {{{16|}}}
 
| {{{17|}}}
 
| {{{18|}}}
 
| {{{19|}}}
 
| {{{20|}}}
 
| {{{21|}}}
 
| {{{22|}}}
 
-->
 
 
  |-
 
  |-
 
</includeonly>
 
</includeonly>

Latest revision as of 12:55, 17 July 2018





This is a template for formatting one row (skill) of the skill cap table