Page 1 of 3

[Solved]16x inventory grid

Posted: Wed Mar 14, 2018 2:23 am
by delvisomanda
Interkarma said I should put this problem here... so I'll paste the message.

I was translating the textures of the inventory, and I came to a problem.
If I modify the classic inventory, there's no problem, but when I try to modify the 16xgrid inventory, it doesn't display correctly.

Classic

texture
Image

in-game
Image

16x grid

texture
Image

in-game
Image

Of course, this is not a big problem, I can translate the classics, and that's it. But maybe there's something I didn't see.

pd: Is there a way to return to the start menu (DFU settings and mods) instead of leaving the game?

Re: 16x inventory grid

Posted: Wed Mar 14, 2018 7:39 am
by Hazelnut
Please post the minimal number of file(s) that cause this issue and I'll investigate.

Re: 16x inventory grid

Posted: Wed Mar 14, 2018 9:31 am
by TheLacus
Is texture compression enabled?

Re: 16x inventory grid

Posted: Wed Mar 14, 2018 10:53 am
by delvisomanda
Here are the files

https://mega.nz/#!zA0lCLCR!Tos_MACd3gpo ... BxMS8Dw3e0

and no, texture compression is disable. That makes one of my textures, something strange, I'll upload it too, for opinions.

Re: 16x inventory grid

Posted: Wed Mar 14, 2018 11:20 am
by delvisomanda
This is the texture mentioned.

Original (For some reason, this texture cannot be upscaled)

Image

Compressed

Image

Uncompressed

Image

And here are the files

https://mega.nz/#!bdtWBSrB!2AEzlZ3WclyC ... OgSDQeX8IQ

Edit: For what I've tested, using compression, it looks like x16 grid inventory works.

Re: 16x inventory grid

Posted: Wed Mar 14, 2018 11:55 am
by TheLacus
Please disable compression, open the inventory with x16 grid and close the game. The log created inside the game folder may provide useful informations ;)

Re: 16x inventory grid

Posted: Wed Mar 14, 2018 12:06 pm
by delvisomanda

Re: 16x inventory grid

Posted: Wed Mar 14, 2018 12:27 pm
by Hazelnut
Hmm, if it works with compression switched on I doubt it's anything to do with the item list component which renders the 4 or 16 items. To get the backgrounds for the 16x slots it simply copies other bits of the image (the amulet etc slots IIRC) as background textures for each slots' button component.

line 415 of ItemListScroller.cs:

Code: Select all

                itemListTextures = new Texture2D[listDisplayUnits];
                Texture2D baseInvTexture = ImageReader.GetTexture(baseInvTextureName);
                for (int i = 0; i < itemCutoutRects16.Length; i++)
                    itemListTextures[i] = ImageReader.GetSubTexture(baseInvTexture, itemCutoutRects16[i], new DFSize(320, 200));

Re: 16x inventory grid

Posted: Wed Mar 14, 2018 12:41 pm
by Interkarma
Wondering if problem caused by some recent changes to ImageReader.GetSubTexture(). It will now try to use Graphics.CopyTexture() where available, otherwise it falls back to the old pixel array method. Enabling compression will result in fallback as cannot use Graphics.CopyTexture() on compressed images without some caveats.

There's also some relative coordinate scaling changes to GetSubTexture(), but if enabling compression fixes this problem it seems more likely that CopyTexture() change is involved. I'll check this out tomorrow if nobody beats me to it overnight.

Re: 16x inventory grid

Posted: Wed Mar 14, 2018 9:48 pm
by Interkarma
This works fine for me with compressed textures enabled or disabled.

grid-inv-16-modded.jpg
grid-inv-16-modded.jpg (141.92 KiB) Viewed 4006 times

delvisomanda, I noticed your texture pack above has a lot of images in it, including coloured tile images and a set specifically for the 16x grid. The good news is you only need to replace a single image here: INVE00I0.IMG. The other variants with coloured tiles and the 16x grid layout don't need to be replaced (and are not used at all). This is all done using the more flexible UI in Daggerfall Unity which can slice out subrects and recolour as needed.

Let me know if you still have troubles here by just replacing normal INVE00I0.IMG. There could still be an issue with CopyTexture() on your system I need to diagnose.