编写人员:“雪舞”
时间:2022-12-19 11:00:04
用途:各种打造界面UI中,放入道具材料图标!
什么是物品框,具体图示:
XML组件定义代码:
<Window Type="TLBB_ActionButton" Name="Gemcompose_Special_Button">
<Property Name="UnifiedSize" Value="{{0.000000,36.000000},{0.000000,35.000000}}"/>
<Property Name="UnifiedPosition" Value="{{0.763000,0.000000},{0.000000,0.000000}}"/>
<Property Name="DragAcceptName" Value="G8" />
<Property Name="DraggingEnabled" Value="True" />
<Event Name="RBClicked" Function="Gemcompose_Remove(2);" />
</Window>
LUA中的使用方法:
--界面载入
function Gemcompose_OnLoad()
g_ActionButton_ComposeItem = Gemcompose_Special_Button
end
清空物品框函数:
g_ActionButton_ComposeItem:SetActionItem(-1)
获取你放入的道具图标,背包位置bagPos
local composeItem = EnumAction(bagPos, "packageitem")
if composeItem:GetID() == 0 then
return
end
给物品栏设置物品图标:
g_ActionButton_ComposeItem:SetActionItem(composeItem:GetID())
|