Keep money window open

I want to have the Gold window displayed all the time because for my vending machine, the Choices command takes away the window and players can't keep track of their money so I want to fix that. I tried a custom script command but it didn't work. It was made for VX Ace and I tried changing the At signs to dollar signs but it still didn't work.

Anyone got an MV command script?

PS: I've found that having the Gold window command on every textbox for the event keeps making it blink so I would like a more polished solution.
Try adding this as a plugin:
JavaScript:
Window_Message.prototype.terminateMessage = function () {
    this.close();
    if(!$gameSwitches.value(42)) this._goldWindow.close();
    $gameMessage.clear();
};

It will prevent the gold window from closing when a message ends if switch 42 is turned on (feel free to change 42 to something else).
You could also use SRD HUDMaker and make the gold value a HUD element that shows at all times
Try adding this as a plugin:
JavaScript:
Window_Message.prototype.terminateMessage = function () {
    this.close();
    if(!$gameSwitches.value(42)) this._goldWindow.close();
    $gameMessage.clear();
};

It will prevent the gold window from closing when a message ends if switch 42 is turned on (feel free to change 42 to something else).
Some feedback: I've tried this and there's an issue with the window not updating the amount after purchase and I had to close and open the window to get an updated Gold amount.

You could also use SRD HUDMaker and make the gold value a HUD element that shows at all times
Ack! I got it set up but my RPG Maker program is out of date and comes up with an error instead! I'm updating my program now.
OK, now it's outright broke now. =/
Some feedback: I've tried this and there's an issue with the window not updating the amount after purchase and I had to close and open the window to get an updated Gold amount.
Ah, that makes sense, I guess that window never updates itself because normally it doesn't need to. We can make it though. Try adding this below the code from earlier:

JavaScript:
void ((alias) => {
    Window_Message.prototype.update = function(){
        alias.call(this);
        if(this._goldWindow) this._goldWindow.refresh();
    }   
})(Window_Message.prototype.update);

I can't test it rn, but it should work.
Ah, that makes sense, I guess that window never updates itself because normally it doesn't need to. We can make it though. Try adding this below the code from earlier:

JavaScript:
void ((alias) => {
    Window_Message.prototype.update = function(){
        alias.call(this);
        if(this._goldWindow) this._goldWindow.refresh();
    }  
})(Window_Message.prototype.update);

I can't test it rn, but it should work.
It does update but when I turn off the switch, the window stays up until I either open a menu, leave the map or reset the game. It could use with a check to see if the switch is on or off and if off, the window closes.
Here's a demonstration. It'll give you a better idea on what I would like to have for my game.
ezgif-4-127a2863d3.gif
It does update but when I turn off the switch, the window stays up until I either open a menu, leave the map or reset the game. It could use with a check to see if the switch is on or off and if off, the window closes.
Here's a demonstration. It'll give you a better idea on what I would like to have for my game.
View attachment 291660
Ah, such are the perils of using existing things for something they're not meant for 😛
For some reason I assumed you'd have some message after, which would close it normally, but I guess with a choice like this which may or may not leave the event that wouldn't work. This leaves us without a good place to put such a check, since if we want it to still close after event processing is over, we'd need to be either checking for it every time a switch is changed, which could hurt plugin compatibility, or all the time, which would hurt performance.

This is a somewhat long-winded way of saying that the best way is probably to just close the window manually when needed, no engine modifications required. With the switch off it will close normally whenever a message closes, but if that won't work put the following as a script in the event SceneManager._scene._messageWindow._goldWindow.close().
Ah, such are the perils of using existing things for something they're not meant for 😛
For some reason I assumed you'd have some message after, which would close it normally, but I guess with a choice like this which may or may not leave the event that wouldn't work. This leaves us without a good place to put such a check, since if we want it to still close after event processing is over, we'd need to be either checking for it every time a switch is changed, which could hurt plugin compatibility, or all the time, which would hurt performance.

This is a somewhat long-winded way of saying that the best way is probably to just close the window manually when needed, no engine modifications required. With the switch off it will close normally whenever a message closes, but if that won't work put the following as a script in the event SceneManager._scene._messageWindow._goldWindow.close().
Yep, that worked! Thank you very much!
you also have the option of manually telling the gold window to refresh
SceneManager._scene._messageWindow._goldWindow.refresh()
Try adding this as a plugin:
JavaScript:
Window_Message.prototype.terminateMessage = function () {
    this.close();
    if(!$gameSwitches.value(42)) this._goldWindow.close();
    $gameMessage.clear();
};

It will prevent the gold window from closing when a message ends if switch 42 is turned on (feel free to change 42 to something else).
Hi, your script works pretty good, thanks for it!
But if i enable the plugin the name boxes don't disappear. Is there any way to fix it? 🙂
Thank you!
Hi, your script works pretty good, thanks for it!
But if i enable the plugin the name boxes don't disappear. Is there any way to fix it? 🙂
Thank you!
That sounds like it probably is fixable. What plugin are you using for the name boxes? And have you tried putting this script above that plugin?
That sounds like it probably is fixable. What plugin are you using for the name boxes? And have you tried putting this script above that plugin?
Thanks for the quick answer! I use Yanfly's message core. And putting the script above just worked quite right! Thanks again 🙂

Original thread: https://forums.rpgmakerweb.com/threads/keep-money-window-open.164701/