List
Lists of a plugin’s things, like lights, that Wraith shows for the player to pick from. The plugin supplies items; Wraith keeps the picks and sends button presses back. Any thread.
ItemList
Section titled “ItemList”set(items: Array<import("salamander").Given<Wraith.ItemList.Item>>): voidselected(): Array<bigint>select(id: number | bigint): voiddeselect(id: number | bigint): voiddraw(): voidclose(): voidset(items: (Wraith.ItemList.Item)[])selected(): (integer)[]select(id: integer)deselect(id: integer)draw()close()void Set(System.Collections.Generic.IReadOnlyList<Wraith.ItemList.Item> items)ulong[] Selected()void Select(ulong id)void Deselect(ulong id)void Draw()void Close()void set(std::span<const Wraith::ItemList_Item> items) conststd::span<const uint64_t> selected() constvoid select(uint64_t id) constvoid deselect(uint64_t id) constvoid draw() constvoid close() constpub fn set(&self, items: &[wraith::ItemListItem])pub fn selected(&self) -> &[u64]pub fn select(&self, id: u64)pub fn deselect(&self, id: u64)pub fn draw(&self)pub fn close(&self)fn set(self: Wraith.ItemList, items: []const Wraith.ItemList.Item) voidfn selected(self: Wraith.ItemList) []const u64fn select(self: Wraith.ItemList, id: u64) voidfn deselect(self: Wraith.ItemList, id: u64) voidfn draw(self: Wraith.ItemList) voidfn close(self: Wraith.ItemList) voidvoid Wraith_ItemList_set(Wraith_ItemList self, Slice_Wraith_ItemList_Item items)Slice_u64 Wraith_ItemList_selected(Wraith_ItemList self)void Wraith_ItemList_select(Wraith_ItemList self, uint64_t id)void Wraith_ItemList_deselect(Wraith_ItemList self, uint64_t id)void Wraith_ItemList_draw(Wraith_ItemList self)void Wraith_ItemList_close(Wraith_ItemList self)Everything in it, whenever that changes. The first is the primary.
Uses ItemList.Item.
selected
Section titled “selected”What’s picked of what’s listed, in pick order, or the default. Good till the thread’s next call into Wraith.
select
Section titled “select”Picks id as the player would. With one it replaces the pick, and 0 picks nothing.
deselect
Section titled “deselect”Draws it in a window of the plugin’s own. Render thread, inside a frame callback.
Gone from Wraith; picks are still kept. Fine to call twice.
Get it with Api.lists().
open(id: string, options: import("salamander").Given<Wraith.ItemList.Options>, add: Wraith.ItemList.Add | null, remove: Wraith.ItemList.Remove | null, rename: Wraith.ItemList.Rename | null): Wraith.ItemListopen(id: string, options: Wraith.ItemList.Options, add: Wraith.ItemList.Add|nil, remove: Wraith.ItemList.Remove|nil, rename: Wraith.ItemList.Rename|nil): Wraith.ItemListWraith.ItemList? Open(string id, Wraith.ItemList.Options options, Wraith.ItemList.Add? add, Wraith.ItemList.Remove? remove, Wraith.ItemList.Rename? rename)sal::Result<Wraith::ItemList, Wraith::ListError> open(std::string_view id, Wraith::ItemList_Options options, Wraith::ItemList_Add add, Wraith::ItemList_Remove remove, Wraith::ItemList_Rename rename) constpub fn open(&self, id: &str, options: wraith::ItemListOptions, add: wraith::ItemListAdd, remove: wraith::ItemListRemove, rename: wraith::ItemListRename) -> Result<wraith::ItemList, wraith::ListError>fn open(self: Wraith.Lists, id: []const u8, options: Wraith.ItemList.Options, add: ?Wraith.ItemList.Add, remove: ?Wraith.ItemList.Remove, rename: ?Wraith.ItemList.Rename) (Wraith.ListError || rt.Failure)!Wraith.ItemListuint32_t Wraith_Lists_open(Wraith_Lists self, sal_string id, Wraith_ItemList_Options options, Wraith_ItemList_Add add, Wraith_ItemList_Remove remove, Wraith_ItemList_Rename rename, Wraith_ItemList *out)id is unique for the plugin: letters, digits, _, - and .. Each callback passed adds its
button. Gone with the plugin.
Fails with ListError. Uses ItemList.Options, ItemList.Add, ItemList.Remove, ItemList.Rename, ItemList.
ListError
Section titled “ListError”What can go wrong, besides Cancelled, Unsupported and Gone.
| Code | Error | |
|---|---|---|
| 1 | InvalidId |
|
| 2 | AlreadyOpen |
|
| 3 | Failed |
ItemList.Item
Section titled “ItemList.Item”A struct, 0x30 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | id |
u64 |
Stable while it’s around, like its address. Not 0 |
| 0x8 | name |
string |
Picks are kept by name too, so they carry over when the id changes |
| 0x18 | detail |
string |
Shown on hover. Can be empty |
| 0x28 | current |
bool |
The one in use now, like the camera on screen |
id: bigintname: stringdetail: stringcurrent: booleanid: integername: stringdetail: stringcurrent: booleanulong Idstring Namestring Detailbool Currentuint64_t idsal::String namesal::String detailbool currentpub id: u64pub name: salamander::Strpub detail: salamander::Strpub current: boolid: u64name: []const u8detail: []const u8current: booluint64_t idsal_string namesal_string detailbool currentItemList.Pick
Section titled “ItemList.Pick”How many the player can pick.
An enum of u8.
| Value | Name | |
|---|---|---|
| 0 | none |
|
| 1 | one |
|
| 2 | many |
ItemList.Options
Section titled “ItemList.Options”A struct, 0x28 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | title |
string |
Defaults to the id |
| 0x10 | pick |
ItemList.Pick |
|
| 0x11 | current_by_default |
bool |
While nothing picked is listed, the current one counts as picked, else the first |
| 0x12 | remember |
bool |
Keeps picks for next time the game starts |
| 0x18 | current_label |
string |
Beside the current one, like “On screen”. Defaults to “Current” |
title: stringpick: Wraith.ItemList.Pick | Wraith.ItemList.PickNamecurrent_by_default: booleanremember: booleancurrent_label: stringtitle: stringpick: Wraith.ItemList.Pick|Wraith.ItemList.PickNamecurrent_by_default: booleanremember: booleancurrent_label: stringstring TitleWraith.ItemList.Pick Pickbool CurrentByDefaultbool Rememberstring CurrentLabelsal::String titleWraith::ItemList_Pick pickbool current_by_defaultbool remembersal::String current_labelpub title: salamander::Strpub pick: wraith::ItemListPickpub current_by_default: boolpub remember: boolpub current_label: salamander::Strtitle: []const u8pick: Wraith.ItemList.Pickcurrent_by_default: boolremember: boolcurrent_label: []const u8sal_string titleWraith_ItemList_Pick pickbool current_by_defaultbool remembersal_string current_labelItemList.Add
Section titled “ItemList.Add”The player pressed add. List the new one, and select it if it should be picked. Render thread.
Wraith.ItemList.AddWraith.ItemList.AddWraith.ItemList.AddWraith::ItemList_Addwraith::ItemListAddWraith.ItemList.AddWraith_ItemList_AddItemList.Remove
Section titled “ItemList.Remove”The player pressed remove on id. Render thread.
Wraith.ItemList.RemoveWraith.ItemList.RemoveWraith.ItemList.RemoveWraith::ItemList_Removewraith::ItemListRemoveWraith.ItemList.RemoveWraith_ItemList_RemoveItemList.Rename
Section titled “ItemList.Rename”The player renamed id. List it again with its new name. Render thread.
Wraith.ItemList.RenameWraith.ItemList.RenameWraith.ItemList.RenameWraith::ItemList_Renamewraith::ItemListRenameWraith.ItemList.RenameWraith_ItemList_Renamewraith.io · Mods on the Hub · Get Wraith
Made with ♥ by Asgard
