{# 宏:渲染一个物品槽 item: ItemDto / SearchResultItemDto / CleanNode show_name: 是否在下方显示名字 #} {% macro item_slot(item, show_name=False) %} {# [Update] 标准化帧数 (统一使用小驼峰 frameCount) #} {% set frames = item.frameCount or 1 %}
{# [Update] 统一使用小驼峰 imagePath #} {% if item.imagePath %} {% set img_path = item.imagePath %} {% else %} {{ item.name }} {% endif %} {% if item.stack and item.stack > 1 %} {{ item.stack }} {% endif %}
{% if show_name %} {{ item.name }} {% endif %}
{% endmacro %}