Bug - Fixed Bookshelf skills greyed out in Skill Casting frame after Standard ascension

Veracity

Developer
Staff member
This is the second time in a row this has happened. I wonder if it's associated with the item number change or something?

- I use my Summoning skills in aftercore.
- The daily limited skills are greyed out in the Skill Casting frame (as expected).
- I ascend into a Standard run
- Summon Smithsness is greyed out in the Skill Casting frame. So are all other bookshelf skills.
- get tomesUsed returns 0

Refresh Session does nothing.
Visiting the CharSheet in the Relay Browser does nothing
Visiting the bookcase in the Campground does nothing
Exiting KoLmafia and logging in again fixes it.
 
Someone was saying earlier today that kolproxy had the same issue with some skills after ascending into a Standard ascension, fixed by logging out and back in. I suspect it's KoL's fault.
 
Well... Summon Smithsness is not greyed out in the topmenu skills, nor is it greyed out in the Campground Bookshelf. In fact, I went there and told KoL to cast it - and it did so.

I wonder what it is that makes the Use Skill frame decide to grey it out? It knows I have the skill - and it is not restricted for me - but it thinks I can't use it. I thought that could only happen because I'd hit the daily limit.
 
Near as I can tell, individual skills are greyed out in the SkillBuffFrame strictly based on what this or that setting says. For Tome skills, if you can interact, you can use every Tome 3 times a day, so the skill-specific setting determines if it is available. If you cannot interact, you get 3 tome summonings, period, spread among all of your tomes.

So, when you ascend, we transition from looking at tomeSummons to decide if you can use a particular tome to looking at the tome-specific setting.

The SkillBuffFrame was registering listeners only for the individual skills, not for tomeSummons. That seems wrong, although I am not sure why it would matter; we should never set tomeSummons without also setting the skill in question, right?

ValhallaManager calls KoLMafia.resetCounters, which resets all daily counters - which includes both tomeSummons and the individual tome settings. It does this in onAscension, which is called after you have left Valhalla but before we have refreshed the session.

The list of skills in the SkillBuffFrame is, usually, KoLConstants.usableSkills - which should be empty in Valhalla and should be empty after ascension until we have read your CharSheet.

Which means, that all the enabling/disabling that happens when that list is empty does nothing, since the list of skills is empty. Can it be that it is remembering which items were disabled from the last time there was something in the list? DisabledItemsComboBox has a HashSet of disabledItems. It looks to me like it is removing items from that set when they get removed from the combo box.

This continues to be puzzling.
 
OK, we have issues either with the DisabledItemComboBox or with how we use it.

The SkillBuffFrame has a "skillSelect" field which is-a AutoFilterComboBox which is-a DisabledItemsComboBox.

That is created when the frame is created. It is initialized with model = KoLConstants.usableSkills.
You can use the Skill Type combo box which will then use setModel to point it to KoLConstants.summoningSkills, KoLConstants.remedySkills, and so on.

Those are all LockableListModel<UseSkillRequest> and are cleared whenever the session is refreshed. The CharSheet will refill them, learning skills will add to them, and so on. When a new character is logged in, the lists are cleared and repopulated with the new character's skills.

I added a "dumpDisabledItems" method to the DisabledItemsComboBox and to the SkillBuffFrame and added "test dump_disabled_items" to the gCLI.

I am logged in with my main who has used her summoning skills for the day.
I do "test dump_disabled_items" and the following appears on stdout:

Code:
Summon Confiscated Things (5 mp)
Summon Carrot (11 mp)
Grab a Cold One (30 mp)
Summon Geeky Gifts (5 mp)
Summon Holiday Fun! (11 mp)
Summon Rad Libs (2 mp)
Advanced Cocktailcrafting (10 mp)
Advanced Saucecrafting (10 mp)
Spaghetti Breakfast (30 mp)
Summon Smithsness (2 mp)
Pastamastery (10 mp)
-------
I switch to "Remedies" on the SkillBuffFrame and do it again.

Code:
Summon Confiscated Things (5 mp)
Summon Carrot (11 mp)
Grab a Cold One (30 mp)
Summon Geeky Gifts (5 mp)
Summon Holiday Fun! (11 mp)
Summon Rad Libs (2 mp)
Advanced Cocktailcrafting (10 mp)
Advanced Saucecrafting (10 mp)
Spaghetti Breakfast (30 mp)
Summon Smithsness (2 mp)
Pastamastery (10 mp)
-------
(Note that none of those items are actually in that ListModel).
I log out and call up the gCLI (without restarting KoLmafia), and do it again:

Code:
Summon Confiscated Things (5 mp)
Summon Carrot (11 mp)
Grab a Cold One (30 mp)
Summon Geeky Gifts (5 mp)
Summon Holiday Fun! (11 mp)
Summon Rad Libs (2 mp)
Advanced Cocktailcrafting (10 mp)
Advanced Saucecrafting (10 mp)
Spaghetti Breakfast (30 mp)
Summon Smithsness (2 mp)
Pastamastery (10 mp)
-------
I log in as a different character (without restarting KoLmafia) and do it again:

Code:
Summon Confiscated Things (5 mp)
Summon Carrot (11 mp)
Grab a Cold One (30 mp)
Summon Geeky Gifts (5 mp)
Summon Holiday Fun! (11 mp)
Summon Rad Libs (2 mp)
Advanced Cocktailcrafting (10 mp)
Advanced Saucecrafting (10 mp)
Spaghetti Breakfast (30 mp)
Summon Smithsness (2 mp)
Pastamastery (10 mp)
-------
So this is the root cause of the problem: the disabledItems HashSet is not cleared when the underlying model is changed - or is cleared and updated. I see removeItem, removeItemAt, and removeAllItems methods in the DisabledItemsComboBox - but those don't seem to be called when I did the various things above.

I also suspect that we should call the update() method of the SkillBuffFrame whenever we change the model, refresh skills, or add skills.

This is not a simple bug.
 
Revision 15240 resets and updates your disabled skills whenever we clear all skills or reset all skills from the CharSheet.
I'll try it out on Wednesday when I ascend into another Standard run...
 
OK, it worked. I just ascended (after having used my tomes for the day) and Summon Smithsness was no longer greyed out.
 
Back
Top