Advertisement
ludovicodes

LudoDisplayName.js

Dec 17th, 2017
1,133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. //LudoDisplayName.js
  3. //=============================================================================
  4.  
  5. /*:
  6.  * @plugindesc Allows you to change the display name of a map via script events.
  7.  * @author Alessio De Santis
  8.  *
  9.  *
  10.  * @help
  11.  * Use
  12.  * $ndname[MapID-1].displayName = "new map display name"
  13.  * in an event script command to change the display name of a map.
  14.  * Use
  15.  * $ndname[MapID-1].displayName = ""
  16.  * to show default display Text.
  17.  *
  18.  * Change MapID with the Id of the map that you want to change the display name of.
  19.  */  
  20.  
  21.  
  22.  //-----------------------------------------------------------------------------
  23.  
  24. $ndname = [];
  25.  
  26. Scene_Title.prototype.create = function() {
  27.     Scene_Base.prototype.create.call(this);
  28.     this.createBackground();
  29.     this.createForeground();
  30.     this.createWindowLayer();
  31.     this.createCommandWindow();
  32.  
  33.     this.initnd();
  34. };
  35.  
  36. Scene_Title.prototype.initnd = function() {
  37.     for(i of $dataMapInfos){
  38.         if(i && $ndname.length <= $dataMapInfos.length){
  39.             $ndname.push({
  40.                 id : i.id,
  41.                 displayName : ""
  42.             })
  43.         }
  44.     }
  45. }
  46.  
  47. Game_Map.prototype.displayName = function() {
  48.     if($dataMap.displayName && $ndname[$gameMap._mapId-1].displayName != "")
  49.         return $ndname[$gameMap._mapId-1].displayName
  50.     return $dataMap.displayName;
  51. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement