Status
Not open for further replies.

Ahuramazda

Veteran
Veteran
Joined
Nov 9, 2012
Messages
262
Reaction score
131
First Language
English
Primarily Uses
RMMZ
Been working on making this scene match the looks of my other menus (Main, Status, Item, Skill, ect) and I am having an odd bug with one window that hasn't appeared in any other edits I've been doing. I have been bashing my head on this one for about 6 hours trying every idea I could think of and nothing works to fix the actual bug.

Lets start with how the window looks by default:
Its going under the stat change window on the right and isn't butted up to the bottom of the command window... but it displays all item names and the collection number properly.
1599957418150.png

Well, I go into the plugin script and edit it like this:
Code:
Scene_Equip.prototype.createItemWindow = function() {
    this._itemWindow = new Window_EquipItem();
    this._itemWindow.x = 150 // Edit: added
    this._itemWindow.y = 324 // Edit: added
    this._itemWindow.width = 764 // Edit: added
    // this._itemWindow.height = 508 // Edit: added
    this._itemWindow.setHelpWindow(this._helpWindow);
    this._itemWindow.setHandler('ok',     this.onItemOk.bind(this));
    this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
    this._slotWindow.setItemWindow(this._itemWindow);
    this.addWindow(this._itemWindow);
    this._itemWindow.hide();
};

Result:
1599957625244.png
That moves it to the desired x/y position and corrects the window width to be where I need it. Notice I left the height commented out?

When I un-comment the height, that's when the bug happens and I cannot for the life of me figure out why it is happening and cannot find it in this plugin, or the core (Scene) or (Windows) files as to why it is doing what it is.
1599957764373.png

Notice the bottom of the window... the bottom 2 items in the list (weapon 10/255 and the "unequip" command is no longer visible. They can still be selected and it will either equip the item in the slot or remove the equipped item when chosen, working perfectly as you would expect, except they are not getting their names drawn anymore.

If I have more items and start scrolling through the list, its always the bottom 2 slots that refuses to draw any info, so it's not specifically just the final 2 items in the list, its just slots 10/11 for drawing item info.

I was wondering if someone may know what exactly is happening here and maybe if not right out fix it, maybe help guide me in a direction to what I can tinker with to fix it. Every other item/spell selection window I have resized using the same methods has worked without issue.

I'm starting to wonder if there is something I have overlooked in the Window_Selectable or Window_ItemList that controls how many items are drawn (since Window_EquipItem is derived from both of them)

No, I cannot put up the full plugin due to YEP's ToU. Yes this is ported to MZ, hence the MZ part for the title, I have been porting my entire project over to MZ one at a time and so far this is the only roadblock. :/

Edit: Solved. Found out that it was YEP Item Core that was hijacking this window as well, so a simple bit of code was needed to check if this was Scene_Item or Scene_Equip and made the window with the desired position/dimensions and everything else worked perfectly.
Code:
Yanfly.Item.Window_ItemList_initialize = Window_ItemList.prototype.initialize;
Window_ItemList.prototype.initialize = function(x, y, width, height) {
    if (SceneManager._scene instanceof Scene_Equip) {
        Yanfly.Item.Window_ItemList_initialize.call(this, new Rectangle(150, 324, 764, 508));
    }
    else {
        Yanfly.Item.Window_ItemList_initialize.call(this, new Rectangle(150, 388, 828, 376));
    }
};
 
Last edited:

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
16,105
Reaction score
8,923
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

Working in the IT industry:
- "How long does it take?".
- "It takes 1 month".
- "What if we add more people to the project?".
- "It would take 2 months".
Doing RPG Maker News for 16th September 2021

Stream is live! I am currently doing pixel art and will be practicing shading! Feel free to drop by!
wow, Surface Tension is really one MF of an FPS level huh
So, I got let go from my current job because my skill set didn't align with the department's goals anymore. I have some hope, because I am currently in contact with a manager from a different department, and they are desperate for more employees. We'll see what happens... :kaoswt:

Forum statistics

Threads
115,121
Messages
1,087,375
Members
149,607
Latest member
iamicon
Top