Slots
Slots: the places in Wraith’s UI a plugin can add to, like a Workbench tab, its Settings page, or a
part of the scene window, and plugins’ own. What goes in one is an object of the slot’s trait,
added with Ui.contributeTo, and Wraith describes each one in Ui.slots. Wraith’s own parts go
through the same slots.
SettingsSection
Section titled “SettingsSection”Part of the plugin’s page in Settings: Ui.contributeTo("settings", section). On the render thread.
describe(): Wraith.SettingsSection.Infodraw(): voiddescribe(): Wraith.SettingsSection.Infodraw()Wraith.SettingsSection.Info Describe()void Draw()Wraith::SettingsSection_Info describe() constvoid draw() constpub fn describe(&self) -> wraith::SettingsSectionInfopub fn draw(&self)fn describe(self: Wraith.SettingsSection) Wraith.SettingsSection.Infofn draw(self: Wraith.SettingsSection) voidWraith_SettingsSection_Info Wraith_SettingsSection_describe(Wraith_SettingsSection self)void Wraith_SettingsSection_draw(Wraith_SettingsSection self)describe
Section titled “describe”Asked once, as it’s added
Uses SettingsSection.Info.
ScenePart
Section titled “ScenePart”Part of the scene window (Photo Mode), like a button in scene.toolbar. Render thread.
describe(): Wraith.ScenePart.Infodraw(target: import("salamander").Given<Wraith.Slot.Target>): voiddescribe(): Wraith.ScenePart.Infodraw(target: Wraith.Slot.Target)Wraith.ScenePart.Info Describe()void Draw(Wraith.Slot.Target target)Wraith::ScenePart_Info describe() constvoid draw(Wraith::Slot_Target target) constpub fn describe(&self) -> wraith::ScenePartInfopub fn draw(&self, target: wraith::SlotTarget)fn describe(self: Wraith.ScenePart) Wraith.ScenePart.Infofn draw(self: Wraith.ScenePart, target: Wraith.Slot.Target) voidWraith_ScenePart_Info Wraith_ScenePart_describe(Wraith_ScenePart self)void Wraith_ScenePart_draw(Wraith_ScenePart self, Wraith_Slot_Target target)describe
Section titled “describe”Asked once, as it’s added
Uses ScenePart.Info.
For what’s picked, or a bone, inside its part of the window
Uses Slot.Target.
HubButton
Section titled “HubButton”A tile on the overlay’s bar, after Wraith’s own: Ui.contributeTo("hub", button). Render thread.
describe(): Wraith.HubButton.InfoisOpen(): booleanclick(): voiddescribe(): Wraith.HubButton.InfoisOpen(): booleanclick()Wraith.HubButton.Info Describe()bool IsOpen()void Click()Wraith::HubButton_Info describe() constbool isOpen() constvoid click() constpub fn describe(&self) -> wraith::HubButtonInfopub fn is_open(&self) -> boolpub fn click(&self)fn describe(self: Wraith.HubButton) Wraith.HubButton.Infofn isOpen(self: Wraith.HubButton) boolfn click(self: Wraith.HubButton) voidWraith_HubButton_Info Wraith_HubButton_describe(Wraith_HubButton self)bool Wraith_HubButton_isOpen(Wraith_HubButton self)void Wraith_HubButton_click(Wraith_HubButton self)describe
Section titled “describe”Asked once, as it’s added
Uses HubButton.Info.
isOpen
Section titled “isOpen”Lit with a dot under it, like an open window’s
A slot a plugin defined with Ui.defineSlot, for other plugins to add objects of its trait to.
contributions(): Array<object | null>remove(): voidcontributions(): (any)[]remove()Salamander.AnyObject[] Contributions()void Remove()std::span<const sal::Object> contributions() constvoid remove() constpub fn contributions(&self) -> &[salamander::Object]pub fn remove(&self)fn contributions(self: Wraith.Slot) []const rt.AnyObjectfn remove(self: Wraith.Slot) voidSlice_object Wraith_Slot_contributions(Wraith_Slot self)void Wraith_Slot_remove(Wraith_Slot self)contributions
Section titled “contributions”What’s in it now, in the order added, each an object of its trait. Kept till the next call; one
thread at a time. Views of them, like salamander.as in a script, work while they’re there
remove
Section titled “remove”Takes it away. What’s in it stays, for when one by its id comes again, like when its plugin reloads. Gone with the plugin anyway
Contribution
Section titled “Contribution”Something a plugin added to a slot.
isOpen(): booleanfocus(): voidremove(): voidopen(id: string): voidclose(id: string): voidisOpen(): booleanfocus()remove()open(id: string)close(id: string)bool IsOpen()void Focus()void Remove()void Open(string id)void Close(string id)bool isOpen() constvoid focus() constvoid remove() constvoid open(std::string_view id) constvoid close(std::string_view id) constpub fn is_open(&self) -> boolpub fn focus(&self)pub fn remove(&self)pub fn open(&self, id: &str)pub fn close(&self, id: &str)fn isOpen(self: Wraith.Contribution) boolfn focus(self: Wraith.Contribution) voidfn remove(self: Wraith.Contribution) voidfn open(self: Wraith.Contribution, id: []const u8) voidfn close(self: Wraith.Contribution, id: []const u8) voidbool Wraith_Contribution_isOpen(Wraith_Contribution self)void Wraith_Contribution_focus(Wraith_Contribution self)void Wraith_Contribution_remove(Wraith_Contribution self)void Wraith_Contribution_open(Wraith_Contribution self, sal_string id)void Wraith_Contribution_close(Wraith_Contribution self, sal_string id)isOpen
Section titled “isOpen”Shown last frame: its tab in front, its foldout open, or its node picked
Brings its tab to the front, opens its foldout, or picks its node
remove
Section titled “remove”Waits for a draw under way, except from inside a draw or a script. Fine to call twice.
For a Workbench tab of many: opens the one with this id, or brings it to the front
For a Workbench tab of many: closes the one with this id, without asking. For one, closes it
SlotError
Section titled “SlotError”What can go wrong, besides Cancelled, Unsupported and Gone.
| Code | Error | |
|---|---|---|
| 1 | UnknownSlot |
No slot by that id, see Ui.slots |
| 2 | NotTaken |
The slot doesn’t take that presentation or a kind |
| 3 | InvalidId |
Not letters, digits, _, - and . |
| 4 | AlreadyAdded |
The plugin has one by that id in that slot already, or a slot by that id’s defined already |
| 5 | Failed |
|
| 6 | WrongTrait |
The object isn’t the slot’s trait |
Slot.Presentation
Section titled “Slot.Presentation”How a contribution shows in its slot.
An enum of u8.
| Value | Name | |
|---|---|---|
| 0 | default |
The slot’s first in presentations |
| 1 | inline |
Drawn in place, without a frame |
| 2 | foldout |
Under a header that folds |
| 3 | tab |
A tab beside the slot’s others |
| 4 | node |
A row in the slot’s tree, which can have children and be picked. Its draw shows once it’s picked |
Slot.Thread
Section titled “Slot.Thread”Which thread a slot draws on.
An enum of u8.
| Value | Name | |
|---|---|---|
| 0 | render |
|
| 1 | workbench |
The Workbench’s own. Read what game-thread code left rather than calling into the game |
| 2 | any |
A plugin’s own slot, used wherever that plugin says |
Slot.Info
Section titled “Slot.Info”What a slot takes, from Wraith.
A struct, 0x80 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | id |
string |
Like “scene.inspector” |
| 0x10 | title |
string |
|
| 0x20 | help |
string |
|
| 0x30 | trait |
string |
What goes in it implements, like Wraith.ScenePart |
| 0x40 | thread |
Slot.Thread |
|
| 0x48 | presentations |
[]Slot.Presentation |
What it takes, the default first |
| 0x58 | hierarchy |
bool |
Nodes, and parents to put things under |
| 0x59 | kinds |
bool |
Contributions can show only for nodes of a kind, like “actor” |
| 0x60 | parents |
[]string |
Wraith’s own parents, like “world/actors” |
| 0x70 | known_kinds |
[]string |
Wraith’s own kinds, like “actor” |
id: stringtitle: stringhelp: stringtrait: stringthread: Wraith.Slot.Thread | Wraith.Slot.ThreadNamepresentations: Array<Wraith.Slot.Presentation | Wraith.Slot.PresentationName>hierarchy: booleankinds: booleanparents: Array<string>known_kinds: Array<string>id: stringtitle: stringhelp: stringtrait: stringthread: Wraith.Slot.Thread|Wraith.Slot.ThreadNamepresentations: (Wraith.Slot.Presentation|Wraith.Slot.PresentationName)[]hierarchy: booleankinds: booleanparents: (string)[]known_kinds: (string)[]string Idstring Titlestring Helpstring TraitWraith.Slot.Thread ThreadWraith.Slot.Presentation[] Presentationsbool Hierarchybool Kindsstring[] Parentsstring[] KnownKindssal::String idsal::String titlesal::String helpsal::String traitWraith::Slot_Thread threadsal::Slice<Wraith::Slot_Presentation> presentationsbool hierarchybool kindssal::Slice<sal::String> parentssal::Slice<sal::String> known_kindspub id: salamander::Strpub title: salamander::Strpub help: salamander::Strpub r#trait: salamander::Strpub thread: wraith::SlotThreadpub presentations: salamander::Slice<wraith::SlotPresentation>pub hierarchy: boolpub kinds: boolpub parents: salamander::Slice<salamander::Str>pub known_kinds: salamander::Slice<salamander::Str>id: []const u8title: []const u8help: []const u8trait: []const u8thread: Wraith.Slot.Threadpresentations: []const Wraith.Slot.Presentationhierarchy: boolkinds: boolparents: []const []const u8known_kinds: []const []const u8sal_string idsal_string titlesal_string helpsal_string traitWraith_Slot_Thread threadSlice_Wraith_Slot_Presentation presentationsbool hierarchybool kindsSlice_string parentsSlice_string known_kindsSlot.Definition
Section titled “Slot.Definition”A slot of a plugin’s own, from Ui.defineSlot.
A struct, 0x40 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | id |
string |
Letters, digits, _, - and .. Others name it as plugin.id, like ffxiv.viewers |
| 0x10 | title |
string |
|
| 0x20 | help |
string |
What goes in it, and where it shows |
| 0x30 | trait |
string |
What’s added implements, by its full name, like Ffxiv.Viewer |
id: stringtitle: stringhelp: stringtrait: stringid: stringtitle: stringhelp: stringtrait: stringstring Idstring Titlestring Helpstring Traitsal::String idsal::String titlesal::String helpsal::String traitpub id: salamander::Strpub title: salamander::Strpub help: salamander::Strpub r#trait: salamander::Strid: []const u8title: []const u8help: []const u8trait: []const u8sal_string idsal_string titlesal_string helpsal_string traitSlot.Target
Section titled “Slot.Target”What it’s drawn for: the picked node, or nothing.
A struct, 0x30 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | kind |
string |
|
| 0x10 | id |
u64 |
|
| 0x18 | parent |
u64 |
For part of a node, like a bone: the node’s id, like its actor’s. Else 0 |
| 0x20 | name |
string |
What it’s called, like a bone’s name, which its edits go by. Can be empty |
kind: stringid: bigintparent: bigintname: stringkind: stringid: integerparent: integername: stringstring Kindulong Idulong Parentstring Namesal::String kinduint64_t iduint64_t parentsal::String namepub kind: salamander::Strpub id: u64pub parent: u64pub name: salamander::Strkind: []const u8id: u64parent: u64name: []const u8sal_string kinduint64_t iduint64_t parentsal_string nameSettingsSection.Info
Section titled “SettingsSection.Info”A struct, 0x30 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | title |
string |
Its header. Defaults to the plugin’s name |
| 0x10 | id |
string |
Unique for the plugin in Settings. Can be empty |
| 0x20 | presentation |
Slot.Presentation |
foldout, the default, or inline after the plugin’s settings |
| 0x24 | order |
i32 |
Lower comes first. Wraith’s own are 100 apart, from 100 |
| 0x28 | open |
bool |
A foldout starts open |
title: stringid: stringpresentation: Wraith.Slot.Presentation | Wraith.Slot.PresentationNameorder: numberopen: booleantitle: stringid: stringpresentation: Wraith.Slot.Presentation|Wraith.Slot.PresentationNameorder: integeropen: booleanstring Titlestring IdWraith.Slot.Presentation Presentationint Orderbool Opensal::String titlesal::String idWraith::Slot_Presentation presentationint32_t orderbool openpub title: salamander::Strpub id: salamander::Strpub presentation: wraith::SlotPresentationpub order: i32pub open: booltitle: []const u8id: []const u8presentation: Wraith.Slot.Presentationorder: i32open: boolsal_string titlesal_string idWraith_Slot_Presentation presentationint32_t orderbool openScenePart.Info
Section titled “ScenePart.Info”A struct, 0x68 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | id |
string |
Unique for the plugin in the slot, so its other parts can name it as parent. Can be empty |
| 0x10 | title |
string |
Its header or row. Defaults to the plugin’s name |
| 0x20 | icon |
string |
A glyph from Wraith’s icon font before the title, as UTF-8. Can be empty |
| 0x30 | parent |
string |
With a hierarchy: one of its parents, or one of the plugin’s own node ids. Empty for the top |
| 0x40 | kind |
string |
What a node is, or what a part shows for, like camera. Empty for everything |
| 0x50 | node |
u64 |
For a node, its id among its kind, handed to whatever shows for it |
| 0x58 | presentation |
Slot.Presentation |
How it shows, from the slot’s presentations. default is its first |
| 0x5c | order |
i32 |
Lower comes first. Wraith’s own are 100 apart, from 100 |
| 0x60 | open |
bool |
Foldouts and nodes start open |
id: stringtitle: stringicon: stringparent: stringkind: stringnode: bigintpresentation: Wraith.Slot.Presentation | Wraith.Slot.PresentationNameorder: numberopen: booleanid: stringtitle: stringicon: stringparent: stringkind: stringnode: integerpresentation: Wraith.Slot.Presentation|Wraith.Slot.PresentationNameorder: integeropen: booleanstring Idstring Titlestring Iconstring Parentstring Kindulong NodeWraith.Slot.Presentation Presentationint Orderbool Opensal::String idsal::String titlesal::String iconsal::String parentsal::String kinduint64_t nodeWraith::Slot_Presentation presentationint32_t orderbool openpub id: salamander::Strpub title: salamander::Strpub icon: salamander::Strpub parent: salamander::Strpub kind: salamander::Strpub node: u64pub presentation: wraith::SlotPresentationpub order: i32pub open: boolid: []const u8title: []const u8icon: []const u8parent: []const u8kind: []const u8node: u64presentation: Wraith.Slot.Presentationorder: i32open: boolsal_string idsal_string titlesal_string iconsal_string parentsal_string kinduint64_t nodeWraith_Slot_Presentation presentationint32_t orderbool openHubButton.Info
Section titled “HubButton.Info”A struct, 0x38 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | id |
string |
Unique for the plugin on the hub, which remembers where it was dragged by it. Can be empty |
| 0x10 | title |
string |
Its tooltip. Defaults to the plugin’s name |
| 0x20 | icon |
string |
A Lucide icon’s name, like “user” (see lucide.dev/icons), or its glyph from Wraith’s icon font. Empty shows the title’s first letter |
| 0x30 | order |
i32 |
Lower comes first, after Wraith’s own tiles |
id: stringtitle: stringicon: stringorder: numberid: stringtitle: stringicon: stringorder: integerstring Idstring Titlestring Iconint Ordersal::String idsal::String titlesal::String iconint32_t orderpub id: salamander::Strpub title: salamander::Strpub icon: salamander::Strpub order: i32id: []const u8title: []const u8icon: []const u8order: i32sal_string idsal_string titlesal_string iconint32_t orderwraith.io · Mods on the Hub · Get Wraith
Made with ♥ by Asgard
