Skip to main content

Skin Gifts

Version History

Build VersionChange DateChange TypeDescription
6760422025-06-21stableCurrent version

Overview

The skin_gifts.lua file defines the gift system configuration for skin items and reward popups in Don't Starve Together. This file is automatically generated by the export_accountitems.lua script and contains mappings between skin items and their associated gift types, as well as popup display configurations for different gift categories.

Usage Example

-- Access gift system data
local skin_gifts = require("skin_gifts")

-- Get gift type for a specific skin item
local function get_gift_type(item_name)
return skin_gifts.types[item_name]
end

-- Get popup configuration for a gift type
local function get_popup_config(gift_type)
return skin_gifts.popupdata[gift_type]
end

-- Example usage
local torch_gift_type = get_gift_type("torch_nautical") -- Returns "TWITCH_DROP"
local popup_config = get_popup_config("TWITCH_DROP") -- Returns popup display data

Data Structure

The file returns a table with two main components:

{
types = SKIN_GIFT_TYPES, -- Maps skin items to gift types
popupdata = SKIN_GIFT_POPUPDATA -- Defines popup display configurations
}

Gift Types

SKIN_GIFT_TYPES Table

Maps individual skin items to their corresponding gift type categories:

SKIN_GIFT_TYPES = {
["item_name"] = "GIFT_TYPE",
-- Example:
["torch_nautical"] = "TWITCH_DROP",
["backpack_heart"] = "CUPID",
["mysterybox_terraria"] = "DEFAULT"
}

Supported Gift Types

Gift TypeDescriptionExample Items
ANRARGA New Reign ARG rewardscane_ancient, treasurechest_sacred
ARGAlternate Reality Game rewardstorch_shadow, torch_shadow_alt
CUPIDValentine's Day themed itemsbackpack_heart, emote_swoon, reviver_cupid
DEFAULTStandard mystery box itemsmysterybox_terraria, mysterybox_invisible_5
GORGEThe Gorge event rewardsplayerportrait_bg_foods
GORGE_TOURNAMENTGorge tournament rankingsprofileflair_quagmiretournament_gold
HAMLETHamlet DLC themed packpack_hamlet_wormwood
HOTLAVAHot Lava crossoverpack_hl_gift
LUNAR_NYLunar New Year itemswinterhat_rooster
ONIOxygen Not Included crossoverglomling_puft, pack_oni_gift
ROGReign of Giants DLC packpack_rog_gift
ROT2Return of Them updatemast_crabking
SWShipwrecked DLC packpack_sw_gift
TOTTurn of Tides updatemast_rose
TWITCH_DROPTwitch streaming rewardsMost themed skins and items
VARGVarg event rewardwinterhat_fancy_puppy
WINTERWinter/Holiday themedbeargervest_yule, mysterybox_ugly_3
YOTBYear of the Beefalosaddle_basic_yotb, saddle_basic_yotbalt
YOTPYear of the Pig Kingbeefalohat_pigking

SKIN_GIFT_POPUPDATA Table

Defines visual presentation settings for gift popup dialogs:

SKIN_GIFT_POPUPDATA = {
["GIFT_TYPE"] = {
atlas = "texture_atlas_path",
image = "texture_name.tex",
titleoffset = {x, y, z},
title_size = number -- Optional
}
}
PropertyTypeDescription
atlasstringPath to texture atlas XML file
imagestringTexture filename within the atlas
titleoffsettable3D position offset {x, y, z} for title text
title_sizenumberOptional font size override for title

Example Popup Configurations

-- Twitch Drop popup
TWITCH_DROP = {
atlas = "images/thankyou_twitch.xml",
image = "twitch.tex",
titleoffset = {0, -20, 0}
}

-- Winter themed popup
WINTER = {
atlas = "images/thankyou_winter.xml",
image = "winter.tex",
titleoffset = {0, -30, 0}
}

-- Hamlet DLC popup with custom positioning
HAMLET = {
atlas = "images/thankyou_hamlet.xml",
image = "hamlet.tex",
titleoffset = {-120, 0, 0}
}

Functions

Gift Type Utilities

-- Check if item has associated gift type
local function is_gift_item(item_name)
return skin_gifts.types[item_name] ~= nil
end

-- Get all items of specific gift type
local function get_items_by_gift_type(target_type)
local items = {}
for item, gift_type in pairs(skin_gifts.types) do
if gift_type == target_type then
table.insert(items, item)
end
end
return items
end

-- Get popup display configuration
local function get_gift_popup_config(gift_type)
local config = skin_gifts.popupdata[gift_type]
if config then
return {
atlas = config.atlas,
image = config.image,
titleoffset = config.titleoffset,
title_size = config.title_size
}
end
return nil
end

Gift System Integration

-- Display gift received popup
local function show_gift_popup(item_name, callback)
local gift_type = skin_gifts.types[item_name]
if gift_type then
local popup_config = skin_gifts.popupdata[gift_type]
if popup_config then
-- Create and display popup with configuration
local popup = CreateGiftPopup(popup_config)
popup:Show(callback)
end
end
end

-- Validate gift item configuration
local function validate_gift_item(item_name)
local gift_type = skin_gifts.types[item_name]
if not gift_type then
return false, "No gift type defined"
end

local popup_config = skin_gifts.popupdata[gift_type]
if not popup_config then
return false, "No popup configuration for gift type: " .. gift_type
end

return true, "Valid gift item"
end

Item Categories

Themed Skin Collections

Nautical Theme (TWITCH_DROP):

  • boat_nautical, anchor_nautical, mast_nautical
  • torch_nautical, hambat_nautical, fishbox_nautical

Crystal Theme (TWITCH_DROP):

  • beebox_crystal, icebox_crystal, lantern_crystal
  • dragonflyfurnace_crystal, telebase_crystal

Circus Theme (TWITCH_DROP):

  • arrowsign_post_circus, birdcage_circus, featherhat_circus
  • tent_circus, tophat_circus, umbrella_circus

Valentine's Theme (CUPID):

  • backpack_heart, emote_swoon, shovel_heart
  • reviver_cupid series, treasurechest_cupid

Profile Decorations

All playerportrait_bg_* and profileflair_* items provide UI customization options and inherit their gift types from the corresponding base items.

Integration Points

This system integrates with:

  • Reward System: Determines how items are presented when received
  • UI System: Popup display and visual presentation
  • Account System: Tracking gift sources and acquisition methods
  • Event System: Special event and promotion item handling
  • Inventory System: Item categorization and organization

Auto-Generation

This file is automatically generated and should not be manually edited:

  1. Source: export_accountitems.lua processes account item definitions
  2. Update Trigger: New items, events, or promotional campaigns
  3. Validation: Ensures all gift types have popup configurations
  4. Consistency: Maintains uniform gift presentation across updates