local tier_color = {
    "#eeeeee", -- 1, grey
    "#6dd69d", -- 2, green
    "#66aaff", -- 3, blue
    "#ffff99", -- 4, yellow
    "#ff4422", -- 5, red
    "#a744ff", -- 6, purple
    "#5544ff", -- 7, deep blue
}

-- original description
aer_itemdesc.register_tooltip(function(itemname, def)
    local desc = ""
    local old_desc = def.description
    if old_desc == "" then old_desc = nil end

    if old_desc then
        return desc .. old_desc, (tier_color[def._tt_color] or def._tt_color or "#eee")
    end
end, 1)
aer_itemdesc.register_tooltip(function(itemname, def)
    return "-----------------------", "#555"
end)

-----------
-- _tt_long_desc
aer_itemdesc.register_tooltip(function(itemname, def)
    return def._tt_long_desc, "#dddddd"
end)
-- _tt_how_to_use
aer_itemdesc.register_tooltip(function(itemname, def)
    return def._tt_how_to_use, "#aaaaaa"
end)
-- _tt_help
aer_itemdesc.register_tooltip(function(itemname, def)
    return def._tt_help, "#aaaaaa"
end)
-- _tt_uses
aer_itemdesc.register_tooltip(function(itemname, def)
	if not def._tt_uses then return end
    return def._tt_uses .. " total uses", "#eeee33"
end)
-- mod_name:item_name
aer_itemdesc.register_tooltip(function(itemname, def)
    return "\n" .. itemname, "#aaa"
end)
-----------

