RitnLibInformatron¶
🚧 Beta — do not use in production.
RitnLibInformatronis a beta class with two known blocking defects::getElement()readsself.gui[self.gui_name](string key"informatron") while the constructor stores the element under integer key[1]— always returnsnil.:setPageContent()returns the undefined globalFLAG_PAGE_DISPLAYinstead ofself.FLAG_PAGE_DISPLAY— always returnsnil. Furthermore, theinformatron_page_contentremote interface incore/interfaces.luais commented out, making the class end-to-end unusable. Full reference documentation will be written once the class is stabilised.
| Source | classes/RitnClass/RitnInformatron.lua |
| Inherits from | RitnLibGui |
| Stage | control (runtime) |
| Access | require(ritnlib.defines.class.ritnClass.informatron) |
| Status | 🚧 beta (blocked) |
object_name |
"RitnLibInformatron" |
Intent (target)¶
Integration wrapper for Informatron. Built around an Informatron event payload to render a page's content into the Informatron screen GUI via the informatron_page_content remote interface.
-- intended usage once the class is stabilised (inside the Informatron remote handler)
remote.add_interface("my-mod", {
informatron_page_content = function(data)
local informatron = RitnLibInformatron("my-mod", data)
return informatron:setPageContent({
{ name = "my-panel", parent = "start", gui = { type = "frame", ... } },
})
end
})
In the meantime, use the Informatron API directly (remote.call("informatron", ...)) and build the GUI manually.
Constructor¶
| Parameter | Type | Description |
|---|---|---|
mod_name |
string |
Mod name (passed to RitnLibGui.init as action) |
informatron_data |
EventData |
Informatron event payload (player_index field required) |
Note —
self.page_name = page_namereads the globalpage_nameat construction time. This global must be set by the caller (Informatron injects it before calling the remote interface).
Fields inherited from RitnLibGui¶
See RitnLibGui for all dispatcher fields (.player, .mod_name, .gui_action, etc.).
Own fields¶
| Field | Type | Value |
|---|---|---|
gui_name |
"informatron" |
Logical GUI name |
page_name |
string? |
Name of the page being rendered (read from global page_name) |
gui |
{ [1]: LuaGuiElement } |
{ self.player.gui.screen } |
content |
table |
Element-tree cache (consumer-populated) |
content_origine |
string[] |
Path { "main-flow", "content-container", "content-pane" } |
FLAG_PAGE_DISPLAY |
true |
Success constant |
FLAG_PAGE_NOT_DISPLAY |
false |
Failure constant |
Methods¶
:getElement(element_type, element_name?)¶
Retrieves a LuaGuiElement from the page tree by walking content_origine then self.content[element_type][element_name].
⚠ Beta defect — reads
self.gui[self.gui_name](key"informatron") but the constructor stores underself.gui[1]. Always returnsnil.
Parameters:
| Name | Type | Description |
|---|---|---|
element_type |
string |
Element category in self.content |
element_name |
string? |
Element name (optional) |
Return value: LuaGuiElement?
:setPageContent(pageElements)¶
Iterates pageElements and adds each element to the Informatron content pane via parent.add(element.gui).
⚠ Beta defect — returns the undefined global
FLAG_PAGE_DISPLAY(notself.FLAG_PAGE_DISPLAY). Return value is alwaysnil.
Parameters:
| Name | Type | Description |
|---|---|---|
pageElements |
{ name: string, parent: string, gui: table }[] |
List of elements to add |
Return value: boolean? (intent: true = success, false = page not displayed)
See also¶
RitnLibGui— parent class (extension contract)core/interfaces.lua— Informatron remote interface (commented out)- Known bugs
- Class map