Advertisement
Guest User

GS_mapaMund.js

a guest
Jun 21st, 2017
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // GS_mapaMundi.js v1.22
  3. //=============================================================================
  4. /*:
  5.  * @plugindesc v1.22 - Allows developers to create mapa-mundi in games.
  6.  * @author GuilhermeSantos
  7.  *
  8.  * @param Map-Info
  9.  * @desc Set the settings of the maps.
  10.  * @type struct<MapaInfo>[]
  11.  * @default ["{\"Keyboard (open)\":\"true\",\"KeyName (open)\":\"pageup\",\"KeyName (open) (Advanced)\":\"My Advanced keyName\",\"Keyboard (close)\":\"true\",\"KeyName (close)\":\"pagedown\",\"KeyName (close) (Advanced)\":\"My Advanced keyName\",\"Zoom\":\"true\",\"Distance\":\"1.5\",\"Restore (Type)\":\"automatic\",\"Restore\":\"1\",\"Frames\":\"30\",\"Map-Id\":\"1\"}"]
  12.  *
  13.  * @param Map-Icons
  14.  * @desc Set the icons on the mapa-mundi.
  15.  * @type struct<MapaIcons>[]
  16.  * @default ["{\"Icon\":\"system/\",\"Extension of the Icon\":\"png\",\"Map-Id\":\"1\",\"TileX\":\"1\",\"TileY\":\"1\",\"Hue\":\"1\",\"ScaleX\":\"1.5\",\"ScaleY\":\"1.5\",\"Text Icon\":\"txt\",\"Text\":\"My Icon\",\"fontSize\":\"16\",\"TextScaleX\":\"1.5\",\"TextScaleY\":\"1.5\",\"textX\":\"-56.00\",\"textY\":\"0.00\",\"Animation\":\"true\",\"animFrames\":\"60\",\"animFrames2\":\"60\",\"Opacity\":\"true\",\"StartOpacity\":\"0\",\"Delay\":\"60\"}"]
  17.  *
  18.  * @param Map-ConfigMove
  19.  * @desc Set the config of the mapa-mundi movement.
  20.  * @type struct<ConfigMove>[]
  21.  * @default ["{\"Move Camera\":\"automatic\",\"Limit (Y+)\":\"1\",\"Limit (Y-)\":\"1\",\"Limit (X+)\":\"1\",\"Limit (X-)\":\"1\",\"Speed\":\"2.0\",\"Map-Id\":\"1\"}"]
  22.  *
  23.  * @param Map-ZoomPrivate
  24.  * @desc Set the privates locations of zoom (disabled).
  25.  * @type struct<ZoomPrivate>[]
  26.  * @default ["{\"Private Type\":\"Disabled\",\"Region ID\":\"1\",\"Point (X)\":\"1\",\"Point End (X)\":\"1\",\"Point (Y)\":\"1\",\"Point End (Y)\":\"1\",\"Map-Id\":\"1\"}"]
  27.  *
  28.  * @help
  29.  * ============================================================================
  30.  * Introduction
  31.  * ============================================================================
  32.  *
  33.  * This plugin lets you create the mapa-mundi.
  34.  *
  35.  * ============================================================================
  36.  * Dependencies (2)
  37.  * ============================================================================
  38.  * SRD_CameraCore (SumRndmDde)
  39.  * Need: - Effect of zooming.
  40.  *       - Move of camera
  41.  * Get: http://bit.ly/2sAhKJc
  42.  * --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
  43.  * YEP_StopMapMovement (Yanfly Engine Plugins)
  44.  * Need: - To stop the movement of the player.
  45.  *       - To stop the movement of the events
  46.  * Get: http://bit.ly/2swXN53
  47.  * ============================================================================
  48.  * Plugin Commands (2)
  49.  * ============================================================================
  50.  *
  51.  * If you would like to shut off the mapa-mundi or turn it on,
  52.  * you can use the following plugin commands:
  53.  *
  54.  * Plugin Command:
  55.  *
  56.  *   HideMapaMundi
  57.  *   Hide the mapa-mundi.
  58.  *
  59.  *   ShowMapaMundi
  60.  *   Show the mapa-mundi.
  61.  *
  62.  * ============================================================================
  63.  * Changelog (8)
  64.  * ============================================================================
  65.  *
  66.  * Version 1.22:
  67.  * - Added new function to clear icons.
  68.  * - Added new function to opacity of the icons.
  69.  * - Added new parameters.
  70.  *  
  71.  * Version 1.21:
  72.  * - Added new function to open/close mapa-mundi.
  73.  * - Added new parameters.
  74.  *
  75.  * Version 1.20:
  76.  * - Added new function to zoom-map.
  77.  * - Added new function to private locations of the zoom-map (disabled).
  78.  * - Fixed bug of the camera movement.
  79.  * - Added new parameters.
  80.  *
  81.  * Version 1.18:
  82.  * - Added new function to save menu access.
  83.  * - Bugs Fix.
  84.  *
  85.  * Version 1.15:
  86.  * - Added new movement of camera of the mapa-mundi.
  87.  * - Added new parameters.
  88.  *
  89.  * Version 1.12:
  90.  * - Added new animation of icons and improvements.
  91.  * - Added new draw text for icons.
  92.  *
  93.  * Version 1.10:
  94.  * - Added new features and improvements.
  95.  * - The system must implement and not lock for lack of dependencies.
  96.  *  
  97.  * Version 1.00:
  98.  * - Finished Plugin!
  99. */
  100.  
  101. /*~struct~MapaInfo:
  102.  * @param Keyboard (open)
  103.  * @desc Key to open mapa-mundi.
  104.  * @type boolean
  105.  * @default true
  106.  * @on Enable
  107.  * @off Disable
  108.  *
  109.  * @param KeyName (open)
  110.  * @parent Keyboard (open)
  111.  * @type select
  112.  * @desc Which key opens the world map?
  113.  * @default pageup
  114.  * @option tab
  115.  * @value tab
  116.  * @option ok
  117.  * @value ok
  118.  * @option shift
  119.  * @value shift
  120.  * @option control
  121.  * @value control
  122.  * @option escape
  123.  * @value escape
  124.  * @option pageup
  125.  * @value pageup
  126.  * @option pagedown
  127.  * @value pagedown
  128.  * @option left
  129.  * @value left
  130.  * @option up
  131.  * @value up
  132.  * @option right
  133.  * @value right
  134.  * @option down
  135.  * @value down
  136.  * @option advanced
  137.  * @value advanced
  138.  *
  139.  * @param KeyName (open) (Advanced)
  140.  * @parent Keyboard (open)
  141.  * @desc Advanced keyName.
  142.  * @type string
  143.  * @default My Advanced keyName
  144.  *
  145.  * @param Keyboard (close)
  146.  * @desc Key to close mapa-mundi.
  147.  * @type boolean
  148.  * @default true
  149.  * @on Enable
  150.  * @off Disable
  151.  *
  152.  * @param KeyName (close)
  153.  * @parent Keyboard (close)
  154.  * @type select
  155.  * @desc Which key close the world map?
  156.  * @default pagedown
  157.  * @option tab
  158.  * @value tab
  159.  * @option ok
  160.  * @value ok
  161.  * @option shift
  162.  * @value shift
  163.  * @option control
  164.  * @value control
  165.  * @option escape
  166.  * @value escape
  167.  * @option pageup
  168.  * @value pageup
  169.  * @option pagedown
  170.  * @value pagedown
  171.  * @option left
  172.  * @value left
  173.  * @option up
  174.  * @value up
  175.  * @option right
  176.  * @value right
  177.  * @option down
  178.  * @value down
  179.  * @option advanced
  180.  * @value advanced
  181.  *
  182.  * @param KeyName (close) (Advanced)
  183.  * @parent Keyboard (close)
  184.  * @desc Advanced keyName.
  185.  * @type string
  186.  * @default My Advanced keyName
  187.  *
  188.  * @param Zoom
  189.  * @desc Effect of zoom when the world map is opened.
  190.  * @type boolean
  191.  * @default true
  192.  * @on Enable
  193.  * @off Disable
  194.  *
  195.  * @param Distance
  196.  * @parent Zoom
  197.  * @desc Distance of the zoom(out).
  198.  * @type number
  199.  * @max 2
  200.  * @min 1
  201.  * @decimals 1
  202.  * @default 1.5
  203.  *
  204.  * @param Restore (Type)
  205.  * @parent Zoom
  206.  * @type select
  207.  * @desc What is the restore type?
  208.  * @default automatic
  209.  * @option number
  210.  * @value number
  211.  * @option automatic
  212.  * @value automatic
  213.  *
  214.  * @param Restore
  215.  * @parent Restore (Type)
  216.  * @desc Distance of the zoom(in).
  217.  * @type number
  218.  * @max 2
  219.  * @min 1
  220.  * @decimals 1
  221.  * @default 1
  222.  *
  223.  * @param Frames
  224.  * @parent Zoom
  225.  * @desc Execution Time of the zoom(out/in).
  226.  * @type number
  227.  * @max 300
  228.  * @min 30
  229.  * @default 30
  230.  *
  231.  * @param Map-Id
  232.  * @desc ID of Map.
  233.  * @type number
  234.  * @min 1
  235.  * @default 1
  236.  */
  237.  
  238. /*~struct~MapaIcons:
  239.  * @param Icon
  240.  * @desc The image of the icon.
  241.  * @require 1
  242.  * @dir img
  243.  * @type file
  244.  * @default system/
  245.  *
  246.  * @param Extension of the Icon
  247.  * @type select
  248.  * @desc What is the image file format?
  249.  * @default png
  250.  * @option png
  251.  * @value png
  252.  * @option jpg
  253.  * @value jpg
  254.  *
  255.  * @param Map-Id
  256.  * @desc ID of Map.
  257.  * @type number
  258.  * @min 1
  259.  * @default 1
  260.  *
  261.  * @param TileX
  262.  * @desc Tile x of icon.
  263.  * @type number
  264.  * @min 1
  265.  * @default 1
  266.  *
  267.  * @param TileY
  268.  * @desc Tile y of icon.
  269.  * @type number
  270.  * @min 1
  271.  * @default 1
  272.  *
  273.  * @param Hue
  274.  * @parent Zoom
  275.  * @desc The hue offset in 360 degrees.
  276.  * @type number
  277.  * @max 360
  278.  * @min -360
  279.  * @default 1
  280.  *
  281.  * @param ScaleX
  282.  * @desc Scale x of icon.
  283.  * @type number
  284.  * @max 4
  285.  * @min -2
  286.  * @decimals 1
  287.  * @default 1.5
  288.  *
  289.  * @param ScaleY
  290.  * @desc Scale y of icon.
  291.  * @type number
  292.  * @max 4
  293.  * @min -2
  294.  * @decimals 1
  295.  * @default 1.5
  296.  *
  297.  * @param Text Icon
  298.  * @type select
  299.  * @desc What is the type of format text?
  300.  * @default txt
  301.  * @option txt
  302.  * @value txt
  303.  * @option command
  304.  * @value command
  305.  * @option disabled
  306.  * @value disabled
  307.  *
  308.  * @param Text
  309.  * @parent Text Icon
  310.  * @desc Text of icon.
  311.  * @type string
  312.  * @default My Icon
  313.  *
  314.  * @param fontSize
  315.  * @parent Text Icon
  316.  * @desc Size of font.
  317.  * @type number
  318.  * @max 72
  319.  * @min 6
  320.  * @default 16
  321.  *
  322.  * @param TextScaleX
  323.  * @parent Text Icon
  324.  * @desc Scale y of text icon.
  325.  * @type number
  326.  * @max 4
  327.  * @min -2
  328.  * @decimals 1
  329.  * @default 1.5
  330.  *
  331.  * @param TextScaleY
  332.  * @parent Text Icon
  333.  * @desc Scale y of text icon.
  334.  * @type number
  335.  * @max 4
  336.  * @min -2
  337.  * @decimals 1
  338.  * @default 1.5
  339.  *
  340.  * @param textX
  341.  * @parent Text Icon
  342.  * @desc Position x of font.
  343.  * @type number
  344.  * @max 100
  345.  * @min -100
  346.  * @decimals 2
  347.  * @default -56.00
  348.  *
  349.  * @param textY
  350.  * @parent Text Icon
  351.  * @desc Position y of font.
  352.  * @type number
  353.  * @max 100
  354.  * @min -100
  355.  * @decimals 2
  356.  * @default 0.00
  357.  *
  358.  * @param Animation
  359.  * @parent Zoom
  360.  * @desc Effect of zoom-in and zoom-out of icon.
  361.  * @type boolean
  362.  * @default true
  363.  * @on Enable
  364.  * @off Disable
  365.  *
  366.  * @param animFrames
  367.  * @parent Animation
  368.  * @desc Execution Time of the scale(in) icon.
  369.  * @type number
  370.  * @max 999
  371.  * @min 30
  372.  * @default 60
  373.  *
  374.  * @param animFrames2
  375.  * @parent Animation
  376.  * @desc Execution Time of the scale(out) icon.
  377.  * @type number
  378.  * @max 999
  379.  * @min 30
  380.  * @default 60
  381.  *
  382.  * @param Opacity
  383.  * @parent Zoom
  384.  * @desc Effect of opacity-in and opacity-out of icon.
  385.  * @type boolean
  386.  * @default true
  387.  * @on Enable
  388.  * @off Disable
  389.  *
  390.  * @param StartOpacity
  391.  * @parent Opacity
  392.  * @desc Opacity initial of effect.
  393.  * @type number
  394.  * @max 999
  395.  * @min 0
  396.  * @default 0
  397.  *
  398.  * @param Delay
  399.  * @parent Opacity
  400.  * @desc Delay to start the effect.
  401.  * @type number
  402.  * @max 999
  403.  * @min 0
  404.  * @default 60
  405.  */
  406.  
  407. /*~struct~ConfigMove:
  408.  * @param Move Camera
  409.  * @type select
  410.  * @desc What is the limit type?
  411.  * @default automatic
  412.  * @option number
  413.  * @value number
  414.  * @option automatic
  415.  * @value automatic
  416.  *
  417.  * @param Limit (Y+)
  418.  * @parent Move Camera
  419.  * @desc Value of limit to down.
  420.  * @type number
  421.  * @min 0
  422.  * @default 1
  423.  *
  424.  * @param Limit (Y-)
  425.  * @parent Move Camera
  426.  * @desc Value of limit to up.
  427.  * @type number
  428.  * @min 0
  429.  * @default 1
  430.  *
  431.  * @param Limit (X+)
  432.  * @parent Move Camera
  433.  * @desc Value of limit to right.
  434.  * @type number
  435.  * @min 0
  436.  * @default 1
  437.  *
  438.  * @param Limit (X-)
  439.  * @parent Move Camera
  440.  * @desc Value of limit to left.
  441.  * @type number
  442.  * @min 0
  443.  * @default 1
  444.  *
  445.  * @param Speed
  446.  * @parent Move Camera
  447.  * @desc Value of speed of the movement.
  448.  * @type Number
  449.  * @min 1
  450.  * @decimals 1
  451.  * @default 2.0
  452.  *
  453.  * @param Map-Id
  454.  * @parent Zoom
  455.  * @desc ID of Map.
  456.  * @type number
  457.  * @min 1
  458.  * @default 1
  459.  */
  460.  
  461. /*~struct~ZoomPrivate:
  462.  * @param Private Type
  463.  * @type select
  464.  * @desc What is the value type?
  465.  * @default Disabled
  466.  * @option PointToPoint
  467.  * @value PointToPoint
  468.  * @option Region
  469.  * @value Region
  470.  * @option Disabled
  471.  * @value Disabled
  472.  *
  473.  * @param Region ID
  474.  * @parent Private Type
  475.  * @desc Value of region.
  476.  * @type number
  477.  * @min 1
  478.  * @max 255
  479.  * @default 1
  480.  *
  481.  * @param Point (X)
  482.  * @parent Private Type
  483.  * @desc Value of tile map x to point.
  484.  * @type number
  485.  * @min 0
  486.  * @default 1
  487.  *
  488.  * @param Point End (X)
  489.  * @parent Private Type
  490.  * @desc Value of tile map x to end point.
  491.  * @type number
  492.  * @min 0
  493.  * @default 1
  494.  *
  495.  * @param Point (Y)
  496.  * @parent Private Type
  497.  * @desc Value of tile map y to point.
  498.  * @type number
  499.  * @min 0
  500.  * @default 1
  501.  *
  502.  * @param Point End (Y)
  503.  * @parent Private Type
  504.  * @desc Value of tile map y to end point.
  505.  * @type number
  506.  * @min 0
  507.  * @default 1
  508.  *
  509.  * @param Map-Id
  510.  * @parent Zoom
  511.  * @desc ID of Map.
  512.  * @type number
  513.  * @min 1
  514.  * @default 1
  515.  */
  516.  
  517. var GS = GS || {};
  518. GS.mapaMundi = GS.mapaMundi || {};
  519.  
  520. var Imported = Imported || {};
  521. Imported["GS_mapaMundi"] = 1.22;
  522.  
  523. (function (_) {
  524.     "use strict";
  525.  
  526.     //-----------------------------------------------------------------------------
  527.     // Methods
  528.     //
  529.     _.localPath = function (p) {
  530.         if (p.substring(0, 1) === '/') p = p.substring(1);
  531.         var path = require('path');
  532.         var base = path.dirname(process.mainModule.filename);
  533.         return path.join(base, p);
  534.     };
  535.  
  536.     _.reloadDev = function () {
  537.         if (Utils.isNwjs()) {
  538.             var window = require('nw.gui').Window.get();
  539.             window.reloadDev();
  540.         }
  541.     };
  542.  
  543.     _.progressBar = function (value) {
  544.         if (Utils.isNwjs()) {
  545.             var window = require('nw.gui').Window.get();
  546.             window.setProgressBar(value);
  547.         }
  548.     };
  549.  
  550.     Graphics.printIconError = function (url) {
  551.         if (this._errorPrinter && !this._errorShowed) {
  552.             this._errorPrinter.innerHTML = this._makeErrorHtml('Loading Error', 'Failed to load: ' + url);
  553.             var button = document.createElement('button');
  554.             button.innerHTML = 'Retry';
  555.             button.style.fontSize = '24px';
  556.             button.style.color = '#ffffff';
  557.             button.style.backgroundColor = '#000000';
  558.             button.onmousedown = button.ontouchstart = function (event) {
  559.                 ResourceHandler.retry();
  560.                 event.stopPropagation();
  561.                 var fs = require('fs');
  562.                 if (fs.existsSync(url)) {
  563.                     Graphics.eraseLoadingError();
  564.                     Graphics.printIconRestart(url);
  565.                 };
  566.             };
  567.             this._errorPrinter.appendChild(button);
  568.             this._loadingCount = -Infinity;
  569.         }
  570.     };
  571.  
  572.     Graphics.printIconRestart = function (url) {
  573.         if (this._errorPrinter && !this._errorShowed) {
  574.             this._errorPrinter.innerHTML = this._makeErrorHtml('Loading Complete', 'Complete to load: ' + url);
  575.             var button = document.createElement('button');
  576.             button.innerHTML = 'Restart';
  577.             button.style.fontSize = '24px';
  578.             button.style.color = '#ffffff';
  579.             button.style.backgroundColor = '#000000';
  580.             button.onmousedown = button.ontouchstart = function (event) {
  581.                 ResourceHandler.retry();
  582.                 event.stopPropagation();
  583.                 _.progressBar(0);
  584.                 _.reloadDev();
  585.             };
  586.             this._errorPrinter.appendChild(button);
  587.             this._loadingCount = -Infinity;
  588.         }
  589.     };
  590.  
  591.     //-----------------------------------------------------------------------------
  592.     // Dependencies
  593.     //
  594.     var SRD_CameraCore = Imported['SumRndmDde Camera Core'] || false;
  595.     var YEP_StopMapMovement = Imported['YEP_StopMapMovement'] || false;
  596.  
  597.     //-----------------------------------------------------------------------------
  598.     // Parameters
  599.     //
  600.     var params = PluginManager.parameters('GS_mapaMundi');
  601.     var MapInfo = JSON.parse(params['Map-Info']);
  602.     var MapIcons = JSON.parse(params['Map-Icons']);
  603.     var MapConfigMove = JSON.parse(params['Map-ConfigMove']);
  604.     var mapPrivateZoom = JSON.parse(params['Map-ZoomPrivate']);
  605.  
  606.     //-----------------------------------------------------------------------------
  607.     // Game_Player
  608.     //
  609.     // The game object class for the player. It contains event starting
  610.     // determinants and map scrolling functions.
  611.     var Game_PlayerclearTransferInfo = Game_Player.prototype.clearTransferInfo;
  612.     Game_Player.prototype.clearTransferInfo = function () {
  613.         Game_PlayerclearTransferInfo.call(this);
  614.         $gameSystem.resetAllMapaMundi();
  615.         var mapId = $gameMap.mapId();
  616.         var length = MapInfo.length;
  617.         for (let i = 0; i < length; i++) {
  618.             let info = JSON.parse(MapInfo[i]);
  619.             let infoId = JSON.parse(info['Map-Id']);
  620.             if (infoId == mapId) {
  621.                 $gameSystem.mapZoomSet('Zoom', JSON.parse(info['Zoom']));
  622.                 $gameSystem.mapZoomSet('Distance', JSON.parse(info['Distance']));
  623.                 $gameSystem.mapZoomSet('Frames', JSON.parse(info['Frames']));
  624.                 $gameSystem.mapZoomSet('Map-Id', JSON.parse(info['Map-Id']));
  625.                 $gameSystem.mapZoomSet('Restore (Type)', info['Restore (Type)']);
  626.                 $gameSystem.mapZoomSet('Restore', JSON.parse(info['Restore']));
  627.                 $gameSystem.mapZoomSet('Keyboard (open)', JSON.parse(info['Keyboard (open)']));
  628.                 $gameSystem.mapZoomSet('KeyName (open)', info['KeyName (open)']);
  629.                 $gameSystem.mapZoomSet('KeyName (open) (Advanced)', info['KeyName (open) (Advanced)']);
  630.                 $gameSystem.mapZoomSet('Keyboard (close)', JSON.parse(info['Keyboard (close)']));
  631.                 $gameSystem.mapZoomSet('KeyName (close)', info['KeyName (close)']);
  632.                 $gameSystem.mapZoomSet('KeyName (close) (Advanced)', info['KeyName (close) (Advanced)']);
  633.                 break;
  634.             }
  635.         }
  636.         length = MapIcons.length;
  637.         for (let i = 0; i < length; i++) {
  638.             let info = JSON.parse(MapIcons[i]);
  639.             let infoId = JSON.parse(info['Map-Id']);
  640.             if (infoId == mapId) {
  641.                 $gameSystem.mapIconsSet(
  642.                     info['Icon'],
  643.                     info['Extension of the Icon'],
  644.                     JSON.parse(info['TileX']),
  645.                     JSON.parse(info['TileY']),
  646.                     JSON.parse(info['Hue']),
  647.                     JSON.parse(info['ScaleX']),
  648.                     JSON.parse(info['ScaleY']),
  649.                     $gameSystem.getTextIcon(
  650.                         info['Text Icon'],
  651.                         info['Text']
  652.                     ),
  653.                     JSON.parse(info['fontSize']),
  654.                     JSON.parse(info['TextScaleX']),
  655.                     JSON.parse(info['TextScaleY']),
  656.                     JSON.parse(info['textX']),
  657.                     JSON.parse(info['textY']),
  658.                     JSON.parse(info['animFrames']),
  659.                     JSON.parse(info['animFrames2']),
  660.                     JSON.parse(info['ScaleX']),
  661.                     JSON.parse(info['ScaleY']),
  662.                     JSON.parse(info['Animation']),
  663.                     $gameSystem.setOpacityIconsMapaMundi(
  664.                         JSON.parse(info['Opacity']),
  665.                         JSON.parse(info['StartOpacity']),
  666.                         JSON.parse(info['Delay'])
  667.                     )
  668.                 );
  669.             }
  670.         }
  671.         length = MapConfigMove.length;
  672.         for (let i = 0; i < length; i++) {
  673.             let info = JSON.parse(MapConfigMove[i]);
  674.             let infoId = JSON.parse(info['Map-Id']);
  675.             if (infoId == mapId) {
  676.                 $gameSystem.mapMoveSet('Move Camera', info['Move Camera']);
  677.                 $gameSystem.mapMoveSet('Limit (Y+)', JSON.parse(info['Limit (Y+)']));
  678.                 $gameSystem.mapMoveSet('Limit (Y-)', JSON.parse(info['Limit (Y-)']));
  679.                 $gameSystem.mapMoveSet('Limit (X+)', JSON.parse(info['Limit (X+)']));
  680.                 $gameSystem.mapMoveSet('Limit (X-)', JSON.parse(info['Limit (X-)']));
  681.                 $gameSystem.mapMoveSet('Move Speed', JSON.parse(info['Speed']));
  682.                 $gameSystem.mapMoveSet('Map-Id', JSON.parse(info['Map-Id']));
  683.                 break;
  684.             }
  685.         }
  686.         length = mapPrivateZoom.length;
  687.         for (let i = 0; i < length; i++) {
  688.             let info = JSON.parse(mapPrivateZoom[i]);
  689.             let infoId = JSON.parse(info['Map-Id']);
  690.             if (infoId == mapId) {
  691.                 $gameSystem.mapPrivateZoomSet('Private Type', info['Private Type']);
  692.                 $gameSystem.mapPrivateZoomSet('Region ID', JSON.parse(info['Region ID']));
  693.                 $gameSystem.mapPrivateZoomSet('Point (X)', JSON.parse(info['Point (X)']));
  694.                 $gameSystem.mapPrivateZoomSet('Point End (X)', JSON.parse(info['Point End (X)']));
  695.                 $gameSystem.mapPrivateZoomSet('Point (Y)', JSON.parse(info['Point (Y)']));
  696.                 $gameSystem.mapPrivateZoomSet('Point End (Y)', JSON.parse(info['Point End (Y)']));
  697.                 $gameSystem.mapPrivateZoomSet('Map-Id', JSON.parse(info['Map-Id']));
  698.                 break;
  699.             }
  700.         }
  701.     };
  702.  
  703.     //-----------------------------------------------------------------------------
  704.     // Game_System
  705.     //
  706.     // The game object class for the system data.
  707.     Game_System.prototype.mapaMundi = function () {
  708.         return this._mapaMundi;
  709.     };
  710.  
  711.     Game_System.prototype.saveZoomMap = function (zoom) {
  712.         this._saveZoomMap = zoom;
  713.     };
  714.  
  715.     Game_System.prototype.zoomMap = function () {
  716.         return this._saveZoomMap;
  717.     };
  718.  
  719.     Game_System.prototype.saveIsMenuEnabled = function () {
  720.         this._saveMenuEnabled = this.isMenuEnabled();
  721.         this.disableMenu();
  722.     };
  723.  
  724.     Game_System.prototype.saveMenuEnabled = function () {
  725.         return this._saveMenuEnabled;
  726.     };
  727.  
  728.     Game_System.prototype.enableCallMenuMapaMundi = function () {
  729.         this._saveMenuCallMapaMundi = true;
  730.     };
  731.  
  732.     Game_System.prototype.disableCallMenuMapaMundi = function () {
  733.         this._saveMenuCallMapaMundi = false;
  734.     };
  735.  
  736.     Game_System.prototype.callMenuMapaMundi = function () {
  737.         return this._saveMenuCallMapaMundi;
  738.     };
  739.  
  740.     Game_System.prototype.resetAllMapaMundi = function () {
  741.         this.mapIconsReset();
  742.         this.mapZoomReset();
  743.         this.mapMoveReset();
  744.         this.mapPrivateZoomReset();
  745.     };
  746.  
  747.     Game_System.prototype.mapPrivateZoomReset = function () {
  748.         this._mapPrivateZoomInfo = [];
  749.     };
  750.  
  751.     Game_System.prototype.mapPrivateZoomSet = function (object, value) {
  752.         this._mapPrivateZoomInfo[object] = value;
  753.     };
  754.  
  755.     Game_System.prototype.mapPrivateZoomInfo = function (object) {
  756.         return this._mapPrivateZoomInfo[object] || false;
  757.     };
  758.  
  759.     Game_System.prototype.mapMoveReset = function () {
  760.         this._mapMoveInfo = [];
  761.     };
  762.  
  763.     Game_System.prototype.mapMoveSet = function (object, value) {
  764.         this._mapMoveInfo[object] = value;
  765.     };
  766.  
  767.     Game_System.prototype.mapMoveInfo = function (object) {
  768.         if (this._mapMoveInfo[object] === 0) {
  769.             return this._mapMoveInfo[object];
  770.         }
  771.         return this._mapMoveInfo[object] || false;
  772.     };
  773.  
  774.     Game_System.prototype.mapZoomReset = function () {
  775.         this._mapZoomInfo = [];
  776.     };
  777.  
  778.     Game_System.prototype.mapZoomSet = function (object, value) {
  779.         this._mapZoomInfo[object] = value;
  780.     };
  781.  
  782.     Game_System.prototype.mapZoomInfo = function (object) {
  783.         return this._mapZoomInfo[object] || false;
  784.     };
  785.  
  786.     Game_System.prototype.mapIconsReset = function () {
  787.         this._mapIcons = [];
  788.     };
  789.  
  790.     Game_System.prototype.mapIconsSet = function (path, extension, x, y, hue, scaleX, scaleY, text, fontSize, TextScaleX, TextScaleY, textX, textY, animFrames, animFrames2, minIconScaleX, minIconScaleY, Animation, Opacity) {
  791.         this._mapIcons.push([path, extension, x, y, hue, scaleX, scaleY, text, fontSize, TextScaleX, TextScaleY, textX, textY, animFrames, animFrames2, minIconScaleX, minIconScaleY, Animation, Opacity]);
  792.     };
  793.  
  794.     Game_System.prototype.existIcons = function () {
  795.         var fs = require('fs');
  796.         var mapIcons = $gameSystem._mapIcons;
  797.         var length = mapIcons.length;
  798.         for (var i = 0; i < length; i++) {
  799.             var filePath = mapIcons[i][0];
  800.             var fileExtension = mapIcons[i][1];
  801.             var path = _.localPath('img/' + filePath + '.' + fileExtension);
  802.             if (!fs.existsSync(path)) {
  803.                 SceneManager.stop();
  804.                 _.progressBar(2.5);
  805.                 return Graphics.printIconError(path);
  806.             }
  807.         }
  808.         return true;
  809.     };
  810.  
  811.     Game_System.prototype.startMapaMundi = function () {
  812.         this._mapaMundi = true;
  813.         this.saveIsMenuEnabled();
  814.         this.startMapaMundiZoom();
  815.         this.startMapaMundiStopPlayer();
  816.         if (this.tileMapSpritesExist()) {
  817.             this._cancelIconsMapaMundi = false;
  818.             this.tileMapSpriteClear();
  819.         }
  820.         this.startMapaMundiIcons();
  821.         this.startShiftValuesMapaMundi();
  822.     };
  823.  
  824.     Game_System.prototype.startShiftValuesMapaMundi = function () {
  825.         if (SRD_CameraCore) {
  826.             $gameMap._shiftCameraMapaMundiY = 0;
  827.             $gameMap._shiftCameraMapaMundiX = 0;
  828.         }
  829.     };
  830.  
  831.     Game_System.prototype.startMapaMundiStopPlayer = function () {
  832.         if (YEP_StopMapMovement) {
  833.             Game_Interpreter.prototype.pluginCommand('StopPlayerMovement', []);
  834.             Game_Interpreter.prototype.pluginCommand('StopEventMovement', []);
  835.         }
  836.     };
  837.  
  838.     Game_System.prototype.startMapaMundiZoom = function () {
  839.         var zoomEnable = $gameSystem.mapZoomInfo('Zoom');
  840.         var zoomDistance = $gameSystem.mapZoomInfo('Distance');
  841.         var zoomFrames = $gameSystem.mapZoomInfo('Frames');
  842.         var zoomType = $gameSystem.mapZoomInfo('Restore (Type)');
  843.         if (SRD_CameraCore) {
  844.             if (zoomEnable) {
  845.                 if (zoomType === 'automatic') $gameSystem.saveZoomMap(Math.floor($gameScreen._zoomScale));
  846.                 Game_Interpreter.prototype.pluginCommand('ZoomOut', [zoomDistance.toString(), zoomFrames.toString()]);
  847.             }
  848.         }
  849.     };
  850.  
  851.  
  852.     Game_System.prototype.tileMapSpritesExist = function () {
  853.         if (this._tileMapSprites instanceof Array === false) return;
  854.         return this._tileMapSprites.length > 0;
  855.     };
  856.  
  857.     Game_System.prototype.tileMapSpriteClear = function () {
  858.         var length = this._tileMapSprites.length;
  859.         for (var i = 0; i < length; i++) {
  860.             SceneManager._scene._spriteset._tilemap.removeChild(this._tileMapSprites[i]);
  861.         }
  862.     };
  863.  
  864.     Game_System.prototype.startMapaMundiIcons = function () {
  865.         if (!this.existIcons()) return;
  866.         var mapIcons = $gameSystem._mapIcons;
  867.         var length = mapIcons.length;
  868.         this._tileMapSprites = [];
  869.         this._tileMapSpritesIndex = 0;
  870.         for (var i = 0; i < length; i++) {
  871.             var path = mapIcons[i][0];
  872.             var hue = mapIcons[i][4];
  873.             var bitmap = this.loadBitmap(this.bitmapPath(path), this.bitmapFile(path), hue);
  874.             var x = mapIcons[i][2];
  875.             var y = mapIcons[i][3];
  876.             var scaleX = mapIcons[i][5];
  877.             var scaleY = mapIcons[i][6];
  878.             var text = mapIcons[i][7];
  879.             var fontSize = mapIcons[i][8];
  880.             var TextScaleX = mapIcons[i][9];
  881.             var TextScaleY = mapIcons[i][10];
  882.             var textX = mapIcons[i][11];
  883.             var textY = mapIcons[i][12];
  884.             var animFrames = mapIcons[i][13];
  885.             var animFrames2 = mapIcons[i][14];
  886.             var minIconScaleX = mapIcons[i][15];
  887.             var minIconScaleY = mapIcons[i][16];
  888.             var Animation = mapIcons[i][17];
  889.             var Opacity = mapIcons[i][18];
  890.             this._tileMapSprites.push(new Sprite_IconsMap(bitmap, x, y, scaleX, scaleY, text, fontSize, TextScaleX, TextScaleY, textX, textY, animFrames, animFrames2, minIconScaleX, minIconScaleY, Animation, Opacity));
  891.             SceneManager._scene._spriteset._tilemap.addChild(this._tileMapSprites[this._tileMapSpritesIndex]);
  892.             this._tileMapSpritesIndex++;
  893.         }
  894.     };
  895.  
  896.     Game_System.prototype.bitmapPath = function (path) {
  897.         var length = path.length;
  898.         var string = '';
  899.         for (var i = 0; i < length; i++) {
  900.             if (path[i] != '/') string += path[i];
  901.             if (path[i] == '/') break;
  902.         } return string;
  903.     };
  904.  
  905.     Game_System.prototype.bitmapFile = function (path) {
  906.         var length = path.length;
  907.         var string = '';
  908.         var initString = false;
  909.         for (var i = 0; i < length; i++) {
  910.             if (!initString) {
  911.                 if (path[i] == '/') initString = true;
  912.             } else {
  913.                 if (path[i] != '/') string += path[i];
  914.             }
  915.         } return string;
  916.     };
  917.  
  918.     Game_System.prototype.loadBitmap = function (paste, file, hue) {
  919.         return ImageManager.loadBitmap('img/' + paste + '/', file.toString(), hue, true) || new Bitmap(0, 0);
  920.     };
  921.  
  922.     Game_System.prototype.getTextIcon = function (type, text) {
  923.         switch (type) {
  924.             case 'command':
  925.                 try {
  926.                     var command = eval(text);
  927.                 } catch (error) {
  928.                     console.error(error, text);
  929.                     return '';
  930.                 }
  931.                 return command;
  932.             case 'txt':
  933.                 return text;
  934.             case 'disabled':
  935.                 return 'disabled';
  936.         }
  937.     };
  938.  
  939.     Game_System.prototype.stopMapaMundi = function () {
  940.         this._mapaMundi = false;
  941.         this.stopMapaMundiZoom();
  942.         this.stopMapaMundiStopPlayer();
  943.         this.stopMapaMundiIcons();
  944.     };
  945.  
  946.     Game_System.prototype.stopMapaMundiStopPlayer = function () {
  947.         if (YEP_StopMapMovement) {
  948.             Game_Interpreter.prototype.pluginCommand('AllowPlayerMovement', []);
  949.             Game_Interpreter.prototype.pluginCommand('AllowEventMovement', []);
  950.         }
  951.     };
  952.  
  953.     Game_System.prototype.stopMapaMundiZoom = function () {
  954.         var zoomEnable = $gameSystem.mapZoomInfo('Zoom');
  955.         var zoomDistance = $gameSystem.mapZoomInfo('Restore');
  956.         var zoomFrames = $gameSystem.mapZoomInfo('Frames');
  957.         var zoomType = $gameSystem.mapZoomInfo('Restore (Type)');
  958.         if (SRD_CameraCore) {
  959.             if (zoomEnable) {
  960.                 if (zoomType === 'automatic') zoomDistance = $gameSystem.zoomMap();
  961.                 if (!$gameMap.playerPrivateZoomMapaMundi()) Game_Interpreter.prototype.pluginCommand('ZoomIn', [zoomDistance.toString(), zoomFrames.toString()]);
  962.             }
  963.             Game_Interpreter.prototype.pluginCommand('ResetFocus', [zoomFrames.toString()]);
  964.             this.enableCallMenuMapaMundi();
  965.         }
  966.     };
  967.  
  968.     Game_System.prototype.stopMapaMundiIcons = function () {
  969.         this._cancelIconsMapaMundi = true;
  970.     };
  971.  
  972.     Game_System.prototype.cancelIconsMapaMundi = function () {
  973.         return this._cancelIconsMapaMundi;
  974.     };
  975.  
  976.     Game_System.prototype.setOpacityIconsMapaMundi = function (Opacity, StartOpacity, Delay) {
  977.         return new Array(Opacity, StartOpacity, Delay);
  978.     };
  979.  
  980.     //-----------------------------------------------------------------------------
  981.     // Game_Interpreter
  982.     //
  983.     // The interpreter for running event commands.
  984.     var gameInterpreterCommand = Game_Interpreter.prototype.pluginCommand;
  985.     Game_Interpreter.prototype.pluginCommand = function (command, args) {
  986.         gameInterpreterCommand.call(this, command, args);
  987.         if (command === 'ShowMapaMundi') $gameSystem.startMapaMundi();
  988.         if (command === 'HideMapaMundi') $gameSystem.stopMapaMundi();
  989.     };
  990.  
  991.     //-----------------------------------------------------------------------------
  992.     // Sprite_IconsMap
  993.     //
  994.     // The sprite for displaying a icons in map.
  995.  
  996.     function Sprite_IconsMap() {
  997.         this.initialize.apply(this, arguments);
  998.     }
  999.  
  1000.     Sprite_IconsMap.prototype = Object.create(Sprite_Base.prototype);
  1001.     Sprite_IconsMap.prototype.constructor = Sprite_IconsMap;
  1002.  
  1003.     Sprite_IconsMap.prototype.initialize = function (bitmap, x, y, scaleX, scaleY, text, fontSize, TextScaleX, TextScaleY, textX, textY, animFrames, animFrames2, minIconScaleX, minIconScaleY, Animation, Opacity) {
  1004.         Sprite_Base.prototype.initialize.call(this);
  1005.         console.log(Opacity)
  1006.         if (Opacity[0]) {
  1007.             this.initOpacity(Opacity[1], Opacity[2]);
  1008.         }
  1009.         this.initMembers(bitmap, x, y, scaleX, scaleY, text, fontSize, TextScaleX, TextScaleY, textX, textY, animFrames, animFrames2, minIconScaleX, minIconScaleY, Animation);
  1010.     };
  1011.  
  1012.     Sprite_IconsMap.prototype.initOpacity = function (startOpacity, framesOpacity) {
  1013.         this.opacity = startOpacity;
  1014.         this._framesOpacity = framesOpacity;
  1015.         this.spriteOpacitySet(true);
  1016.     };
  1017.  
  1018.     Sprite_IconsMap.prototype.initMembers = function (bitmap, x, y, scaleX, scaleY, text, fontSize, TextScaleX, TextScaleY, textX, textY, animFrames, animFrames2, minIconScaleX, minIconScaleY, Animation) {
  1019.         this.anchor.x = 0.5;
  1020.         this.anchor.y = 1;
  1021.         this._x = x;
  1022.         this._y = y;
  1023.         this.bitmap = bitmap;
  1024.         this.scale = new Point(scaleX, scaleY);
  1025.         if (text.toString() != 'disabled') {
  1026.             this._text = new Sprite(new Bitmap(100, 40));
  1027.             this._text.bitmap.fontSize = fontSize;
  1028.             this._text.bitmap.drawText(text, 5, 5, 100, 0, 'center');
  1029.             this._text.scale = new Point(TextScaleX, TextScaleY);
  1030.             this._text.x = textX;
  1031.             this._text.y = textY;
  1032.             this.addChild(this._text);
  1033.         }
  1034.         this._framesAnimationSave = [animFrames, animFrames2];
  1035.         this._minIconScaleX = minIconScaleX;
  1036.         this._minIconScaleY = minIconScaleY;
  1037.         this._AnimationIcon = Animation;
  1038.         this.resetAllFramesAnimation();
  1039.     };
  1040.  
  1041.     Sprite_IconsMap.prototype.update = function () {
  1042.         Sprite_Base.prototype.update.call(this);
  1043.         this.updatePosition();
  1044.         if (this.spriteOpacity()) this.updateOpacity();
  1045.         if (this._AnimationIcon) this.updateAnimation();
  1046.     };
  1047.  
  1048.     Sprite_IconsMap.prototype.spriteOpacitySet = function (value) {
  1049.         this._spriteOpacity = value;
  1050.     };
  1051.  
  1052.     Sprite_IconsMap.prototype.spriteOpacity = function () {
  1053.         return this._spriteOpacity;
  1054.     };
  1055.  
  1056.     Sprite_IconsMap.prototype.updateOpacity = function () {
  1057.         if (this._framesOpacity > 0) {
  1058.             this._framesOpacity--;
  1059.         } else {
  1060.             if (this.opacity < 255) this.opacity += 2;
  1061.         }
  1062.     };
  1063.  
  1064.     Sprite_IconsMap.prototype.updatePosition = function () {
  1065.         this.x = this.screenX();
  1066.         this.y = this.screenY();
  1067.         this.z = this.screenZ();
  1068.     };
  1069.  
  1070.     Sprite_IconsMap.prototype.scrolledX = function () {
  1071.         return $gameMap.adjustX(this._x);
  1072.     };
  1073.  
  1074.     Sprite_IconsMap.prototype.scrolledY = function () {
  1075.         return $gameMap.adjustY(this._y);
  1076.     };
  1077.  
  1078.     Sprite_IconsMap.prototype.screenX = function () {
  1079.         var tw = $gameMap.tileWidth();
  1080.         return Math.round(this.scrolledX() * tw + tw / 2);
  1081.     };
  1082.  
  1083.     Sprite_IconsMap.prototype.screenY = function () {
  1084.         var th = $gameMap.tileHeight();
  1085.         return Math.round(this.scrolledY() * th + th - this.shiftY());
  1086.     };
  1087.  
  1088.     Sprite_IconsMap.prototype.shiftY = function () {
  1089.         return 6;
  1090.     };
  1091.  
  1092.     Sprite_IconsMap.prototype.screenZ = function () {
  1093.         return 3;
  1094.     };
  1095.  
  1096.     Sprite_IconsMap.prototype.resetAllFramesAnimation = function () {
  1097.         this._framesAnimation = this._framesAnimationSave[0];
  1098.         this._framesAnimation2 = this._framesAnimationSave[1];
  1099.     };
  1100.  
  1101.     Sprite_IconsMap.prototype.updateAnimation = function () {
  1102.         if (this._framesAnimation2 > 0) {
  1103.             this.scale.x += 0.0020;
  1104.             this.scale.y += 0.0020;
  1105.             return this._framesAnimation2--;
  1106.         }
  1107.         if (this._framesAnimation > 0) {
  1108.             if (this.scale.x > this._minIconScaleX) this.scale.x -= 0.0020;
  1109.             if (this.scale.x > this._minIconScaleX) this.scale.y -= 0.0020;
  1110.             this._framesAnimation--;
  1111.         } else {
  1112.             this.resetAllFramesAnimation();
  1113.         }
  1114.     };
  1115.  
  1116.     //-----------------------------------------------------------------------------
  1117.     // Game_Variables
  1118.     //
  1119.     // The game object class for variables.
  1120.     Game_Variables.prototype.getTextIcon = function (paste, json, lineVariable) {
  1121.         return GS.Language.getText(paste, json, lineVariable);
  1122.     };
  1123.  
  1124.     //-----------------------------------------------------------------------------
  1125.     // ImageManager
  1126.     //
  1127.     // The static class that loads images, creates bitmap objects and retains them.
  1128.     ImageManager.loadMapaMundi = function (filename, hue) {
  1129.         return this.loadBitmap('img/system/MapaMundi/', filename, hue, false);
  1130.     };
  1131.  
  1132.     //-----------------------------------------------------------------------------
  1133.     // Game_Map
  1134.     //
  1135.     // The game object class for a map. It contains scrolling and passage
  1136.     // determination functions.
  1137.  
  1138.     var gameMapUpdate = Game_Map.prototype.update;
  1139.     Game_Map.prototype.update = function (sceneActive) {
  1140.         gameMapUpdate.apply(this, arguments);
  1141.         if (SRD_CameraCore) {
  1142.             this.updateMoveMapaMundi();
  1143.         }
  1144.         this.updateMenuUser();
  1145.         this.keyBoardMapaMundi();
  1146.         this.updateCancelIconsMapaMundi();
  1147.     };
  1148.  
  1149.     Game_Map.prototype.updateMenuUser = function () {
  1150.         if ($gameSystem.callMenuMapaMundi()) {
  1151.             if (this._menuUserFrame === undefined) this._menuUserFrame = 0;
  1152.             if (this._menuUserFrame < 10) {
  1153.                 this._menuUserFrame++;
  1154.             } else {
  1155.                 this._menuUserFrame = 0;
  1156.                 $gameSystem.disableCallMenuMapaMundi();
  1157.                 var menu = $gameSystem.saveMenuEnabled();
  1158.                 if (menu) $gameSystem.enableMenu();
  1159.             }
  1160.         }
  1161.     };
  1162.  
  1163.     Game_Map.prototype.updateMoveMapaMundi = function () {
  1164.         if ($gameSystem.mapaMundi()) {
  1165.             if (this._timerInputCamera > 0) {
  1166.                 this._timerInputCamera--;
  1167.             } else {
  1168.                 this._timerInputCamera = 5;
  1169.                 if (Input.isPressed('up')) {
  1170.                     this.moveMapaMundi('up');
  1171.                 }
  1172.                 if (Input.isPressed('down')) {
  1173.                     this.moveMapaMundi('down');
  1174.                 }
  1175.                 if (Input.isPressed('right')) {
  1176.                     this.moveMapaMundi('right');
  1177.                 }
  1178.                 if (Input.isPressed('left')) {
  1179.                     this.moveMapaMundi('left');
  1180.                 }
  1181.             }
  1182.         }
  1183.     };
  1184.  
  1185.     Game_Map.prototype.moveMapaMundi = function (position) {
  1186.         switch (position) {
  1187.             case 'down':
  1188.                 this.moveMapaMundiExe(position, true, function () {
  1189.                     let shiftCameraSpeed = $gameSystem.mapMoveInfo('Move Speed');
  1190.                     $gameMap._shiftCameraMapaMundiY += Math.ceil(Math.pow(Math.log(Math.floor(shiftCameraSpeed)), shiftCameraSpeed));
  1191.                     let shiftCameraVelocity = Math.floor(Math.abs(shiftCameraSpeed * $gameMap._shiftCameraMapaMundiY) * Math.floor(shiftCameraSpeed));
  1192.                     $gameMap.shiftCameraPosition($gameMap._shiftCameraMapaMundiX, $gameMap._shiftCameraMapaMundiY, (shiftCameraVelocity / 2));
  1193.                 });
  1194.                 break;
  1195.             case 'up':
  1196.                 this.moveMapaMundiExe(position, true, function () {
  1197.                     let shiftCameraSpeed = $gameSystem.mapMoveInfo('Move Speed');
  1198.                     $gameMap._shiftCameraMapaMundiY -= Math.ceil(Math.pow(Math.log(Math.floor(shiftCameraSpeed)), shiftCameraSpeed));
  1199.                     let shiftCameraVelocity = Math.floor(Math.abs(shiftCameraSpeed * $gameMap._shiftCameraMapaMundiY) * Math.floor(shiftCameraSpeed));
  1200.                     $gameMap.shiftCameraPosition($gameMap._shiftCameraMapaMundiX, $gameMap._shiftCameraMapaMundiY, (shiftCameraVelocity / 2));
  1201.                 });
  1202.                 break;
  1203.             case 'right':
  1204.                 this.moveMapaMundiExe(position, false, function () {
  1205.                     let shiftCameraSpeed = $gameSystem.mapMoveInfo('Move Speed');
  1206.                     $gameMap._shiftCameraMapaMundiX += Math.ceil(Math.pow(Math.log(Math.floor(shiftCameraSpeed)), shiftCameraSpeed));
  1207.                     let shiftCameraVelocity = Math.floor(Math.abs(shiftCameraSpeed * $gameMap._shiftCameraMapaMundiX) * Math.floor(shiftCameraSpeed));
  1208.                     $gameMap.shiftCameraPosition($gameMap._shiftCameraMapaMundiX, $gameMap._shiftCameraMapaMundiY, (shiftCameraVelocity / 2));
  1209.                 });
  1210.                 break;
  1211.             case 'left':
  1212.                 this.moveMapaMundiExe(position, false, function () {
  1213.                     let shiftCameraSpeed = $gameSystem.mapMoveInfo('Move Speed');
  1214.                     $gameMap._shiftCameraMapaMundiX -= Math.ceil(Math.pow(Math.log(Math.floor(shiftCameraSpeed)), shiftCameraSpeed));
  1215.                     let shiftCameraVelocity = Math.floor(Math.abs(shiftCameraSpeed * $gameMap._shiftCameraMapaMundiX) * Math.floor(shiftCameraSpeed));
  1216.                     $gameMap.shiftCameraPosition($gameMap._shiftCameraMapaMundiX, $gameMap._shiftCameraMapaMundiY, (shiftCameraVelocity / 2));
  1217.                 });
  1218.                 break;
  1219.         }
  1220.     };
  1221.  
  1222.     Game_Map.prototype.moveMapaMundiExe = function (position, Xy, callback) {
  1223.         var limit_type = $gameSystem.mapMoveInfo('Move Camera');
  1224.         if (limit_type === 'automatic') {
  1225.             if (position == 'down') var displayEnd = Math.floor($gameMap.height() - $gameMap.screenTileY());
  1226.             if (position == 'up') var displayEnd = 0;
  1227.             if (position == 'right') var displayEnd = Math.floor($gameMap.width() - $gameMap.screenTileX());
  1228.             if (position == 'left') var displayEnd = 0;
  1229.         } else if (limit_type === 'number') {
  1230.             if (position == 'down') var displayEnd = $gameSystem.mapMoveInfo('Limit (Y+)');
  1231.             if (position == 'up') var displayEnd = $gameSystem.mapMoveInfo('Limit (Y-)');
  1232.             if (position == 'right') var displayEnd = $gameSystem.mapMoveInfo('Limit (X+)');
  1233.             if (position == 'left') var displayEnd = $gameSystem.mapMoveInfo('Limit (X-)');
  1234.         }
  1235.         var limit = displayEnd;
  1236.         if (Xy) {
  1237.             var display = Math.floor(this.displayY());
  1238.         } else {
  1239.             var display = Math.floor(this.displayX());
  1240.         }
  1241.         if (position == 'down' || position == 'right') {
  1242.             if (display < limit) {
  1243.                 callback();
  1244.             }
  1245.         }
  1246.         if (position == 'up' || position == 'left') {
  1247.             if (display > limit) {
  1248.                 callback();
  1249.             }
  1250.         }
  1251.     };
  1252.  
  1253.     Game_Map.prototype.playerPrivateZoomMapaMundi = function () {
  1254.         var privateType = $gameSystem.mapPrivateZoomInfo('Private Type');
  1255.         if (privateType === 'Disabled') return;
  1256.         var playerX = $gamePlayer._realX;
  1257.         var playerY = $gamePlayer._realY;
  1258.         if (privateType === 'Region') {
  1259.             var privateRegion = $gameSystem.mapPrivateZoomInfo('Region ID');
  1260.             if (this.regionId(playerX, playerY) == privateRegion) {
  1261.                 return true;
  1262.             }
  1263.         } else {
  1264.             var privateX = $gameSystem.mapPrivateZoomInfo('Point (X)');
  1265.             var privateEndX = $gameSystem.mapPrivateZoomInfo('Point End (X)');
  1266.             var privateY = $gameSystem.mapPrivateZoomInfo('Point (Y)');
  1267.             var privateEndY = $gameSystem.mapPrivateZoomInfo('Point End (Y)');
  1268.             if (playerX >= privateX && playerX <= privateEndX) {
  1269.                 if (playerY >= privateY && playerY <= privateEndY) {
  1270.                     return true;
  1271.                 }
  1272.             }
  1273.         }
  1274.         return false;
  1275.     };
  1276.  
  1277.     Game_Map.prototype.keyBoardMapaMundi = function () {
  1278.         if (!$gameSystem.mapaMundi()) {
  1279.             var Keyboard = $gameSystem.mapZoomInfo('Keyboard (open)');
  1280.             var KeyName = $gameSystem.mapZoomInfo('KeyName (open)');
  1281.             var KeyName_Advanced = $gameSystem.mapZoomInfo('KeyName (open) (Advanced)');
  1282.             if (Keyboard) {
  1283.                 var key;
  1284.                 if (KeyName === 'advanced') {
  1285.                     key = KeyName_Advanced.toString();
  1286.                 } else {
  1287.                     key = KeyName.toString();
  1288.                 }
  1289.                 if (Input.isTriggered(key)) {
  1290.                     $gameSystem.startMapaMundi();
  1291.                 }
  1292.             }
  1293.         } else {
  1294.             var Keyboard = $gameSystem.mapZoomInfo('Keyboard (close)');
  1295.             var KeyName = $gameSystem.mapZoomInfo('KeyName (close)');
  1296.             var KeyName_Advanced = $gameSystem.mapZoomInfo('KeyName (close) (Advanced)');
  1297.             if (Keyboard) {
  1298.                 var key;
  1299.                 if (KeyName === 'advanced') {
  1300.                     key = KeyName_Advanced.toString();
  1301.                 } else {
  1302.                     key = KeyName.toString();
  1303.                 }
  1304.                 if (Input.isTriggered(key)) {
  1305.                     $gameSystem.stopMapaMundi();
  1306.                 }
  1307.             }
  1308.         }
  1309.     };
  1310.  
  1311.     Game_Map.prototype.updateCancelIconsMapaMundi = function () {
  1312.         if ($gameSystem.cancelIconsMapaMundi()) {
  1313.             var length = $gameSystem._tileMapSprites.length;
  1314.             for (var i = 0; i < length; i++) {
  1315.                 if ($gameSystem._tileMapSprites[i].spriteOpacity()) {
  1316.                     $gameSystem._tileMapSprites[i].spriteOpacitySet(false);
  1317.                 }
  1318.                 if ($gameSystem._tileMapSprites[i].opacity > 0) {
  1319.                     $gameSystem._tileMapSprites[i].opacity -= 4;
  1320.                 } else {
  1321.                     SceneManager._scene._spriteset._tilemap.removeChild($gameSystem._tileMapSprites[i]);
  1322.                 }
  1323.             }
  1324.         }
  1325.     };
  1326. })(GS.mapaMundi);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement