Template talk:CritterMonths

From Nookipedia, the Animal Crossing wiki
Revision as of 00:56, May 20, 2020 by SuperHamster (talk | contribs) (→‎Template suggestion: +reply)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template suggestion[edit]

I don't know whether it's possible or practical to require the input for the template to specify each month the critter is catchable, but if so, you could really shorten the template by implementing something like this:

Example of longest template call:
{{CritterMonths|type=fish|m1=y|m2=y|m3=y|m4=y|m5=y|m6=y|m7=y|m8=y|m9=y|m10=y|m11=y|m12=y}}

{{#forargs: m
| key
| value
| <span style="color:{{#if:{{#var: value }}|{{#switch: {{{type|}}} | fish=#50b3d4 | bug=#77AC3F | #DFDFDF}}; font-weight:600;|#DFDFDF;}}">{{#switch|{{#var: key }}| 1 | 6 | 7 = J | 2 = F | 3 | 5 = M | 4 | 8 = A | 9 = S | 10 = O | 11 = N | 12 = D}}</span>&nbsp;
}}

This is the first time I've tried using the Loops extension so... I'm not 100% sure this will work, but I figured you might know SuperHamster. Sunmarshsignature.png (talk) 00:31, May 20, 2020 (EDT)

Ah, good stuff, thank you! You're right, we should use loops now that we have it. I can go ahead and update the template.
Just to clarify, I intend to keep the original functionality as well, and I don't expect editors to use the new method; the reason I added it is because this is likely the best way to store month data in Cargo and for the API. I'll also be auto-generating instances of this template for the new critter info templates, which is a lot easier if I can go month-by-month. ~SuperHamster Talk 00:56, May 20, 2020 (EDT)