StaticItemPanel
classBlock 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
| Name | Type | Description | |
|---|---|---|---|
| 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: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)
- name read-only Object name
- Prototype:is_valid() Returns false once the underlying engine object has been destroyed
Inherited from Object (1)
- Object:get_class() Class of this object