MV [MV] I want to extend MiniInformationWindow.js so it can also be used with 'Selection Item'.


Hi there,

I’m reaching out because I’d like to expand the functionality of the MiniInformationWindow.js plugin a bit further.

As you know, this plugin can display information in a mini window on various screens such as Items, Equipment, and Skills. However, unfortunately, it doesn’t seem to work in situations where items are displayed and selected via the “Select Item” event command.

I was wondering if it would be possible to tweak or add some code so that it also functions in that scenario. Any guidance, tips, or help you could provide would be greatly appreciated!

Thanks in advance!
so far I see, Window_EventItem is part of Scene_Item
which is already there.

and its coded for it already, so I don't know what it misses.
so far I see, Window_EventItem is part of Scene_Item
which is already there.

and its coded for it already, so I don't know what it misses.
However, I’ve checked multiple times with all plugins turned off and tested every possible case, but the mini window still doesn’t work in the ‘Select Item’ event.

I tried modifying the plugin myself, but all my attempts failed. What I did find out for sure is that there’s no such thing as Scene_EventItem.
Scene_ItemList = your inventory, which is also part of Window_EventItem.
which also target this._itemWindow.

while it shared the same variable, that one exist in calling the notification.
so I don't know what it require to target.

so I'm unsure why it doesn't work there.

there are scenes not added, but adding those is easy if required.

for the Window_EventItem => Scene_Item (which is called) is unsure.
there is probably a a way to get it on there, but I have no idea at this point.

maybe someone else see what it misses or variable required?
Scene_ItemList = your inventory, which is also part of Window_EventItem.
which also target this._itemWindow.

while it shared the same variable, that one exist in calling the notification.
so I don't know what it require to target.

so I'm unsure why it doesn't work there.

there are scenes not added, but adding those is easy if required.

for the Window_EventItem => Scene_Item (which is called) is unsure.
there is probably a a way to get it on there, but I have no idea at this point.

maybe someone else see what it misses or variable required?
Thank you for your response. For now, I thought the solution would be to add code like this inside the plugin:

var __SItem_create = Scene_Item.prototype.create;
Scene_Item.prototype.create = function() {
__SItem_create.call(this);
if (useSceneItem) this.createMiniWindow();
};

So, I initially thought I needed to do something in the Scene_EventItem code,
but then realized that's not the case. After that,
I started thinking maybe I need to do something in the Scene_Map.prototype.create code, but I'm still not sure.
to create the scenes required is in this code:
JavaScript:
    Scene_Base.prototype.createMiniWindow = function() {
        this._miniWindow = new Window_MiniInfo();
        if (this._buyWindow) this._buyWindow._miniInfoWindow = this._miniWindow;
        if (this._sellWindow) this._sellWindow._miniInfoWindow = this._miniWindow;
        if (this._slotWindow) this._slotWindow._miniInfoWindow = this._miniWindow;
        if (this._itemWindow) this._itemWindow._miniInfoWindow = this._miniWindow;
        this.addChild(this._miniWindow);
    };

but as you can see, the last line: this._itemWindow should do that thing.
but I to get the specific scene of the Window_EventItem can also be
the event ItemList, so adding your code (so modify (to try out))

JavaScript:
var __SItem_createList = Scene_ItemList.prototype.create;
Scene_ItemList.prototype.create = function() {
__SItem_createList.call(this);
if (useSceneItem) this.createMiniWindow();
};

I cannot tell if this will work, as they target the same, but see what it does.
if it fails or throw an error, comment it out: start: /* end */.

start = above the function, end is below it, so it wrap the block in 1 comment.

otherwise, set a // in front of each line.

but I have otherwise no clue.
Hi there!

TL;DR - Just copy and paste this this into the bottom of the plugin code:
Spoiler
JavaScript:
    var __Window_Message_createSubWindows = Window_Message.prototype.createSubWindows;
    Window_Message.prototype.createSubWindows = function() {
        __Window_Message_createSubWindows.call(this)
        const scene = SceneManager._scene
        if (this._itemWindow && scene.constructor.name === "Scene_Map") {
            scene.createMiniWindow()
            this._itemWindow._miniInfoWindow = scene._miniWindow
        }
    }

    var __Window_EventItem_callUpdateHelp = Window_EventItem.prototype.callUpdateHelp;
    Window_EventItem.prototype.callUpdateHelp = function() {
        __Window_EventItem_callUpdateHelp.call(this)
        if (this.active && this._miniInfoWindow) {
            this.updateHelp()
        }
    }
1755365166621.png

Now for the explanation:
  • Window_Message → The Message window of the Scene Map.
  • Window_EventItem → The item window of the scene map, from the Select Item event command. Which is also a sub window of the message window.
  • Window_MiniInfo → The mini info window created by the plugin.

The main problem is that the Window_MiniInfo is not created on the Scene_Map. The current plugin uses a method from Scene_Base to create the Mini Info Window and attach it to another window:

JavaScript:
    Scene_Base.prototype.createMiniWindow = function() {
        this._miniWindow = new Window_MiniInfo();
        if (this._buyWindow) this._buyWindow._miniInfoWindow = this._miniWindow;
        if (this._sellWindow) this._sellWindow._miniInfoWindow = this._miniWindow;
        if (this._slotWindow) this._slotWindow._miniInfoWindow = this._miniWindow;
        if (this._itemWindow) this._itemWindow._miniInfoWindow = this._miniWindow;
        this.addChild(this._miniWindow);
    };

On the other scenes, the plugin author call this method on the .create method to put the Window_MiniInfo there:

JavaScript:
    var __SEquip_create = Scene_Equip.prototype.create;
    Scene_Equip.prototype.create = function() {
        __SEquip_create.call(this);
        if (useSceneEquip) this.createMiniWindow();
    };

We would have to do the same for the scene map:

JavaScript:
    var __Scene_Map_create = Scene_Map.prototype.create;
    Scene_Map.prototype.create = function() {
        __Scene_Map_create.call(this);
        this.createMiniWindow()
    }

But, the Window_EventItem is a sub window of the Window_Message. And the Window_Message is not created when we call the .createMiniWindow().

We need to apply the Window_MiniInfo to the Window_EventItem. So instead of using the .create method of the Scene Map above, I did it on the .createSubWindows() method of the Window_Message:

JavaScript:
    var __Window_Message_createSubWindows = Window_Message.prototype.createSubWindows;
    Window_Message.prototype.createSubWindows = function() {
        __Window_Message_createSubWindows.call(this)
        const scene = SceneManager._scene
        if (this._itemWindow && scene.constructor.name === "Scene_Map") {
            scene.createMiniWindow()
            this._itemWindow._miniInfoWindow = scene._miniWindow
        }
    }

(We need to check if we are on the Scene Map, because this Window_Message method is also created on the battle scene, I guess)

With this, we make sure that the Window_MiniInfo is above the Window_EventItem

But, there is another problem. With only this approach we will not see the Window_MiniInfo because it is updated on the .callUpdateHelp method from the Window_EventItem(inherited from Window_Selectable). And this method only works if the Window_EventItem has a Help Window. Which by default, it does not have:
JavaScript:
Window_Selectable.prototype.callUpdateHelp = function() {
    if (this.active && this._helpWindow) {
        this.updateHelp();
    }
};

So we also need to add a check on this method to see if it is active, if it has the miniInfoWindow and if it does not have the help window. Because if it already has a help window, the .updateHelp would be called twice.

JavaScript:
    var __Window_EventItem_callUpdateHelp = Window_EventItem.prototype.callUpdateHelp;
    Window_EventItem.prototype.callUpdateHelp = function() {
        __Window_EventItem_callUpdateHelp.call(this)
        if (this.active && this._miniInfoWindow && !this._helpWindow) {
            this.updateHelp()
        }
    }

Of course, there are clean ways of doing that and also follow the plugin author code logic. But I just tried to make it work. And it does 🙂

1755364941189.png
The main problem is that the Window_MiniInfo is not created on the Scene_Map. The current plugin uses a method from Scene_Base to create the Mini Info Window and attach it to another window:
I had no idea it was attached to the message window, but the look of it
looks nice though.

I wonder if its only for the status/traits showing?

Nice job getting it work ^^
Hi there!

TL;DR - Just copy and paste this this into the bottom of the plugin code:
Spoiler
JavaScript:
    var __Window_Message_createSubWindows = Window_Message.prototype.createSubWindows;
    Window_Message.prototype.createSubWindows = function() {
        __Window_Message_createSubWindows.call(this)
        const scene = SceneManager._scene
        if (this._itemWindow && scene.constructor.name === "Scene_Map") {
            scene.createMiniWindow()
            this._itemWindow._miniInfoWindow = scene._miniWindow
        }
    }

    var __Window_EventItem_callUpdateHelp = Window_EventItem.prototype.callUpdateHelp;
    Window_EventItem.prototype.callUpdateHelp = function() {
        __Window_EventItem_callUpdateHelp.call(this)
        if (this.active && this._miniInfoWindow) {
            this.updateHelp()
        }
    }
View attachment 347585

Now for the explanation:
  • Window_Message → The Message window of the Scene Map.
  • Window_EventItem → The item window of the scene map, from the Select Item event command. Which is also a sub window of the message window.
  • Window_MiniInfo → The mini info window created by the plugin.

The main problem is that the Window_MiniInfo is not created on the Scene_Map. The current plugin uses a method from Scene_Base to create the Mini Info Window and attach it to another window:

JavaScript:
    Scene_Base.prototype.createMiniWindow = function() {
        this._miniWindow = new Window_MiniInfo();
        if (this._buyWindow) this._buyWindow._miniInfoWindow = this._miniWindow;
        if (this._sellWindow) this._sellWindow._miniInfoWindow = this._miniWindow;
        if (this._slotWindow) this._slotWindow._miniInfoWindow = this._miniWindow;
        if (this._itemWindow) this._itemWindow._miniInfoWindow = this._miniWindow;
        this.addChild(this._miniWindow);
    };

On the other scenes, the plugin author call this method on the .create method to put the Window_MiniInfo there:

JavaScript:
    var __SEquip_create = Scene_Equip.prototype.create;
    Scene_Equip.prototype.create = function() {
        __SEquip_create.call(this);
        if (useSceneEquip) this.createMiniWindow();
    };

We would have to do the same for the scene map:

JavaScript:
    var __Scene_Map_create = Scene_Map.prototype.create;
    Scene_Map.prototype.create = function() {
        __Scene_Map_create.call(this);
        this.createMiniWindow()
    }

But, the Window_EventItem is a sub window of the Window_Message. And the Window_Message is not created when we call the .createMiniWindow().

We need to apply the Window_MiniInfo to the Window_EventItem. So instead of using the .create method of the Scene Map above, I did it on the .createSubWindows() method of the Window_Message:

JavaScript:
    var __Window_Message_createSubWindows = Window_Message.prototype.createSubWindows;
    Window_Message.prototype.createSubWindows = function() {
        __Window_Message_createSubWindows.call(this)
        const scene = SceneManager._scene
        if (this._itemWindow && scene.constructor.name === "Scene_Map") {
            scene.createMiniWindow()
            this._itemWindow._miniInfoWindow = scene._miniWindow
        }
    }

(We need to check if we are on the Scene Map, because this Window_Message method is also created on the battle scene, I guess)

With this, we make sure that the Window_MiniInfo is above the Window_EventItem

But, there is another problem. With only this approach we will not see the Window_MiniInfo because it is updated on the .callUpdateHelp method from the Window_EventItem(inherited from Window_Selectable). And this method only works if the Window_EventItem has a Help Window. Which by default, it does not have:
JavaScript:
Window_Selectable.prototype.callUpdateHelp = function() {
    if (this.active && this._helpWindow) {
        this.updateHelp();
    }
};

So we also need to add a check on this method to see if it is active, if it has the miniInfoWindow and if it does not have the help window. Because if it already has a help window, the .updateHelp would be called twice.

JavaScript:
    var __Window_EventItem_callUpdateHelp = Window_EventItem.prototype.callUpdateHelp;
    Window_EventItem.prototype.callUpdateHelp = function() {
        __Window_EventItem_callUpdateHelp.call(this)
        if (this.active && this._miniInfoWindow && !this._helpWindow) {
            this.updateHelp()
        }
    }

Of course, there are clean ways of doing that and also follow the plugin author code logic. But I just tried to make it work. And it does 🙂

View attachment 347584
I really appreciate it! I’m so happy the problem’s been solved. Thank you both so much!
I had no idea it was attached to the message window, but the look of it
looks nice though.

I wonder if its only for the status/traits showing?

Nice job getting it work ^^
Thank you so much! I’m really glad everything got worked out. I truly appreciate both of you!

Original thread: https://forums.rpgmakerweb.com/threads/mv-i-want-to-extend-miniinformationwindow-js-so-it-can-also-be-used-with-selection-item.179587/