Bug - Fixed Gear Changer needs to update after enthrone or bjornify command

Darzil

Developer
Bug - After the changes in r13649 to Gear Changer and other files, when enthrone or bjornify change the familiar, it is not reflected in Gear Changer.
 

Veracity

Developer
Staff member
See, this is exactly the kind of thing that makes me want to revisit listeners. The way it should work is this:

Gear Changer registers a "hatseat" listener.
When FamiliarRequest recognizes that the rider in the hatseat has changed, it fires that listener.
The Gear Changer's listener executes and it sets the selected item for the familiar list associated with the Crown of Thrones.

Ditto for Bjorn.

The problem is that currently, we have three kinds of listeners:

Character Listeners - "something has changed in the character"
Item Listeners - "a specific item has arrived"
Preference Listeners - "a Preference has changed" - except that last one has been extended to apply to general strings - "(hats)" is fired when your list of available hats might have changed, for example.

So, yeah - I could use "(hatseat)" as a Preference listener, but that sure feels wrong. A "Preference" listener should be fired for, well, Preferences, so that when you log in with a new character and call fireAllPreferencesChanged, it updates the UIs associated with Preferences - not the list of hats, say.

It's going to take some careful looking at, since I don't especially want to break Daily Deeds, which uses things like "(hats)". In fact, that subsystem might be where non-preference listeners were added to PreferenceListener.
 

Veracity

Developer
Staff member
Moved to a new thread, rather than leaving on the Implemented "New Content" thread, since this needs to be fixed correctly, rather than just kludged.
 

Veracity

Developer
Staff member
Revision 13658 does a bunch of refactoring and creates a NamedListenerRegistry. For now, only the GearChangeFrame registers such listeners - "(throne)" and "(bjorn)" - and KoLCharacter.setEnthroned and KoLCharacter.setBjorned fire those named listeners.

I also moved PreferenceListenerRegistry out of preferences and ItemListenerRegistry out of InventoryManager. I am far from done with refactoring listeners, but this is closer to what I have in mind, at least.
 
Top