Remove Gold name/icon from Gold Window

Hey guys,

I have been tinkering with my menu layout and have come up with something I'm rather happy with. Only problem is that I can't seem to remove the blue text that says "Coin" from the bottom of the screen. I am using Yanfly's main menu manager.

I can find the instances of when the Gold Window is created in the rpg_scenes.js, but through my tinkering I cant seem to remove the text from the window. All I need is the amount of gold itself in the window. Window size and positioning is irrelevant. I have attached a picture to give an idea of what I mean.

Regards,
Will
I'm assuming that "Coin" is the currency unit as defined by you in the Database? So you just want to remove the currency unit from the Gold Window?

This is a bit hacky but you can paste this into a new .js file, name it something like 'RemoveCurrencyUnitGoldWindow.js' and add it to your Plugin Manager. The default line is commented out and replaced with one that doesn't draw the currency unit.
Code:
Window_Gold.prototype.refresh = function() {
    var x = this.textPadding();
    var width = this.contents.width - this.textPadding() * 2;
    this.contents.clear();
    //this.drawCurrencyValue(this.value(), this.currencyUnit(), x, 0, width);
    this.drawCurrencyValue(this.value(), "", x, 0, width);
};

I say hacky because it will remove the unit from any instance of the Gold Window, including if you open the Gold Window from a message (with the \$ character) or the Gold Window in the Scene Shop.


Given that, the full solution would either be:
  • Create a new window (Window_MenuGold) that is almost an exact copy of the Window_Gold and use that one instead in the Scene_Menu
or
  • Set a flag on the window based on the scene and then draw the text accordingly
    • scene processing add something like this._goldWindow.setMode('menu');
    • Add a function to Window_Gold to set the mode somethign like: Window_Gold.prototype.setMode = function(mode) {this._mode = mode};
    • then in the Window_Gold.refresh function add an if statement to check if(this._mode === 'menu') {draw without unit} else {draw with unit}
I say hacky because it will remove the unit from any instance of the Gold Window, including if you open the Gold Window from a message (with the \$ character) or the Gold Window in the Scene Shop.


Given that, the full solution would either be:
  • Create a new window (Window_MenuGold) that is almost an exact copy of the Window_Gold and use that one instead in the Scene_Menu

I think this here is my best bet. Dare I ask, I haven't yet got the hang of creating windows so would you mind giving me a quick hand? I can remove the older one from the menu scene alone easy enough, but just creating a new window with the data I need is still beyond me.
Much appreciated for your help 🙂
No problem.
First, get a decent text editor if you don't already have one. If you're just starting out then I recommend Notepad++. Later on you can upgrade to better ones if you want.

  1. Copy all of Window_Gold into a new .js file
    • That starts on line 1508 of the rpg_window.js file
  2. In your new .js file, ctrl-H and rename everything to Window_MenuGold
  3. Change the Window_MenuGold.prototype.refresh function as I did earlier
  4. Find the Scene_Menu.prototype.createGoldWindow function in the rpg_scenes.js file. Copy it to your new .js file
  5. Change "new Window_Gold" to "new Window_MenuGold"
  6. Add to project plugins and turn the plugin on
  7. ????
  8. Profit
Worked a treat. I use SublimeText for all my JS editing and it makes things for a complete rookie so easy.
Thank you very much for all your help 🙂
Glad to hear it worked out well. Your menu looks very nice by the way

Original thread: https://forums.rpgmakerweb.com/threads/remove-gold-name-icon-from-gold-window.89683/