Advertisement
ICF-Soft

ICF-Soft Status Menu RPG Maker MV

Dec 22nd, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // ICF-Soft Plugins - Status Menu
  3. // ICFSoft_StatusMenu.js
  4. //=============================================================================
  5.  
  6. var Imported = Imported || {};
  7. Imported.ICFSoft_StatusMenu = true;
  8.  
  9. var ICF = ICF || {};
  10. ICF.StatusMenu = ICF.StatusMenu || {};
  11.  
  12. ICF.StatusMenu.Version = 100; // 1.00
  13.  
  14. //=============================================================================
  15.  /*:
  16.  * @plugindesc v1.00b A status menu where you can organize actor params.
  17.  * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
  18.  *
  19.  * @param Column1
  20.  * @desc Param names that will be shown in column.
  21.  * @default atk def mat mdf agi luk
  22.  *
  23.  * @param Column2
  24.  * @desc Param names that will be shown in column.
  25.  * @default
  26.  *
  27.  * @param Column3
  28.  * @desc Param names that will be shown in column.
  29.  * @default
  30.  *
  31.  * @param Percentage params
  32.  * @desc What params will be used as percentages.
  33.  * @default
  34.  *
  35.  * @help
  36.  * ============================================================================
  37.  * Introduction
  38.  * ============================================================================
  39.  *
  40.  * This plugin is made for use with ICF-Soft Params Core but can work alone.
  41.  *
  42.  * Allows you to show params in up to three columns plus equip, using all
  43.  * window width.
  44.  *
  45.  * More features will be added in the future.
  46.  *
  47.  * ============================================================================
  48.  * Parameters
  49.  * ============================================================================
  50.  *
  51.  * ColumnX: Place the param names that will be shown in comlumn separated by
  52.  * spaces. You can use up to 3 columns sharing width with equips.
  53.  * It works with param, nparam and pparam.
  54.  *
  55.  * Percentage params: Tell what params will be used as percentages.
  56.  * It works with pparam.
  57.  *
  58.  * ============================================================================
  59.  * Incompatibilities
  60.  * ============================================================================
  61.  *
  62.  * Can be incompatible or interfere with some similar plugins.
  63.  *
  64.  * ============================================================================
  65.  * Known isues
  66.  * ============================================================================
  67.  *
  68.  * Can interfere with some similar plugins or enhace them.
  69.  *
  70.  * ============================================================================
  71.  *
  72.  * For commercial and non-commercial games.
  73.  * Credit to ICF-Soft.
  74.  * This entire header must be included with plugin.
  75.  *
  76.  * ============================================================================
  77. */
  78. //=============================================================================
  79.  /*:es
  80.  * @plugindesc v1.00b Una ventana de estado que permite mostrar
  81.  * los nparam y los pparam.
  82.  * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
  83.  *
  84.  * @param Column1
  85.  * @desc Nombres básicos de los parámetros separados por espacios.
  86.  * @default atk def mat mdf agi luk
  87.  *
  88.  * @param Column2
  89.  * @desc Nombres básicos de los parámetros separados por espacios.
  90.  * @default
  91.  *
  92.  * @param Column3
  93.  * @desc Nombres básicos de los parámetros separados por espacios.
  94.  * @default
  95.  *
  96.  * @param Percentage params
  97.  * @desc Indica qué parámetros serán tratados como porcentajes.
  98.  * @default
  99.  *
  100.  * @help
  101.  * ============================================================================
  102.  * Introducción
  103.  * ============================================================================
  104.  *
  105.  * Este plugin está hecho para su uso con el ICF-Soft Params Core pero puede
  106.  * usarse solo.
  107.  *
  108.  * Permite mostrar los parámetros en hasta tres columnas aparte del
  109.  * equipamiento aprovechando todo el ancho.
  110.  *
  111.  * Iré añadiendo más características.
  112.  *
  113.  * ============================================================================
  114.  * Parámetros
  115.  * ============================================================================
  116.  *
  117.  * ColumnX: Para colocar los nombres básicos de los parámetros separados por
  118.  * espacios. Hay hasta 3 columnas repartidas entre el ancho de la ventana.
  119.  * Por el momento funciona con los param, nparam y pparam.
  120.  *
  121.  * Percentage params: Indica qué parámetros serán tratados como porcentajes.
  122.  * Usa dos decimales. De momento solo para los pparam.
  123.  *
  124.  * ============================================================================
  125.  * Incompatibilidades
  126.  * ============================================================================
  127.  *
  128.  * Puede ser incompatible con otros plugins similares.
  129.  *
  130.  * ============================================================================
  131.  * Problemas conocidos
  132.  * ============================================================================
  133.  *
  134.  * Puede interferir con otros plugins similares. Pero puede combinarse
  135.  * con otros.
  136.  *
  137.  * ============================================================================
  138.  *
  139.  * Para juegos comerciales y no comerciales.
  140.  * Se debe incluir a ICF-Soft en los créditos.
  141.  * Esta cabecera debe incluirse íntegramente con el plugin.
  142.  *
  143.  * ============================================================================
  144. */
  145. //=============================================================================
  146.  
  147. //=============================================================================
  148. // Parameter Variables
  149. //=============================================================================
  150.  
  151. ICF.Parameters = PluginManager.parameters('ICFSoft_StatusMenu');
  152. ICF.Param = ICF.Param || {};
  153.  
  154. ICF.Param.StatusMenuCol1 = ICF.Parameters['Column1'].toLowerCase().split(/\s+/);
  155. ICF.Param.StatusMenuCol2 = ICF.Parameters['Column2'].toLowerCase().split(/\s+/);
  156. ICF.Param.StatusMenuCol3 = ICF.Parameters['Column3'].toLowerCase().split(/\s+/);
  157. ICF.Param.PercentageParams = ICF.Parameters['Percentage params'].toLowerCase().split(/\s+/);
  158.  
  159. if (ICF.Param.StatusMenuCol1[0] == "") ICF.Param.StatusMenuCol1.shift();
  160. if (ICF.Param.StatusMenuCol2[0] == "") ICF.Param.StatusMenuCol2.shift();
  161. if (ICF.Param.StatusMenuCol3[0] == "") ICF.Param.StatusMenuCol3.shift();
  162.  
  163. if (!Imported.ICFSoft_ParamCore) {
  164.     ICF.Param.NParams = [];
  165.     ICF.Param.PParams = [];
  166.     ICF.Param.BParams = ["mhp", "mmp", "atk", "def", "mat", "mdf", "agi", "luk"];
  167.     ICF.Param.XParams = ["hit", "eva", "cri", "cev", "mev", "mrf", "cnt", "hrg", "mrg", "trg"];
  168.     ICF.Param.SParams = ["tgr", "grd", "rec", "pha", "mcr", "tcr", "pdr", "mdr", "fdr", "exr"];
  169. }
  170.  
  171. //=============================================================================
  172. // Window_Status
  173. //=============================================================================
  174.  
  175. Window_Status.prototype.drawBlock3 = function(y) {
  176.     if (ICF.Param.StatusMenuCol1.length == 0) {
  177.         this.drawEquipments(this.contentsWidth()/2, y);
  178.     } else if (ICF.Param.StatusMenuCol2.length == 0) {
  179.         var width = this.contentsWidth() / 2 - this.textPadding() * 3;
  180.         this.drawParameters(this.textPadding(), y, width, ICF.Param.StatusMenuCol1);
  181.         this.drawEquipments(this.contentsWidth()/2 + this.textPadding(), y);
  182.     } else if (ICF.Param.StatusMenuCol3.length == 0) {
  183.         var width = this.contentsWidth() / 3 - this.textPadding() * 4;
  184.         this.drawParameters(this.textPadding(), y, width, ICF.Param.StatusMenuCol1);
  185.         this.drawParameters(this.contentsWidth()/3 + this.textPadding(), y, width, ICF.Param.StatusMenuCol2);
  186.         this.drawEquipments(this.contentsWidth()*2/3 + this.textPadding(), y);
  187.     } else {
  188.         var width = this.contentsWidth() / 4 - this.textPadding() * 5;
  189.         this.drawParameters(this.textPadding(), y, width, ICF.Param.StatusMenuCol1);
  190.         this.drawParameters(this.contentsWidth()/4 + this.textPadding(), y, width, ICF.Param.StatusMenuCol2);
  191.         this.drawParameters(this.contentsWidth()*2/4 + this.textPadding(), y, width, ICF.Param.StatusMenuCol3);
  192.         this.drawEquipments(this.contentsWidth()*3/4 + this.textPadding(), y);
  193.     }
  194. };
  195.  
  196. ICF.StatusMenu.drawParamsOldStyle = Window_Status.prototype.drawParameters;
  197. Window_Status.prototype.drawParameters = function(x, y, width, ary) {
  198.     if ((width == undefined)||(ary == undefined)) {
  199.     ICF.StatusMenu.drawParamsOldStyle.call(this, x, y);
  200.     return;
  201.     }
  202.     var lineHeight = this.lineHeight();
  203.     var y2 = y;
  204.     for (var i = 0; i < ary.length; i++) {
  205.         var param = [];
  206.     if (ICF.Param.NParams.indexOf(ary[i]) > -1) {
  207.         var paramId = ICF.Param.NParams.indexOf(ary[i]);
  208.         param.push(ICF.Param.NParamsFullName[paramId]);
  209.         param.push(this._actor.NParam(paramId));
  210.     } else if (ICF.Param.PParams.indexOf(ary[i]) > -1) {
  211.         var paramId = ICF.Param.PParams.indexOf(ary[i]);
  212.         param.push(ICF.Param.PParamsFullName[paramId]);
  213.         if (ICF.Param.PercentageParams.indexOf(ary[i]) > -1) {
  214.             param.push((this._actor.PParam(paramId)*100).toFixed(2) + "%");
  215.         } else {
  216.             param.push(Math.trunc(this._actor.PParam(paramId)));
  217.         }
  218.     } else if (ICF.Param.BParams.indexOf(ary[i]) > -1) {
  219.         var paramId = ICF.Param.BParams.indexOf(ary[i]);
  220.         param.push(TextManager.param(paramId));
  221.         param.push(this._actor.param(paramId));
  222.     }
  223.     if (param.length > 0) {
  224.         this.changeTextColor(this.systemColor());
  225.         this.drawText(param[0], x, y2, width * 2 / 3);
  226.         this.resetTextColor();
  227.         this.drawText(param[1], x + width * 2 / 3, y2, width / 3, 'right');
  228.     }
  229.     y2 += lineHeight;
  230.     }
  231. };
  232.  
  233. //=============================================================================
  234. // End of File
  235. //=============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement