| 赞 | 58 |
| VIP | 0 |
| 好人卡 | 0 |
| 积分 | 4 |
| 经验 | 0 |
| 最后登录 | 2026-6-4 |
| 在线时间 | 958 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 442
- 在线时间
- 958 小时
- 注册时间
- 2021-3-24
- 帖子
- 621

|
- /*:
- * @target MZ
- * @plugindesc [v1.0] 角色属性显示过滤器:在插件设置中勾选需要显示的属性。
- * @author Gemini
- *
- * @param visibleParams
- * @text 显示属性设置
- * @desc 勾选你希望在菜单和状态栏中显示的属性。
- * @type struct<ParamConfig>
- * @default {"mhp":"true","mmp":"true","atk":"true","def":"true","mat":"true","mdf":"true","agi":"true","luk":"true"}
- *
- * @help
- * 这是一个轻量级的属性显示控制插件。
- *
- * 影响范围:
- * 1. 状态栏 (Status Window)
- * 2. 装备界面属性对比
- *
- * 原理:通过重写 Window_StatusBase.prototype.drawItemProp 来实现过滤。
- */
- /*~struct~ParamConfig:
- * @param mhp
- * @text 最大生命 (MHP)
- * @type boolean
- * @default true
- *
- * @param mmp
- * @text 最大魔法 (MMP)
- * @type boolean
- * @default true
- *
- * @param atk
- * @text 攻击力 (ATK)
- * @type boolean
- * @default true
- *
- * @param def
- * @text 防御力 (DEF)
- * @type boolean
- * @default true
- *
- * @param mat
- * @text 魔法攻击 (MAT)
- * @type boolean
- * @default true
- *
- * @param mdf
- * @text 魔法防御 (MDF)
- * @type boolean
- * @default true
- *
- * @param agi
- * @text 敏捷度 (AGI)
- * @type boolean
- * @default true
- *
- * @param luk
- * @text 运气 (LUK)
- * @type boolean
- * @default true
- */
- (() => {
- const pluginName = "CharacterStatusFilter";
- const parameters = PluginManager.parameters(pluginName);
- const visibleParams = JSON.parse(parameters['visibleParams'] || '{}');
- // 将字符串转为布尔值映射表
- const paramMap = {
- 0: visibleParams.mhp === "true",
- 1: visibleParams.mmp === "true",
- 2: visibleParams.atk === "true",
- 3: visibleParams.def === "true",
- 4: visibleParams.mat === "true",
- 5: visibleParams.mdf === "true",
- 6: visibleParams.agi === "true",
- 7: visibleParams.luk === "true"
- };
- // 拦截基础状态窗口的属性绘制逻辑
- // RPG Maker MZ 使用 Window_StatusBase 处理这类通用绘制
- const _Window_StatusParams_drawItem = Window_StatusParams.prototype.drawItem;
- Window_StatusParams.prototype.drawItem = function(index) {
- // 获取当前行对应的属性 ID (0-7)
- const paramId = index;
- // 如果插件设置中该 ID 为 false,则跳过绘制
- if (!paramMap[paramId]) {
- return;
- }
- _Window_StatusParams_drawItem.apply(this, arguments);
- };
- // 针对装备窗口的属性对比过滤
- const _Window_EquipStatus_drawItem = Window_EquipStatus.prototype.drawItem;
- Window_EquipStatus.prototype.drawItem = function(x, y, paramId) {
- if (!paramMap[paramId]) {
- return;
- }
- _Window_EquipStatus_drawItem.apply(this, arguments);
- };
- })();
复制代码 找AI给你算一卦 |
|