local function pushDescItem(desc, descTag)
if not desc or not ItemTips.contentPanel then
return
end
local movePosY = 0
if desc and next(desc) then
local contentSz = GUI:getContentSize(ItemTips.contentPanel)
for
```lua
local function pushDescItem(desc, descTag)
if not desc or not ItemTips.contentPanel then
return
end
local movePosY = 0
if desc and next(desc) then
local contentSz = GUI:getContentSize(ItemTips.contentPanel)
for i, v in ipairs(desc) do
local isadd = true
if descTag == 1 then
if v.y and v.y ~= 0 then
isadd = false
v.y = contentSz.height - v.y
v.isTop = true
table.insert(topDesY, v)
end
end
if isadd then
if v.isTop then
v.y = contentSz.height - v.y
GUI:setContentSize(ItemTips.contentPanel, contentSz)
end
if v.newLine then
local lineH = v.height or 0
lineH = lineH > 0 and lineH or _DefaultSpace
local linePanel = ItemTips.CreateIntervalPanel(ItemTips.contentPanel, lineH, true)
GUI:setPosition(linePanel, v.x or 0, v.y or 0)
ItemTips.PushItem(ItemTips.contentPanel, linePanel)
elseif v.text then
rich_att_num = rich_att_num + 1
local textSize = _setFontSize or _DefaultFSize
if v.fontsize and v.fontsize > 0 then
textSize = v.fontsize
end
local rich_att = GUI:RichTextFCOLOR_Create(ItemTips.contentPanel, string.format("rich_att_%s", rich_att_num), math.floor(v.x or 0), math.floor(v.y or 0), v.text, ItemTips._isItem and 420 or (_TotalWidth - 20), textSize, "#FFFFFF", vspace, nil, fontPath)
ItemTips.PushItem(ItemTips.contentPanel, rich_att)
if SL:GetMetaValue("WINPLAYMODE") then
movePosY = movePosY - 1
end
elseif v.res then
desc_img_num = desc_img_num + 1
local img = ItemTips.GetNodeImage(ItemTips.contentPanel, v, desc_img_num)
if img then
ItemTips.PushItem(ItemTips.contentPanel, img)
if v.isSFX and SL:GetMetaValue("WINPLAYMODE") then --pc与移动的宽高差导致的位置进行调整
local imgSz = GUI:getContentSize(img)
local posX = GUI:getPositionX(img)
local posY = GUI:getPositionY(img)
GUI:setPosition(img, math.floor(posX), math.floor(posY - imgSz.height / 2 + movePosY))
end
end
end
end
end
end
end
```