Replacement Inventory Sprite Inheriting Dimensional Properties Of Original Texture

Discuss modding questions and implementation details.
Post Reply
User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Replacement Inventory Sprite Inheriting Dimensional Properties Of Original Texture

Post by Magicono43 »

So I'm pretty sure I had this issue when I was working on my other overhaul project like a year+ back, and I somehow "hacked" a way to get around it by changing the code a bunch.

However, now that I am making another mod I obviously can't do this, but maybe I am doing something wrong here. But, is it intended to be the case that a texture that is replacing a texture from the vanilla inherits the dimensional properties of the original image instead of the new one?

Here is a screenshot example, which hopefully makes it more clear the issue I'm having:
2022_01_01_12_09_18.jpg
2022_01_01_12_09_18.jpg (192.04 KiB) Viewed 770 times
The 4 smaller looking gems are replacing existing textures, that being for the Ruby, Emerald, Sapphire, and Diamond. The rest that look much larger are completely custom and not replacing anything. The ruby replacement has dimensions of 23x15, the vanilla ruby has dimensions of 9x11, and for some reason when in-game the replacement ruby texture seems to be getting scaled/squished down to what looks like 9x11 dimensions I would have to assume, but I'm not sure why or if this is intended behavior for texture replacements.

If it is intended, is there a way around it doing that? I tried to put in an xml files with the same name with different dimensions, but that seemed to have no effect on the inventory icon sprite, this only had an effect when I used it to change the scale and position of sprites put on the paper-doll. Hope that was clear enough, thanks for reading and any help.

User avatar
Hazelnut
Posts: 3016
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Replacement Inventory Sprite Inheriting Dimensional Properties Of Original Texture

Post by Hazelnut »

It's been a while, but IIRC the replacement textures will be getting the size from the vanilla data but for new ones you have to specify (if you can do this, can't remember) or they will be sized to fill the whole slot in the UI. Personally I think the smaller ones look much better in your screenshot, so maybe try XML for the new ones... though I've only used that for paperdoll placement and not sure if you can specify the inv slot size. Try it and see or step through the asset replacement code.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: Replacement Inventory Sprite Inheriting Dimensional Properties Of Original Texture

Post by Magicono43 »

Hazelnut wrote: Sat Jan 08, 2022 5:55 pm It's been a while, but IIRC the replacement textures will be getting the size from the vanilla data but for new ones you have to specify (if you can do this, can't remember) or they will be sized to fill the whole slot in the UI. Personally I think the smaller ones look much better in your screenshot, so maybe try XML for the new ones... though I've only used that for paperdoll placement and not sure if you can specify the inv slot size. Try it and see or step through the asset replacement code.
Yeah, in the end I did just make the custom gems smaller by increasing their "filler" transparency space. I did try with XML files to make the custom replacement textures a different size, but it did not change anything it seemed, so that might only be applied for Paperdoll textures? Have not looked at the asset replacement code in a while, so I should look at it again to see exactly what gets checked when and how, etc.

Post Reply