[Solved]16x inventory grid

Post here if you need help getting started with Daggerfall Unity or just want to clarify a potential bug. Questions about playing or modding classic Daggerfall should be posted to Community.
User avatar
delvisomanda
Posts: 84
Joined: Mon Jan 08, 2018 4:29 pm
Location: Argentina

[Solved]16x inventory grid

Post 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?
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: 3014
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: 16x inventory grid

Post by Hazelnut »

Please post the minimal number of file(s) that cause this issue and I'll investigate.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

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

Re: 16x inventory grid

Post by TheLacus »

Is texture compression enabled?

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

Re: 16x inventory grid

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

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

Re: 16x inventory grid

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

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

Re: 16x inventory grid

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

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

Re: 16x inventory grid

Post by delvisomanda »

Currently translating Daggerfall into Spanish.

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

Re: 16x inventory grid

Post 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));
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

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

Re: 16x inventory grid

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

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

Re: 16x inventory grid

Post 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 3900 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