Template talk:Robot icon
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:
{{Robot icon|Soldier}}
{{Robot icon|Soldier|giant|alt=Giant Soldier}}
{{Robot icon|Sniper}}
{{Robot icon|Sniper|alt=Razorback Sniper}}
These all produce results like this:
The corresponding files seem to exist, and inputting nonexistent files produces a missing-texture image:
; 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)
Costume boss icons
Is there a way to give the costume robot icons the red giant background? Simply inputing giant does not seem to work. Lolimsogreat21 (talk) 18:35, 24 September 2025 (UTC)Lolimsogreat21
- Works fine for me. The second unnamed parameter must be 'giant', try adding
|2=giant
.| s | GrampaSwood
(talk) (contribs) 18:45, 24 September 2025 (UTC)
- Thank you, that seems to have done the trick. Although inputting only giant still does not work. Lolimsogreat21 (talk) 18:48, 24 September 2025 (UTC)Lolimsogreat21
- Are you inputting it as the second unnamed parameter or is it the first unnamed parameter?
| s | GrampaSwood
(talk) (contribs) 18:52, 24 September 2025 (UTC)
- Are you inputting it as the second unnamed parameter or is it the first unnamed parameter?