Bug maximizerMList does not correctly handle changes to maximizerMRUSize

VeeArr

New member
KoLConstants.maximizerMList is used to display the list of recent maximizer expressions in the maximizer frame. However, it does not respond correctly to updates to the maximizerMRUSize preference, which under some circumstances can cause the frame to get stuck reverting the list to the default list after any use. In particular, this can happen when a script (such as autoscend) sets the maximizerMRUSize to 0 and then later resets it to a positive value. (Presumably the specific trigger is the frame being opened for the first time while the preference is set to 0, but I did not verify this.)

maximizerMList is an instance of PartialMRUList, which extends ScriptMRUList. While ScriptMRUList.update() has code that correctly listens for changes to the relevant MRU size parameter, the Listener implementation in PartialMRUList.update() overrides it and does not handle updates based on the MRU size parameter. The best remedy is probably for PartialMRUList.update() to call super.update().
 
Just FYI I looked at this for a few minutes.

Two comments. First my superficial inspection suggests the update code was tweaked by hola when he added the Bookmarks capability. That intermittently broke the ScriptMRU capability because sometimes the drop down menu would have repeated sections. I was never able to make it happen enough to debug it. I gave up on ScriptMRU but I have seen similar behavior in the Scripts menu when built from the file system. So I am reluctant to dive into code that may be buggy. Second the PartialMRU menu is a hybrid and there are comments suggesting update was overwritten to accommodate that but my superficial review didn't help me figure out whether super.update() was going to break things or not.
 
Back
Top