[Solved]16x inventory grid

Just need help getting up and running or have a general support question? This is the place.
User avatar
delvisomanda
Posts: 81
Joined: Mon Jan 08, 2018 4:29 pm
Location: Argentina

[Solved]16x inventory grid

Post by delvisomanda » Wed Mar 14, 2018 2:23 am

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?
Last edited by delvisomanda on Fri Mar 16, 2018 12:01 am, edited 1 time in total.
Currently translating Daggerfall into Spanish.

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

Re: 16x inventory grid

Post by Hazelnut » Wed Mar 14, 2018 7:39 am

Please post the minimal number of file(s) that cause this issue and I'll investigate.

User avatar
TheLacus
Posts: 684
Joined: Wed Sep 14, 2016 6:22 pm
Contact:

Re: 16x inventory grid

Post by TheLacus » Wed Mar 14, 2018 9:31 am

Is texture compression enabled?
If you are interested in creating mods for Daggerfall Unity you can find the documentation here.

User avatar
delvisomanda
Posts: 81
Joined: Mon Jan 08, 2018 4:29 pm
Location: Argentina

Re: 16x inventory grid

Post by delvisomanda » Wed Mar 14, 2018 10:53 am

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.
Currently translating Daggerfall into Spanish.

User avatar
delvisomanda
Posts: 81
Joined: Mon Jan 08, 2018 4:29 pm
Location: Argentina

Re: 16x inventory grid

Post by delvisomanda » Wed Mar 14, 2018 11:20 am

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.
Currently translating Daggerfall into Spanish.

User avatar
TheLacus
Posts: 684
Joined: Wed Sep 14, 2016 6:22 pm
Contact:

Re: 16x inventory grid

Post by TheLacus » Wed Mar 14, 2018 11:55 am

Please disable compression, open the inventory with x16 grid and close the game. The log created inside the game folder may provide useful informations ;)
If you are interested in creating mods for Daggerfall Unity you can find the documentation here.

User avatar
delvisomanda
Posts: 81
Joined: Mon Jan 08, 2018 4:29 pm
Location: Argentina

Re: 16x inventory grid

Post by delvisomanda » Wed Mar 14, 2018 12:06 pm

Currently translating Daggerfall into Spanish.

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

Re: 16x inventory grid

Post by Hazelnut » Wed Mar 14, 2018 12:27 pm

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));

User avatar
Interkarma
Posts: 3596
Joined: Sun Mar 22, 2015 1:51 am

Re: 16x inventory grid

Post by Interkarma » Wed Mar 14, 2018 12:41 pm

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.

User avatar
Interkarma
Posts: 3596
Joined: Sun Mar 22, 2015 1:51 am

Re: 16x inventory grid

Post by Interkarma » Wed Mar 14, 2018 9:48 pm

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 1009 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.

Post Reply