| 赞 | 37 |
| VIP | |
| 好人卡 | |
| 积分 | 105 |
| 经验 | |
| 最后登录 | 2026-1-6 |
| 在线时间 | 463 小时 |
- 梦石
- 2
- 星屑
- 8479
- 在线时间
- 463 小时
- 注册时间
- 2021-12-4
- 回帖
- 486

|
发表于 2023-10-10 20:52:18
|
显示全部楼层
在rmmz_managers.js中可以找到以下代码来控制颜色,需要对它的定义进行改写来加入属性ID参数,同时在调用它的两个地方传入属性ID。
- ColorManager.paramchangeTextColor = function(change, paramId) {
- if (paramId === 7) change = -change; // 上一行为修改内容(添加paramId参数),本行为新增内容,表示幸运值(7号属性)为负面属性,增加为红,减少为绿
- if (change > 0) {
- return this.powerUpColor();
- } else if (change < 0) {
- return this.powerDownColor();
- } else {
- return this.normalColor();
- }
- };
复制代码
下面两段代码都在rmmz_windows.js文件。
- Window_EquipStatus.prototype.drawNewParam = function(x, y, paramId) {
- const paramWidth = this.paramWidth();
- const newValue = this._tempActor.param(paramId);
- const diffvalue = newValue - this._actor.param(paramId);
- this.changeTextColor(ColorManager.paramchangeTextColor(diffvalue, paramId)); // 本行为修改内容,添加paramId参数
- this.drawText(newValue, x, y, paramWidth, "right");
- };
- // 以上为第2570行,以下为第3730行。
- Window_ShopStatus.prototype.drawActorParamChange = function(x, y, actor, item1) {
- const width = this.innerWidth - this.itemPadding() - x;
- const paramId = this.paramId();
- const change = this._item.params[paramId] - (item1 ? item1.params[paramId] : 0);
- this.changeTextColor(ColorManager.paramchangeTextColor(change, paramId)); // 本行为修改内容,添加paramId参数
- this.drawText((change > 0 ? "+" : "") + change, x, y, width, "right");
- };
复制代码 |
|