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.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).
