Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Non-Destructive Localization - Plugin for RPG Maker MV/MZ

Auto generate translation file and translate your game without replacing your in-editor text · By Sang Hendrix

[Info] NameBox with special code (Ex text, like \N[x] or \V[x] )

A topic by Naughty Arcade Studio created 2 days ago Views: 12 Replies: 2
Viewing posts 1 to 2

Hello, I'm using your plugin and it's really great one (An awesome on, shoud I say)

I just wanted to share a little bug I had, where the namebox of message box would not shown at the correct size. Otherwise, I recommend 1000% this plugin, it's a really powerfull one.

(By exemple if actor 10 was "Seraphina", \N[10] would transcribe a Seraphina but the name box would only show "Seraph")

This was due to the override of "Window_NameBox.prototype.windowWidth", which I modified a little, using the "source code" of RPG MZ :

const _Window_NameBox_windowWidth = Window_NameBox.prototype.windowWidth; 
Window_NameBox.prototype.windowWidth = function () {
      if (this._name) {
        const cleanName = (translations[this._name] || this._name).replace(/<[^>]*>/g, '');
        const textWidth = this.textSizeEx(cleanName).width;
        const padding = this.padding + this.itemPadding();
        const width = Math.ceil(textWidth) + padding * 2;
        return Math.min(width, Graphics.boxWidth);
      } else {
        return _Window_NameBox_windowWidth.call(this);  
      }
};
Developer

Hello. Did you fix it and that was the fixed code or what you meant was your custom code caused the bug?

Hello, sorry if it wasn't clear.

I modified your code with the code I posted earlier. It works correctly now, I simply added the width calculation from the source code of RPG MZ.


Before posting the message, I checked whether the bug still occurred on a “clean” project, and it did. My apologies if the bug does not appear for you.