Skip to content

[Modding Support] Custom Item support for Cloak (and Shield) slots #2740

@RedRoryOTheGlen

Description

@RedRoryOTheGlen

ISSUE
In the current build of DFU, it is impossible to set a custom item to be equipped in the cloak slot.

If any item is equipped as a cloak in either slot, the PaperDollRenderer will try to render the cloak interior.
Image

To get the cloak interior ImageData it will first check if the item is a cloak. If not, it will return a blank ImageData.
Image

First problem is that it will only recognize the vanilla Casual and Formal Cloak items as Cloaks. So any other item (even if its a cloak, like a scarf or such) will not be able to have any kind of Cloak Interior.
Image

Continuing on. With ImageData in hand, it will attempt to call DrawTexture with the blank ImageData and immediately throw an exception due to ImageData's contents being null. This results in the paperdoll being unable to refresh.
Image
Image

EXPECTED BEHAVIOR
First:
I am not quite sure how, but some way of being able to dictate whether an item has a Cloak Interior texture without having to replace the vanilla cloaks would be nice.

Second:
Adding a null check for the ImageData to either the DrawTexture or BlitCloakInterior methods completely avoids this issue.

Image
Image

No exception is thrown and the paperdoll updates as normal. Attached is my testing of equipping clothes to the cloak slot to enable layering chest clothing:
Image
Image

OTHERS
As an aside, there is a workaround for avoiding the exception. Because of how BlitCloakInterior is done, if there is a vanilla cloak equipped in Cloak2 slot, the player is able to equip custom items in Cloak1 slot without causing an error. This indicates to me that the exception for an item without a cloak interior image is more of an oversight than deliberate limitation.

Image

Thank you for your time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions