Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local is_local = false
- local append = (is_local and "(Local)") or "(Client)"
- name = "Hide Armor/Hats "..append
- author = "Crimeraaa"
- description =
- [[
- Client-only mod that lets you choose which hats/armors/clothing you want to hide.
- This should be helpful if you get annoyed that various items cover up neat art details.
- ]]
- version = "1.0.5"
- api_version = 10
- dst_compatible = true
- dont_starve_compatible = false
- client_only_mod = true
- server_only_mod = false
- all_clients_require_mod = false
- -- icon_atlas = "modicon.xml"
- -- icon = "modicon.tex"
- local function FormatOption(description, data, hover)
- return {
- description = description,
- data = data,
- hover = hover
- }
- end
- local function AddTitle(title)
- return {
- name = "",
- label = title,
- hover = "",
- options = {
- { description = "", data = 0 }
- },
- default = 0,
- }
- end
- local function AddOption(name, label, hover, options, default)
- return {
- name = name,
- label = label,
- hover = hover,
- options = options,
- default = default,
- }
- end
- local item_opts = {
- FormatOption("Hide", true, "This item will be invisible when equipped."),
- FormatOption("Show", false, "This item will be visible when equipped."),
- }
- local item_fx_opts = {
- FormatOption("Disable", true, "This item's visual effects will be disabled."),
- FormatOption("Enable", false, "This item's visual effects will stay enabled."),
- }
- -- TODO: Find a way to actually hide the Polly Roger's Hat
- -- Keep this in sync with the table in `scripts/equip_list`.
- -- All built-in Lua 5.1 functions/libraries aren't available in modinfo, like `require`.
- local items_list = {
- {
- name = "Backpacks",
- data = {
- { prefab = "backpack", display = "Backpack" },
- { prefab = "candybag", display = "Candy Bag" },
- { prefab = "spicepack", display = "Chef Pouch" },
- { prefab = "icepack", display = "Insulated Pack" },
- { prefab = "krampus_sack", display = "Krampus Sack" },
- { prefab = "piggyback", display = "Piggyback" },
- { prefab = "seedpouch", display = "Seed Pack-It" },
- },
- },
- {
- name = "Headslot Armors",
- data = {
- { prefab = "wathgrithrhat", display = "Battle Helm" },
- { prefab = "beehat", display = "Beekeeper Hat" },
- {
- prefab = "lunarplanthat",
- display = "Brightshade Helm",
- fx = {
- prefab = "lunarplanthat_fx",
- display = "Brightshade Helm FX",
- hover = "Disable this to actually hide the helmet.",
- },
- },
- { prefab = "skeletonhat", display = "Bone Helm" },
- { prefab = "cookiecutterhat", display = "Cookie Cutter Cap" },
- { prefab = "dreadstonehat", display = "Dreadstone Helm" },
- { prefab = "eyemaskhat", display = "Eye Mask" },
- { prefab = "footballhat", display = "Football Helmet" },
- { prefab = "slurtlehat", display = "Shelmet" },
- { prefab = "armorruins", display = "Thulecite Helm" },
- {
- prefab = "voidclothhat",
- display = "Void Cowl",
- fx = {
- prefab = "voidclothhat_fx",
- display = "Void Cowl FX",
- hover = "Disable this to actually hide the helmet.",
- },
- },
- },
- },
- {
- name = "Bodyslot Armors",
- data = {
- { prefab = "armor_bramble", display = "Bramble Husk" },
- { prefab = "armor_lunarplant", display = "Brightshade Armor" },
- { prefab = "armorskeleton", display = "Bone Armor" },
- { prefab = "armordreadstone", display = "Dreadstone Armor" },
- { prefab = "armorgrass", display = "Grass Suit" },
- { prefab = "armorwood", display = "Log Suit" },
- { prefab = "armormarble", display = "Marble Suit" },
- { prefab = "armor_sanity", display = "Night Armor" },
- { prefab = "armordragonfly", display = "Scalemail" },
- --[[ Originally used "armorbramble" instead of "armor_bramble" LMAO ]]
- { prefab = "armorsnurtleshell", display = "Snurtle Shell Armor" },
- { prefab = "armorruins", display = "Thulecite Suit" },
- },
- },
- {
- name = "Headslot Clothing (DS)",
- data = {
- { prefab = "catcoonhat", display = "Cat Cap" },
- { prefab = "beefalohat", display = "Beefalo Hat" },
- { prefab = "bushhat", display = "Bush Hat" },
- { prefab = "eyebrellahat", display = "Eyebrella" },
- { prefab = "watermelonhat", display = "Fashion Melon" },
- { prefab = "featherhat", display = "Feather Hat" },
- { prefab = "flowerhat", display = "Garland" },
- { prefab = "icehat", display = "Ice Cube" },
- { prefab = "minerhat", display = "Miner Hat" },
- { prefab = "molehat", display = "Moggles" },
- { prefab = "earmuffshat", display = "Rabbit Earmuffs" },
- { prefab = "rainhat", display = "Rain Hat" },
- { prefab = "strawhat", display = "Straw Hat" },
- { prefab = "spiderhat", display = "Spiderhat" },
- { prefab = "walrushat", display = "Tam o' Shanter" },
- {
- prefab = "tophat",
- display = "Top Hat",
- fx = {
- prefab = "tophat_shadow_fx",
- display = "Magician's Top Hat FX",
- hover = "Disable this if you want to remove the shadows.",
- }
- },
- { prefab = "winterhat", display = "Winter Hat" },
- },
- },
- {
- name = "Headslot Clothing (DST)",
- data = {
- { prefab = "moonstorm_goggleshat", display = "Astroggles" },
- { prefab = "balloonhat", display = "Balloon Hat" },
- { prefab = "blue_mushroomhat", display = "Blue Funcap" },
- { prefab = "monkey_mediumhat", display = "Captain's Tricorn" },
- { prefab = "alterguardianhat", display = "Celestial Crown" },
- { prefab = "mermhat", display = "Clever Disguise" },
- { prefab = "deserthat", display = "Desert Goggles" },
- { prefab = "goggleshat", display = "Fashion Goggles" },
- { prefab = "plantregistryhat", display = "Gardeneer Hat" },
- { prefab = "green_mushroomhat", display = "Green Funcap" },
- { prefab = "batnosehat", display = "Milkmade Hat" },
- { prefab = "nightcaphat", display = "Nightcap" },
- { prefab = "nutrientsgoggleshat", display = "Premier Gardeneer Hat" },
- { prefab = "monkey_smallhat", display = "Pirate's Bandana" },
- { prefab = "walterhat", display = "Pinetree Pioneer Hat" },
- -- This hat is so stubborn, it refuses to be hidden via the mod
- -- Yet hiding it via the ingame console it perfectly fine? >:(
- -- { prefab = "polly_rogershat", display = "Polly Roger's Hat" },
- { prefab = "red_mushroomhat", display = "Red Funcap" },
- { prefab = "kelphat", display = "Seawreath" },
- { prefab = "antlionhat", display = "Turf-Raiser Helm" },
- },
- },
- {
- name = "Bodyslot Clothing",
- data = {
- --[[ Originally missed a space between "armor" and "slurper" smh ]]
- { prefab = "armor_slurper", display = "Belt of Hunger" },
- { prefab = "trunkvest_summer", display = "Breezy Vest" },
- { prefab = "sweatervest", display = "Dapper Vest" },
- { prefab = "hawaiianshirt", display = "Floral Shirt" },
- { prefab = "beargervest", display = "Hibearnation Vest" },
- { prefab = "balloonvest", display = "Inflatable Vest" },
- { prefab = "onemanband", display = "One Man Band" },
- { prefab = "raincoat", display = "Rain Coat" },
- { prefab = "reflectivevest", display = "Summer Frest" },
- { prefab = "trunkvest_winter", display = "Puffy Vest" },
- },
- },
- {
- name = "Amulets",
- data = {
- { prefab ="blueamulet", display = "Chilled Amulet" },
- { prefab ="greenamulet", display = "Construction Amulet" },
- { prefab ="orangeamulet", display = "The Lazy Forager" },
- { prefab ="amulet", display = "Life Giving Amulet" },
- { prefab ="yellowamulet", display = "Magiluminescence" },
- { prefab ="purpleamulet", display = "Nightmare Amulet" },
- },
- },
- }
- local STATIC_I = 1
- local item_hover = "Show or Hide '"
- local item_hover_default = "\n(Default: Show)"
- local fx_hover_default = "\n(Default: Enable)"
- local function CategoryConfigs(configs, data)
- for i=1, #data do
- STATIC_I = STATIC_I + 1
- configs[STATIC_I] = AddOption(
- data[i].prefab, --[[ name ]]
- data[i].display, --[[ label ]]
- item_hover .. data[i].display .."'?".. item_hover_default, --[[ hover ]]
- item_opts, --[[ options ]]
- false --[[ default ]]
- )
- if data[i].fx then
- STATIC_I = STATIC_I + 1
- configs[STATIC_I] = AddOption(
- data[i].fx.prefab, --[[ name ]]
- data[i].fx.display, --[[ label ]]
- data[i].fx.hover .. fx_hover_default, --[[ hover ]]
- item_fx_opts, --[[ options ]]
- false --[[ default ]]
- )
- end
- end
- end
- local function CreateConfigs(tbl)
- local configs = {}
- configs[STATIC_I] = AddTitle("Hide or Show?")
- for i=1, #tbl do
- local category = tbl[i]
- STATIC_I = STATIC_I + 1
- configs[STATIC_I] = AddTitle(category.name)
- CategoryConfigs(configs, category.data)
- end
- return configs
- end
- -- at the very least, i don't have to type AddOption over and over again myself and can just update the table to update the configs :)
- configuration_options = CreateConfigs(items_list)
Advertisement
Add Comment
Please, Sign In to add comment