feat: 新增技能装备详情弹窗IBox,替换旧英雄信息弹窗逻辑
1. 重构IBoxComp组件,支持技能和装备详情展示 2. 为EquipBoxComp和SkillBoxComp添加长按弹窗功能 3. 更新UI配置,修正IBox弹窗层级 4. 新增富文本工具函数生成技能装备详情文案
This commit is contained in:
@@ -36,7 +36,7 @@ export var UIConfigData: { [key: number]: UIConfig } = {
|
||||
[UIID.Netinstable]: { layer: LayerType.PopUp, prefab: "common/prefab/netinstable" },
|
||||
[UIID.Role_Controller]: { layer: LayerType.UI, prefab: "gui/role_controller" },
|
||||
[UIID.Victory]: { layer: LayerType.UI, prefab: "gui/element/victory" },
|
||||
[UIID.IBox]: { layer: LayerType.UI, prefab: "gui/element/ibox" },
|
||||
[UIID.IBox]: { layer: LayerType.PopUp, prefab: "gui/element/ibox" },
|
||||
[UIID.Notity]: { layer: LayerType.UI, prefab: "gui/element/notity" },
|
||||
// [UIID.Ranks]: { layer: LayerType.UI, prefab: "gui/element/ranks" },
|
||||
// [UIID.Heros]: { layer: LayerType.UI, prefab: "gui/element/heros" },
|
||||
|
||||
@@ -328,3 +328,49 @@ export function buildSkillDescRich(source: ISkillDescSource): string {
|
||||
})
|
||||
.join("\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* 单个技能详情富文本(IBox 弹窗用):展示 CD/持续时间 + 结构化效果描述。
|
||||
* @param skillUuid SkillSet 技能 UUID
|
||||
* @param overrides 可选覆写参数(如药水卡自定义档位)
|
||||
* @param lv 技能等级(仅用于展示,不影响数值计算)
|
||||
* @returns 多行富文本串:第一行 CD/持续时间,第二行效果描述
|
||||
*/
|
||||
export function buildSingleSkillRich(skillUuid: number, overrides?: SkillOverrides, lv: number = 1): string {
|
||||
const base = SkillSet[skillUuid];
|
||||
if (!base) return "未知技能";
|
||||
const skill = mergeSkillParams(base, overrides);
|
||||
// SkillConfig 未定义 cd 字段,冷却时间由外部运行时数据传入;计时模式展示持续时间
|
||||
const dur = skill.buff_duration ?? (skill.timed_buff_id !== undefined ? BuffList[skill.timed_buff_id]?.duration : undefined) ?? 0;
|
||||
const cdTag = dur > 0 ? `<color=${RICH_VALUE_COLOR}>持续:${dur}s</color>` : "";
|
||||
const nameTag = `「<color=${RICH_NAME_COLOR}>${skill.name}</color>」 Lv.${lv}`;
|
||||
|
||||
// 复用结构化效果行,head 为空避免重复触发类型前缀
|
||||
const line = buildEffectLine("", skill);
|
||||
const prefix = line.prefix.replace(SKILL_NAME_PATTERN, `「<color=${RICH_NAME_COLOR}>$1</color>」`);
|
||||
const effect = line.value
|
||||
? `${prefix}<color=${RICH_VALUE_COLOR}>${line.value}</color>${line.suffix}`
|
||||
: `${prefix}${line.suffix}`;
|
||||
|
||||
return cdTag ? `${nameTag} ${cdTag}\n${effect}` : `${nameTag}\n${effect}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* 装备详情富文本(IBox 弹窗用):展示装备包含的全部驻场光环词条。
|
||||
* @param fieldUuids FieldSkillSet 驻场光环 UUID 数组
|
||||
* @returns 多行富文本串,每行一个词条
|
||||
*/
|
||||
export function buildEquipRich(fieldUuids: number[]): string {
|
||||
if (!fieldUuids?.length) return "无词条";
|
||||
const lines: string[] = [];
|
||||
for (const uuid of fieldUuids) {
|
||||
const line = buildFieldLine("", uuid);
|
||||
if (!line) continue;
|
||||
const prefix = line.prefix.replace(SKILL_NAME_PATTERN, `「<color=${RICH_NAME_COLOR}>$1</color>」`);
|
||||
const text = line.value
|
||||
? `${prefix}<color=${RICH_VALUE_COLOR}>${line.value}</color>${line.suffix}`
|
||||
: `${prefix}${line.suffix}`;
|
||||
lines.push(text);
|
||||
}
|
||||
return lines.length > 0 ? lines.join("\n") : "无词条";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user