Template talk:Robot icon

From Team Fortress Wiki
Jump to: navigation, search

Custom Icon Support

Thinking of copying everything here, then paste everything in a new page and make it support custom icons (not wanting to make this template support custom icons and keep it to valve only)

Is this okay to be done? Or I will get that page deleted? MCandRBfan (talk) 14:30, 11 July 2019 (UTC)

Four of these icons don't work

The following icons don't work:

These all produce results like this:

Soldier


The corresponding files seem to exist, and inputting nonexistent files produces a missing-texture image:

Thisdoesnotexist

; so I suspect that perhaps there is one portion of the template's code that recognizes the value, but another portion does not.

I would suggest trying to use {{Icon class}} instead of the {{#switch: . . .}} shenanigans, however this would compromise some of the nicknames that exist in this template. If that is somehow better though, here's a modified version of the template that, with some tweaking and fixing (crits don't work properly and the image is put on top of the "line" instead of across it), could work:

{{#if:{{#ifeq:{{{2}}}|crit|¬}}{{#ifeq:{{{3}}}|crit|¬}}|<!--
With crits on, we create a second div which is the border. We then move the file over the border, and place both within a display:inline-block div.
--><div style="display:inline-block; vertical-align:middle"><div style="width:{{#expr:{{{size|24}}}+8}}px; height:{{#expr:{{{size|24}}}+8}}px; background:#1e87b9"></div><div style="position:absolute"><div style="position:relative; top:-{{#expr:{{{size|24}}}+6}}px; right:-2px; width:{{{size|24}}}px; height:{{{size|24}}}px; padding:2px 2px; border-radius:4px; background:{{#if:{{#ifeq:{{{2}}}|giant|¬}}{{#ifeq:{{{3}}}|giant|¬}}|#bf1603|#ebe4ca}};">|<!--
With crits off, it's the simple, old stuff.
--><div style="display:inline-block;padding:3px 3px;margin-right:4px;border-radius:4px;background:{{#if:{{#ifeq:{{{2}}}|giant|¬}}{{#ifeq:{{{3}}}|giant|¬}}|#bf1603|#ebe4ca}};">}}{{Icon class
|{{{1}}}
|size={{#expr:{{{size|24}}}+8}}px}}</div>

--Lemondoge (talk) 02:59, 12 August 2020 (UTC)