Module:Icons: Difference between revisions

4,837 bytes removed ,  15 October 2022
Amend extension overrides & default extension - The majority of images are now of type PNG rather than SVG
(Amend Melee image override)
(Amend extension overrides & default extension - The majority of images are now of type PNG rather than SVG)
Line 8: Line 8:


local p = {}
local p = {}
--Extension overrides for items that have non-svg images
--Extension overrides for items that have non-png images
--Name level overrides take precedence over type level overrides
local extOverrides = {
local extOverrides = {
["Adventure"] = "png",
["type"] = {
["Crown of Rhaelyx"] = "png",
["spell"] = "svg",
["Jewel of Rhaelyx"] = "png",
["curse"] = "svg", -- Some exceptions included by name below
["Circlet of Rhaelyx"] = "png",
["aurora"] = "svg",
["Charge Stone of Rhaelyx"] = "png",
["combatArea"] = "svg",
["Mysterious Stone"] = "png",
["dungeon"] = "svg",
["Lemon"] = "jpg",
["prayer"] = "svg",
["Lemons"] = "jpg",
["upgrade"] = "svg", -- Some exceptions included by name below
["Lemonade"] = "jpg",
["tree"] = "svg",
["Miolite Sprig"] = "png",
["rock"] = "svg", -- Some exceptions included by name below
["Miolite Trio"] = "png",
["thieving"] = "svg",
["Miolite Warden"] = "png",
["mark"] = "svg", -- Some exceptions included by name below
["Miolite Monarch"] = "png",
["constellation"] = "svg",
["Wicked Greater Dragon"] = "png",
["building"] = "svg"
["Hunting Greater Dragon"] = "png",
},
["Chaotic Greater Dragon"] = "png",
["name"] = {
["Beavis"] = "png",
-- General
["Pudding Duckie"] = "png",
["Adventure"] = "png",
["Pyro"] = "png",
-- Items
["Snek"] = "png",
["Amulet of Fishing"] = "svg",
["Larry, the Lonely Lizard"] = "png",
["Lemon"] = "jpg",
["Caaarrrlll"] = "png",
["Lemons"] = "jpg",
["Gronk"] = "png",
["Lemonade"] = "jpg",
["Finn, the Cat"] = "png",
["Ancient Crossbow"] = "svg",
["Marahute"] = "png",
["Air Shard"] = "svg",
["Monk-ey"] = "png",
["Water Shard"] = "svg",
["Asura"] = "png",
["Earth Shard"] = "svg",
["Summoning Shard (Silver)"] = "png",
["Fire Shard"] = "svg",
["Summoning Shard (Red)"] = "png",
["Confetti Crossbow"] = "svg",
["Summoning Shard (Green)"] = "png",
["Cloudburst Staff"] = "gif",
["Summoning Shard (Gold)"] = "png",
["Shockwave"] = "svg",
["Summoning Shard (Blue)"] = "png",
["Golbin Thief"] = "svg",
["Summoning Shard (Black)"] = "png",
["Occultist"] = "svg",
['Infernal Core'] = 'png',
["Wolf"] = "svg",
['Cool Glasses'] = 'png',
["Ent"] = "svg",
["Wizard's Sigil"] = 'png',
["Mole"] = "svg",
["Wizard's Scroll"] = 'png',
["Octopus"] = "svg",
["Whetstone"] = 'png',
["Minotaur"] = "svg",
["Whale (Perfect)"] = 'png',
["Centaur"] = "svg",
["Trout (Perfect)"] = 'png',
["Witch"] = "svg",
["Training Shield"] = 'png',
["Pig"] = "svg",
["Thiever's Cape"] = 'png',
["Crow"] = "svg",
["Thief's Moneysack"] = 'png',
["Leprechaun"] = "svg",
["Swordfish (Perfect)"] = 'png',
["Cyclops"] = "svg",
["Strawberry Cupcake (Perfect)"] = 'png',
["Yak"] = "svg",
["Strawberry Cupcake"] = 'png',
["Unicorn"] = "svg",
["Strawberry Cake (Perfect)"] = 'png',
["Dragon"] = "svg",
["Strawberry Cake"] = 'png',
["Monkey"] = "svg",
["Stack of Bones"] = 'png',
["Salamander"] = "svg",
["Sneak-Ers"] = 'png',
["Bear"] = "svg",
["Shrimp (Perfect)"] = 'png',
["Devil"] = "svg",
["Shipwheel"] = 'png',
-- Pets
["Shark (Perfect)"] = 'png',
["Cris"] = "svg",
["Seed Pouch"] = 'png',
["Cool Rock"] = "svg",
["Seahorse (Perfect)"] = 'png',
["Puff, the Baby Dragon"] = "svg",
["Sardine (Perfect)"] = 'png',
["Bruce"] = "svg",
["Salmon (Perfect)"] = 'png',
["Lil Ron"] = "svg",
["Sailor's Top"] = 'png',
["Leonardo"] = "svg",
["Runecrafting Pouch"] = 'png',
["Golden Golbin"] = "svg",
["Ring of Wealth"] = 'png',
["Ty"] = "svg",
["Raw Chicken"] = 'png',
["Ripper the Reindeer"] = "svg",
["Raw Beef"] = 'png',
["Chick"] = "svg",
["Prayer Scroll"] = 'png',
["Zarrah"] = "svg",
["Plain Pizza Slice (Perfect)"] = 'png',
["Chio"] = "svg",
["Plain Pizza Slice"] = 'png',
["Bouncing Bob"] = "svg",
["Pile of Ores"] = 'png',
["Rosey"] = "svg",
["Pile of Logs"] = 'png',
["Ayyden"] = "svg",
["Miner's Helmet"] = 'png',
["Arctic Yeti"] = "svg",
["Merchant's Permit"] = 'png',
["Mac"] = "svg",
["Meat Pizza Slice (Perfect)"] = 'png',
["Jerry the Giraffe"] = "svg",
["Meat Pizza Slice"] = 'png',
["Preston the Platypus"] = "svg",
["Marksman's Sigil"] = 'png',
["Quill"] = "svg",
["Manta Ray (Perfect)"] = 'png',
["Gunter"] = "svg",
["Lumberjack's Top"] = 'png',
["Salem"] = "svg",
["Lobster (Perfect)"] = 'png',
["Peri"] = "svg",
["Lemon Cake (Perfect)"] = 'png',
["Otto"] = "svg",
["Lemon Cake"] = 'png',
["Jelly Jim"] = "svg",
["Knight's Sigil"] = 'png',
["Harley"] = "svg",
["Knight's Defender"] = 'png',
["Singe"] = "svg",
["Knight's Cape"] = 'png',
["Aquarias"] = "svg",
["Jeweled Necklace"] = 'png',
["Norman"] = "svg",
["Jester's Hat"] = 'png',
["Erran"] = "svg",
["Jadestone"] = 'png',
["Ren"] = "svg",
["Herring (Perfect)"] = 'png',
["Pablo"] = "svg",
["Hearty Soup (Perfect)"] = 'png',
["Sam"] = "svg",
["Hearty Soup"] = 'png',
["Tim the Wolf"] = "svg",
["Gold Crested Shield"] = 'png',
["Mark"] = "svg",
["Golbin Mask"] = 'png',
["Astro"] = "svg",
["Giant Club"] = 'png',
-- Curses, included to override the type level override above
["Fishing Hook"] = 'png',
["Madness"] = "png",
["Fine Coinpurse"] = 'png',
["Torment"] = "png",
["Fanfish (Perfect)"] = 'png',
["Despair"] = "png",
["Cream Corn Soup (Perfect)"] = 'png',
-- Upgrades, included to override the type level override above
["Cream Corn Soup"] = 'png',
["Golbin Crate"] = "png",
["Cream"] = 'png',
["Corundum Axe"] = "png",
["Crate of Food"] = 'png',
["Augite Axe"] = "png",
["Crate of Basic Supplies"] = 'png',
["Meteorite Axe"] = "png",
["Crab (Perfect)"] = 'png',
["Divine Axe"] = "png",
["Cooking Apron"] = 'png',
["Spruce Cooking Fire"] = "png",
["Chicken Soup (Perfect)"] = 'png',
["Elderwood Cooking Fire"] = "png",
["Chicken Soup"] = 'png',
["Carrion Cooking Fire"] = "png",
["Chicken (Perfect)"] = 'png',
["Iridium Pot"] = "png",
["Chest of Gems"] = 'png',
["Palladium Pot"] = "png",
["Cherry Seeds"] = 'png',
["Divine Pot"] = "png",
["Cherry Cupcake (Perfect)"] = 'png',
["Corundum Furnace"] = "png",
["Cherry Cupcake"] = 'png',
["Augite Furnace"] = "png",
["Cherry"] = 'png',
["Divine Furnace"] = "png",
["Chef's Spoon"] = 'png',
["Sign of the Stars"] = "png",
["Chef's Hat"] = 'png',
["Summoner's Altar"] = "png",
["Cheese"] = 'png',
["Golden Shard"] = "png",
["Cave Giant Boots"] = 'png',
-- Rocks (Mining), included to override the type level override above
["Cave Fish (Perfect)"] = 'png',
["Rune Essence"] = "png",
["Carrot Cake (Perfect)"] = 'png',
["Pure Essence"] = "png",
["Carrot Cake"] = 'png',
["Onyx"] = "png",
["Carp (Perfect)"] = 'png',
["Oricha"] = "png",
["Bread (Perfect)"] = 'png',
["Cerulean"] = "png",
["Bread"] = 'png',
-- Marks (Summoning), included to override the type level override above
["Book of Scholars"] = 'png',
["Eagle"] = "png",
["Bob's Gloves"] = 'png',
["Owl"] = "png",
["Beef Pie (Perfect)"] = 'png',
["Beaver"] = "png",
["Beef Pie"] = 'png',
["Fox"] = "png",
["Beef (Perfect)"] = 'png',
["Lightning Spirit"] = "png",
["Beef"] = 'png',
["Siren"] = "png",
["Basic Soup (Perfect)"] = 'png',
["Spider"] = "png",
["Basic Soup"] = 'png',
["Spectre"] = "png"
["Basic Bag"] = 'png',
}
["Bag of Flour"] = 'png',
["Apple Tree Seeds"] = 'png',
["Apple Pie (Perfect)"] = 'png',
["Apple Pie"] = 'png',
["Apple"] = 'png',
["Antique Vase"] = 'png',
["Anglerfish (Perfect)"] = 'png',
["Amulet of Incantation"] = 'png',
["Alchemist's Bag"] = 'png',
["Absorbing Shield"] = 'png',
["Shield of Melee Power"] = 'png',
["Shield of Ranged Power"] = 'png',
["Shield of Magic Power"] = 'png',
["Ring of Power"] = 'png',
["Beginning of the End"] = 'png',
["Goo"] = 'png',
["Wildflower"] = 'png',
["Nature's Call Staff Top"] = 'png',
["Nature's Call Staff Bottom"] = 'png',
["Fine Poison Powder"] = 'png',
["Poison Scales"] = 'png',
["Miolite Spore"] = 'png',
["Poison Essence"] = 'png',
["Worm Spike"] = 'png',
["Burning Essence"] = 'png',
["Cursed Hands"] = 'png',
["Stinging Essence"] = 'png',
["Tough Shell"] = 'png',
["Undead Essence"] = 'png',
["Desecrated Bones"] = 'png',
["War Axe"] = 'png',
["Warberd"] = 'png',
["Throwing Power Gloves"] = 'png',
["Slingshot"] = 'png',
["Elerine Longbow"] = 'png',
["Elerine Spear"] = 'png',
["Nature's Call Staff"] = 'png',
["Nature's Wrath Staff"] = 'png',
["Nature's Blessing Ring"] = 'png',
["Poisoned Shortbow"] = 'png',
["Poisoned Dagger"] = 'png',
["Scaled Shield"] = 'png',
["Poison Virulence Ring"] = 'png',
["Poison Virulence Gloves"] = 'png',
["Burning Madness Ring"] = 'png',
["Burning Madness Gloves"] = 'png',
["Spiked Shell Ring"] = 'png',
["Spiked Shell Gloves"] = 'png',
["Relentless Fury Ring"] = 'png',
["Relentless Fury Gloves"] = 'png',
["Ring of Blade Echoes"] = 'png',
["Ring of Barrage"] = 'png',
["Ring of Spirit Power"] = 'png',
["Hinder Potion I"] = 'png',
["Hinder Potion II"] = 'png',
["Hinder Potion III"] = 'png',
["Hinder Potion IV"] = 'png',
["Famished Potion I"] = 'png',
["Famished Potion II"] = 'png',
["Famished Potion III"] = 'png',
["Famished Potion IV"] = 'png',
["Lethal Toxins Potion I"] = 'png',
["Lethal Toxins Potion II"] = 'png',
["Lethal Toxins Potion III"] = 'png',
["Lethal Toxins Potion IV"] = 'png',
["Impending Darkness"] = 'png',
["Mastery Token (Astrology)"] = 'png',
["Stardust"] = 'png',
["Golden Stardust"] = 'png',
["Astrology Skillcape"] = 'png',
["Secret Stardust Potion I"] = 'png',
["Secret Stardust Potion II"] = 'png',
["Secret Stardust Potion III"] = 'png',
["Secret Stardust Potion IV"] = 'png',
["Noxious Serpent"] = 'png',
["Venomous Snake"] = 'png',
["Legaran Wurm"] = 'png',
["Spiked Red Claw"] = 'png',
["Greater Skeletal Dragon"] = 'png',
["Giant Moth"] = 'png',
["Elerine Mage"] = 'png',
["Elerine Warrior"] = 'png',
["Elerine Archer"] = 'png',
["Cursed Lich"] = 'png',
["Christmas Present (Blue)"] = 'png',
["Christmas Present (Green)"] = 'png',
["Christmas Present (Purple)"] = 'png',
["Christmas Present (Standard)"] = 'png',
["Christmas Present (White)"] = 'png',
["Christmas Present (Yellow)"] = 'png',
["Edible Candy Cane"] = 'png',
["Event Token (Holiday 2021)"] = 'png',
["Gingerbread House"] = 'png',
["Gingerbread Man"] = 'png',
["Holiday Scarf"] = 'png',
["Locked Chest"] = 'png',
["Locked Chest Key"] = 'png',
["Festive Chio"] = 'png',
["Festive Cool Rock"] = 'png',
["Mastery Tokens"] = 'gif',
["Enchanted Topaz Bolts"] = 'png',
["Enchanted Sapphire Bolts"] = 'png',
["Enchanted Ruby Bolts"] = 'png',
["Enchanted Emerald Bolts"] = 'png',
["Enchanted Diamond Bolts"] = 'png',
["Enchanted Jadestone Bolts"] = 'png',
["Poison Ring"] = 'png',
["Burning Ring"] = 'png',
["Frostburn Ring"] = 'png',
["Ultima Godsword"] = 'png',
["Mystery Wand"] = 'png',
["Poison Arrows"] = 'png',
["Fire Arrows"] = 'png',
["Frostburn Arrows"] = 'png',
["Burning Wand"] = 'png',
["Frostburn Wand"] = 'png',
["Ring of Balance"] = 'png',
["Flying Cape"] = 'png',
["Amulet of Healing"] = 'png',
["Sword of Some Reliability"] = 'png',
["One Layer Shield"] = 'png',
["Warding Shield"] = 'png',
["Tilted Crossbow"] = 'png',
["Ultimate Speed Boots"] = 'png',
["Almighty Ring"] = 'png',
["Punching Bag Platebody"] = 'png',
["Precision Gloves"] = 'png',
["Heavy Gloves"] = 'png',
["Ultimate Slapping Gloves"] = 'png',
["Amulet of Burning Leech"] = 'png',
["Amulet of Poison Leech"] = 'png',
["Magic Critical Amulet"] = 'png',
["Melee Critical Amulet"] = 'png',
["Bloodthirst Amulet"] = 'png',
["Dragon Head Helmet"] = 'png',
["Stonewall Shield"] = 'png',
["Impossible Longbow"] = 'png',
["Throwing Dragon Sword"] = 'png',
["Golbin Crate"] = 'png',
["Bone"] = 'png',
["Tidal Edge"] = 'png',
["Darksteel Dagger"] = 'png'
}
}


--Some overrides only apply for a specific type
--Some overrides only apply for a specific type
local typeExtOverrides = {
local typeExtOverrides = {
['item'] = {
-- Example: ["item"] = { ["Chicken"] = "png" }
['Chicken'] = 'png'
}
}
}


Line 379: Line 236:
local text = args[2]
local text = args[2]
local iconType = args.type
local iconType = args.type
local ext = args.ext ~= nil and args.ext ~= '' and args.ext or 'svg'
local ext = args.ext ~= nil and args.ext ~= '' and args.ext or 'png'
local notext = args.notext ~= nil and args.notext ~= ''
local notext = args.notext ~= nil and args.notext ~= ''
local nolink = args.nolink ~= nil and args.nolink ~= ''
local nolink = args.nolink ~= nil and args.nolink ~= ''
Line 415: Line 272:
ovrTypeExt = ovrTypeExt[img]
ovrTypeExt = ovrTypeExt[img]
end
end
local ovrExt = extOverrides[img]
local ovrType = typeOverrides[iconType]
local ovrType = typeOverrides[iconType]
local ovrExt = extOverrides.name[img]
if ovrExt == nil then
ovrExt = extOverrides.type[ovrType or iconType]
end
if not hasText and ovrTxt ~= nil then
if not hasText and ovrTxt ~= nil then
text = ovrTxt
text = ovrTxt
Line 432: Line 292:
elseif ovrExt ~= nil then
elseif ovrExt ~= nil then
ext = ovrExt
ext = ovrExt
elseif iconType == 'mark' then
ext = 'png'
end
end
if ovrType ~= nil then
if ovrType ~= nil then