Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetDyeTintMasks

From RoR Wiki
Revision as of 19:43, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Dye functions
Version: WAR 1.4.8

Returns which dye colours (primary, secondary) an item's model can take.

tintMask = GetDyeTintMasks(itemId)

Arguments

itemId
number – Item id (the id field of an item data table).

Returns

tintMask
number – Bit mask: 1 = primary colour, 2 = secondary colour, 3 = both, 0 = none. These match the stock UI's GameData.TintMasks.A, B, BOTH and NONE checks.

Details

  • The mask comes from the item's model data. It does not look at the EITEMFLAG_DYE_ABLE flag; the stock UI checks both.
  • If the argument check fails, nothing is returned.
  • Exactly one argument must be passed.

Errors

None besides the generic Invalid Parameters message when the argument is missing or not a number.

Example

From default/ea_modifyitem/source/useitemtargeting.lua:

function UseItemTargeting.ItemIsDyable(itemData)
    local tintMasks = GetDyeTintMasks( itemData.id )
    return( itemData.flags[GameData.Item.EITEMFLAG_DYE_ABLE] == true and tintMasks ~= GameData.TintMasks.NONE and not itemData.broken )
end

See also