设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 141|回复: 3
打印 上一主题 下一主题

[有事请教] 请教下各位大佬,VisuMZ代码怎么改成图片红框那样

[复制链接]

Lv1.梦旅人

梦石
0
星屑
82
在线时间
22 小时
注册时间
2026-5-1
帖子
2
跳转到指定楼层
1
发表于 前天 15:46 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
// Declare Constants
const lineHeight = this.lineHeight();
const actor = this._actor;
const padding = this.itemPadding();
const labelFmt = '\\C[16]%1: \\C[0]%2';
const traitType1 = DataManager.traitSetType('Element');
const traitSet1 = actor.traitSet('Element');
const traitType2 = DataManager.traitSetType('SubElement');
const traitSet2 = actor.traitSet('SubElement');
const traitHeight = (this.innerHeight / Math.max(Window_StatusData.traitCol1.length, Window_StatusData.traitCol2.length)) - lineHeight;
let x = 0;
let y = 0;
let width = this.innerWidth / 2;

// Draw Actor Graphic
this.drawActorGraphic(0, width);

// Draw Element Trait Sets
if (traitType1.Visible || traitType2.Visible) {
    this.drawItemDarkRect(x, y, width, lineHeight, 2);
    this.drawItemDarkRect(width, y, width, lineHeight, 2);
    if (traitType1.Visible) {
        this.drawTextEx(labelFmt.format(traitType1.Label, traitSet1.Display), padding, y, width - padding * 2);
    }
    if (traitType2.Visible) {
        this.drawTextEx(labelFmt.format(traitType2.Label, traitSet2.Display), width + padding, y, width - padding * 2);
    }
    y += lineHeight;
    this.setDescriptionFontSizeToTraitSet();
    this.drawItemDarkRect(x, y, width, traitHeight);
    this.drawItemDarkRect(width, y, width, traitHeight);
    if (traitType1.Visible) {
        this.drawTextEx(traitSet1.Description, padding, y, width - padding * 2);
    }
    if (traitType2.Visible) {
        this.drawTextEx(traitSet2.Description, width + padding, y, width - padding * 2);
    }
    this.resetDescriptionFontSize();
    this.resetFontSettings();
    y += traitHeight;
}
const topY = y;

// Prepare Elemental Data
const elementCol1 = this.getElementIDsCol1();
const elementCol2 = this.getElementIDsCol2();
let columnData;
if (elementCol2.length > 0) {
    columnData = ['Resist','Resist','Bonus','Bonus'];
} else {
    columnData = ['Resist','Bonus'];
}
const dataRows = Math.max(elementCol1.length, elementCol2.length, 1);
const dataCols = columnData.length;

// Draw Elemental Data
this.drawItemDarkRect(width * 0, y, width, lineHeight, 2);
this.drawItemDarkRect(width * 1, y, width, lineHeight, 2);
this.changeTextColor(ColorManager.systemColor());
this.drawText(TextManager.statusMenuDmgReceive, width * 0, y, width, 'center');
this.drawText(TextManager.statusMenuDmgDealt, width * 1, y, width, 'center');
y += lineHeight;
this.setDescriptionFontSizeToTraitSet();
const smallLineHeight = this.textSizeEx(' ').height;

// Draw Elemental Table
for (let i = 0; i < dataRows; i++) {
    for (let j = 0; j < dataCols; j++) {
        // Draw Dark Rect
        const colWidth = this.innerWidth / dataCols;
        this.drawItemDarkRect(colWidth * j, y, colWidth, smallLineHeight);

        // Draw Element Name
        let elementID = elementCol1[i];
        if (dataCols === 4) {
            elementID = (j % 2 === 0) ? elementCol1[i] : elementCol2[i];
        }
        if (!elementID) continue;
        const name = $dataSystem.elements[elementID];
        this.drawTextEx(name, colWidth * (j + 1/3) + padding, y, colWidth*2/3);
        const type = columnData[j];

        // Draw Resistance Data
        this.resetFontSettings();
        let drawText = '';
        if (type === 'Resist') {
            const rate = actor.elementRate(elementID);
            const flippedRate = (rate - 1) * -1;
            this.changeTextColor(ColorManager.paramchangeTextColor(flippedRate));
            drawText = '%1%'.format(Math.round(flippedRate * 100));
            if (actor.getAbsorbedElements().includes(elementID)) {
                this.changeTextColor(ColorManager.powerUpColor());
                drawText = TextManager.statusMenuDmgAbsorb.format(Math.round(rate * 100));
            } else if (rate > 1) {
                drawText = '%1'.format(drawText);
            } else if (rate <= 1) {
                drawText = '+%1'.format(drawText);
            }

        // Draw Bonus Damage Data
        } else if (type === 'Bonus') {
            const dealtPlus = actor.getDealtElementPlus(elementID);
            const dealtRate = actor.getDealtElementRate(elementID);
            const dealtFlat = actor.getDealtElementFlat(elementID);
            const dealt = ((1 + dealtPlus) * dealtRate + dealtFlat) - 1;
            this.changeTextColor(ColorManager.paramchangeTextColor(dealt));
            drawText = '%1%'.format(Math.round(dealt * 100));
            if (dealt >= 0) drawText = '+%1'.format(drawText);
        }

        // Draw Value
        this.contents.drawText(drawText, colWidth * j, y, (colWidth/3) - padding, smallLineHeight, 'right');
    }
    y += smallLineHeight;
}

// Closing the Table
for (let j = 0; j < dataCols; j++) {
    const colWidth = this.innerWidth / dataCols;
    this.drawItemDarkRect(colWidth * j, y, colWidth, this.innerHeight - y);
}

268bc93f-2bac-4e2a-b9cc-0d168fc037ad.png (723.7 KB, 下载次数: 2)

268bc93f-2bac-4e2a-b9cc-0d168fc037ad.png

Lv4.逐梦者

梦石
0
星屑
5973
在线时间
261 小时
注册时间
2018-1-22
帖子
211
2
发表于 前天 20:51 | 只看该作者
单改成这种列表还是很好改的,但是和visu放在一起我就不知道了。。。
自分自身の神様になること
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
82
在线时间
22 小时
注册时间
2026-5-1
帖子
2
3
 楼主| 发表于 昨天 14:14 | 只看该作者
526396987 发表于 2026-6-2 20:51
单改成这种列表还是很好改的,但是和visu放在一起我就不知道了。。。

大佬没用visu吗?

点评

不开源,用不了一点  发表于 7 小时前
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2026-6-4 17:08

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表