//============================================================================= // TMPlugin - 行の高さを変更 // バージョン: 1.0.0 // 最終更新日: 2017/10/17 // 配布元 : http://hikimoki.sakura.ne.jp/ //----------------------------------------------------------------------------- // Copyright (c) 2017 tomoaky // Released under the MIT license. // http://opensource.org/licenses/mit-license.php //============================================================================= /*: @plugindesc Changes the row height of the window. @author tomoaky @url https://github.com/munokura/tomoaky-MV-plugins @license MIT License @help English Help Translator: munokura This is an unofficial English translation of the plugin help, created to support global RPG Maker users. Feedback is welcome to improve translation quality (see: https://github.com/munokura/tomoaky-MV-plugins ). Original plugin by tomoaky. ----- TMPlugin - Change Line Height ver. 1.0.0 How to Use: There are no plugin commands. This plugin has been tested with RPG Maker MV Version 1.5.1. This plugin is distributed under the MIT License. You are free to use it commercially, modify it, and redistribute it. @param helpLineRate @desc Help line height correction factor Default: 1.00 @default 1.00 @type number @decimals 2 @param itemListLineRate @desc Correction factor for the row height of the item list. Initial value: 1.00 @default 1.00 @type number @decimals 2 @param skillListLineRate @desc Skill list row height correction factor Initial value: 1.00 @default 1.00 @type number @decimals 2 @param equipSlotLineRate @desc Equipment slot row height correction factor Default: 1.00 @default 1.00 @type number @decimals 2 @param equipStatusLineRate @desc Equipment status line height correction factor Initial value: 1.00 @default 1.00 @type number @decimals 2 */ /*:ja @plugindesc ウィンドウの行の高さを変更します。 @author tomoaky @url https://github.com/munokura/tomoaky-MV-plugins @license MIT License @help TMPlugin - 行の高さを変更 ver1.0.0 使い方: プラグインコマンドはありません。 このプラグインは RPGツクールMV Version 1.5.1 で動作確認をしています。 このプラグインはMITライセンスのもとに配布しています、商用利用、 改造、再配布など、自由にお使いいただけます。 @param helpLineRate @desc ヘルプの行の高さの補正倍率 初期値: 1.00 @default 1.00 @type number @decimals 2 @param itemListLineRate @desc アイテムリストの行の高さの補正倍率 初期値: 1.00 @default 1.00 @type number @decimals 2 @param skillListLineRate @desc スキルリストの行の高さの補正倍率 初期値: 1.00 @default 1.00 @type number @decimals 2 @param equipSlotLineRate @desc 装備スロットの行の高さの補正倍率 初期値: 1.00 @default 1.00 @type number @decimals 2 @param equipStatusLineRate @desc 装備ステータスの行の高さの補正倍率 初期値: 1.00 @default 1.00 @type number @decimals 2 */ var Imported = Imported || {}; Imported.TMLineHeightEx = true; (function() { var parameters = PluginManager.parameters('TMLineHeightEx'); var helpLineRate = +(parameters['helpLineRate'] || 1); var itemListLineRate = +(parameters['itemListLineRate'] || 1); var skillListLineRate = +(parameters['skillListLineRate'] || 1); var equipStatusLineRate = +(parameters['equipStatusLineRate'] || 1); var equipSlotLineRate = +(parameters['equipSlotLineRate'] || 1); //----------------------------------------------------------------------------- // Window_Base // Window_Base.prototype.lineRate = function() { return 1; }; var _Window_Base_lineHeight = Window_Base.prototype.lineHeight; Window_Base.prototype.lineHeight = function() { var result = _Window_Base_lineHeight.call(this); return Math.floor(result * this.lineRate()); }; var _Window_Base_standardFontSize = Window_Base.prototype.standardFontSize; Window_Base.prototype.standardFontSize = function() { var result = _Window_Base_standardFontSize.call(this); return Math.floor(result * this.lineRate()); }; Window_Base.prototype.drawIcon = function(iconIndex, x, y) { var bitmap = ImageManager.loadSystem('IconSet'); var pw = Window_Base._iconWidth; var ph = Window_Base._iconHeight; var sx = iconIndex % 16 * pw; var sy = Math.floor(iconIndex / 16) * ph; var dw = Math.floor(pw * this.lineRate()); var dh = Math.floor(ph * this.lineRate()); this.contents.blt(bitmap, sx, sy, pw, ph, x, y, dw, dh); }; Window_Base.prototype.drawItemName = function(item, x, y, width) { width = width || 312; if (item) { var iconWidth = Math.floor(Window_Base._iconWidth * this.lineRate()); var iconHeight = Math.floor(Window_Base._iconHeight * this.lineRate()); var iconBoxWidth = iconWidth + Math.round(4 * this.lineRate()); this.resetTextColor(); this.drawIcon(item.iconIndex, x + Math.floor((iconBoxWidth - iconWidth) / 2), y + Math.round((this.lineHeight() - iconHeight) / 2)); this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth); } }; //----------------------------------------------------------------------------- // Window_Help // Window_Help.prototype.lineRate = function() { return helpLineRate; }; Window_Help.prototype.calcTextHeight = function(textState, all) { var lastFontSize = this.contents.fontSize; var textHeight = 0; var lines = textState.text.slice(textState.index).split('\n'); var maxLines = all ? lines.length : 1; for (var i = 0; i < maxLines; i++) { var maxFontSize = this.contents.fontSize; var regExp = /\x1b[\{\}]/g; for (;;) { var array = regExp.exec(lines[i]); if (array) { if (array[0] === '\x1b{') this.makeFontBigger(); if (array[0] === '\x1b}') this.makeFontSmaller(); if (maxFontSize < this.contents.fontSize) maxFontSize = this.contents.fontSize; } else { break; } } textHeight += maxFontSize + Math.floor(8 * this.lineRate()); } this.contents.fontSize = lastFontSize; return textHeight; }; //----------------------------------------------------------------------------- // Window_ItemList // Window_ItemList.prototype.lineRate = function() { return itemListLineRate; }; //----------------------------------------------------------------------------- // Window_SkillList // Window_SkillList.prototype.lineRate = function() { return skillListLineRate; }; //----------------------------------------------------------------------------- // Window_EquipStatus // Window_EquipStatus.prototype.lineRate = function() { return equipStatusLineRate; }; //----------------------------------------------------------------------------- // Window_EquipSlot // Window_EquipSlot.prototype.lineRate = function() { return equipSlotLineRate; }; })();