local needCombineEx = checkNeedCombineExAdd()
local abilexStr = itemData.ExAbil and itemData.ExAbil.abilex
local exAttrStr = not needCombineEx and ItemTips.ParseExAddAttr(abilexStr) or nil
if exAttrStr and next(exAttrStr) then
local checkList =
这段代码的逻辑有问题,我来帮你修正一下:
```lua
local needCombineEx = checkNeedCombineExAdd()
local abilexStr = itemData.ExAbil and itemData.ExAbil.abilex
local exAttrStr = not needCombineEx and ItemTips.ParseExAddAttr(abilexStr) or nil
if exAttrStr and next(exAttrStr) then
local checkList = {
"君龙之心",
"鱼龙百变",
"浮光掠影",
"天外飞仙",
"北冥神功",
"独孤九剑",
"万剑归宗"
}
-- 检查是否在表里
local isInList = false
for i, name in ipairs(checkList) do
if string.find(itemData.Name, name) then
isInList = true
break
end
end
-- 只有表里装备才显示附加属性
if isInList then
local strd = "附加" -- 这里可以根据需要改为"成长"
for i, v in ipairs(exAttrStr) do
local rich_att_ex = nil
if v.str then
rich_att_ex = GUI:RichText_Create(contentPanel, "rich_att_ex_" .. i, 0, 0, v.str, richWidth, _setFontSize or _DefaultFSize, "#FFFFFF", vspace, nil, fontPath)
ItemTips.PushItem(contentPanel, rich_att_ex)
maxWidth = math.max(maxWidth, GUI:getContentSize(rich_att_ex).width)
upAttrMaxWidth = math.max(upAttrMaxWidth, GUI:getContentSize(rich_att_ex).width)
end
if rich_att_ex and v.id and upAttrs[v.id] then
table.insert(upAttrRichs, rich_att_ex)
end
end
ItemTips.PushItem(contentPanel, ItemTips.CreateIntervalPanel(contentPanel, _DefaultSpace, true))
end
end
```
主要修改:
1. 添加了`isInList`变量来判断是否在检查列表中
2. 使用`string.find(itemData.Name, name)`正确检查是否包含特定名称
3. 只有当`isInList`为true时才执行显示逻辑
4. 移除了错误的return和break位置
这样就能实现"只有表里装备才显示附加属性"的需求了。