I'm pretty sure both ultimately end up looking at the same data in the end. MPRestoreItemList and HPRestoreItemList.
I'm pretty sure that's not true.
swingui/panels/RestorativeItemsPanel:
Code:
public RestorativeItemPanel()
{
super( "use item", "check wiki", KoLConstants.inventory, new boolean[] {false, true} );
this.filterItems();
}
The Restorative Items Panel shows you everything in your inventory…
Code:
private class RestorativeItemFilterField
extends FilterItemField
{
@Override
public boolean isVisible( final Object element )
{
AdventureResult item = (AdventureResult) element;
int itemId = item.getItemId();
switch ( ItemDatabase.getConsumptionType( itemId ) )
{
case KoLConstants.MP_RESTORE:
case KoLConstants.HP_RESTORE:
case KoLConstants.HPMP_RESTORE:
if ( KoLCharacter.inBeecore() && KoLCharacter.hasBeeosity( item.getName() ) )
{
return false;
}
return super.isVisible( element );
default:
return false;
}
}
}
… That is an HP, MP or HP/MP restore item. It pays no attention whatsoever to the HPRestoreItemList and MPRestoreItemList, which are hardcoded data structures that determine what is available in the HP/MP Usage panel of the Adventure Frame for use in KoLmafia's built-in restoration.
In order for "your own black heart" to appear in the "Restoratives" list, all we have to do is change its usage from "usable" to "hpmp" in items.txt.
I wrote
this Feature Request more than two years ago suggesting that we provide more details of restoration items in the Restoratives panel. Obviously, that would best be done with having them in a data file, preferably with the range of HP and/or MP that are restored and a notes field for additional annotations.
These show everything, so at present in order to achieve this we have to add it to the restore lists, albeit unticked so Mafia won't use them automatically.
Not so. We have to manually add things to the HP and MP restoration list to have them appear in the HP/MP Usage panel. We have had many bug reports over the years about things not appearing there.
Given those lists are getting pretty unwieldy, I guess we could do with a restores.txt data file, with fields perhaps of name, hp restored (range), mp restored (range), in_combat?.
And a notes field. And the data from this file could be used to satisfy my Feature Request.
Then maybe an extra preference, which lists the names of those which can appear in the "use these restores", so we can make that list configurable.
Given the file, we can build the HP and MP lists at runtime, sorted by "most restored" down to "least restored", as the hard-coded lists are right now. The additional preference could be used to say "exclude these from the list" - although if everything starts out unticked (as now), I'm not sure that is necessary.
In any case, as I said, in order to get this item on the Restoratives panel, all we have to do is change its usage in items.txt. Souping up the display of that panel and making the restorative go into a data file are additional feature requests - which go hand in hand.