Item Menu Script

Name

Veteran
Veteran
Joined
Mar 28, 2016
Messages
131
Reaction score
190
First Language
English
Primarily Uses
RMMV
I am working on my own item menu plugin based off of the default item menu script. I have it the way I want, but the help info doesn't show in the box. Can anyone help me with this?


Here is the script:

//-----------------------------------------------------------------------------
// Scene_Item
//
// The scene class of the item screen.


function Scene_Item() {
    this.initialize.apply(this, arguments);
}


Scene_Item.prototype = Object.create(Scene_ItemBase.prototype);
Scene_Item.prototype.constructor = Scene_Item;


Scene_Item.prototype.initialize = function() {
    Scene_ItemBase.prototype.initialize.call(this);
};


Scene_Item.prototype.create = function() {
    Scene_ItemBase.prototype.create.call(this);
    this.createHelpWindow();
    this.createCategoryWindow();
    this.createItemWindow();
    this.createActorWindow();
};


Scene_Item.prototype.createCategoryWindow = function() {
    this._categoryWindow = new Window_ItemCategory();
    this._categoryWindow.x = 0;
    this._categoryWindow.y = 0;
    this._categoryWindow.setHandler('ok',     this.onCategoryOk.bind(this));
    this._categoryWindow.setHandler('cancel', this.popScene.bind(this));
    this.addWindow(this._categoryWindow);
};


Scene_Item.prototype.createItemWindow = function() {
    this._itemWindow = new Window_ItemList();
    this._itemWindow.x = 200;
    this._itemWindow.y = 80;
    this._itemWindow.height = 540;
    this._itemWindow.width = 400;
    this._itemWindow.setHelpWindow(this._helpWindow);
    this._itemWindow = new Window_ItemList(0, this._itemWindow.y, this._itemWindow.width, this._itemWindow.height);
    this._itemWindow.setHandler('ok',     this.onItemOk.bind(this));
    this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
    this.addWindow(this._itemWindow);
    this._categoryWindow.setItemWindow(this._itemWindow);
};


Scene_Item.prototype.createHelpWindow = function() {
    this._helpWindow = new Window_Help();
    this._helpWindow.height = 150;
    this._helpWindow.width = 400;
    this._helpWindow.x = 410;
    this._helpWindow.y = 460;
    this.addWindow(this._helpWindow);
};


Window_ItemList.prototype.maxCols = function() {
    return 1;
}


Scene_Item.prototype.user = function() {
    var members = $gameParty.movableMembers();
    var bestActor = members[0];
    var bestPha = 0;
    for (var i = 0; i < members.length; i++) {
        if (members.pha > bestPha) {
            bestPha = members.pha;
            bestActor = members;
        }
    }
    return bestActor;
};


Scene_Item.prototype.onCategoryOk = function() {
    this._itemWindow.activate();
    this._itemWindow.selectLast();
};


Scene_Item.prototype.onItemOk = function() {
    $gameParty.setLastItem(this.item());
    this.determineItem();
};


Scene_Item.prototype.onItemCancel = function() {
    this._itemWindow.deselect();
    this._categoryWindow.activate();
};


Scene_Item.prototype.playSeForItem = function() {
    SoundManager.playUseItem();
};


Scene_Item.prototype.useItem = function() {
    Scene_ItemBase.prototype.useItem.call(this);
    this._itemWindow.redrawCurrentItem();
};
 





 




 






Here is a screenshot: (the box at the bottom right is the desc box)

itemmenu.png





 
Not signed in




 






 
 
Last edited by a moderator:

Lantiz

PunyMagus
Veteran
Joined
Dec 29, 2012
Messages
723
Reaction score
1,074
First Language
Portuguese
Primarily Uses
Other
Scene_Item.prototype.createItemWindow = function() {
    this._itemWindow = new Window_ItemList();
    this._itemWindow.x = 200;
    this._itemWindow.y = 80;
    this._itemWindow.height = 540;
    this._itemWindow.width = 400;
    this._itemWindow.setHelpWindow(this._helpWindow);
    this._itemWindow = new Window_ItemList(0, this._itemWindow.y, this._itemWindow.width, this._itemWindow.height);

    this._itemWindow.setHandler('ok',     this.onItemOk.bind(this));
    this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
    this.addWindow(this._itemWindow);
    this._categoryWindow.setItemWindow(this._itemWindow);
};


You need to create the instance before setting the help window.


Change the position of the marked lines and it should work.


By the way instead of creating a new window, you could just call the initialize function again.
 
Last edited by a moderator:

Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
556
Reaction score
794
First Language
English
Primarily Uses
RMMV
There is probably nothing being sent to the help window to draw. Check the Window_Help class update function to see what it does.
 

Lantiz

PunyMagus
Veteran
Joined
Dec 29, 2012
Messages
723
Reaction score
1,074
First Language
Portuguese
Primarily Uses
Other
@Lantiz okies. I will try it!


Just do this way:

Code:
Scene_Item.prototype.createItemWindow = function() {
    this._itemWindow = new Window_ItemList(0, 80, 540, 400);
    this._itemWindow.setHelpWindow(this._helpWindow);
    this._itemWindow.setHandler('ok',     this.onItemOk.bind(this));
    this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
    this.addWindow(this._itemWindow);
    this._categoryWindow.setItemWindow(this._itemWindow);
};
 

Name

Veteran
Veteran
Joined
Mar 28, 2016
Messages
131
Reaction score
190
First Language
English
Primarily Uses
RMMV
I got it! thanks so much!! solved!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top