Mog Monogatari Menu - Gold Display

Hey guys!,

I'm having trouble figuring out how to get the gold display to show from right-left rather than left-right with this plugin. I attached visual examples so you could see what I'm talking about as well as the current version of the plugin so you don't have to download the full master project.

Thanks in advance!,


moggold.png
If I remember correctly you can change it from the plugin option themselves. If I get to my laptop before anyone else comments I'll take a quick look.
If I remember correctly you can change it from the plugin option themselves. If I get to my laptop before anyone else comments I'll take a quick look.
You can change the X/Y from the parameters but not the orientation of the layout itself and it just doesn't make sense vs. everything else. 😢
I read through that Moghunter plugin and it doesn't look like it changes the default behavior of the gold window. If you turn off all your plugins, you'll see that the gold window behaves like that already, so I don't believe it has anything to do with the Moghunter plugin.

Anyways, the function to write the gold value is this:
Code:
Window_Base.prototype.drawCurrencyValue = function(value, unit, x, y, width) {
   var unitWidth = Math.min(80, this.textWidth(unit));
   this.resetTextColor();
   this.drawText(value, x, y, width - unitWidth - 6, 'right');
   this.changeTextColor(this.systemColor());
   this.drawText(unit, x + width - unitWidth, y, unitWidth, 'right');
};
If you add that to a new plugin and change the first drawText to use 'left' instead of 'right', then you'll overwrite the default behavior and it will be left-aligned.
I read through that Moghunter plugin and it doesn't look like it changes the default behavior of the gold window. If you turn off all your plugins, you'll see that the gold window behaves like that already, so I don't believe it has anything to do with the Moghunter plugin.

Anyways, the function to write the gold value is this:
Code:
Window_Base.prototype.drawCurrencyValue = function(value, unit, x, y, width) {
   var unitWidth = Math.min(80, this.textWidth(unit));
   this.resetTextColor();
   this.drawText(value, x, y, width - unitWidth - 6, 'right');
   this.changeTextColor(this.systemColor());
   this.drawText(unit, x + width - unitWidth, y, unitWidth, 'right');
};
If you add that to a new plugin and change the first drawText to use 'left' instead of 'right', then you'll overwrite the default behavior and it will be left-aligned.
Thanks for taking the time to do that - but unfortunately the plugin itself pulls from an image and not from a draw text command. I think the code below is what controls the image itself - I just can't figure out how to control the alignment.

Code:
//==============================
// * create HP Number
//==============================
Scene_Menu.prototype.createGold = function() {
    this._gold_number = [];
    this._GoldData = [this._goldImg.width / 10,this._goldImg.height]
    var x = Moghunter.scMenu_GoldNumberX;
    var y = Moghunter.scMenu_GoldNumberY;
    for (var i = 0; i < 9; i++) {
         this._gold_number[i] = new Sprite(this._goldImg);
         this._gold_number[i].visible = false;
         this._gold_number[i].opacity = 255;
         this._gold_number[i].x = x ;
         this._gold_number[i].y = y ;
         this._field.addChild(this._gold_number[i]);         
    };   
    this.refresh_number(this._gold_number,$gameParty.gold(),this._GoldData,x)
Sorry, I misunderstood. Reading the plugin further, I realize that it actually completely hides the normal gold window and creates a different one from scratch, and that the numbers are actually pictures instead of text.

The function you are looking for is called:
Scene_Menu.prototype.refresh_number

You need to make 4 changes (well 2 changes, each 2 times):
Find the lines starting with
Code:
var nx =
Change both lines to:
Code:
var nx = (img_data[0] * i);

Next find the lines starting with
Code:
sprites[i].x
Change those to:
Code:
sprites[i].x = x + nx;

You'll need to update your x position, but now it will left-align the number to your x position instead of right-align.
That worked beautifully! Thank you so much for taking the time out of your day to help me! I really appreciate it. 😍

Original thread: https://forums.rpgmakerweb.com/threads/mog-monogatari-menu-gold-display.95343/