Tweaks
Tweaks a plugin lists with the project’s own, and switching any tweak by name.
Tweaks.SwitchSubscription
Section titled “Tweaks.SwitchSubscription”cancel(): voidcancel()void Cancel()void cancel() constpub fn cancel(&self)fn cancel(self: Wraith.Tweaks.SwitchSubscription) voidvoid Wraith_Tweaks_SwitchSubscription_cancel(Wraith_Tweaks_SwitchSubscription self)cancel
Section titled “cancel”Fine to call twice, or from inside one.
Tweaks
Section titled “Tweaks”Get it with Api.tweaks().
add(definition: import("salamander").Given<Wraith.Tweaks.Definition>, handler: Wraith.Tweaks.Handler): voidaddIn(section: string, definition: import("salamander").Given<Wraith.Tweaks.Definition>, handler: Wraith.Tweaks.Handler): voidremove(id: string): voidaddHook(section: string, definition: import("salamander").Given<Wraith.Tweaks.Definition>, hook: Wraith.Hook | null): voidaddOpener(section: string, definition: import("salamander").Given<Wraith.Tweaks.Definition>, window: Wraith.Window | null): voidisOn(name: string): booleansetOn(name: string, on: boolean): voidonSwitched(handler: Wraith.Tweaks.Switched): Wraith.Tweaks.SwitchSubscriptionadd(definition: Wraith.Tweaks.Definition, handler: Wraith.Tweaks.Handler)addIn(section: string, definition: Wraith.Tweaks.Definition, handler: Wraith.Tweaks.Handler)remove(id: string)addHook(section: string, definition: Wraith.Tweaks.Definition, hook: Wraith.Hook|nil)addOpener(section: string, definition: Wraith.Tweaks.Definition, window: Wraith.Window|nil)isOn(name: string): booleansetOn(name: string, on: boolean)onSwitched(handler: Wraith.Tweaks.Switched): Wraith.Tweaks.SwitchSubscriptionvoid Add(Wraith.Tweaks.Definition definition, Wraith.Tweaks.Handler? handler)void AddIn(string section, Wraith.Tweaks.Definition definition, Wraith.Tweaks.Handler? handler)void Remove(string id)void AddHook(string section, Wraith.Tweaks.Definition definition, Wraith.Hook? hook)void AddOpener(string section, Wraith.Tweaks.Definition definition, Wraith.Window? window)bool IsOn(string name)void SetOn(string name, bool on)Wraith.Tweaks.SwitchSubscription? OnSwitched(Wraith.Tweaks.Switched? handler)sal::Result<void, Wraith::TweakError> add(Wraith::Tweaks_Definition definition, Wraith::Tweaks_Handler handler) constsal::Result<void, Wraith::TweakError> addIn(std::string_view section, Wraith::Tweaks_Definition definition, Wraith::Tweaks_Handler handler) constvoid remove(std::string_view id) constsal::Result<void, Wraith::TweakError> addHook(std::string_view section, Wraith::Tweaks_Definition definition, Wraith::Hook hook) constsal::Result<void, Wraith::TweakError> addOpener(std::string_view section, Wraith::Tweaks_Definition definition, Wraith::Window window) constsal::Result<bool, Wraith::TweakError> isOn(std::string_view name) constsal::Result<void, Wraith::TweakError> setOn(std::string_view name, bool on) constsal::Result<Wraith::Tweaks_SwitchSubscription, Wraith::TweakError> onSwitched(Wraith::Tweaks_Switched handler) constpub fn add(&self, definition: wraith::TweaksDefinition, handler: wraith::TweaksHandler) -> Result<(), wraith::TweakError>pub fn add_in(&self, section: &str, definition: wraith::TweaksDefinition, handler: wraith::TweaksHandler) -> Result<(), wraith::TweakError>pub fn remove(&self, id: &str)pub fn add_hook(&self, section: &str, definition: wraith::TweaksDefinition, hook: wraith::Hook) -> Result<(), wraith::TweakError>pub fn add_opener(&self, section: &str, definition: wraith::TweaksDefinition, window: wraith::Window) -> Result<(), wraith::TweakError>pub fn is_on(&self, name: &str) -> Result<bool, wraith::TweakError>pub fn set_on(&self, name: &str, on: bool) -> Result<(), wraith::TweakError>pub fn on_switched(&self, handler: wraith::TweaksSwitched) -> Result<wraith::TweaksSwitchSubscription, wraith::TweakError>fn add(self: Wraith.Tweaks, definition: Wraith.Tweaks.Definition, handler: Wraith.Tweaks.Handler) (Wraith.TweakError || rt.Failure)!voidfn addIn(self: Wraith.Tweaks, section: []const u8, definition: Wraith.Tweaks.Definition, handler: Wraith.Tweaks.Handler) (Wraith.TweakError || rt.Failure)!voidfn remove(self: Wraith.Tweaks, id: []const u8) voidfn addHook(self: Wraith.Tweaks, section: []const u8, definition: Wraith.Tweaks.Definition, hook: Wraith.Hook) (Wraith.TweakError || rt.Failure)!voidfn addOpener(self: Wraith.Tweaks, section: []const u8, definition: Wraith.Tweaks.Definition, window: Wraith.Window) (Wraith.TweakError || rt.Failure)!voidfn isOn(self: Wraith.Tweaks, name: []const u8) (Wraith.TweakError || rt.Failure)!boolfn setOn(self: Wraith.Tweaks, name: []const u8, on: bool) (Wraith.TweakError || rt.Failure)!voidfn onSwitched(self: Wraith.Tweaks, handler: Wraith.Tweaks.Switched) (Wraith.TweakError || rt.Failure)!Wraith.Tweaks.SwitchSubscriptionuint32_t Wraith_Tweaks_add(Wraith_Tweaks self, Wraith_Tweaks_Definition definition, Wraith_Tweaks_Handler handler)uint32_t Wraith_Tweaks_addIn(Wraith_Tweaks self, sal_string section, Wraith_Tweaks_Definition definition, Wraith_Tweaks_Handler handler)void Wraith_Tweaks_remove(Wraith_Tweaks self, sal_string id)uint32_t Wraith_Tweaks_addHook(Wraith_Tweaks self, sal_string section, Wraith_Tweaks_Definition definition, Wraith_Hook hook)uint32_t Wraith_Tweaks_addOpener(Wraith_Tweaks self, sal_string section, Wraith_Tweaks_Definition definition, Wraith_Window window)uint32_t Wraith_Tweaks_isOn(Wraith_Tweaks self, sal_string name, bool *out)uint32_t Wraith_Tweaks_setOn(Wraith_Tweaks self, sal_string name, bool on)uint32_t Wraith_Tweaks_onSwitched(Wraith_Tweaks self, Wraith_Tweaks_Switched handler, Wraith_Tweaks_SwitchSubscription *out)Until removed or the plugin goes. The same id replaces it and keeps it on.
Fails with TweakError. Uses Tweaks.Definition, Tweaks.Handler.
Like add, under a heading like Combat. Empty is none.
Fails with TweakError. Uses Tweaks.Definition, Tweaks.Handler.
remove
Section titled “remove”Waits for its handler if it’s running, unless called from inside it.
addHook
Section titled “addHook”A toggle that enables hook while on. The definition’s mode and fields are ignored.
Fails with TweakError. Uses Tweaks.Definition, Hook.
addOpener
Section titled “addOpener”An open button that opens and focuses window.
Fails with TweakError. Uses Tweaks.Definition, Window.
Whether a tweak’s box is on, by saved name. A group’s own box, not its contents. Any thread.
Fails with TweakError.
Switches it next frame, like clicking its box. Fine from inside any handler.
Fails with TweakError.
onSwitched
Section titled “onSwitched”Hears every tweak go on or off. Gone with the plugin.
Fails with TweakError. Uses Tweaks.Switched, Tweaks.SwitchSubscription.
TweakError
Section titled “TweakError”What can go wrong, besides Cancelled, Unsupported and Gone.
| Code | Error | |
|---|---|---|
| 1 | InvalidId |
Empty, too long, or not letters, digits, _, - and . |
| 2 | InvalidDefinition |
A key that isn’t one, or a field with no name |
| 3 | NotFound |
No tweak or group’s saved by that name |
| 4 | Failed |
Tweaks.Mode
Section titled “Tweaks.Mode”An enum of u8.
| Value | Name | |
|---|---|---|
| 0 | toggle |
On until it’s turned off |
| 1 | action |
Runs once, then everything it did goes back |
| 2 | open |
An action that opens something, like a window. Shown with an open button. |
Tweaks.FieldType
Section titled “Tweaks.FieldType”An enum of u8.
| Value | Name | |
|---|---|---|
| 0 | f64 |
|
| 1 | f32 |
|
| 2 | i64 |
|
| 3 | i32 |
|
| 4 | i16 |
|
| 5 | i8 |
|
| 6 | u64 |
|
| 7 | u32 |
|
| 8 | u16 |
|
| 9 | u8 |
|
| 10 | bool |
Tweaks.Choice
Section titled “Tweaks.Choice”A struct, 0x18 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | value |
f64 |
|
| 0x8 | label |
string |
value: numberlabel: stringvalue: numberlabel: stringdouble Valuestring Labeldouble valuesal::String labelpub value: f64pub label: salamander::Strvalue: f64label: []const u8double valuesal_string labelTweaks.Field
Section titled “Tweaks.Field”Like a tweak’s @data, but no memory: changes go to the handler.
A struct, 0x70 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | name |
string |
|
| 0x10 | type |
Tweaks.FieldType |
|
| 0x18 | value |
f64 |
|
| 0x20 | label |
string |
Empty shows the name |
| 0x30 | toggle |
bool |
A checkbox for 0 and 1 |
| 0x31 | hex |
bool |
|
| 0x32 | has_min |
bool |
Limits, each only with its has_ |
| 0x38 | min |
f64 |
|
| 0x40 | has_max |
bool |
|
| 0x48 | max |
f64 |
|
| 0x50 | key |
string |
Flips a toggle, like F9. Empty is none. |
| 0x60 | choices |
[]Tweaks.Choice |
A dropdown |
name: stringtype: Wraith.Tweaks.FieldType | Wraith.Tweaks.FieldTypeNamevalue: numberlabel: stringtoggle: booleanhex: booleanhas_min: booleanmin: numberhas_max: booleanmax: numberkey: stringchoices: Array<Wraith.Tweaks.Choice>name: stringtype: Wraith.Tweaks.FieldType|Wraith.Tweaks.FieldTypeNamevalue: numberlabel: stringtoggle: booleanhex: booleanhas_min: booleanmin: numberhas_max: booleanmax: numberkey: stringchoices: (Wraith.Tweaks.Choice)[]string NameWraith.Tweaks.FieldType Typedouble Valuestring Labelbool Togglebool Hexbool HasMindouble Minbool HasMaxdouble Maxstring KeyWraith.Tweaks.Choice[] Choicessal::String nameWraith::Tweaks_FieldType typedouble valuesal::String labelbool togglebool hexbool has_mindouble minbool has_maxdouble maxsal::String keysal::Slice<Wraith::Tweaks_Choice> choicespub name: salamander::Strpub r#type: wraith::TweaksFieldTypepub value: f64pub label: salamander::Strpub toggle: boolpub hex: boolpub has_min: boolpub min: f64pub has_max: boolpub max: f64pub key: salamander::Strpub choices: salamander::Slice<wraith::TweaksChoice>name: []const u8@"type": Wraith.Tweaks.FieldTypevalue: f64label: []const u8toggle: boolhex: boolhas_min: boolmin: f64has_max: boolmax: f64key: []const u8choices: []const Wraith.Tweaks.Choicesal_string nameWraith_Tweaks_FieldType typedouble valuesal_string labelbool togglebool hexbool has_mindouble minbool has_maxdouble maxsal_string keySlice_Wraith_Tweaks_Choice choicesTweaks.Definition
Section titled “Tweaks.Definition”A struct, 0x48 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | id |
string |
Kept with the user’s settings |
| 0x10 | title |
string |
Empty shows the id. |
| 0x20 | key |
string |
Like Ctrl+F8. Empty is none. |
| 0x30 | mode |
Tweaks.Mode |
|
| 0x38 | fields |
[]Tweaks.Field |
id: stringtitle: stringkey: stringmode: Wraith.Tweaks.Mode | Wraith.Tweaks.ModeNamefields: Array<Wraith.Tweaks.Field>id: stringtitle: stringkey: stringmode: Wraith.Tweaks.Mode|Wraith.Tweaks.ModeNamefields: (Wraith.Tweaks.Field)[]string Idstring Titlestring KeyWraith.Tweaks.Mode ModeWraith.Tweaks.Field[] Fieldssal::String idsal::String titlesal::String keyWraith::Tweaks_Mode modesal::Slice<Wraith::Tweaks_Field> fieldspub id: salamander::Strpub title: salamander::Strpub key: salamander::Strpub mode: wraith::TweaksModepub fields: salamander::Slice<wraith::TweaksField>id: []const u8title: []const u8key: []const u8mode: Wraith.Tweaks.Modefields: []const Wraith.Tweaks.Fieldsal_string idsal_string titlesal_string keyWraith_Tweaks_Mode modeSlice_Wraith_Tweaks_Field fieldsTweaks.EventKind
Section titled “Tweaks.EventKind”An enum of u8.
| Value | Name | |
|---|---|---|
| 0 | on |
Turned on, or an action run. Each field comes as a changed just before. |
| 1 | off |
|
| 2 | changed |
A field’s value, before on or when it changes while on |
Tweaks.Event
Section titled “Tweaks.Event”A struct, 0x20 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | kind |
Tweaks.EventKind |
|
| 0x8 | field |
string |
For changed |
| 0x18 | value |
f64 |
kind: Wraith.Tweaks.EventKind | Wraith.Tweaks.EventKindNamefield: stringvalue: numberkind: Wraith.Tweaks.EventKind|Wraith.Tweaks.EventKindNamefield: stringvalue: numberWraith.Tweaks.EventKind Kindstring Fielddouble ValueWraith::Tweaks_EventKind kindsal::String fielddouble valuepub kind: wraith::TweaksEventKindpub field: salamander::Strpub value: f64kind: Wraith.Tweaks.EventKindfield: []const u8value: f64Wraith_Tweaks_EventKind kindsal_string fielddouble valueTweaks.Handler
Section titled “Tweaks.Handler”On the render thread. Failing an on keeps it off and shows the error (a script’s throw).
Wraith.Tweaks.HandlerWraith.Tweaks.HandlerWraith.Tweaks.HandlerWraith::Tweaks_Handlerwraith::TweaksHandlerWraith.Tweaks.HandlerWraith_Tweaks_HandlerTweaks.Switched
Section titled “Tweaks.Switched”A tweak went on or off, by saved name like kai/Combat/Max bravery. Render thread, after the frame it changed.
Wraith.Tweaks.SwitchedWraith.Tweaks.SwitchedWraith.Tweaks.SwitchedWraith::Tweaks_Switchedwraith::TweaksSwitchedWraith.Tweaks.SwitchedWraith_Tweaks_Switchedwraith.io · Mods on the Hub · Get Wraith
Made with ♥ by Asgard
