Sell shop Plugin (simple one)

Hello guys!

I would like to ask for a shop plugin that only sell things.
It must be a simple one. No "Sell" and "Cancel" buttons. And no "Items", "Weapons", "KeyItems" and etc buttons. Like Deactivate categories.

The shop should go directly to a window that shows items/weapons/armors. All in the same window.


I found a shop plugin made by SRD that is pretty much what I want. But it shows a list of all the items which can be sold, even if the player has 0 of that item/weapom/armor.
I think he uses the "buy" session to buid the sell session...

I would like to not show the items that the players have 0.

Here is the plugin link:
http://sumrndm.site/sell-shop/

That's it.
Thank you very much in advance!
Please, anyone could help me? @SumRndmDde? (who knows xD)
If all you want is to not show the items that the player have 0 of while using SRD_SellShop then this should work 🙂
Just place it after SRD_SellShop and if you have any problems with it feel free to message me 🙂

Code:
//=============================================================================
// Only Owned Items For Sell Shop
// MRP_SRD_SellShop_OnlyOwnedItems.js
// By Magnus0808 || Magnus Rubin Peterson
//=============================================================================

/*:
 * @plugindesc Extension to SRD_SellShop. Only shows items you have.
 * @author Magnus0808
 *
 * @help Place after SRD_SellShop. This makes it so the Sell Shop only show the
 * items if you actually have it.
 *
 
 */
 
 var Imported = Imported || {};
 Imported.MRP_SRD_SellShop_OnlyOwnedItems = true;
 
 var MRP = MRP || {};
 MRP.SRD_SellShop_OnlyOwnedItems = MRP.SRD_SellShop_OnlyOwnedItems ||{};
 
(function() {
        
    //-----------------------------------------------------------------------------
    // Window_ShopBuy
    //
    // Changes to Window_ShopBuy
    
    MRP.SRD_SellShop_OnlyOwnedItems.Window_ShopBuy_makeItemList = Window_ShopBuy.prototype.makeItemList;
    Window_ShopBuy.prototype.makeItemList = function() {
        MRP.SRD_SellShop_OnlyOwnedItems.Window_ShopBuy_makeItemList.call(this);
        if($gameTemp.getSellShop()) {
            var filteredData = [];
            var filteredPrice = [];
            for(var i = 0; i < this._data.length; i++) {
                if($gameParty.hasItem(this._data[i])) {
                    filteredData.push(this._data[i]);
                    filteredPrice.push(this._price[i]);
                }
            }
            this._data = filteredData;
            this._price = filteredPrice;
        }
    };
    
})();
@Magnus0808 hello!! It works perfectly!! Thank you very very much for your help!!

If it does not bother you too much, I'd like to ask you one more favor.
If possible, I would like to aks you to take off this "Sell" and "cancel" options. I'm asking this because I'm doing my game for mobile, and these options make the game a little bit confusing.
sell and cancel.jpg

So it will be nice if the cursor goes directly to the sell items.

But this is just a detail, I would like to say that the way it is is already excellent! Thanks a lot for the help! :LZScheeze:
@thalesgal Hello 🙂 Of cause I can do that.
I left the command window, however I deactivated it, removed the cancel command, and by passed it so it should just work as a label now.

Just replace the other plugin I wrote with this 🙂

Code:
//=============================================================================
// Only Owned Items For Sell Shop PLUS
// MRP_SRD_SellShop_OnlyOwnedItems_PLUS.js
// By Magnus0808 || Magnus Rubin Peterson
//=============================================================================

/*:
 * @plugindesc Extension to SRD_SellShop. Only shows items you have, and some changes.
 * @author Magnus0808
 *
 * @help Place after SRD_SellShop. This makes it so the Sell Shop only show the
 * items if you actually have it.
 *
 * This also removes the command for Cancel in the command window of a shop, and you
 * do not have to click on the sell command.
 *
 */
 
 var Imported = Imported || {};
 Imported.MRP_SRD_SellShop_OnlyOwnedItems_PLUS = true;
 
 var MRP = MRP || {};
 MRP.SRD_SellShop_OnlyOwnedItems_PLUS = MRP.SRD_SellShop_OnlyOwnedItems_PLUS ||{};
 
(function() {
    
    //-----------------------------------------------------------------------------
    // Scene_Shop
    //
    // Changes to Scene_Shop
    
    MRP.SRD_SellShop_OnlyOwnedItems_PLUS.Scene_Shop_create = Scene_Shop.prototype.create;
    Scene_Shop.prototype.create = function() {
        MRP.SRD_SellShop_OnlyOwnedItems_PLUS.Scene_Shop_create.call(this);   
        if($gameTemp.getSellShop()) {
            this._commandWindow.deactivate();
            this.commandBuy();
        }
    };
    
    MRP.SRD_SellShop_OnlyOwnedItems_PLUS.Scene_Shop_onBuyCancel = Scene_Shop.prototype.onBuyCancel;
    Scene_Shop.prototype.onBuyCancel = function() {   
        if($gameTemp.getSellShop()) {
            this.popScene.call(this)
        } else {
            MRP.SRD_SellShop_OnlyOwnedItems_PLUS.Scene_Shop_onBuyCancel.call(this);
        }
    };
    
    //-----------------------------------------------------------------------------
    // Window_ShopCommand
    //
    // Changes to Window_ShopCommand

    MRP.SRD_SellShop_OnlyOwnedItems_PLUS.Window_ShopCommand_isCursorVisible = Window_ShopCommand.prototype.isCursorVisible;
    Window_ShopCommand.prototype.isCursorVisible = function() {
        if($gameTemp.getSellShop()) {
            return false;
        } else {
            var row = this.row();
            return row >= this.topRow() && row <= this.bottomRow();
        }
    };
    
    MRP.SRD_SellShop_OnlyOwnedItems_PLUS.Window_ShopCommand_makeCommandList = Window_ShopCommand.prototype.makeCommandList;
    Window_ShopCommand.prototype.makeCommandList = function() {
        if($gameTemp.getSellShop()) {
            this.addCommand(TextManager.sell,    'buy');
        } else {
            MRP.SRD_SellShop_OnlyOwnedItems_PLUS.Window_ShopCommand_makeCommandList.call(this);
        }
    };
        
    //-----------------------------------------------------------------------------
    // Window_ShopBuy
    //
    // Changes to Window_ShopBuy
    
    MRP.SRD_SellShop_OnlyOwnedItems_PLUS.Window_ShopBuy_makeItemList = Window_ShopBuy.prototype.makeItemList;
    Window_ShopBuy.prototype.makeItemList = function() {
        MRP.SRD_SellShop_OnlyOwnedItems_PLUS.Window_ShopBuy_makeItemList.call(this);
        if($gameTemp.getSellShop()) {
            var filteredData = [];
            var filteredPrice = [];
            for(var i = 0; i < this._data.length; i++) {
                if($gameParty.hasItem(this._data[i])) {
                    filteredData.push(this._data[i]);
                    filteredPrice.push(this._price[i]);
                }
            }
            this._data = filteredData;
            this._price = filteredPrice;
        }
    };
    
})();
@Magnus0808 hi!! Thank you veeeeery muuch! It works perfectly. You are the guy! I wish you all the best.
I know it's an old thread but it would be great if somebody could do a version of SRD_SellShop which does only show items for sell the player actualy owns. It's very confusing (and kind of a spoiler) if everybody is able to see what's in the game without even getting it first.

@Fun , please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.


Please make a new thread instead.

Original thread: https://forums.rpgmakerweb.com/threads/sell-shop-plugin-simple-one.107847/