Feature - Implemented Enable Mojo Filter button in aftercore

Darzil

Developer
In 11510 the behaviour of the mojo filter button was changed : Disable the mojo filter button if you don't have (or can't use) a mojo filter.

Personally in aftercore I liked being able to clear my mojo with a mouse click, though I appreciate it being greyed out when I don't have one in run.

Any chance of it being available if you have a mojo filter or if you have mall access with the relevant mall using options enabled?
 

Catch-22

Active member
The same is true for use milk, it's disabled unless you have one in your inventory or you can make them. I thought it was done that way on purpose, but I'll take a look at it if V thinks it's worth doing.
 

lostcalpolydude

Developer
Staff member
The change to milk was done recently as well. I thought it made sense with the way dog hair and distention pills were set up, but those are untradeable items so it makes sense for them to work differently.

I'll look at it, and worst case I'll revert the changes.
 

Winterbay

Active member
I think it is brilliant, because now I don't need to check if I have a mojo filter by looking in my inventory (or clicking the button in vain) but instead can see directly if I can use one or not (when in run that is).
 

Veracity

Developer
Staff member
I think it's fine to not show it in run. Desireable, even. But if I have "purchase items as needed from the mall" enabled - and I am out of Ronin or otherwise in aftercore - I want to be able to craft or buy milk, whether or not I have any in inventory, and buy a mojo filter, if I have none in inventory.
 

lostcalpolydude

Developer
Staff member
The same is true for use milk, it's disabled unless you have one in your inventory or you can make them.

I don't see how it would currently be enabled when you don't have any but can create some.

Mostly I forgot about automated mall buying because automation scares me, so I manually buy 50 of things like this whenever I run low.

I have some code written, I'll be able to test it tomorrow after I free the king.
 

Catch-22

Active member
I don't see how it would currently be enabled when you don't have any but can create some.

Er, yeah, possibly I was mistaken. I think I manually made about 10 of them when I realized what was going on in my run, so it's possible that it won't automake them too.
 

lostcalpolydude

Developer
Staff member
I'm not sure how to check if it's possible to make milk. I looked at ResultProcessor.autoCreate() and came up with
Code:
CreateItemRequest milkCreator = CreateItemRequest.getInstance( ItemPool.MILK_OF_MAGNESIUM );
int possible = milkCreator.getQuantityPossible();
boolean canMakeMilk = possible > 0;

However, getQuantityPossible() is giving an NPE error.
 

lostcalpolydude

Developer
Staff member
autoCreate() only calls refreshConcoctions() before CreateItemRequest.getInstance(). I wonder if I just need to check for milkCreator being null rather than checking getQuantityPossible(). It makes sense that ResultProcessor would never get null, since it checks for ingredients before getting there.
 

roippi

Developer
CreateItemRequest.getInstance is overloaded; the full signature is

Code:
public static final CreateItemRequest getInstance( final Concoction conc, final boolean returnNullIfNotPermitted )

so yeah. Either check for null, or call a version of it that doesn't return null.
 
Top