Bug Map Name Window not showing

Hi there!

Bug

I found a bug where the Map Name Window will not show when you enter on a map that has a show text command on an autorun/parallel event.

How to replicate
  • Put a name to be displayed in the map settings.
  • On that same map, create an autorun/parallel event and put a show text command to open.
  • Hit playtest. As soon as the map is loaded, the show text command will display a message and it will not show the map name window.
  • Download the sample project to see that happening.
RPG Maker MZ - Core script 1.4.4
Sample project download here. (One Drive - 4,27MB .zip)

Cause

JavaScript:
Scene_Map.prototype.updateMapNameWindow = function() {
    if ($gameMessage.isBusy()) {
        this._mapNameWindow.close();
    }
};

Suggestion

Remove the above code and on the Game_Map.prototype.setup code, add:

JavaScript:
if($dataMap.displayName){
    this.enableNameDisplay()
}else{
    this.disableNameDisplay()
}
JavaScript:
Game_Map.prototype.setup = function(mapId) {
    if (!$dataMap) {
        throw new Error("The map data is not available");
    }
    this._mapId = mapId;
    this._tilesetId = $dataMap.tilesetId;
    this._displayX = 0;
    this._displayY = 0;
    this.refereshVehicles();
    this.setupEvents();
    this.setupScroll();
    this.setupParallax();
    this.setupBattleback();
    this._needsRefresh = false;
};
Yes, I see this too.

The close condition seems quite deliberate. My guess is that it's is there only to prevent overlap of the map name window and the message window? If that's the case, a couple of alternatives could be:
  1. Remove the updateMapNameWindow close condition entirely:
    JavaScript:
    Scene_Map.prototype.updateMapNameWindow = function() {};
    RMMZ renders its window layer using masks, so this allows the map name to display as long as the message window is not positioned on top of it.

  2. Make updateMapNameWindow reposition the map name to remain visible, e.g.
    JavaScript:
    Scene_Map.prototype.updateMapNameWindow = function() {
        if ($gameMessage.positionType() === 0) {  // top
            const wMsg  = this._messageWindow;
            this._mapNameWindow.y = wMsg.y + wMsg.height;
        }
    };
    It might be better to reference actual window coordinates for a more generally-applicable solution.
Approving this for discussion / official input~

Original thread: https://forums.rpgmakerweb.com/threads/map-name-window-not-showing.145438/