H3lp Yours3lfDocs
api

itemSlot

Display an icon in a bordered slot with an optional count.

Builds a bordered icon slot with an optional normal-text count. It does not inspect inventory or query game state.

Example

local ui = require 'openmw.ui'
local itemSlot = require 'scripts.s3.components.itemSlot'

ui.create {
  type = ui.TYPE.Container,
  layer = 'Windows',
  content = ui.content {
    itemSlot {
      resource = {
        path = 'white',
      },
      count = 4,
    },
  },
}

Parameters

FieldTypeDescription
resourceopenmw.ui.TextureResource or openmw.ui.TextureResourceOptionsIcon texture resource or options for one.
countnumber?Optional count rendered over the icon.
iconPropstable?Properties for the icon.
countPropstable?Properties for the count label.
templateopenmw.ui.Template?Replaces the default H3UI slot template.

Common layout fields are documented on the UI Components overview. Count values become text during construction; live inventory changes require an owner update or rebuild.

See also

grid · image · iconButton