When KoLmafia reads lastAdventure and attempts to set the AdventureSelectPanel to point to it, the adventure is not always visible.
AdventureSelectPanel.updateSelectedAdventure does this:
This sets the text in the filter box to the "zone" - "The Sea" or "Dreadsylvania", for example, which will filter the displayed adventures in the list of locations to show only those in the selected zone. It then does this:
which selects the specific location. That works, as you can see if you last adventured in Dreadsylvania: Dreadsylvanian Castle, for example; there are only three locations in Dreadsylvana, all of which fit in the 4-location window, and the correct one is selected.
However, if your location was, say, The Sea: The Coral Corral, although that location IS selected, you have to scroll to find it; that location is not made visible, contrary to what you might expect by the call to ensureIndexIsVisible.
Java documentation says this about JList.ensureIndexIsVisible:
So, what's the deal?
AdventureSelectPanel.updateSelectedAdventure does this:
Code:
( (AutoFilterTextField) this.zoneSelect ).setText( location.getZone() );
Code:
this.locationSelect.setSelectedValue( location, true );
this.locationSelect.ensureIndexIsVisible( this.locationSelect.getSelectedIndex() );
However, if your location was, say, The Sea: The Coral Corral, although that location IS selected, you have to scroll to find it; that location is not made visible, contrary to what you might expect by the call to ensureIndexIsVisible.
Java documentation says this about JList.ensureIndexIsVisible:
The JList is inside a GenericScrollPane, which is a JScrollPane, which manages a viewport.Scrolls the list within an enclosing viewport to make the specified cell completely visible. This calls scrollRectToVisible with the bounds of the specified cell. For this method to work, the JList must be within a JViewport.
So, what's the deal?