本帖最后由 Arrose 于 2025-3-27 19:48 编辑
你试试,插件文件名改成ASFontLoad.js/*: * @target MZ * @plugindesc [V1.0.0] 字体加载插件 * @author Arrose * * @url [url]https://github.com/Future-Machine-Research-Institute/RMMZPluginDemo[/url] * * @help * * 此插件以MIT协议发行 * * @param messageWindowFontSet * @text 消息窗口字体设置 * @desc 消息窗口字体设置 * @type string * @default * * @param messageWindowFontFileName * @text 字体文件名 * @desc 字体文件名(带文件名后缀) * @parent messageWindowFontSet * @type string * @default mplus-1m-regular.woff * * @param messageWindowFontSize * @text 字体大小 * @desc 字体大小 * @parent messageWindowFontSet * @type number * @min 0 * @default 26 * */ const ASFontLoadPluginNameSpace = (() => { "use strict"; const pluginName = "ASFontLoad"; const parameters = PluginManager.parameters(pluginName); const messageWindowFontFileName = parameters.messageWindowFontFileName; const messageWindowFontFamily = messageWindowFontFileName.split(".")[0]; const messageWindowFontSize = Number(parameters.messageWindowFontSize) || 26; const _Window_Message_resetFontSettings = Window_Message.prototype.resetFontSettings; Window_Message.prototype.resetFontSettings = function() { _Window_Message_resetFontSettings.apply(this); this.contents.fontFace = messageWindowFontFamily; this.contents.fontSize = messageWindowFontSize; }; const _Scene_Boot_LoadGameFonts = Scene_Boot.prototype.loadGameFonts; Scene_Boot.prototype.loadGameFonts = function() { _Scene_Boot_LoadGameFonts.apply(this, arguments); FontManager.load(messageWindowFontFamily, messageWindowFontFileName); }; })();
/*:
* @target MZ
* @plugindesc [V1.0.0] 字体加载插件
* @author Arrose
*
* @url [url]https://github.com/Future-Machine-Research-Institute/RMMZPluginDemo[/url]
*
* @help
*
* 此插件以MIT协议发行
*
* @param messageWindowFontSet
* @text 消息窗口字体设置
* @desc 消息窗口字体设置
* @type string
* @default
*
* @param messageWindowFontFileName
* @text 字体文件名
* @desc 字体文件名(带文件名后缀)
* @parent messageWindowFontSet
* @type string
* @default mplus-1m-regular.woff
*
* @param messageWindowFontSize
* @text 字体大小
* @desc 字体大小
* @parent messageWindowFontSet
* @type number
* @min 0
* @default 26
*
*/
const ASFontLoadPluginNameSpace = (() => {
"use strict";
const pluginName = "ASFontLoad";
const parameters = PluginManager.parameters(pluginName);
const messageWindowFontFileName = parameters.messageWindowFontFileName;
const messageWindowFontFamily = messageWindowFontFileName.split(".")[0];
const messageWindowFontSize = Number(parameters.messageWindowFontSize) || 26;
const _Window_Message_resetFontSettings = Window_Message.prototype.resetFontSettings;
Window_Message.prototype.resetFontSettings = function() {
_Window_Message_resetFontSettings.apply(this);
this.contents.fontFace = messageWindowFontFamily;
this.contents.fontSize = messageWindowFontSize;
};
const _Scene_Boot_LoadGameFonts = Scene_Boot.prototype.loadGameFonts;
Scene_Boot.prototype.loadGameFonts = function() {
_Scene_Boot_LoadGameFonts.apply(this, arguments);
FontManager.load(messageWindowFontFamily, messageWindowFontFileName);
};
})();
|