MV Change windows that are part of a screen? (SOLVED)

So, looking at a screen there are different Windows that are involved.
So my question is this:
When I open say Shop:Buy, what function determine which Windows are to be opened for that screen?
Currently it opens the following windows, where I would like to delete ShopInfo and ShopStatus:
1634549247918.png

Windows modified by YEP_ShopMenuCore.
And I want to add the highlighted window.
1634549179103.png

Window_StatCompare is from SRD_EquipCompareUpgrade.
Any suggestions or any help is highly appreciated!
Thanks!
"Screens" are scenes in RMMV's code (rpg_scenes.js). I'm assuming that:

Windows are typically added to a scene when it is created, e.g.
Spoiler: Scene_Shop#create (rpg_scenes.js)
JavaScript:
Scene_Shop.prototype.create = function() {
    Scene_MenuBase.prototype.create.call(this);
    this.createHelpWindow();
    this.createGoldWindow();
    this.createCommandWindow();
    this.createDummyWindow();
    this.createNumberWindow();
    this.createStatusWindow();
    this.createBuyWindow();
    this.createCategoryWindow();
    this.createSellWindow();
};
Instead of completely removing certain window(s), consider hiding them instead.
  • If you remove a window, you also need to remove all references to that window;
  • If you hide it, you only need to remove any remaining input handlers it might have.
Window_ShopStatus and Window_ShopInfo are both non-interactive windows, i.e. just for display. Removing them (e.g. by overriding the corresponding create_x_Window method with an empty function) might be simple in this case, and would reduce RAM usage slightly, but I hide them in the example below just to be safe. 😴

Untested example:
Spoiler: Suggested plugin code
JavaScript:
// Adjust shop windows after scene creation
(function(alias) {
  Scene_Shop.prototype.create = function() {
    alias.apply(this, arguments);
    this.createCompareWindow();
    this._statusWindow.hide();
    this._infoWindow.hide();
  };
})(Scene_Shop.prototype.create);

// Create, associate, and add a "stat compare window" to the shop scene
Scene_Shop.prototype.createCompareWindow = function() {
  var x = this._statusWindow.x;
  var y = this._statusWindow.y;
  var w = this._statusWindow.width;
  var h = this._statusWindow.height;
  this._compareWindow = new Window_StatCompare(x, y, w, h);
  this._buyWindow.setStatusWindow(this._compareWindow);
  this._sellWindow.setStatusWindow(this._compareWindow);
  this.addWindow(this._compareWindow);
};
"Screens" are scenes in RMMV's code (rpg_scenes.js). I'm assuming that:

Windows are typically added to a scene when it is created, e.g.
Spoiler: Scene_Shop#create (rpg_scenes.js)
JavaScript:
Scene_Shop.prototype.create = function() {
    Scene_MenuBase.prototype.create.call(this);
    this.createHelpWindow();
    this.createGoldWindow();
    this.createCommandWindow();
    this.createDummyWindow();
    this.createNumberWindow();
    this.createStatusWindow();
    this.createBuyWindow();
    this.createCategoryWindow();
    this.createSellWindow();
};
Instead of completely removing certain window(s), consider hiding them instead.
  • If you remove a window, you also need to remove all references to that window;
  • If you hide it, you only need to remove any remaining input handlers it might have.
Window_ShopStatus and Window_ShopInfo are both non-interactive windows, i.e. just for display. Removing them (e.g. by overriding the corresponding create_x_Window method with an empty function) might be simple in this case, and would reduce RAM usage slightly, but I hide them in the example below just to be safe. 😴

Untested example:
Spoiler: Suggested plugin code
JavaScript:
// Adjust shop windows after scene creation
(function(alias) {
  Scene_Shop.prototype.create = function() {
    alias.apply(this, arguments);
    this.createCompareWindow();
    this._statusWindow.hide();
    this._infoWindow.hide();
  };
})(Scene_Shop.prototype.create);

// Create, associate, and add a "stat compare window" to the shop scene
Scene_Shop.prototype.createCompareWindow = function() {
  var x = this._statusWindow.x;
  var y = this._statusWindow.y;
  var w = this._statusWindow.width;
  var h = this._statusWindow.height;
  this._compareWindow = new Window_StatCompare(x, y, w, h);
  this._buyWindow.setStatusWindow(this._compareWindow);
  this._sellWindow.setStatusWindow(this._compareWindow);
  this.addWindow(this._compareWindow);
};
Yes, thank you. I didn't post which plugins they were from originally as I didn't find it relevant.
I am commonly editing(trying to) Windows and such. But upon changing "Window_Help" which I wanted to change specifically for "Scene_Skill", it also changed the layout of "Window_Help" for everything else. So I realized that I am changing how every Scene interacts with the "Window_Help" and not just the one in "Scene_Skill".

The Windows in this post are for another reason, but I felt it'd apply as I figured I'll just "hide"(thanks) the Window_Help in the Scene_Skill and use another: Window_SkillDesc(Mine).

But thanks a lot for your help, I shall add what plugins are related to the Scenes, as the statcompare is not YEP, rather it is SRD. But both EquipCore and ShopMenuCore are included in my plugins and the Window_Shop is modified by YEP.

I shall play abit of Halo and then I'll be applying what you showed me. It was the prototype.create() I was looking for. Can't believe I didn't find it myself though, I was so stuck looking through the Windows 😛 Thank you again.
I'm guessing SRD's plugin uses the same constructor arguments (x, y, width, height) for its Window_StatCompare, but if not then you'll need to change that part of the code.

Good luck! 👋
I'm guessing SRD's plugin uses the same constructor arguments (x, y, width, height) for its Window_StatCompare, but if not then you'll need to change that part of the code.

Good luck! 👋
Running into some issues, naturally, trying to place the equip compare into the shop compare might not be that easy 😛

But I'm sure I'll be able to figure it out 🙂

Thanks!

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.

Original thread: https://forums.rpgmakerweb.com/threads/change-windows-that-are-part-of-a-screen-solved.141342/