找回密码
 register
搜索
查看: 455|回复: 0

客户端显示物品道具图标 官方函数 DataPool:CreateActionItemForShow的代替函数

[复制链接]
  • 打卡等级:本地老炮
  • 打卡总天数:527
  • 打卡月天数:16
  • 打卡总奖励:525
  • 最近打卡:2026-06-18 02:14:29
Waylee 发表于 2023-6-11 23:03 | 显示全部楼层 |阅读模式
文章编辑人员:雪舞
内容测试时间:2023-6-11 23:02:01
测试版本:新武侠世界

这种图标是创建在xml的TLBB_ActionButton组件上面的
显示图标:

官方案例:
for i = 1, 4 do
                local itemAction = DataPool:CreateActionItemForShow(g_SetItem[item_table_index], 1)
                if itemAction:GetID() ~= 0 then
                        g_ActionItem:SetActionItem(itemAction:GetID())
                end
               
                local strName = PlayerPackage:GetItemName(g_SetItem[item_table_index])
                g_ItemNameText:SetText("#L"..strName)
end

替换函数:
        for i = 1, 4 do
                local itemAction = GemMelting:UpdateProductAction(g_SetItem[item_table_index], 1)
                if itemAction:GetID() ~= 0 then
                        g_ActionItem:SetActionItem(itemAction:GetID())
                end
                
                local strName = LuaFnGetItemName(g_SetItem[item_table_index]) --PlayerPackage:GetItemName(g_SetItem[item_table_index])
                g_ItemNameText:SetText("#cff6633"..strName)
        end


如果想把图标清空,g_ActionItem:SetActionItem(itemAction:GetID()) 改成g_ActionItem:SetActionItem(-1)即可

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?register

×
您需要登录后才可以回帖 登录 | register

本版积分规则

QQ|雪舞知识库 ( 浙ICP备15015590号-1 | 萌ICP备20232229号|浙公网安备33048102000118号 )|天天打卡

GMT+8, 2026-6-19 07:26 , Processed in 0.070322 second(s), 32 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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