FANDOM


local categorization = require('Module:Categorization')
local utils = require('Module:Utils')
 
local categorize = categorization.categorize_in_namespaces('Catalog')
 
local p = {}
 
p.accessory_types = {
    hat = {
        identifier = 8,
        category = "Hats"
    };
    hair = {
        identifier = 41,
        category = "Hair accessories"
    };
    face = {
        identifier = 42,
        category = "Face accessories"
    };
    neck = {
        identifier = 43,
        category = "Neck accessories"
    };
    shoulder = {
        identifier = 44,
        category = "Shoulder accessories"
    };
    front = {
        identifier = 45,
        category = "Front accessories"
    };
    back = {
        identifier = 46,
        category = "Back accessories"
    };
    waist = {
        identifier = 47,
        category = "Waist accessories"
    };
}
 
function p._format_accessory_type(args)
    local accessory_type = args["accessory type"]
    if accessory_type then
        accessory_type_info = p.accessory_types[accessory_type:lower()]
        if accessory_type_info then
            return categorize(accessory_type_info.category)
        elseif accessory_type:lower() == "none" then
            return categorize("Accessories")
        else
            return error("Unknown accessory type")
        end
    else
        return error("No accessory type was given")
    end
end
 
p.format_accessory_type = utils.make_wrapper_function(p._format_accessory_type)
 
return p
Community content is available under CC-BY-SA unless otherwise noted.