Skin Gifts
Version History
| Build Version | Change Date | Change Type | Description |
|---|---|---|---|
| 676042 | 2025-06-21 | stable | Current 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 Type | Description | Example Items |
|---|---|---|
ANRARG | A New Reign ARG rewards | cane_ancient, treasurechest_sacred |
ARG | Alternate Reality Game rewards | torch_shadow, torch_shadow_alt |
CUPID | Valentine's Day themed items | backpack_heart, emote_swoon, reviver_cupid |
DEFAULT | Standard mystery box items | mysterybox_terraria, mysterybox_invisible_5 |
GORGE | The Gorge event rewards | playerportrait_bg_foods |
GORGE_TOURNAMENT | Gorge tournament rankings | profileflair_quagmiretournament_gold |
HAMLET | Hamlet DLC themed pack | pack_hamlet_wormwood |
HOTLAVA | Hot Lava crossover | pack_hl_gift |
LUNAR_NY | Lunar New Year items | winterhat_rooster |
ONI | Oxygen Not Included crossover | glomling_puft, pack_oni_gift |
ROG | Reign of Giants DLC pack | pack_rog_gift |
ROT2 | Return of Them update | mast_crabking |
SW | Shipwrecked DLC pack | pack_sw_gift |
TOT | Turn of Tides update | mast_rose |
TWITCH_DROP | Twitch streaming rewards | Most themed skins and items |
VARG | Varg event reward | winterhat_fancy_puppy |
WINTER | Winter/Holiday themed | beargervest_yule, mysterybox_ugly_3 |
YOTB | Year of the Beefalo | saddle_basic_yotb, saddle_basic_yotbalt |
YOTP | Year of the Pig King | beefalohat_pigking |
Popup Display Configuration
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
}
}
Popup Configuration Properties
| Property | Type | Description |
|---|---|---|
atlas | string | Path to texture atlas XML file |
image | string | Texture filename within the atlas |
titleoffset | table | 3D position offset {x, y, z} for title text |
title_size | number | Optional 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_nauticaltorch_nautical,hambat_nautical,fishbox_nautical
Crystal Theme (TWITCH_DROP):
beebox_crystal,icebox_crystal,lantern_crystaldragonflyfurnace_crystal,telebase_crystal
Circus Theme (TWITCH_DROP):
arrowsign_post_circus,birdcage_circus,featherhat_circustent_circus,tophat_circus,umbrella_circus
Valentine's Theme (CUPID):
backpack_heart,emote_swoon,shovel_heartreviver_cupidseries,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:
- Source:
export_accountitems.luaprocesses account item definitions - Update Trigger: New items, events, or promotional campaigns
- Validation: Ensures all gift types have popup configurations
- Consistency: Maintains uniform gift presentation across updates
Related Modules
skin_affinity_info: Character-specific skin associationsskin_assets: Asset definitions and loadingprefabskins: Skin application systempopupmanager: Popup display managementplayerprofile: Player inventory and unlocks