Opened 12 years ago

Closed 12 years ago

#3652 closed defect (fixed)

FF: Inventory doesn't scroll to the end

Reported by: SF/simsaw Owned by: Kirben
Priority: normal Component: Engine: AGOS
Keywords: Cc:
Game: The Feeble Files

Description

If you scroll the inventory in The Feeble Files, it doesn't scroll to the end of the inventory but almost just to the 2nd line instead. If you press the scroll a 2nd time, it scrolls entirely down. This is for both scrolling up and down - with one difference: If you press the scroll down arrow the first time only just a short time, it will scroll down entirely the next time. If you do so for scrolling up from the bottom, it will stop at the 2nd line where you need to scroll up again.

That bug makes playing very uncomfortable once you get more than two rows of inventory items and you have to scroll twice to get where you want to.

I tested with the daily build from March 10 2008, 4 CD English and 4 CD German version.

Ticket imported from: #1911558. Ticket imported from: bugs/3652.

Attachments (1)

feeble.001 (1.1 KB ) - added by SF/simsaw 12 years ago.
situation with more than 2 rows of inventory items

Download all attachments as: .zip

Change History (5)

by SF/simsaw, 12 years ago

Attachment: feeble.001 added

situation with more than 2 rows of inventory items

comment:1 by eriktorbjorn, 12 years ago

I didn't try it with this particular savegame (I don't know if the ones from the 4 CD version are compatible with the ones from the 2 CD version), but I was able to reproduce it with one of my own old savegames.

I have a general idea of what's causing the bug, though I'm not sure what the proper fix is. Here's how I think it works:

The engine maintains a list of "hit areas", one for each object you can interact with. Hit areas are added/removed as objects are added/removed on screen. Each hit area has an id, which identifies the object it represents, and _currentBox points to the hit area the mouse is currently over (if any).

When using the inventory arrows, the inventory is scrolled (if possible) for as long as the mouse button is depressed and the mouse is over the arrow's hit area.

When the inventory scrolls, the hit areas for the inventory items are updated. In at least some cases, this involves finding the first unoccupied slot in the hit area list. The problem is that somewhere along the line, something cleared the "this slot is being used" flag for the inventory arrow, so it finds - and changes the id of - the slot that _currentBox is pointing to. As far as the engine is concerned, the mouse pointer is no longer over the inventory arrow.

I think it's removeIconArray() that clear the flags for the inventory arrows. Obviously, since the arrows are still working, something sets up these hit areas again. I haven't checked when or how that happens.

comment:2 by eriktorbjorn, 12 years ago

Owner: set to Kirben

comment:3 by Kirben, 12 years ago

The problem was the code was checking the id number of pointer to current hitarea (which changes), instead of just the id number of the current hitarea.

Fixed in ScummVM 0.12.0 SVN, use the next daily snapshot.

comment:4 by Kirben, 12 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.