Sell shop Plugin (simple one)

Status
Not open for further replies.

thalesgal

Veteran
Veteran
Joined
Dec 23, 2016
Messages
195
Reaction score
45
First Language
Portuguese
Primarily Uses
RMMV
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!
 

Magnus0808

Software Developer
Veteran
Joined
Feb 2, 2019
Messages
147
Reaction score
166
First Language
Danish
Primarily Uses
RMMV
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;
        }
    };
    
})();
 

Attachments

thalesgal

Veteran
Veteran
Joined
Dec 23, 2016
Messages
195
Reaction score
45
First Language
Portuguese
Primarily Uses
RMMV
@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:
 

Magnus0808

Software Developer
Veteran
Joined
Feb 2, 2019
Messages
147
Reaction score
166
First Language
Danish
Primarily Uses
RMMV
@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;
        }
    };
    
})();
 

Attachments

thalesgal

Veteran
Veteran
Joined
Dec 23, 2016
Messages
195
Reaction score
45
First Language
Portuguese
Primarily Uses
RMMV
@Magnus0808 hi!! Thank you veeeeery muuch! It works perfectly. You are the guy! I wish you all the best.
 

Fun

Warper
Member
Joined
May 6, 2020
Messages
3
Reaction score
0
First Language
German
Primarily Uses
RMMV
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.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,867
Reaction score
5,240
First Language
Dutch
Primarily Uses
RMXP

@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.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,037
Messages
1,018,464
Members
137,821
Latest member
Capterson
Top