Adding Transformations - wofsauge/External-Item-Descriptions GitHub Wiki
All transformations are defined by a unique identifier and a list of displaynames.
The vanilla transformation-identifiers are listed in a seperate enum: EID.TRANSFORMATION
Adding a new Transformation
-- Create Transformation object
-- Format: UniqueName, Displayname, Language (default:"en_us")
EID:createTransformation("NewTransform1", "New transformation")
-- Add russian display name to created Transformation
EID:createTransformation("NewTransform1", "New russian transformation", "ru")
-- Assign Transformation to My Reflection
EID:assignTransformation("collectible", 5, "NewTransform1")
!Note: EID:AssignTransformation()
does add to existing transformations!
Adding multiple Transformations
Its possible to assign as many transformations to an entity as you wish. To accomplish this, seperate the transformation identifiers using a Comma ,
EID:assignTransformation("collectible", 5, EID.TRANSFORMATION["GUPPY"]..",NewTransform1,"..EID.TRANSFORMATION["MUSHROOM"])
-- OR use the ids directly
EID:assignTransformation("collectible", 5, "1,NewTransform1,2")
Removing Transformations
Its also possible to remove/unassign as many transformations of an entity as you wish. For that you can use the following function:
EID:removeTransformation(targetType, targetIdentifier, transformationString)
-- Example
EID:removeTransformation("collectible", 5, "1") -- Removes transformation "GUPPY" from My Reflection
Adding Transformation icon
The icon of each Transformation is determined by the transformations unique Identifier.
If no icon is found, it will use the default transformation icon
To add an icon to a transformation, you need to create a new icon with the same unique identifier as your transformation.
local dummySprite = Sprite()
dummySprite:Load("gfx/eid_inline_icons.anm2", true)
-- Add icon with the same Identifier as the transformation (NewTransform1)
EID:addIcon("NewTransform1", "hearts", 2, 9, 9, -1, 0, dummySprite)
-- The icon will now be assigned to this transformation entry:
EID:createTransformation("NewTransform1", "New transformation")