Difference between revisions of "Template:SkillRow"
(156 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--> |
− | | {{{ | + | |style="{{#if: {{{2}}} | background-color: lightgrey; }} text-align: left"| {{{1|}}} |
+ | |style="text-align: left"| {{{3|}}} | ||
+ | <!-- iterate through entire skill cap range given by the #ask--> | ||
+ | {{#while: | ||
+ | | {{#if: {{{ {{#var: i}} |}}} | true }} | ||
+ | <!-- iterate over a range (same numbers in skill caps--> | ||
+ | | {{#vardefine: startRange | {{#var: i}} }} | ||
+ | {{#while: | ||
+ | | {{#if: {{{ {{#expr: {{#var: i}} }} |}}} | {{#ifeq: {{{ {{#expr: {{#var: i}} }} |}}} | {{{ {{#expr: {{#var: i}} + 1}} |}}} | true}} }} | ||
+ | | {{#vardefine: i | {{#expr: {{#var: i}} + 1}} }} | ||
+ | }} | ||
+ | {{#vardefine: endRange | {{#var: i}} }} | ||
+ | <!-- mark "unknown" and "?" as red--> | ||
+ | {{#switch: {{{ {{#var: i}} |}}} | ||
+ | | Unknown | ? = {{#vardefine: backgroundColorModifier | style="background-color: red" }} | ||
+ | | #default = {{#vardefine: backgroundColorModifier | }} | ||
+ | }} | ||
− | {{#vardefine: | + | <!-- 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: | + | {{#vardefine: backgroundColorModifier | }} |
− | {{#vardefine: | + | {{#vardefine: subStr | }} |
− | {{#vardefine: | + | {{#vardefine: firstOutput | 0 }} |
− | + | {{#vardefine: i | {{#expr: {{#var: i}} + 1}} }} | |
− | |||
}} | }} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
</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