Change icons here Module:Icons/data. Please do not add game logo icons, as those are managed in Module:Abb/data!
A library of functions for displaying icons on pages or within other templates. For best performance, a chain of icons (sit in a row with nothing between) should be done with a single call.
Functions
This module relies on the exists() and trim() contained within Module:Util. All function calls from this module are prefixed with util e.g. util.exists().
_generate()
This function is internal only and the main workhorse for p.Icons() and p.innerIcon(). This function builds the function list. The first task is determining the size of the icons.
if util.exists(iconSetting) then
iconSetting = util.trim(iconSetting)
if util.exists(iconSize[iconSetting]) then
iconSetting = iconSize[iconSetting]
end
else
iconSetting = iconSize["medium"]
end
-- This is for calls from other Lua modules as the above will result in nil
if util.exists(iconSetting) == false then
if util.exists(iconSize) then
iconSetting = iconSize
else
iconSetting = iconSize["medium"]
end
end
In wikitext mark up the rough equivalent would be:
{{#ifeq:{{{iconSetting}}}|medium|{{#switch:{{{iconSetting}}}|a = x14px |b = 16px| c= 20px|...|#default = {{{iconSize|x14px}}}}}}}
The next step is to break the comma separated lists into a table:
if util.exists(iconLinks) then
iconLinks = mw.text.split(iconLinks, ",")
end
if util.exists(tipOverride) then
tipOverride = mw.text.split(tipOverride, ",")
end
if util.exists(iconClass)then
iconClass = "|class=" .. tostring(iconClass);
else
iconClass = ""
end
This would be the equivalent of using multiple {{#explode:}} functions and variables to store each item as its own.
Once the data has been pre-processed a loop is used to run through each item in the list to generate the icon collection:
for k, v in ipairs(iconList) do
newIcon = iconData[util.trim(v)]
if util.exists(newIcon) then
currentIcon = newIcon.icon
if util.exists(tipOverride, k) then
currentTip = tipOverride[k]
else
if util.exists(iconLinks, k) then
currentTip = iconLinks[k]
else
currentTip = newIcon.tip
end
end
else
currentIcon = "Icon question.png"
currentTip = "Unrecognized icon name"
result = result .. "[[Category:Modules with invalid parameters]]"
end
--Create wikitext icon
dataLine = '[[File:' .. currentIcon .. '|' .. iconSetting
if util.exists(iconLinks, k) then
dataLine = dataLine .. '|link=' .. iconLinks[k]
else
dataLine = dataLine .. '|link='
end
if currentTip ~= nil then
dataLine = dataLine .. '|' .. currentTip
end
dataLine = dataLine .. iconClass .. ']]'
createTip = mw.html.create('span')
createTip:addClass( 'va-icon' )
:attr('title', currentTip)
:wikitext(dataLine)
result = result .. tostring(createTip)
if k < table.getn(iconList) then
result = result .. " "
end
end
Line 2 checks the data list at Module:Icons/data for the data relating to the icon short code and returns a result or nil (does not exist) Depending on if a result was found the code continues, if there is no match a dummy icon is supplied at lines 14/15 and a maintenance category added at line 16.
If a match is found, the next task is to check if the tooltip is being overwritten, if it isn't being overwrite, it will then check if an page alternative link has been supplied, otherwise fall back to the default tooltip.
A fallback feature is implemented so if it does not find the icon, it will also search Module:Abb/data. It will use the "title" part for the tooltip.
The wikitext equivalent would be
{{{tipOverride|{{{iconLinks|default}}}}}}
Now the correct icon, tooltip and link have been obtained, lines 21-31 build the image file in the format [[File:<icon>|<size>|link=<link>|<tooltip>|class=<class>]].
Lines 33-37 create the <span /> which contains the icon and inserts the icon inside. When rendered this will appear as <span class="va-icon" title="<tooltip>">icon</span>.
Finally lines 39-41 check if the item being created is the last in the list to be created. If not it will add a space at the end of the string so there is space between the icons on the page once completed.
Invocation parameters
The invocation parameters are passed through from p.Icons(frame) or p.innerIcon(iconList, iconSetting, iconLinks, tipOverride, iconClass, iconSize). The variables align between these three functions and the below should be taken as an explanation for all three.
| Label | Parameter | Variable | Description | Required | Example |
|---|---|---|---|---|---|
| Icons | 1 | iconList | A string list of icon short code(s) passed through to the module. For multiple codes being passed these should be split by a comma (,). | fo76,ww | |
| Icon Size | 2 | iconSetting | The image size to be passed to all icons in the list. A custom size can be set (e.g. x26px) or one of the standard sizes can be applied:
To ensure all icons are consistent in size, it is recommended to control on the height (e.g. x14px) rather than the width (e.g. 14px) |
- Defaults are built in | |
| Link | 3 | iconLinks | The page(s) the icon(s) links to. For multiple pages, article names are split with a comma (,) | Fallout 76,Wild Wasteland | |
| Tooltip | 4 | tipOverride | The tooltip(s) shown when hovering over the icon(s), for multiple icons, the tooltips can be split with a comma (') | - Defaults are built in | Fire, EMP |
| CSS Class | 4 | iconClass | CSS classes to be applied to the icons. If this is set it will apply to all icons in the group. Classes are written without the class= component. |
va-icon va-icon-blue |
p.Icons() and p.innerIcon()
These two functions are pass through functions to _generate(). Before passing through the list of icons supplied is split.
The differences between the functions is where they should be used and that p.innerIcon() doesn't pass through a table of icon sizes, just a predetermined size and can only be called from other lua modules. p.Icons() is for all other namespaces and cannot be called from another module.
Invocation parameters
Due to the close nature of these two functions and _generate() the invocation parameters are the same as listed above.
p.platforms()
p.platforms() uses the same data set as the other functions, but only returns results for icons that have been marked as being a platform in the data set. In addition to this, it also uses Semantic Mediawiki so the data returned can be queried in Special:Ask.
Once the function has confirmed the icon in the list is a valid platform, it will create a hidden <span /> holding the semantic tag advising of the platform assigned from the default tooltip [[Has platform::<platform>]]. The code then largely follows that of _generate() to create the icon, with a blank link attribute. The two spans are then joined together before checking for the next platform.
If no platforms are found the code will return <sup>[Platforms needed]</sup>[[Category:Platforms needed]].
Invocation parameters
The only parameter taken by this function is the iconList parameter, holding the string of short codes.
p.documentation()
p.documentation() is self generating documentation to display the icon produced by each short code. It first takes all the datasets available and sorts them into alphabetical order and creates a table header allowing for 3 icons in a row. For each short code it will put the short code in the first, third or fifth column and the icon in the second, fourth or sixth column based on where in the sorted dataset it resides.
Due to the ever expanding icon list, this function does run the risk of becoming oversized with time. If the character size is exceeded it may need splitting into two functions.
Invocation parameters
As a self contained function, there are not parameters that can be passed through.
Available icons
Legend:
- Bold prefixes are from Module:Icons/data
- Italic prefixes are from Module:Abb/data
| Prefix | Icon | Title | Type | Subtype |
|---|---|---|---|---|
| ' | Wiki | |||
| ability | Ability | |||
| absolutely | Absolutely! | Fallout 76 | Animated | |
| ac | Armor Class | |||
| acid | Acid Damage | |||
| action | Action Points (AP) | |||
| agi | Agility | |||
| agi dark | Agility | |||
| alcohol | Alcohol | |||
| amil | Another Millenia | Mod | ||
| ammo | Ammunition | |||
| ammo2 | Ammunition | |||
| android | Android OS | Platform | ||
| aotl | Attack of the Lobotomites! | Mod | ||
| ap | Action Points (AP) | |||
| apple | Apple iOS | Platform | ||
| ar | All Roads | Publication | ||
| ar1 | America Rising - A Tale of the Enclave | Mod | ||
| ar2 | America Rising 2 - Legacy of the Enclave | Mod | ||
| armorwb | Armor Workbench | Fallout 76 | ||
| atom | Atoms | Fallout 76 | ||
| attack | Attack | |||
| awolp | A World of (Less) Pain | Mod | ||
| awop | A World Of Pain | Mod | ||
| axed | Axed Content | |||
| balloons | Balloons | Fallout 76 | Animated | |
| blade | Bladed Melee Weapon | |||
| bleed | Bleed Damage | |||
| blunt | Blunt Melee Weapon | |||
| bonezone | THE BONE ZONE | Community | ||
| bonus effect | Bonus Effect | |||
| boss | Boss Enemy | |||
| brain | Learned by default | |||
| bronze | Bronze | |||
| bullion | Gold Bullion | Fallout 76 | ||
| camp | C.A.M.P. | Fallout 76 | ||
| caps | Caps | |||
| caravan | Plays Caravan | |||
| cards | Plays Cards | |||
| chance | Random Chance | |||
| chance fo76 | Random Chance | Fallout 76 | ||
| check | Check | |||
| check1 | Check | |||
| checkbrown | Check | |||
| chems | Chems | |||
| chemst | Chemistry Station | |||
| china | China | Flag | ||
| chr | Charisma | |||
| chr dark | Charisma | |||
| colmod | Collective Modding | Community | ||
| comfnv | Fallout: New Vegas Community | Community | ||
| comfo3 | Fallout 3 Community | Community | ||
| comfo4 | Fallout 4 Community | Community | ||
| comfo76 | Fallout 76 Community | Community | ||
| companion | Companion | |||
| confidence | Confidence | |||
| container | Container Spawn | Fallout 76 | ||
| cooking | Cooking | Fallout 76 | Animated | |
| cookst | Cooking Station | |||
| craft | Crafting | |||
| credit | Creation Club Credits | |||
| credits | Creation Credits | |||
| crit | Critical Damage | |||
| crit effect | Critical Effect | |||
| cross | No | |||
| crosshair | Attack | |||
| cryo | Cryo Damage | |||
| csep | CSEP | Mod | ||
| cut | Cut Content | Developer | ||
| d20 | Fallout Pen and Paper d20 | Publication | ||
| dailyops | Daily Ops | Fallout 76 | ||
| damage | Damage | |||
| dap | Armor Class | |||
| dead | Dead | Fallout 76 | ||
| default | Learned by default | |||
| defense | Defense | |||
| detect | Detection | |||
| detection | Detection | |||
| dial | Dialogue | |||
| dialogue | Dialogue | |||
| disabled | Physical Disability Representation | Fallout 76 | Animated | |
| disease | Disease | |||
| dislike | Dislike | |||
| dislike2 | Dislike | |||
| distance | Distance | |||
| diz | DiZco12's Lightweight Lore-Friendly Overhaul | Mod | ||
| doa | Dawn of America | Mod | ||
| doctor | Doctor | |||
| dos | DOS | Platform | ||
| dotc | Driveables of the Commonweath | Mod | ||
| dps | Damage per Second (DPS) | |||
| dr | Damage Resistance (DR) | |||
| drink | Drink | Fallout 76 | ||
| dt | Damage Threshold (DT) | |||
| dur | Duration | |||
| dust | DUST Survival Simulator | Mod | ||
| effect | Effect | |||
| electrical | Electrical Damage | |||
| emp | EMP | |||
| end | Endurance | |||
| end dark | Endurance | |||
| enemy | Enemy Drop | Fallout 76 | ||
| energy | Energy Damage | |||
| enslave | Can be Enslaved | |||
| esrbmature | Mature | Rating | ||
| esrbteen | Teen | Rating | ||
| essential | Essential | |||
| event | Event | |||
| eventpublic | Public Event | Fallout 76 | ||
| expedition | Expeditions | Fallout 76 | ||
| expeditions | Expeditions | Fallout 76 | ||
| experience | Experience Points (XP) | |||
| explmill | Explosives Mill | |||
| explosion | Explosion | |||
| expo | Expeditions | Fallout 76 | ||
| expos | Expeditions | Fallout 76 | ||
| eye | Detection | |||
| fanfic | Fanfiction | Community | ||
| fb | Fallout Bible | Publication | ||
| fbg | Fallout: The Board Game | Game | Main | |
| fbgab | Fallout: Atomic Bonds | Game | Expansion | |
| fbgagenda | influence / Agenda | Fallout Board Game | ||
| fbgaggressive | Aggressive | Fallout Board Game | ||
| fbgagility | Agility | Fallout Board Game | ||
| fbgapparel | Apparel | Fallout Board Game | ||
| fbgarmor | Armor | Fallout Board Game | ||
| fbgasset | Asset | Fallout Board Game | ||
| fbgcharisma | Charisma | Fallout Board Game | ||
| fbgcompanion | Companion | Fallout Board Game | ||
| fbgcritter | Critter | Fallout Board Game | ||
| fbgdangerous | Dangerous | Fallout Board Game | ||
| fbgdeadly | Deadly | Fallout Board Game | ||
| fbgdieablhits | VATS die: arms, body, legs, 2 hits | Fallout Board Game | ||
| fbgendurance | Endurance | Fallout Board Game | ||
| fbgfreedom | Freedom | Fallout Board Game | ||
| fbghit | Hit | Fallout Board Game | ||
| fbghuman | Human | Fallout Board Game | ||
| fbgintelligence | Intelligence | Fallout Board Game | ||
| fbgloot | Loot | Fallout Board Game | ||
| fbgluck | Luck | Fallout Board Game | ||
| fbgmonster | Monster | Fallout Board Game | ||
| fbgnc | Fallout: New California | Game | Expansion | |
| fbgperception | Perception | Fallout Board Game | ||
| fbgquest | Quest action | Fallout Board Game | ||
| fbgradiation | Radiation | Fallout Board Game | ||
| fbgranged | Ranged | Fallout Board Game | ||
| fbgretreat | Retreat | Fallout Board Game | ||
| fbgrobot | Robot | Fallout Board Game | ||
| fbgsecurity | Security | Fallout Board Game | ||
| fbgsettlement | Settlement | Fallout Board Game | ||
| fbgstrength | Strength | Fallout Board Game | ||
| fbgsupermutant | Super Mutant | Fallout Board Game | ||
| fbgvault109 | Vault 109 | Fallout Board Game | ||
| fbgvault84 | Vault 84 | Fallout Board Game | ||
| fbgwasteland | Wasteland | Fallout Board Game | ||
| fbgweapon | Weapon | Fallout Board Game | ||
| fear | AAAIIIEEE!! | Fallout 76 | Animated | |
| film | Fallout Film | Canceled | ||
| fire | Fire Damage | |||
| firerate | Fire Rate | |||
| fist | Fist | |||
| fnc | Fallout: New California | Mod | ||
| fnv | Fallout: New Vegas | Game | Main | |
| fnvce | Fallout: New Vegas Official Game Guide | Publication | ||
| fnvce1 | Behind the Bright Lights & Big City | Publication | ||
| fnvce2 | Faction Profiles | Publication | ||
| fnvce3 | Tour of the Mojave Wasteland | Publication | ||
| fnvce4 | Wild Wasteland Oddities | Publication | ||
| fnvcs | Courier's Stash | Game | Expansion | |
| fnvdm | Dead Money | Game | Expansion | |
| fnvgra | Gun Runners' Arsenal | Game | Expansion | |
| fnvhh | Honest Hearts | Game | Expansion | |
| fnvlr | Lonesome Road | Game | Expansion | |
| fnvowb | Old World Blues | Game | Expansion | |
| fnvww | Wild Wasteland | |||
| fo1 | Fallout | Game | Main | |
| fo1st | Fallout 1st | Fallout 76 | ||
| FO1ST | Fallout 1st | Fallout 76 | ||
| fo2 | Fallout 2 | Game | Main | |
| fo3 | Fallout 3 | Game | Main | |
| fo3bs | Broken Steel | Game | Expansion | |
| fo3mz | Mothership Zeta | Game | Expansion | |
| fo3oa | Operation: Anchorage | Game | Expansion | |
| fo3pl | Point Lookout | Game | Expansion | |
| fo3tp | The Pitt | Game | Expansion | |
| fo4 | Fallout 4 | Game | Main | |
| fo4ae | Fallout 4 Anniversary Edition | Game | Main | |
| fo4aut | Automatron | Game | Expansion | |
| fo4cc | Creation Club | Game | Expansion | |
| fo4chain01 | Four Key Chain | |||
| fo4chain02 | Five Key Chain | |||
| fo4chain03 | Five Key Chain | |||
| fo4cw | Contraptions Workshop | Game | Expansion | |
| fo4fh | Far Harbor | Game | Expansion | |
| fo4gr | Grognak & the Ruby Ruins | Game | Pip-boy game | |
| fo4holo | Holotape | |||
| fo4key01 | Quantum Key | |||
| fo4key02 | Toy Rocketship Key | |||
| fo4key03 | Vault Boy Key | |||
| fo4note | Note | |||
| fo4nv | Fallout 4: New Vegas | Mod | ||
| fo4nw | Nuka-World | Game | Expansion | |
| fo4pa | Fallout 4: Project Arroyo | Mod | ||
| fo4vr | Fallout 4 VR | Game | Main | |
| fo4vw | Vault-Tec Workshop | Game | Expansion | |
| fo4ww | Wasteland Workshop | Game | Expansion | |
| fo5 | Fallout 5 | Canceled | ||
| fo76 | Fallout 76 | Game | Main | |
| fo76aa | Armor Ace | Game | Season | |
| fo76acap | Atlantic City America's Playground | Game | Update | |
| fo76acbp | Atlantic City Boardwalk Paradise | Game | Update | |
| fo76aml | Appalachian Modern Living | Game | Season | |
| fo76bl | A Better Life Underground | Game | Season | |
| fo76bs | The Big Score | Game | Season | |
| fo76busp | Burning Springs | Game | Update | |
| fo76bxr | Blood x Rust | Game | Season | |
| fo76cos | The City of Steel | Game | Season | |
| fo76cr | C.A.M.P. Revamp | Game | Update | |
| fo76cs | Cold Steel | Game | Season | |
| fo76dd | Duel with the Devil | Game | Season | |
| fo76di | Heart of Steel: A Dread Island Tale | Game | Season | |
| fo76ef | Escape from the 42nd Century | Game | Season | |
| fo76etp | Expeditions: The Pitt | Game | Update | |
| fo76ff | Fight for Freedom | Game | Season | |
| fo76fw | Fallout Worlds | Game | Update | |
| fo76gd | Gleaming Depths | Game | Update | |
| fo76gdsf | Gleaming Depths - The Scientific Forge | Game | Season | |
| fo76gfs | Gone Fission | Game | Season | |
| fo76gfu | Gone Fission | Game | Update | |
| fo76gg | Glow of the Ghoul | Game | Season | |
| fo76gw | Ghoul Within | Game | Update | |
| fo76ib | Invaders from Beyond | Game | Update | |
| fo76ll | Locked & Loaded | Game | Update | |
| fo76lr | The Legendary Run | Game | Update | |
| fo76mi | Mutation Invasion | Game | Update | |
| fo76mz | Milepost Zero | Game | Update | |
| fo76mzcr | Milepost Zero - Country Road | Game | Season | |
| fo76nm | Night of the Moth | Game | Update | |
| fo76nuka | Nuka-World | Game | Season | |
| fo76nw | Nuclear Winter | Game | Update | |
| fo76nwt | Nuka-World on Tour | Game | Update | |
| fo76obm | Once in a Blue Moon | Game | Update | |
| fo76ow | One Wasteland For All | Game | Update | |
| fo76owfa | One Wasteland For All | Game | Update | |
| fo76ps | Pioneer Scouts - Skyline Valley | Game | Season | |
| fo76rd | Rip Daring and the Cryptid Hunt | Game | Season | |
| fo76rdcc | Rip Daring and the Cryptids From Beyond the Cosmos | Game | Season | |
| fo76sa | The Scribe of Avalon | Game | Season | |
| fo76sd | Steel Dawn | Game | Update | |
| fo76sfs | Shoot for the Stars | Game | Season | |
| fo76sr | Steel Reign | Game | Update | |
| fo76sv | Skyline Valley | Game | Update | |
| fo76tlr | The Legendary Run | Game | Season | |
| fo76tm | Test Your Metal | Game | Update | |
| fo76tp | Expeditions: The Pitt | Game | Update | |
| fo76ts | Invaders from Beyond | Game | Update | |
| fo76tym | Test Your Metal | Game | Update | |
| fo76un | The Unstoppables vs The Diabolicals | Game | Season | |
| fo76wa | Wild Appalachia | Game | Update | |
| fo76waslad | Wastelad | Game | Pip-boy game | |
| fo76wl | Wastelanders | Game | Update | |
| fo76zr | Zorbo's Revenge | Game | Season | |
| fobos | Fallout: Brotherhood of Steel | Game | Main | |
| fobos2 | Fallout: Brotherhood of Steel 2 | Canceled | ||
| focas | FOCAS | Mod | ||
| fod | Fallout Demo | Game | Main | |
| fodal | Fallout Dallas | Community | ||
| fodalartp | Arlington Turnpike | Community | ||
| fodali30 | I-30 | Community | ||
| fodali35e | I-35E | Community | ||
| fodali45 | I-45 | Community | ||
| fodalndtp | North Dallas Turnpike | Community | ||
| fodalsh289 | SH 289 | Community | ||
| fodalsh342 | SH 342 | Community | ||
| fodalsh352 | SH 352 | Community | ||
| fodalsh356 | SH 356 | Community | ||
| fodalsh366 | SH 366 | Community | ||
| fodalsh466 | SH 466 | Community | ||
| fodalsh78 | SH 78 | Community | ||
| fodalus175 | US 175 | Community | ||
| fodalus67 | US 67 | Community | ||
| fodalus75 | US 75 | Community | ||
| fodalus77 | US 77 | Community | ||
| fodalus80 | US 80 | Community | ||
| foe | Fallout: Equestria | Mod | ||
| fof | Fallout: Factions | Game | Main | |
| fofcr | Fallout: Factions Core Rulebook | Game | Expansion | |
| fofnw | Fallout: Factions Battle For Nuka-World Starter Set | Game | Expansion | |
| fofqs | Fallout: Factions Welcome to Nuka-World! Quickstart | Game | Expansion | |
| follow1 | Follow me! | Fallout 76 | Animated | |
| follow2 | This way! | Fallout 76 | Animated | |
| folon | Fallout London | Mod | ||
| fonv | Fallout: New Vegas | Game | Main | |
| fonvdm | Dead Money | Game | Expansion | |
| fonvgra | Gun Runners' Arsenal | Game | Expansion | |
| fonvhh | Honest Hearts | Game | Expansion | |
| fonvlr | Lonesome Road | Game | Expansion | |
| fonvowb | Old World Blues | Game | Expansion | |
| food | Food | |||
| foodpr | Food Processor | |||
| formerly | Formerly | |||
| forpg | Fallout: The Roleplaying Game | Game | Main | |
| forpgd6 | Combat Dice (d6) | Fallout: The Roleplaying Game | ||
| forpgfo | Fully Operational | Game | Expansion | |
| forpggm | Fallout: The Roleplaying Game Gamemaster's Toolkit | Game | Expansion | |
| forpggms | Fallout: The Roleplaying Game GM Screen | Game | Expansion | |
| forpgocs | Orange Coloured Sky | Game | Expansion | |
| forpgqs | Fallout: The Roleplaying Game Quickstart | Game | Expansion | |
| forpgrd | Rust Devils NPC Pack | Game | Expansion | |
| forpgrf | Royal Flush | Game | Expansion | |
| forpgsgb | Settler's Guide Book | Game | Expansion | |
| forpgss | Fallout: The Roleplaying Game Starter Set | Game | Expansion | |
| forpgupon | Once Upon a Time in the Wasteland | Game | Expansion | |
| forpgwgb | Wanderer's Guide Book | Game | Expansion | |
| forpgwoa | Winter of Atom | Game | Expansion | |
| fortn | Fortnite: Wrecked | Publication | ||
| fos | Fallout Shelter | Game | Main | |
| foso | Fallout Shelter Online | Game | Main | |
| fot | Fallout Tactics | Game | Main | |
| fot2 | Fallout Tactics 2 | Canceled | ||
| fotf | Fallout: The Frontier | Mod | ||
| fotv | Fallout Television Series | Game | Main | |
| fow | Fallout: Warfare | Canceled | ||
| foww | Fallout: Wasteland Warfare | Game | Main | |
| fowwblast | Blast Icon | Fallout: Wasteland Warfare | ||
| fowwcrit | Critical Point | Fallout: Wasteland Warfare | ||
| fowwenergy | Energy Damage | Fallout: Wasteland Warfare | ||
| fowwnuka | Nuka-Cola Icon | Fallout: Wasteland Warfare | ||
| fowwphysical | Physical Damage | Fallout: Wasteland Warfare | ||
| fowwrad | Radiation Damage | Fallout: Wasteland Warfare | ||
| fowwstar | Star Icon | Fallout: Wasteland Warfare | ||
| fox | Fallout Extreme | Canceled | ||
| fpb | Fallout Pip-Boy | Publication | ||
| free | Free Content | |||
| frost | Frost | |||
| fsbg | Fallout Shelter: The Board Game | Game | Main | |
| funkymothman | Funky Mothman | Fallout 76 | Animated | |
| fww | Fallout: Wasteland Warfare | Game | Main | |
| fwwaat1 | Astoundingly Awesome Tales, #1 | Game | Expansion | |
| fwwaat2 | Astoundingly Awesome Tales, #2 | Game | Expansion | |
| fwwaih | AI Handbook | Game | Expansion | |
| fwwbm | Battle Mode | Game | Expansion | |
| fwwch | FWW Campaign Handbook | Game | Expansion | |
| fwwcitc | Caught in the Crossfire | Game | Expansion | |
| fwwcm | Commonwealth Rules | Game | Expansion | |
| fwwcoh | Co-Op Handbook | Game | Expansion | |
| fwwcp | Capital Rules | Game | Expansion | |
| fwwfitf | Forged in the Fire Rules | Game | Expansion | |
| fwwga | FWW Getting Acclimated | Game | Expansion | |
| fwwhs | Homestead Rules | Game | Expansion | |
| fwwitv | Into the Vault | Game | Expansion | |
| fwwitw | Into the Wasteland | Game | Expansion | |
| fwwnv | New Vegas Rules | Game | Expansion | |
| fwwnw | Nuka-World Rules | Game | Expansion | |
| fwwrop | FWW Rules of Play | Game | Expansion | |
| fwwrpg | Fallout: Wasteland Warfare Roleplaying Game | Game | Main | |
| fwwrpggms | Fallout: Wasteland Warfare Roleplaying Game GM Screen | Game | Expansion | |
| fwwrpgmf | Machine Frequency | Game | Expansion | |
| fwwrpgtus1 | TUS Part 1: Protection Order | Game | Expansion | |
| fwwrpgtus2 | TUS Part 2: Dangerous Trails | Game | Expansion | |
| fwwrpgtus3 | TUS Part 3: Battle Station | Game | Expansion | |
| game | Gameplay | |||
| gamerscore | Gamerscore | |||
| gas | Gas | |||
| gb | Great Britain | Flag | ||
| gold | Gold | |||
| grenade | Grenade | |||
| group | Group | |||
| gun | Gun | |||
| halt | STOP RIGHT THERE! | Fallout 76 | Animated | |
| hate | Hate | |||
| hate2 | Hate | |||
| healing | Healing Rate (HP/s) | |||
| healing rate | Healing Rate (HP/s) | |||
| health | Health Points (HP) | |||
| heart | Health Points (HP) | |||
| heartbeat | Heart | Fallout 76 | Animated | |
| hellodog | Hello! | Fallout 76 | Animated | |
| helpme | Help me! | Fallout 76 | Animated | |
| hp | Health Points (HP) | |||
| hungry | Hungry | Fallout 76 | Animated | |
| ifw | Fallout Wiki | Wiki | ||
| image | It is an image I mean what else can I say | |||
| info | Information | |||
| int | Intelligence | Fallout 76 | ||
| int dark | Intelligence | Fallout 76 | ||
| ios | Apple iOS | Platform | ||
| jes | J.E. Sawyer's Fallout RPG | Publication | ||
| jury | Jury Rigging | |||
| laser | Laser | |||
| lck | Luck | Fallout 76 | ||
| lck dark | Luck | Fallout 76 | ||
| legacy | Legacy Content | |||
| legendary | Legendary | |||
| legendperk | Legendary Perk | Fallout 76 | ||
| level | Level | |||
| lgbtq | LGBTQ representation in Fallout | |||
| lh | Lionheart | Canceled | ||
| like | Like | |||
| like2 | Like | |||
| limited | Limited-Time | |||
| limitedtime | Limited-Time | |||
| loc | Location | Fallout 76 | ||
| location | Location | Fallout 76 | ||
| love | Love | |||
| love2 | Love | |||
| lunchbox | Lunchbox | Fallout 76 | ||
| mac | Macintosh Classic or Mac OS X | Platform | ||
| macclassic | Macintosh Classic (≤ MacOS 9) | Platform | ||
| mag | Ammo Capacity | |||
| melee | Melee | |||
| mentioned | Mentioned | |||
| merch | Merch Supporter | Fallout 76 | ||
| merchant | Merchant or Vendor | Fallout 76 | ||
| mine | Mine | Fallout 76 | ||
| mod | With Mods | |||
| mpfnv | More Perks FNV | Mod | ||
| mpfo3 | More Perks FO3 | Mod | ||
| mtg | Magic: The Gathering | Publication | ||
| mutation | Mutation | Fallout 76 | ||
| mutation dark | Mutation | Fallout 76 | ||
| neutral | Neutral | |||
| neutralface | Neutral | |||
| neutralface2 | Neutral | |||
| new | New Content | Fallout 76 | ||
| no | No | Fallout 76 | ||
| none | Mentioned-Only location | Wiki | ||
| none | Mentioned-Only location | Wiki | ||
| note | Note | |||
| notrade | Non-Tradeable | |||
| npc | NPC Content | |||
| nw | Nuclear Winter Battle-Royale | Fallout 76 | ||
| optional | Optional | |||
| optionalicon | Optional | |||
| pa | One Man, and a Crate of Puppets | Publication | ||
| pail | Mole Miner Pail | Fallout 76 | ||
| parmorst | Power Armor Station | |||
| pbgame | Holotape Game | |||
| pbw | Project: Bygone Weapons | Mod | ||
| pc | PC | Platform | ||
| pegi12 | PEGI 12 | Rating | ||
| pegi16 | PEGI 16 | Rating | ||
| pegi18 | PEGI 18 | Rating | ||
| per | Perception | Fallout 76 | ||
| percent | Random Chance | Fallout 76 | ||
| per dark | Perception | Fallout 76 | ||
| photo | Say cheers! | Fallout 76 | Animated | |
| physical | Physical Damage | |||
| pistol | Gun | Fallout 76 | ||
| plan | Plan or Recipe | |||
| plasma | Plasma Damage | |||
| platinum | Platinum | |||
| plus | Rewards | |||
| poison | Poison Damage | |||
| poison2 | Poison Damage | |||
| possum | Possum Badge | |||
| possum dark | Possum Badge | |||
| present | Holiday Gift | |||
| ps2 | Playstation 2 | Platform | ||
| ps3 | Playstation 3 | Platform | ||
| ps4 | Playstation 4 | |||
| ps5 | Playstation 5 | Platform | ||
| publicworkshop | Workshop | Fallout 76 | ||
| pv13 | Project V13 | Canceled | ||
| pve | Player vs Environment | Fallout 76 | ||
| pvp | Player vs Player | Fallout 76 | ||
| quest | Quest | Fallout 76 | ||
| question | Question Mark | |||
| radiated | Radiated | Fallout 76 | Animated | |
| radiation | Radiation Damage | |||
| random | Random Chance | Fallout 76 | ||
| randomenc | Random Encounter | Fallout 76 | ||
| range | Range | |||
| rarity | Rarity | |||
| ratio | Ratio | |||
| removed | Removed Content | |||
| repair | Repair | |||
| repairs | Repairing! | Fallout 76 | Animated | |
| repeat | Repeat | |||
| required | Required | |||
| rifle | Rifle | |||
| robotwb | Robot Workbench | |||
| rwot | Real World on Tour! | Community | ||
| score | Scoreboard | Fallout 76 | ||
| scout | Pioneer Scouts | Fallout 76 | ||
| scrip | Legendary Scrip | Fallout 76 | ||
| season | Scoreboard | Fallout 76 | ||
| seasonal | Seasonal Content | Fallout 76 | ||
| semi | Sometimes required or at least one required | |||
| semi-required | Sometimes required or at least one required | |||
| sequence | Sequence | |||
| shieldbronze | Armor Class | |||
| shieldgold | Damage Threshold (DT) | |||
| shieldsilver | Damage Resistance (DR) | |||
| shotgun | Shotgun | |||
| sic | In-game spelling, punctuation and/or grammar | Wiki | ||
| silver | Silver | |||
| sleepy | Sleepy | Fallout 76 | Animated | |
| smg | Submachine Gun | |||
| sorry | Sorry! | Fallout 76 | Animated | |
| sound | Sound | |||
| spawn | Spawned | Fallout 76 | ||
| spooky | Spooky Scorched | Fallout 76 | ||
| spread | Spread | |||
| stamp | Stamps | Fallout 76 | ||
| star | Legendary | |||
| stimpak | Stimpak | Fallout 76 | ||
| str | Strength | Fallout 76 | ||
| str dark | Strength | Fallout 76 | ||
| stuadv | Schmault Tec University | Wiki | ||
| stucomm | Schmault Tec University | Wiki | ||
| studata | Schmault Tec University | Wiki | ||
| stuedit | Schmault Tec University | Wiki | ||
| stuoutside | Schmault Tec University | Wiki | ||
| supplies | Supplies | |||
| survival | Fallout 76 Survival Mode | Fallout 76 | ||
| tadpole | Tadpole Badge | Fallout 76 | ||
| tadpole dark | Tadpole Badge | Fallout 76 | ||
| tar | The Armageddon Rag | Canceled | ||
| tea | Tea | |||
| temp | Temporary | |||
| terminal | Terminal | |||
| test | Test cell | Wiki | ||
| text | Text | |||
| thirsty | Thirsty | Fallout 76 | Animated | |
| ticket | Tickets | Fallout 76 | ||
| tickets | Tickets | Fallout 76 | ||
| torn | TORN | Canceled | ||
| treasuremap | Treasure Map | |||
| ttw | Tale of Two Wastelands | Mod | ||
| uk | Great Britain | Flag | ||
| unarmed | Unarmed | |||
| unknown | Unknown | Fallout 76 | Animated | |
| unused | Unused Content | Wiki | ||
| upcoming | Upcoming Content | |||
| us | United States | Flag | ||
| usa | United States | Flag | ||
| vaultboy | Vault Boy | Wiki | ||
| vaultno | No | Fallout 76 | Animated | |
| vaultraid | Vault Raids | Fallout 76 | ||
| vaulttec | Vault-Tec | |||
| vb | Van Buren | Canceled | ||
| vt | Vault-Tec | |||
| Wait | Waiting | Fallout 76 | Animated | |
| weapwb | Weapons Workbench | |||
| weight | Weight | |||
| wiki | Fallout Wiki | Wiki | ||
| wild wasteland | Wild Wasteland | fnv | ||
| windows | Windows Phone | Platform | ||
| ww | Wild Wasteland | |||
| xbox | Xbox | Platform | ||
| xbox360 | Xbox 360 | Platform | ||
| xboxone | Xbox One | Platform | ||
| xboxseries | Xbox | Platform | ||
| xp | Experience Points (XP) | |||
| xpd | Expeditions | Fallout 76 | ||
| yes | Yes | Fallout 76 |
local p = {}
local util = require( 'Module:Util' )
local abbData = require( 'Module:Abb/data' )
--[[
Icon data is now stored on the sub page /data to separate functional code
for the dataset users will often need to update. This reduces the risk of
breaking the code by entering data in the wrong place and makes it easier to
manage the code itself by not having to pass through the large dataset at
the top.
abbData dataset is a fallback if a game isn't listed here somehow.
]]local typeLabels = {
game = "Game",
pub = "''Publication''",
cancel = "''Canceled''",
wiki = "''Wiki''",
cross = "''Publication''",
mod = "''Mod''",
comm = "''Community''",
other = "''Other''",
gto = "''Other''", --end of the Abb type labels
flag = "''Flag''",
fnv = "''Fallout: New Vegas''",
fbg = "''Fallout Board Game''",
fo76 = "''Fallout 76''",
forpg = "''Fallout: The Roleplaying Game''",
foww = "''Fallout: Wasteland Warfare''",
platform = "''Platform''",
rating = "''Rating''",
}
local type2Labels = {
main = "'''Main'''",
dlc = "''Expansion''",
pipboy = "''Pip-boy game''",
update = "''Update''",
season = "''Season''", -- end of Abb type2
animated = "Animated",
dev = "Developer",
damage = "Animated",
}
require( 'Module:Icons/data' )
local iconSize = {
--[[
All sizes are controlled on the height to ensure a string of icons maintain
a consistent line height
]]
["small"] = "x10px",
["medium"] = "x14px",
["normal"] = "x14px",
["big"] = "x20px",
["bigger"] = "x30px",
["huge"] = "x50px",
["humongous"] = "x100px",
}
--[[ 28/Oct/2021 Added class control table to array as to handle light/dark
themes. This was originally put into the frontend template, when class
handling should be back end. Adding the ['class'] = 'light' or
['class'] = 'dark' parameter to a icon's dataset on /data will enable it to
access a class if needed.
]]
--[[ 08/Nov/2021 Remove the class definition as to be able to just pass straight through
local class = {
['light'] = 'lighticon',
['dark'] = 'darkicon',
['general'] = 'generalicon'
}
]]
function _generate(iconList, iconSetting, iconLinks, tipOverride, iconClass, iconSize)
if util.exists(iconSetting) then
iconSetting = util.trim(iconSetting)
if util.exists(iconSize[iconSetting]) then
iconSetting = iconSize[iconSetting]
end
else
iconSetting = iconSize["medium"]
end
if util.exists(iconSetting) == false then
iconSetting = 'x14px'
end
if util.exists(iconLinks) then
iconLinks = mw.text.split(iconLinks, ",")
end
if util.exists(tipOverride) then
tipOverride = mw.text.split(tipOverride, ",")
end
if util.exists(iconClass)then
iconClass = "|class=" .. tostring(iconClass);
else
iconClass = ""
end
local result = ""
for k, v in ipairs(iconList) do
local currentIcon, currentTip
local iconKey = util.trim(v)
newIcon = iconData[iconKey]
if util.exists(newIcon) then
currentIcon = newIcon.icon
if util.exists(tipOverride, k) then
currentTip = tipOverride[k]
else
if util.exists(iconLinks, k) then
currentTip = iconLinks[k]
else
currentTip = newIcon.tip
end
end
else
-- Try ABB data as fallback
local upperKey = iconKey:upper()
if abbData.gameList and abbData.gameList[upperKey] and abbData.gameList[upperKey].icon ~= "" then
local abbEntry = abbData.gameList[upperKey]
currentIcon = abbEntry.icon
if util.exists(tipOverride, k) then
currentTip = tipOverride[k]
else
if util.exists(iconLinks, k) then
currentTip = iconLinks[k]
else
currentTip = abbEntry.title
end
end
else
currentIcon = "Icon question.png"
currentTip = "Unrecognized icon name"
result = result .. "[[Category:Modules with invalid parameters]]"
end
end
-- Create wikitext icon
dataLine = '[[File:' .. currentIcon .. '|' .. iconSetting
if util.exists(iconLinks, k) then
dataLine = dataLine .. '|link=' .. iconLinks[k]
else
dataLine = dataLine .. '|link='
end
if currentTip ~= nil then
dataLine = dataLine .. '|' .. currentTip
end
dataLine = dataLine .. iconClass .. ']]'
createTip = mw.html.create('span')
createTip:addClass( 'va-icon' )
:attr('title', currentTip)
:wikitext(dataLine)
result = result .. tostring(createTip)
if k < #iconList then
result = result .. " "
end
end
return result
end
-- Calls from other modules
function p.innerIcon(iconList, iconSetting, iconLinks, tipOverride, iconClass, iconSize)
iconList = mw.text.split(iconList, ',')
return _generate(iconList, iconSetting, iconLinks, tipOverride, iconClass, iconSize)
end
function p.Icons(frame)
--[[All icons are now lower case to reduce script errors from
incorrectly entering the icon code in a different case to the list]]
local iconList = mw.text.split(string.lower(frame.args[1]), ",")
local iconSetting = frame.args[2]
local iconLinks = frame.args[3]
local tipOverride = frame.args[4]
local iconClass = frame.args[5]
local iconSize = {
--[[
All sizes are controlled on the height to ensure a string of icons maintain
a consistent line height
]]
["small"] = "x10px",
["medium"] = "x14px",
["normal"] = "x14px",
["big"] = "x20px",
["huge"] = "x50px",
["humongous"] = "x100px"
}
return _generate(iconList, iconSetting, iconLinks, tipOverride, iconClass, iconSize)
end
function p.platforms(frame)
--[[All icons are now lower case to reduce script errors from
incorrectly entering the icon code in a different case to the list]]
local icons = mw.text.split(string.lower(frame.args[1]), ",")
local result = ""
for k, v in ipairs(icons) do
currentIcon = iconData[util.trim(v)]
if util.exists(currentIcon, 'platform') == true then
createSM = mw.html.create('span')
createSM:css('display', 'none')
:wikitext('[[Has platform::' .. currentIcon.tip .. ']]')
:allDone()
createPlatform = mw.html.create('span')
createPlatform:addClass('va-icon')
:attr('title', currentIcon.tip)
:wikitext('[[File:'
.. currentIcon.icon
.. '|alt='
.. currentIcon.tip
.. '|x14px|link=]]')
:allDone()
--[[ Uncommenting tostring(createSM) below will enable
Semantic Mediawiki data tracking]]
result = result .. tostring(createSM)
.. tostring(createPlatform)
if k < table.getn(icons) then
result = result .. " "
end
end
end
if result == '' then
result = '<sup>[Platforms needed]</sup>[[Category:Platforms needed]]'
end
return result
end
function p.documentation()
-- Legend
local result = "'''Legend:'''\n"
result = result .. "* '''Bold prefixes''' are from Module:Icons/data\n"
result = result .. "* ''Italic prefixes'' are from Module:Abb/data\n\n"
-- Collect keys from iconData
local keys = {}
for k in pairs(iconData) do
table.insert(keys, k)
end
-- Collect keys from ABB data that aren't in iconData
if abbData and abbData.gameList then
for k in pairs(abbData.gameList) do
local lowerKey = k:lower()
if abbData.gameList[k].icon and abbData.gameList[k].icon ~= "" and not iconData[lowerKey] then
table.insert(keys, lowerKey)
end
end
end
table.sort(keys)
result = result .. '{| class="ace-table ace-table-full sortable"\n|-\n'
result = result .. '! Prefix !! Icon !! Title !! Type !! Subtype\n|-\n'
for k, v in ipairs(keys) do
local iconEntry, prefixDisplay, link
if iconData[v] then
-- From Module:Icons/data
iconEntry = iconData[v]
prefixDisplay = "'''" .. v .. "'''"
link = nil -- No link in iconData
else
-- From Module:Abb/data
local abbEntry = abbData.gameList[v:upper()]
iconEntry = {
icon = abbEntry.icon,
tip = abbEntry.title,
type = abbEntry.type,
type2 = abbEntry.type2
}
prefixDisplay = "''" .. v .. "''"
link = abbEntry.link -- Use link from ABB data
end
-- Create icon with tooltip
local dataLine = '[[File:' .. iconEntry.icon .. '|25px'
if link then
dataLine = dataLine .. '|link=' .. link
end
dataLine = dataLine .. '|' .. iconEntry.tip .. ']]'
local iconSpan = mw.html.create('span')
:addClass('va-icon')
:attr('title', iconEntry.tip)
:wikitext(dataLine)
local rawType = iconEntry.type or ""
local rawType2 = iconEntry.type2 or ""
local displayType = typeLabels[rawType] or rawType
local displayType2 = type2Labels[rawType2] or rawType2
result = result .. '| ' .. prefixDisplay
result = result .. ' || ' .. tostring(iconSpan)
result = result .. ' || ' .. iconEntry.tip
result = result .. ' || ' .. displayType
result = result .. ' || ' .. displayType2
result = result .. '\n|-\n'
end
result = result .. '|}'
return result
end
function p.Test(frame)
--Please empty when done debugging so other users know it is free to use
end
return p
