Inventory button does not update the item image (INV) / (INVNS) / (INVSHR)

Started by Gal Shemesh, Wed 28/06/2023 23:24:30

Previous topic - Next topic

Gal Shemesh

Hi everyone,

Trying to solve this by my own for hours. Would appreciate some assistance.

I'm working on a Sierra-style game with a top icon-bar, and a button with an empty sprite graphic for representing a selected inventory item graphic on-top of it. I followed the manual and set the button's text to (INVSHR). Now the problem is, once I pick an inventory item and close the inventroy GUI, if I then hover with the mouse cursor to reveal the top icon bar, the empty button that should represent the item's sprite remains empty - that is until I actually click on it that the graphic updates; and there must be a different graphic for the 'pushedImage' variable, or else it doesn't update the graphic at all.

I checked the Sierra-style template that comes with AGS and it behaves the same way. In Sierra games like "King's Quest V & VI" the empty button changes to the selected item from the inventory instantly.

Is this a bug or something that I'm doing wrong? To me it seems like the (INVSHR) in general works, but that it requires a manual intervention to actually 'refresh' the button's graphic, instead of refreshing it automatically.

Thanks

UPDATE:
I think that I solved it for now, but it's a workaround. I updated the normal graphic of the button to something else within the function that hides the icon bar, like so:

Code: ags
btnIconCurInv.NormalGraphic = 0;

The 0 sprite will be invisible to the player as it occurs when the icon bar is hidden. And then I used the same trick within the function that shows the icon bar, while setting its graphic sprite back to what it should be. And then the button's graphic refreshes every time the icon bar is showing.
Gal Shemesh,
goldeng

Khris

This seems to be a bug, yes. It works fine in AGS 3.2.1 :)

Gal Shemesh

Thanks @Khris. I will post a bug report then in the "Bug reports & suggestions" thread.
Gal Shemesh,
goldeng

Crimson Wizard

This is quite possibly a regression since 3.6.0, where the GUI redraw was optimized to not happen unless some data changes. Apparently this may not be detected correctly at all times.

Quote from: Gal Shemesh on Thu 29/06/2023 07:58:06Thanks @Khris. I will post a bug report then in the "Bug reports & suggestions" thread.

That thread is for forum & site bug reports, our issue tracker is on github:
https://github.com/adventuregamestudio/ags/issues
but you may also post bug reports in either release threads here:
https://www.adventuregamestudio.co.uk/forums/ags-engine-editor-releases/
or engine & editor development sections

Gal Shemesh

Thanks for the links! I actually posted it here. Should I re-post under the 3.6.0 build too?
Gal Shemesh,
goldeng

Crimson Wizard

The temporary fixed build may be downloaded here (after about 20 mins from posting this), under "Artifacts" section:
https://cirrus-ci.com/task/4689363699761152

I am planning to properly release a new 3.6.0 patch in the beginning of July.


SMF spam blocked by CleanTalk