Feature - Implemented "Take One" from the mall store

slyz

Developer
In the Store Manager -> Removals tab, I feel like Mafia would benefit from having a "take one" button.

Currently, that panel has a "take out" button, which takes all of the selected items out of your store, and an "autosell" button, which takes all of the selected items out of your store then autosells them. KoL also has the built-in option to "take one", which Mafia currently doesn't use.

Because of the way that panel is implemented, it is much easier to remove the "autosell" button, and have "take all" and "take one" buttons instead.

In my opinion, it has the added benefit of avoiding messy misclicks: if a user wants to remove from the mall and then autosell, it is safer to have him do both actions separately. Maybe the "Additions" panel would benefit from having its autosell button removed too.

Here is a patch that does exactly this. It also adds two ASH functions:
Code:
boolean take_shop( item it )
boolean take_shop( item it, boolean takeAll )
where take_shop( item ) defaults to take_shop( item, true ), so it will remove all of an item from your store, and take_shop( item, false ) removes only one of the item.

The return value is false if you don't have a shop, or if the item isn't in your store, and RuntimeLibrary.continueValue() otherwise (true if there wasn't any error, false otherwise).

I feel like I should also add an equivalent CLI command, but I'm not sure how.

Thoughts?
 

Attachments

  • store.patch
    4.9 KB · Views: 24

Rinn

Developer
It would be more consistent to mimic the item manager interface and have the "max possible\all but usable\multiple\exactly one" radio buttons and have the ash functions take in a number like the other take_ functions.
 
Last edited:

lostcalpolydude

Developer
Staff member
KoL lets you remove 1 or all. Taking out X requires either taking all and putting back [all - X] (at the previous price, probably) or taking out X one at a time. Not quite as simple as removing 1 of the item.
 

slyz

Developer
What could I replace the "Autosell" button in the Additions panel with?

And what would be a good name for a CLI "mall take" command?
 

slyz

Developer
For an ASH function, yes. For a CLI command, though? We have "closet put" and "closet take", but "mallsell take" seems counter-intuitive, and I don't want to change the "mallsell" function to be "mall take" and "mall put", since that would break scripts.
 
Last edited:

Veracity

Developer
Staff member
I'd rather add "shop put" and "shop take". That would make "mallsell" a synonym for "shop put", but, meh.
 

slyz

Developer
Here's a patch that also adds the CLI "shop" command:
Code:
shop put item [[@] price [[limit] num]] [, another] | take [all] item [, another] - sell or remove from Mall..
I feel that the only thing this is missing is a replacement for the "autosell" button in the Store Manager's additions panel.

I'm not committing it because I would like to see another dev's opinion on it. It's very low priority, mostly an exercise for me.
 

Attachments

  • store.patch
    15.1 KB · Views: 24

Donavin69

Member
I love this feature idea, along with it, is there a way to get the current amount you have in the mall of an item? This would be really nice when restocking for a new run, I'd really rather take stuff from my mall store no matter what I have it priced at than buy from someone else.
 

slyz

Developer
The patch adds the "boolean take_shop( item it, boolean takeAll )" ASH function, and the "shop take [all] <item>" CLI command, so it will be possible.

I guess I should go ahead and submit this.
 
Last edited:
Top