SeneaL API
Public API for Valheim UI mods: notices, dialogs and HUD elements, with a bridge that routes the game's own windows to any UI that registers as a provider.1.2.0
- HUD elements can be customised by the player as fully as the UI mod's own: a mod declares what the player may change and the UI provider shows it in its HUD editor, stores it in the player's profile and hands the values back. Features
hud.look,hud.options,hud.skins.element.Looks(HudLooks:Panel,Accent,Background,Transparency,TextSize,Caption,All) turns on the provider's standard look settings for the element. The resolved values arrive inelement.Style(HudStyle: panel and accent colors, background, transparency with the global value already applied, text scale, size) andelement.StyleChangedfires when they change. WithTextSizethe provider also resizes the TextMeshPro texts under the element; withCaptionit draws the caption itself.element.AddSkin(id, title, preview)adds named skins; the player picks one,element.Skin/CurrentSkintell which,SkinChangedfires. The first skin is the default.element.AddToggle / AddChoice / AddSlider / AddColor / AddTextadd the mod's own settings (HudOption: tab, section, label, enabled check, value format). Values are checked (slider range and step, color hex, text length),option.Changedandelement.OptionChangedfire on every change, from the player or fromoption.Setin the mod.HudProvider.Updated(element)tells a provider that looks, skins or options of an element changed after it was added.
- Gauges:
HudGauges.Add(owner, id, title)hands a value (Set(value, max)) to the UI provider, which draws it in its own style as a bar, column, ring, half ring or square (Shape,Shapesoffered to the player), with color stops (AddStop(at, color),Blend), a pulse belowWarn, a readout (Readout,Text), anIcon, a default place (Anchor,Offset) and size (Length,Thickness,Diameter). The provider puts it into its HUD editor, where the player picks the shape, size, readout and stop colors.Hostedis false (andHostedChangedfires) while nobody draws it, so the mod shows its own bar then. Featurehud.gauges. - One file: the package no longer has a
patchersfolder, everything is inplugins/SeneaL-API/SeneaL-API.dll. Some mod managers (Vortex, some Gale setups) put the patcher folder over the plugin folder, and then the game did not find SeneaL API at all ("missing dependencies: seneaL.valheim.api"). The AzuEPI stub routing now starts from a second small plugin in the same dll (SeneaL API Early, GUID__seneaL.valheim.api.early), which BepInEx loads before every other plugin, so it still reaches the stubs before their mods start. An oldBepInEx/patchers/SeneaL-APIleft from an earlier version still works for that run and the log asks to delete it.
1.1.0
- Character screen tabs:
CharacterTabs.Add(owner, id, title, open)puts a tab into the UI mod's tab row on the character screen (title, PhosphorIconNameor ownIcon,Order,Visible,Activewhile the mod's window is open, aBadgenumber,Tip); a click calls the mod'sOpen.CharacterTabs.Hostedtells the mod that a UI mod draws the tabs. Featuretabs. - Docked containers:
ContainerDocks.Add(owner, id, match, title)marks containers that a mod opens as pockets (backpacks, portal or ship storage); the UI mod docks them under the inventory instead of showing a chest window and keeps them out of its chest automation. Featurecontainers.dock.
1.0.1
- Linked slots:
SlotDef.PutandSlotDef.Take(Func<Player, ItemData, bool>) let a mod store and take out the item itself instead of the game'sEquipItem/UnequipItem, for cells that hold items without wearing them (potions, keys, a mod's own storage cells). Without them a Linked slot works as before. Featureslots.handlers.
1.0.0
-
Mod settings:
ModSettings.Addputs another mod's BepInEx entries into the UI mod's settings window (keys into its key list with clash warnings, switches, choices and sliders into its mods page); labels, tips and choice names are functions so they follow the language. Featuresettings. -
Theme:
Themes.Icon(name)returns an icon by its Phosphor name. Featuretheme.icons. -
Dialogs:
Dialogs.Chooseopens a dialog with up to four buttons (DialogButton: text, click, primary),CancelIndexsets what Esc picks;Dialog.Centeredcenters the text of any dialog. Without a provider the game's yes / no window takes the first two buttons. Featuredialogs.choice. -
Theme:
Themeshands out the installed UI mod's fonts, 9-sliced sprites (window, card, button, field, row, tab, track, chip) and colors, so another mod can build its own window that looks like the rest of the interface; without a provider every call returns nothing and the mod keeps its own look. Featuretheme.
First version.
New:
- Notices: show top-left, center, unlock and biome banners through
Notices, with a vanilla fallback when no UI provider is registered. - Dialogs: confirm, message and text input windows through
Dialogs, with a vanilla fallback. - HUD elements: any mod can register a
RectTransformwithHudElementsso a UI provider can move, resize and style it. - Providers: a UI mod registers one provider per feature; dialogs open in a provider that goes away are shown again by the next one or by the vanilla window, and dialogs left over from the previous scene are dropped.
- Slots: mods add their own inventory slots with
CustomSlots(Stored or Worn, with an accept check, visibility, order and a change callback); the UI provider stores, draws and persists them. - Linked slots:
SlotMode.Linkedwith aSourceshows an item that lives somewhere else (usually the inventory) in a slot; putting an item in equips it through the game (an item already in the slot is unequipped first, so the new one takes that slot), emptying the slot unequips it, andChangedfires when the item changes. Contract 2. - AzuEPI bridge: when Azumatt's AzuEPI is installed, the equipment slots other mods add through its API are mirrored as Linked slots, so a UI provider shows them next to the slots of this API. AzuEPI keeps running them.
Bridge / AzuEPIturns it off. - AzuEPI API stubs: a small patcher (
BepInEx/patchers/SeneaL-API) loads before the plugins and routes the AzuEPI API stub that some mods carry inside their own dll (all its methods do nothing, so such a mod never reaches AzuEPI) to this API.IsLoaded()answers true when AzuEPI or SeneaL UI is installed,AddSlotgoes to the real AzuEPI if it is installed and is emulated as a Linked slot (merged by name, like AzuEPI does) otherwise. Mods the UI mod already supports itself (Jewelcrafting, BowsBeforeHoes, BetterArchery, EpicLoot and AdventureBackpacks) are left alone by default:Bridge / AzuEPIStubIgnore;Bridge / AzuEPIStubsturns it off. Needs a game restart. A slot that reaches this API through AzuEPI or a stub carries the name of the mod that added it inSlotDef.Origin. - HUD placement:
HudElement.Placedis set by the UI provider while the player has put the element at a place of their own, so a mod that moves its element itself can leave it alone then;HudElements.Find(owner, id)returns one element. Featurehud.placed. - Slot origin: the API now notes which mod adds a slot at the moment of the
AddSlotcall (a hook on the real AzuEPI API and the stub calls), soSlotDef.Originnames the right mod even when the mod passes a prefab name instead of functions or keeps its functions in a helper dll. CustomSlots.AzuManaged: a UI provider that gives the inventory to AzuEPI turns the AzuEPI mirroring and the stub emulation off, so AzuEPI shows the slots of other mods itself.- Slots:
SlotDef.IconNamenames a Phosphor icon (regular weight, e.g."flask") for the empty slot; the UI provider draws it,Icon(a Sprite) still wins. Featureslots.icon. - Slots: using an item that a mod slot accepts (right click, hotbar key, gamepad) puts it into that slot instead of the game's own equipment slot (a ring of type
Utilityused to replace the belt).SlotDef.EquipOnUse = falsekeeps the game's use. Featureslots.use. The README says when to pickWornand whenLinked. - Slots:
SlotDef.EquipTime(Worn slots wait for the game's equip bar: the item's own time by default, 0 for instant, or seconds) andSlotDef.Place(Auto,RoworDoll: the slot can sit on the equipment block instead of the Mod slots row). Featuresslots.timeandslots.place. - Bridge: the game's own
MessageHud,UnifiedPopupandTextInputcalls are routed to the registered providers, so every mod that uses the vanilla windows gets the provider's look. Each bridge can be turned off in the config.
Fixed:
- Dialogs: the text input and popup bridge runs after other mods' prefixes and stays out when one of them already took the call over (XPortal opens its own portal window from
TextInput.RequestText; a second, empty name window used to open over it).
