Shrink ll info font size a bit
This commit is contained in:
parent
ef02ad8b78
commit
b878bbbac5
1 changed files with 34 additions and 3 deletions
|
|
@ -14,6 +14,11 @@
|
|||
* @author ルルの教会
|
||||
* @url https://nine-yusha.com/plugin-infowindow/
|
||||
*
|
||||
* @param FontSize
|
||||
* @text Font Size
|
||||
* @desc ポップアップで表示するテキストのフォントサイズ(ピクセル)。既定値は24。
|
||||
* @default 24
|
||||
*
|
||||
* @help LL_InfoPopupWIndowMV.js
|
||||
*
|
||||
* ポップアップでインフォメッセージを表示します。
|
||||
|
|
@ -50,6 +55,8 @@
|
|||
"use strict";
|
||||
var pluginName = "LL_InfoPopupWIndowMV";
|
||||
var parameters = PluginManager.parameters(pluginName);
|
||||
// Font size for info popup text (uses Window_Base default if not set)
|
||||
var exInfoWindowFontSize = Number(parameters['FontSize'] || 20);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// PluginCommand (for MV)
|
||||
|
|
@ -251,12 +258,36 @@
|
|||
};
|
||||
|
||||
Window_ExInfoWindow.prototype.refresh = function() {
|
||||
this.contents.clear();
|
||||
this.drawTextEx(exInfoWindowText, 0, 0, this.innerWidth);
|
||||
var self = this;
|
||||
// Use a temporary override so drawTextEx uses the plugin-configured font size
|
||||
var _origReset = Window_Base.prototype.resetFontSettings;
|
||||
Window_Base.prototype.resetFontSettings = function() {
|
||||
this.contents.fontFace = this.standardFontFace();
|
||||
this.contents.fontSize = exInfoWindowFontSize;
|
||||
this.resetTextColor();
|
||||
};
|
||||
try {
|
||||
this.contents.clear();
|
||||
// draw text with temporary font size
|
||||
Window_Base.prototype.drawTextEx.call(this, exInfoWindowText, 0, 0);
|
||||
} finally {
|
||||
Window_Base.prototype.resetFontSettings = _origReset;
|
||||
}
|
||||
};
|
||||
|
||||
// for MV
|
||||
Window_ExInfoWindow.prototype.textWidthEx = function(text) {
|
||||
return this.drawTextEx(text, 0, this.contents.height);
|
||||
// Ensure text width is measured with the configured font size.
|
||||
var _origReset = Window_Base.prototype.resetFontSettings;
|
||||
Window_Base.prototype.resetFontSettings = function() {
|
||||
this.contents.fontFace = this.standardFontFace();
|
||||
this.contents.fontSize = exInfoWindowFontSize;
|
||||
this.resetTextColor();
|
||||
};
|
||||
try {
|
||||
return Window_Base.prototype.drawTextEx.call(this, text, 0, this.contents.height);
|
||||
} finally {
|
||||
Window_Base.prototype.resetFontSettings = _origReset;
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
|
|
|||
Loading…
Reference in a new issue