Remove the "Sell" option from the shop menu completely?

Hi everyone,

I've been working on making a shop menu (with mjshi's NPC Dialogue Shop enabled, if it matters- I don't believe it does since it just changes the layout, not the functionality, although I could definitely be wrong), and I noticed there is an option to make a "Purchase Only" shop- but all this does is grey out the Sell button, not remove it entirely.

Is there a way to accomplish this?

Thanks in advance for your help. 🙂
I don't know about the "mjshi's NPC Dialogue Shop", but according to the default mv code, you can try to add this plugin below all the shop plugins and see if works.
If not, put a link of this plugin from mjshi that you are using.
I don't know about the "mjshi's NPC Dialogue Shop", but according to the default mv code, you can try to add this plugin below all the shop plugins and see if works.
If not, put a link of this plugin from mjshi that you are using.

Thank you! I tried your plugin, and it worked fine without the plugin I'm using- unfortunately adding the plugin caused an error. According to the plugin's thread, it's just aesthetics being changed, but an error has occurred nonetheless- very odd.

Here's the error I received:
1583875563494.png

And the plugin's thread: https://forums.rpgmakerweb.com/index.php?threads/npc-dialogue-shop.101108/
But so you don't have to download that, here's the lines in question:
1583875639406.png

(the error points to #352.)

Thank you so much for your help!
Ok!
If you want to it work like this, all the games, then you can use this.
It's not removed, I only change the selectable items enabled in the shop menu.

But if you want sometimes the sell works and sometimes not, then I have to dig the code a little bit, because I never mess with the shop code before ^^''

[EDIT] My bad, you have to change the code directly for it to work...
I will see if I can find a decent solution instead of a poor snippet...
Try giving this plugin a try:
Ok!
If you want to it work like this, all the games, then you can use this.
It's not removed, I only change the selectable items enabled in the shop menu.

But if you want sometimes the sell works and sometimes not, then I have to dig the code a little bit, because I never mess with the shop code before ^^''

[EDIT] My bad, you have to change the code directly for it to work...
I will see if I can find a decent solution instead of a poor snippet...

Ah, I see. Yes, I want to remove the Sell option completely- I never need to use it, so changing the code directly would work perfectly for me.

Thanks for your help!

Try giving this plugin a try:

Unfortunately, the plugin I'm using has a "Talk to shopkeeper" option, so skipping directly to the Buy menu isn't exactly what I'm looking for.

Thanks for your help anyway!
Here!
Change the code directly:
7eFGHzF.png


JavaScript:
Window_ShopCommand.prototype.numVisibleRows = function() {
    return 1;
};

Window_ShopCommand.prototype.maxItems = function() {
    if(this._purchaseOnly){
        return 3;
    }else{
        return 4;
    }
};

Window_ShopCommand.prototype.windowWidth = function() {
    return commandPos.width;
};

Window_ShopCommand.prototype.maxCols = function() {
    if(this._purchaseOnly){
        return 3;
    }else{
        return this.maxItems();
    }
};

Window_ShopCommand.prototype.makeCommandList = function() {
    if(this._purchaseOnly){
        this.addCommand(TextManager.buy,    'buy');
        this.addCommand(commonEventName,   'event');
        this.addCommand(TextManager.cancel, 'cancel');
        this.addCommand(TextManager.sell,   'sell',   !this._purchaseOnly);
    } else {
        this.addCommand(TextManager.buy,    'buy');
        this.addCommand(TextManager.sell,   'sell',   !this._purchaseOnly);
        this.addCommand(commonEventName,   'event');
        this.addCommand(TextManager.cancel, 'cancel');
    }
};

Copy and paste this(overwrite) the code inside the plugin of Mjshi.
It is in the last lines.

These will remove the sell option when you mark "purchase only" when you open the shop.
Here!
Change the code directly:
7eFGHzF.png


JavaScript:
Window_ShopCommand.prototype.numVisibleRows = function() {
    return 1;
};

Window_ShopCommand.prototype.maxItems = function() {
    if(this._purchaseOnly){
        return 3;
    }else{
        return 4;
    }
};

Window_ShopCommand.prototype.windowWidth = function() {
    return commandPos.width;
};

Window_ShopCommand.prototype.maxCols = function() {
    if(this._purchaseOnly){
        return 3;
    }else{
        return this.maxItems();
    }
};

Window_ShopCommand.prototype.makeCommandList = function() {
    if(this._purchaseOnly){
        this.addCommand(TextManager.buy,    'buy');
        this.addCommand(commonEventName,   'event');
        this.addCommand(TextManager.cancel, 'cancel');
        this.addCommand(TextManager.sell,   'sell',   !this._purchaseOnly);
    } else {
        this.addCommand(TextManager.buy,    'buy');
        this.addCommand(TextManager.sell,   'sell',   !this._purchaseOnly);
        this.addCommand(commonEventName,   'event');
        this.addCommand(TextManager.cancel, 'cancel');
    }
};

Copy and paste this(overwrite) the code inside the plugin of Mjshi.
It is in the last lines.

These will remove the sell option when you mark "purchase only" when you open the shop.

Perfect!!! That worked swimmingly! Thank you so, so much @Eliaquim - your name has been added to the credits of my game for your help!

Thanks again!
I would copy those functions into a plugin and modify those. Otherwise if there's an MV update and you update your project, you will lose any changes you made to the default scripts, and have to redo them - which requires remembering what those changes were, and searching for this thread again that shows you how to do them.

<edit - nvm - I thought that was a change to the default script, not to the plugin. You'll just have to remember to reapply them if you ever get a new version of the plugin>
@Shaz
That change was made in the Mjshi's plugin, not in the Core files of mv ^^
yeah, I realised that after I posted 🙂
Thread closed l

Original thread: https://forums.rpgmakerweb.com/threads/remove-the-sell-option-from-the-shop-menu-completely.119008/