refactor: 将代码中的card_lv统一替换为rarity
本次提交完成了全项目范围内术语的统一替换,将原本指代卡牌品质/等级的card_lv字段全部重命名为rarity,对齐了设计文档中的命名规范,避免了术语混淆: 1. 更新了所有配置文件、组件类、数据结构中的字段定义 2. 同步修改了注释、文档说明中的相关表述 3. 修正了英雄、技能、装备卡牌的品质显示逻辑 4. 调整了背景颜色切换、属性计算等相关业务逻辑
This commit is contained in:
@@ -25,7 +25,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
import { HeroInfo } from "../common/config/heroSet";
|
||||
import { getLvColor, CARD_LV_BG_COLORS } from "../common/config/GameSet";
|
||||
import { getLvColor, RARITY_BG_COLORS } from "../common/config/GameSet";
|
||||
import { canHeroUpgrade } from "../common/config/heroUpSet";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
@@ -178,7 +178,7 @@ export class CardLiteComp extends CCComp {
|
||||
/**
|
||||
* 渲染英雄卡面。
|
||||
*
|
||||
* 1. 背景:按 card_lv 切换颜色底框(green/blue/purple/yellow/red)。
|
||||
* 1. 背景:按 rarity 切换颜色底框(green/blue/purple/yellow/red)。
|
||||
* 2. 名称:英雄名。
|
||||
* 3. 等级:局外成长等级(Lv.X),颜色按 getLvColor。
|
||||
* 4. 图标:idle 动画首帧静态展示。
|
||||
@@ -187,10 +187,10 @@ export class CardLiteComp extends CCComp {
|
||||
this.iconVisualToken += 1;
|
||||
if (this.opacityComp) this.opacityComp.opacity = 255;
|
||||
|
||||
// 背景:按 card_lv 切换颜色底框
|
||||
// 背景:按 rarity 切换颜色底框
|
||||
if (this.BG_node) {
|
||||
const bgLv = Math.min(Math.max(hero.card_lv ?? 1, 1), 5);
|
||||
const color = CARD_LV_BG_COLORS[bgLv - 1];
|
||||
const bgLv = Math.min(Math.max(hero.rarity ?? 1, 1), 5);
|
||||
const color = RARITY_BG_COLORS[bgLv - 1];
|
||||
this.BG_node.children.forEach(child => child.active = (child.name === color));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user