StaticItemPanel

StaticItemPanel

class

Block the recipe screen shows above the recipes of an item

  • load-only Usable only while mods load. The game seals these members once loading finishes, so a call or a write from a running world raises an error.

Fields

NameTypeDescription
items StaticItem[] Items this panel is shown for
category string Item category this panel is shown for
order integer Sort order among the panels of one item
widget string Panel widget class path; empty means build draws the panel
build function? Called with the item and the panel each time the panel is shown; returns the ui.Widget it draws, nil hides the panel
label Loc Localized panel title
description_parts Loc[] Localized body paragraphs
context AutosizeInventory Inventory of items shown under the text

Functions

StaticItemPanel:add_context(item)

Add an item to the context inventory

item StaticItem Item to show

StaticItemPanel:clear_context()

Remove every item from the context inventory

StaticItemPanel:set_number(key, value)

Write a number the panel widget reads by key

key string
value number

StaticItemPanel:get_number(key, fallback)

Number written under the key, or the fallback

key string
fallback number

returns number

StaticItemPanel:set_string(key, value)

Write a string the panel widget reads by key

key string
value string

StaticItemPanel:get_string(key)

String written under the key, empty when there is none

key string

returns string

Standard members (5)

Every class of this kind carries these.

StaticItemPanel.cast(object) Trying to cast Object into StaticItemPanel
StaticItemPanel.get_class() Return StaticItemPanel class object
StaticItemPanel.find(name) Looks StaticItemPanel up in db, nil when there is none
StaticItemPanel.get(name) Takes StaticItemPanel from db, reports a miss to the log
StaticItemPanel.reg(name) load-only Register a new StaticItemPanel static object
Inherited from Prototype (2)
Inherited from Object (1)