×
Fallout Wiki

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 (,). Yes 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:
  • small = x10px
  • medium = x14px
  • normal = x14px
  • big = x20px
  • huge = x50px
  • humongous = x100px

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)

No - 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 (,) No 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 (') No - 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. No 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
' Infobox.svg Wiki
ability Ability Ability
absolutely Absolutely! Absolutely! Fallout 76 Animated
ac Armor Class Armor Class
acid Acid Damage Acid Damage
action Action Points (AP) Action Points (AP)
agi Agility Agility
agi dark Agility Agility
alcohol Alcohol Alcohol
amil Another Millenia Another Millenia Mod
ammo Ammunition Ammunition
ammo2 Ammunition Ammunition
android Android OS Android OS Platform
aotl Attack of the Lobotomites! Attack of the Lobotomites! Mod
ap Action Points (AP) Action Points (AP)
apple Apple iOS Apple iOS Platform
ar All Roads All Roads Publication
ar1 America Rising - A Tale of the Enclave America Rising - A Tale of the Enclave Mod
ar2 America Rising 2 - Legacy of the Enclave America Rising 2 - Legacy of the Enclave Mod
armorwb Armor Workbench Armor Workbench Fallout 76
atom Atoms Atoms Fallout 76
attack Attack Attack
awolp A World of (Less) Pain A World of (Less) Pain Mod
awop A World Of Pain A World Of Pain Mod
axed Axed Content Axed Content
balloons Balloons Balloons Fallout 76 Animated
blade Bladed Melee Weapon Bladed Melee Weapon
bleed Bleed Damage Bleed Damage
blunt Blunt Melee Weapon Blunt Melee Weapon
bonezone THE BONE ZONE THE BONE ZONE Community
bonus effect Bonus Effect Bonus Effect
boss Boss Enemy Boss Enemy
brain Learned by default Learned by default
bronze Bronze Bronze
bullion Gold Bullion Gold Bullion Fallout 76
camp C.A.M.P. C.A.M.P. Fallout 76
caps Caps Caps
caravan Plays Caravan Plays Caravan
cards Plays Cards Plays Cards
chance Random Chance Random Chance
chance fo76 Random Chance Random Chance Fallout 76
check Check Check
check1 Check Check
checkbrown Check Check
chems Chems Chems
chemst Chemistry Station Chemistry Station
china China China Flag
chr Charisma Charisma
chr dark Charisma Charisma
colmod Collective Modding Collective Modding Community
comfnv Fallout: New Vegas Community Fallout: New Vegas Community Community
comfo3 Fallout 3 Community Fallout 3 Community Community
comfo4 Fallout 4 Community Fallout 4 Community Community
comfo76 Fallout 76 Community Fallout 76 Community Community
companion Companion Companion
confidence Confidence Confidence
container Container Spawn Container Spawn Fallout 76
cooking Cooking Cooking Fallout 76 Animated
cookst Cooking Station Cooking Station
craft Crafting Crafting
credit Creation Club Credits Creation Club Credits
credits Creation Credits Creation Credits
crit Critical Damage Critical Damage
crit effect Critical Effect Critical Effect
cross No No
crosshair Attack Attack
cryo Cryo Damage Cryo Damage
csep CSEP CSEP Mod
cut Cut Content Cut Content Developer
d20 Fallout Pen and Paper d20 Fallout Pen and Paper d20 Publication
dailyops Daily Ops Daily Ops Fallout 76
damage Damage Damage
dap Armor Class Armor Class
dead Dead Dead Fallout 76
default Learned by default Learned by default
defense Defense Defense
detect Detection Detection
detection Detection Detection
dial Dialogue Dialogue
dialogue Dialogue Dialogue
disabled Physical Disability Representation Physical Disability Representation Fallout 76 Animated
disease Disease Disease
dislike Dislike Dislike
dislike2 Dislike Dislike
distance Distance Distance
diz DiZco12's Lightweight Lore-Friendly Overhaul DiZco12's Lightweight Lore-Friendly Overhaul Mod
doa Dawn of America Dawn of America Mod
doctor Doctor Doctor
dos DOS DOS Platform
dotc Driveables of the Commonweath Driveables of the Commonweath Mod
dps Damage per Second (DPS) Damage per Second (DPS)
dr Damage Resistance (DR) Damage Resistance (DR)
drink Drink Drink Fallout 76
dt Damage Threshold (DT) Damage Threshold (DT)
dur Duration Duration
dust DUST Survival Simulator DUST Survival Simulator Mod
effect Effect Effect
electrical Electrical Damage Electrical Damage
emp EMP EMP
end Endurance Endurance
end dark Endurance Endurance
enemy Enemy Drop Enemy Drop Fallout 76
energy Energy Damage Energy Damage
enslave Can be Enslaved Can be Enslaved
esrbmature Mature Mature Rating
esrbteen Teen Teen Rating
essential Essential Essential
event Event Event
eventpublic Public Event Public Event Fallout 76
expedition Expeditions Expeditions Fallout 76
expeditions Expeditions Expeditions Fallout 76
experience Experience Points (XP) Experience Points (XP)
explmill Explosives Mill Explosives Mill
explosion Explosion Explosion
expo Expeditions Expeditions Fallout 76
expos Expeditions Expeditions Fallout 76
eye Detection Detection
fanfic Fanfiction Fanfiction Community
fb Fallout Bible Fallout Bible Publication
fbg Fallout: The Board Game Fallout: The Board Game Game Main
fbgab Fallout: Atomic Bonds Fallout: Atomic Bonds Game Expansion
fbgagenda influence / Agenda influence / Agenda Fallout Board Game
fbgaggressive Aggressive Aggressive Fallout Board Game
fbgagility Agility Agility Fallout Board Game
fbgapparel Apparel Apparel Fallout Board Game
fbgarmor Armor Armor Fallout Board Game
fbgasset Asset Asset Fallout Board Game
fbgcharisma Charisma Charisma Fallout Board Game
fbgcompanion Companion Companion Fallout Board Game
fbgcritter Critter Critter Fallout Board Game
fbgdangerous Dangerous Dangerous Fallout Board Game
fbgdeadly Deadly Deadly Fallout Board Game
fbgdieablhits VATS die: arms, body, legs, 2 hits VATS die: arms, body, legs, 2 hits Fallout Board Game
fbgendurance Endurance Endurance Fallout Board Game
fbgfreedom Freedom Freedom Fallout Board Game
fbghit Hit Hit Fallout Board Game
fbghuman Human Human Fallout Board Game
fbgintelligence Intelligence Intelligence Fallout Board Game
fbgloot Loot Loot Fallout Board Game
fbgluck Luck Luck Fallout Board Game
fbgmonster Monster Monster Fallout Board Game
fbgnc Fallout: New California Fallout: New California Game Expansion
fbgperception Perception Perception Fallout Board Game
fbgquest Quest action Quest action Fallout Board Game
fbgradiation Radiation Radiation Fallout Board Game
fbgranged Ranged Ranged Fallout Board Game
fbgretreat Retreat Retreat Fallout Board Game
fbgrobot Robot Robot Fallout Board Game
fbgsecurity Security Security Fallout Board Game
fbgsettlement Settlement Settlement Fallout Board Game
fbgstrength Strength Strength Fallout Board Game
fbgsupermutant Super Mutant Super Mutant Fallout Board Game
fbgvault109 Vault 109 Vault 109 Fallout Board Game
fbgvault84 Vault 84 Vault 84 Fallout Board Game
fbgwasteland Wasteland Wasteland Fallout Board Game
fbgweapon Weapon Weapon Fallout Board Game
fear AAAIIIEEE!! AAAIIIEEE!! Fallout 76 Animated
film Fallout Film Fallout Film Canceled
fire Fire Damage Fire Damage
firerate Fire Rate Fire Rate
fist Fist Fist
fnc Fallout: New California Fallout: New California Mod
fnv Fallout: New Vegas Fallout: New Vegas Game Main
fnvce Fallout: New Vegas Official Game Guide Fallout: New Vegas Official Game Guide Publication
fnvce1 Behind the Bright Lights & Big City Behind the Bright Lights & Big City Publication
fnvce2 Faction Profiles Faction Profiles Publication
fnvce3 Tour of the Mojave Wasteland Tour of the Mojave Wasteland Publication
fnvce4 Wild Wasteland Oddities Wild Wasteland Oddities Publication
fnvcs Courier's Stash Courier's Stash Game Expansion
fnvdm Dead Money Dead Money Game Expansion
fnvgra Gun Runners' Arsenal Gun Runners' Arsenal Game Expansion
fnvhh Honest Hearts Honest Hearts Game Expansion
fnvlr Lonesome Road Lonesome Road Game Expansion
fnvowb Old World Blues Old World Blues Game Expansion
fnvww Wild Wasteland Wild Wasteland
fo1 Fallout Fallout Game Main
fo1st Fallout 1st Fallout 1st Fallout 76
FO1ST Fallout 1st Fallout 1st Fallout 76
fo2 Fallout 2 Fallout 2 Game Main
fo3 Fallout 3 Fallout 3 Game Main
fo3bs Broken Steel Broken Steel Game Expansion
fo3mz Mothership Zeta Mothership Zeta Game Expansion
fo3oa Operation: Anchorage Operation: Anchorage Game Expansion
fo3pl Point Lookout Point Lookout Game Expansion
fo3tp The Pitt The Pitt Game Expansion
fo4 Fallout 4 Fallout 4 Game Main
fo4ae Fallout 4 Anniversary Edition Fallout 4 Anniversary Edition Game Main
fo4aut Automatron Automatron Game Expansion
fo4cc Creation Club Creation Club Game Expansion
fo4chain01 Four Key Chain Four Key Chain
fo4chain02 Five Key Chain Five Key Chain
fo4chain03 Five Key Chain Five Key Chain
fo4cw Contraptions Workshop Contraptions Workshop Game Expansion
fo4fh Far Harbor Far Harbor Game Expansion
fo4gr Grognak & the Ruby Ruins Grognak & the Ruby Ruins Game Pip-boy game
fo4holo Holotape Holotape
fo4key01 Quantum Key Quantum Key
fo4key02 Toy Rocketship Key Toy Rocketship Key
fo4key03 Vault Boy Key Vault Boy Key
fo4note Note Note
fo4nv Fallout 4: New Vegas Fallout 4: New Vegas Mod
fo4nw Nuka-World Nuka-World Game Expansion
fo4pa Fallout 4: Project Arroyo Fallout 4: Project Arroyo Mod
fo4vr Fallout 4 VR Fallout 4 VR Game Main
fo4vw Vault-Tec Workshop Vault-Tec Workshop Game Expansion
fo4ww Wasteland Workshop Wasteland Workshop Game Expansion
fo5 Fallout 5 Fallout 5 Canceled
fo76 Fallout 76 Fallout 76 Game Main
fo76aa Armor Ace Armor Ace Game Season
fo76acap Atlantic City America's Playground Atlantic City America's Playground Game Update
fo76acbp Atlantic City Boardwalk Paradise Atlantic City Boardwalk Paradise Game Update
fo76aml Appalachian Modern Living Appalachian Modern Living Game Season
fo76bl A Better Life Underground A Better Life Underground Game Season
fo76bs The Big Score The Big Score Game Season
fo76busp Burning Springs Burning Springs Game Update
fo76bxr Blood x Rust Blood x Rust Game Season
fo76cos The City of Steel The City of Steel Game Season
fo76cr C.A.M.P. Revamp C.A.M.P. Revamp Game Update
fo76cs Cold Steel Cold Steel Game Season
fo76dd Duel with the Devil Duel with the Devil Game Season
fo76di Heart of Steel: A Dread Island Tale Heart of Steel: A Dread Island Tale Game Season
fo76ef Escape from the 42nd Century Escape from the 42nd Century Game Season
fo76etp Expeditions: The Pitt Expeditions: The Pitt Game Update
fo76ff Fight for Freedom Fight for Freedom Game Season
fo76fw Fallout Worlds Fallout Worlds Game Update
fo76gd Gleaming Depths Gleaming Depths Game Update
fo76gdsf Gleaming Depths - The Scientific Forge Gleaming Depths - The Scientific Forge Game Season
fo76gfs Gone Fission Gone Fission Game Season
fo76gfu Gone Fission Gone Fission Game Update
fo76gg Glow of the Ghoul Glow of the Ghoul Game Season
fo76gw Ghoul Within Ghoul Within Game Update
fo76ib Invaders from Beyond Invaders from Beyond Game Update
fo76ll Locked & Loaded Locked & Loaded Game Update
fo76lr The Legendary Run The Legendary Run Game Update
fo76mi Mutation Invasion Mutation Invasion Game Update
fo76mz Milepost Zero Milepost Zero Game Update
fo76mzcr Milepost Zero - Country Road Milepost Zero - Country Road Game Season
fo76nm Night of the Moth Night of the Moth Game Update
fo76nuka Nuka-World Nuka-World Game Season
fo76nw Nuclear Winter Nuclear Winter Game Update
fo76nwt Nuka-World on Tour Nuka-World on Tour Game Update
fo76obm Once in a Blue Moon Once in a Blue Moon Game Update
fo76ow One Wasteland For All One Wasteland For All Game Update
fo76owfa One Wasteland For All One Wasteland For All Game Update
fo76ps Pioneer Scouts - Skyline Valley Pioneer Scouts - Skyline Valley Game Season
fo76rd Rip Daring and the Cryptid Hunt Rip Daring and the Cryptid Hunt Game Season
fo76rdcc Rip Daring and the Cryptids From Beyond the Cosmos Rip Daring and the Cryptids From Beyond the Cosmos Game Season
fo76sa The Scribe of Avalon The Scribe of Avalon Game Season
fo76sd Steel Dawn Steel Dawn Game Update
fo76sfs Shoot for the Stars Shoot for the Stars Game Season
fo76sr Steel Reign Steel Reign Game Update
fo76sv Skyline Valley Skyline Valley Game Update
fo76tlr The Legendary Run The Legendary Run Game Season
fo76tm Test Your Metal Test Your Metal Game Update
fo76tp Expeditions: The Pitt Expeditions: The Pitt Game Update
fo76ts Invaders from Beyond Invaders from Beyond Game Update
fo76tym Test Your Metal Test Your Metal Game Update
fo76un The Unstoppables vs The Diabolicals The Unstoppables vs The Diabolicals Game Season
fo76wa Wild Appalachia Wild Appalachia Game Update
fo76waslad Wastelad Wastelad Game Pip-boy game
fo76wl Wastelanders Wastelanders Game Update
fo76zr Zorbo's Revenge Zorbo's Revenge Game Season
fobos Fallout: Brotherhood of Steel Fallout: Brotherhood of Steel Game Main
fobos2 Fallout: Brotherhood of Steel 2 Fallout: Brotherhood of Steel 2 Canceled
focas FOCAS FOCAS Mod
fod Fallout Demo Fallout Demo Game Main
fodal Fallout Dallas Fallout Dallas Community
fodalartp Arlington Turnpike Arlington Turnpike Community
fodali30 I-30 I-30 Community
fodali35e I-35E I-35E Community
fodali45 I-45 I-45 Community
fodalndtp North Dallas Turnpike North Dallas Turnpike Community
fodalsh289 SH 289 SH 289 Community
fodalsh342 SH 342 SH 342 Community
fodalsh352 SH 352 SH 352 Community
fodalsh356 SH 356 SH 356 Community
fodalsh366 SH 366 SH 366 Community
fodalsh466 SH 466 SH 466 Community
fodalsh78 SH 78 SH 78 Community
fodalus175 US 175 US 175 Community
fodalus67 US 67 US 67 Community
fodalus75 US 75 US 75 Community
fodalus77 US 77 US 77 Community
fodalus80 US 80 US 80 Community
foe Fallout: Equestria Fallout: Equestria Mod
fof Fallout: Factions Fallout: Factions Game Main
fofcr Fallout: Factions Core Rulebook Fallout: Factions Core Rulebook Game Expansion
fofnw Fallout: Factions Battle For Nuka-World Starter Set Fallout: Factions Battle For Nuka-World Starter Set Game Expansion
fofqs Fallout: Factions Welcome to Nuka-World! Quickstart Fallout: Factions Welcome to Nuka-World! Quickstart Game Expansion
follow1 Follow me! Follow me! Fallout 76 Animated
follow2 This way! This way! Fallout 76 Animated
folon Fallout London Fallout London Mod
fonv Fallout: New Vegas Fallout: New Vegas Game Main
fonvdm Dead Money Dead Money Game Expansion
fonvgra Gun Runners' Arsenal Gun Runners' Arsenal Game Expansion
fonvhh Honest Hearts Honest Hearts Game Expansion
fonvlr Lonesome Road Lonesome Road Game Expansion
fonvowb Old World Blues Old World Blues Game Expansion
food Food Food
foodpr Food Processor Food Processor
formerly Formerly Formerly
forpg Fallout: The Roleplaying Game Fallout: The Roleplaying Game Game Main
forpgd6 Combat Dice (d6) Combat Dice (d6) Fallout: The Roleplaying Game
forpgfo Fully Operational Fully Operational Game Expansion
forpggm Fallout: The Roleplaying Game Gamemaster's Toolkit Fallout: The Roleplaying Game Gamemaster's Toolkit Game Expansion
forpggms Fallout: The Roleplaying Game GM Screen Fallout: The Roleplaying Game GM Screen Game Expansion
forpgocs Orange Coloured Sky Orange Coloured Sky Game Expansion
forpgqs Fallout: The Roleplaying Game Quickstart Fallout: The Roleplaying Game Quickstart Game Expansion
forpgrd Rust Devils NPC Pack Rust Devils NPC Pack Game Expansion
forpgrf Royal Flush Royal Flush Game Expansion
forpgsgb Settler's Guide Book Settler's Guide Book Game Expansion
forpgss Fallout: The Roleplaying Game Starter Set Fallout: The Roleplaying Game Starter Set Game Expansion
forpgupon Once Upon a Time in the Wasteland Once Upon a Time in the Wasteland Game Expansion
forpgwgb Wanderer's Guide Book Wanderer's Guide Book Game Expansion
forpgwoa Winter of Atom Winter of Atom Game Expansion
fortn Fortnite: Wrecked Fortnite: Wrecked Publication
fos Fallout Shelter Fallout Shelter Game Main
foso Fallout Shelter Online Fallout Shelter Online Game Main
fot Fallout Tactics Fallout Tactics Game Main
fot2 Fallout Tactics 2 Fallout Tactics 2 Canceled
fotf Fallout: The Frontier Fallout: The Frontier Mod
fotv Fallout Television Series Fallout Television Series Game Main
fow Fallout: Warfare Fallout: Warfare Canceled
foww Fallout: Wasteland Warfare Fallout: Wasteland Warfare Game Main
fowwblast Blast Icon Blast Icon Fallout: Wasteland Warfare
fowwcrit Critical Point Critical Point Fallout: Wasteland Warfare
fowwenergy Energy Damage Energy Damage Fallout: Wasteland Warfare
fowwnuka Nuka-Cola Icon Nuka-Cola Icon Fallout: Wasteland Warfare
fowwphysical Physical Damage Physical Damage Fallout: Wasteland Warfare
fowwrad Radiation Damage Radiation Damage Fallout: Wasteland Warfare
fowwstar Star Icon Star Icon Fallout: Wasteland Warfare
fox Fallout Extreme Fallout Extreme Canceled
fpb Fallout Pip-Boy Fallout Pip-Boy Publication
free Free Content Free Content
frost Frost Frost
fsbg Fallout Shelter: The Board Game Fallout Shelter: The Board Game Game Main
funkymothman Funky Mothman Funky Mothman Fallout 76 Animated
fww Fallout: Wasteland Warfare Fallout: Wasteland Warfare Game Main
fwwaat1 Astoundingly Awesome Tales, #1 Astoundingly Awesome Tales, #1 Game Expansion
fwwaat2 Astoundingly Awesome Tales, #2 Astoundingly Awesome Tales, #2 Game Expansion
fwwaih AI Handbook AI Handbook Game Expansion
fwwbm Battle Mode Battle Mode Game Expansion
fwwch FWW Campaign Handbook FWW Campaign Handbook Game Expansion
fwwcitc Caught in the Crossfire Caught in the Crossfire Game Expansion
fwwcm Commonwealth Rules Commonwealth Rules Game Expansion
fwwcoh Co-Op Handbook Co-Op Handbook Game Expansion
fwwcp Capital Rules Capital Rules Game Expansion
fwwfitf Forged in the Fire Rules Forged in the Fire Rules Game Expansion
fwwga FWW Getting Acclimated FWW Getting Acclimated Game Expansion
fwwhs Homestead Rules Homestead Rules Game Expansion
fwwitv Into the Vault Into the Vault Game Expansion
fwwitw Into the Wasteland Into the Wasteland Game Expansion
fwwnv New Vegas Rules New Vegas Rules Game Expansion
fwwnw Nuka-World Rules Nuka-World Rules Game Expansion
fwwrop FWW Rules of Play FWW Rules of Play Game Expansion
fwwrpg Fallout: Wasteland Warfare Roleplaying Game Fallout: Wasteland Warfare Roleplaying Game Game Main
fwwrpggms Fallout: Wasteland Warfare Roleplaying Game GM Screen Fallout: Wasteland Warfare Roleplaying Game GM Screen Game Expansion
fwwrpgmf Machine Frequency Machine Frequency Game Expansion
fwwrpgtus1 TUS Part 1: Protection Order TUS Part 1: Protection Order Game Expansion
fwwrpgtus2 TUS Part 2: Dangerous Trails TUS Part 2: Dangerous Trails Game Expansion
fwwrpgtus3 TUS Part 3: Battle Station TUS Part 3: Battle Station Game Expansion
game Gameplay Gameplay
gamerscore Gamerscore Gamerscore
gas Gas Gas
gb Great Britain Great Britain Flag
gold Gold Gold
grenade Grenade Grenade
group Group Group
gun Gun Gun
halt STOP RIGHT THERE! STOP RIGHT THERE! Fallout 76 Animated
hate Hate Hate
hate2 Hate Hate
healing Healing Rate (HP/s) Healing Rate (HP/s)
healing rate Healing Rate (HP/s) Healing Rate (HP/s)
health Health Points (HP) Health Points (HP)
heart Health Points (HP) Health Points (HP)
heartbeat Heart Heart Fallout 76 Animated
hellodog Hello! Hello! Fallout 76 Animated
helpme Help me! Help me! Fallout 76 Animated
hp Health Points (HP) Health Points (HP)
hungry Hungry Hungry Fallout 76 Animated
ifw Fallout Wiki Fallout Wiki Wiki
image It is an image I mean what else can I say It is an image I mean what else can I say
info Information Information
int Intelligence Intelligence Fallout 76
int dark Intelligence Intelligence Fallout 76
ios Apple iOS Apple iOS Platform
jes J.E. Sawyer's Fallout RPG J.E. Sawyer's Fallout RPG Publication
jury Jury Rigging Jury Rigging
laser Laser Laser
lck Luck Luck Fallout 76
lck dark Luck Luck Fallout 76
legacy Legacy Content Legacy Content
legendary Legendary Legendary
legendperk Legendary Perk Legendary Perk Fallout 76
level Level Level
lgbtq LGBTQ representation in Fallout LGBTQ representation in Fallout
lh Lionheart Lionheart Canceled
like Like Like
like2 Like Like
limited Limited-Time Limited-Time
limitedtime Limited-Time Limited-Time
loc Location Location Fallout 76
location Location Location Fallout 76
love Love Love
love2 Love Love
lunchbox Lunchbox Lunchbox Fallout 76
mac Macintosh Classic or Mac OS X Macintosh Classic or Mac OS X Platform
macclassic Macintosh Classic (≤ MacOS 9) Macintosh Classic (≤ MacOS 9) Platform
mag Ammo Capacity Ammo Capacity
melee Melee Melee
mentioned Mentioned Mentioned
merch Merch Supporter Merch Supporter Fallout 76
merchant Merchant or Vendor Merchant or Vendor Fallout 76
mine Mine Mine Fallout 76
mod With Mods With Mods
mpfnv More Perks FNV More Perks FNV Mod
mpfo3 More Perks FO3 More Perks FO3 Mod
mtg Magic: The Gathering Magic: The Gathering Publication
mutation Mutation Mutation Fallout 76
mutation dark Mutation Mutation Fallout 76
neutral Neutral Neutral
neutralface Neutral Neutral
neutralface2 Neutral Neutral
new New Content New Content Fallout 76
no No No Fallout 76
none Mentioned-Only location Mentioned-Only location Wiki
none Mentioned-Only location Mentioned-Only location Wiki
note Note Note
notrade Non-Tradeable Non-Tradeable
npc NPC Content NPC Content
nw Nuclear Winter Battle-Royale Nuclear Winter Battle-Royale Fallout 76
optional Optional Optional
optionalicon Optional Optional
pa One Man, and a Crate of Puppets One Man, and a Crate of Puppets Publication
pail Mole Miner Pail Mole Miner Pail Fallout 76
parmorst Power Armor Station Power Armor Station
pbgame Holotape Game Holotape Game
pbw Project: Bygone Weapons Project: Bygone Weapons Mod
pc PC PC Platform
pegi12 PEGI 12 PEGI 12 Rating
pegi16 PEGI 16 PEGI 16 Rating
pegi18 PEGI 18 PEGI 18 Rating
per Perception Perception Fallout 76
percent Random Chance Random Chance Fallout 76
per dark Perception Perception Fallout 76
photo Say cheers! Say cheers! Fallout 76 Animated
physical Physical Damage Physical Damage
pistol Gun Gun Fallout 76
plan Plan or Recipe Plan or Recipe
plasma Plasma Damage Plasma Damage
platinum Platinum Platinum
plus Rewards Rewards
poison Poison Damage Poison Damage
poison2 Poison Damage Poison Damage
possum Possum Badge Possum Badge
possum dark Possum Badge Possum Badge
present Holiday Gift Holiday Gift
ps2 Playstation 2 Playstation 2 Platform
ps3 Playstation 3 Playstation 3 Platform
ps4 Playstation 4 Playstation 4
ps5 Playstation 5 Playstation 5 Platform
publicworkshop Workshop Workshop Fallout 76
pv13 Project V13 Project V13 Canceled
pve Player vs Environment Player vs Environment Fallout 76
pvp Player vs Player Player vs Player Fallout 76
quest Quest Quest Fallout 76
question Question Mark Question Mark
radiated Radiated Radiated Fallout 76 Animated
radiation Radiation Damage Radiation Damage
random Random Chance Random Chance Fallout 76
randomenc Random Encounter Random Encounter Fallout 76
range Range Range
rarity Rarity Rarity
ratio Ratio Ratio
removed Removed Content Removed Content
repair Repair Repair
repairs Repairing! Repairing! Fallout 76 Animated
repeat Repeat Repeat
required Required Required
rifle Rifle Rifle
robotwb Robot Workbench Robot Workbench
rwot Real World on Tour! Real World on Tour! Community
score Scoreboard Scoreboard Fallout 76
scout Pioneer Scouts Pioneer Scouts Fallout 76
scrip Legendary Scrip Legendary Scrip Fallout 76
season Scoreboard Scoreboard Fallout 76
seasonal Seasonal Content Seasonal Content Fallout 76
semi Sometimes required or at least one required Sometimes required or at least one required
semi-required Sometimes required or at least one required Sometimes required or at least one required
sequence Sequence Sequence
shieldbronze Armor Class Armor Class
shieldgold Damage Threshold (DT) Damage Threshold (DT)
shieldsilver Damage Resistance (DR) Damage Resistance (DR)
shotgun Shotgun Shotgun
sic In-game spelling, punctuation and/or grammar In-game spelling, punctuation and/or grammar Wiki
silver Silver Silver
sleepy Sleepy Sleepy Fallout 76 Animated
smg Submachine Gun Submachine Gun
sorry Sorry! Sorry! Fallout 76 Animated
sound Sound Sound
spawn Spawned Spawned Fallout 76
spooky Spooky Scorched Spooky Scorched Fallout 76
spread Spread Spread
stamp Stamps Stamps Fallout 76
star Legendary Legendary
stimpak Stimpak Stimpak Fallout 76
str Strength Strength Fallout 76
str dark Strength Strength Fallout 76
stuadv Schmault Tec University Schmault Tec University Wiki
stucomm Schmault Tec University Schmault Tec University Wiki
studata Schmault Tec University Schmault Tec University Wiki
stuedit Schmault Tec University Schmault Tec University Wiki
stuoutside Schmault Tec University Schmault Tec University Wiki
supplies Supplies Supplies
survival Fallout 76 Survival Mode Fallout 76 Survival Mode Fallout 76
tadpole Tadpole Badge Tadpole Badge Fallout 76
tadpole dark Tadpole Badge Tadpole Badge Fallout 76
tar The Armageddon Rag The Armageddon Rag Canceled
tea Tea Tea
temp Temporary Temporary
terminal Terminal Terminal
test Test cell Test cell Wiki
text Text Text
thirsty Thirsty Thirsty Fallout 76 Animated
ticket Tickets Tickets Fallout 76
tickets Tickets Tickets Fallout 76
torn TORN TORN Canceled
treasuremap Treasure Map Treasure Map
ttw Tale of Two Wastelands Tale of Two Wastelands Mod
uk Great Britain Great Britain Flag
unarmed Unarmed Unarmed
unknown Unknown Unknown Fallout 76 Animated
unused Unused Content Unused Content Wiki
upcoming Upcoming Content Upcoming Content
us United States United States Flag
usa United States United States Flag
vaultboy Vault Boy Vault Boy Wiki
vaultno No No Fallout 76 Animated
vaultraid Vault Raids Vault Raids Fallout 76
vaulttec Vault-Tec Vault-Tec
vb Van Buren Van Buren Canceled
vt Vault-Tec Vault-Tec
Wait Waiting Waiting Fallout 76 Animated
weapwb Weapons Workbench Weapons Workbench
weight Weight Weight
wiki Fallout Wiki Fallout Wiki Wiki
wild wasteland Wild Wasteland Wild Wasteland fnv
windows Windows Phone Windows Phone Platform
ww Wild Wasteland Wild Wasteland
xbox Xbox Xbox Platform
xbox360 Xbox 360 Xbox 360 Platform
xboxone Xbox One Xbox One Platform
xboxseries Xbox Xbox Platform
xp Experience Points (XP) Experience Points (XP)
xpd Expeditions Expeditions Fallout 76
yes 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