You are viewing a potentially older version of this package. View all versions.
DarthVladi-ValHUD-1.0.0 icon

ValHUD

Fully customizable HUD: health, stamina, eitr and adrenaline bars, food and Forsaken power slots, glows, custom icons and fonts, and shareable layouts.

Date uploaded 3 days ago
Version 1.0.0
Download link DarthVladi-ValHUD-1.0.0.zip
Downloads 17
Dependency string DarthVladi-ValHUD-1.0.0

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2350 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2350

README

ValHUD — Customizable HUD for Valheim (v1.0.0)

Replaces the vanilla health, stamina, eitr, adrenaline, food and Forsaken power HUD. Every element is independent: its own position, anchor, rotation, size, shape, orientation, colors, text style and effects. Nothing visual is global. Inside each element, texts and icons have their own positions too. Shapes are drawn with a generated mesh (no AssetBundles). Numbers use Russo One; bar icons are PNGs (Phosphor Icons).

Building

Requirements: Visual Studio 2022 (".NET desktop development" workload) or .NET SDK 6+.

Open ValHUD.sln and build (Ctrl+Shift+B), or from a terminal: dotnet build -c Release.

Paths live in ValHUD.csproj (the "Local paths" block):

  • Game DLLs: F:\SteamLibrary\steamapps\common\Valheim\valheim_Data\Managed
  • BepInEx (r2modman "Vanilla" profile): F:\Valheim Mods\r2modman Data\Valheim\profiles\Vanilla\BepInEx

After building, ValHUD.dll, its .pdb, the fonts folder (Russo One + license) and the icons folder are copied to ...\profiles\Vanilla\BepInEx\plugins\ValHUD\. Launch the game from r2modman with the Vanilla profile.

Hierarchy

hudroot (vanilla, hidden with Ctrl+F3)
└─ ValHUD (full screen)   General → Scale / OffsetX / OffsetY apply to every element
   ├─ HealthBar           each element: own Anchor + X/Y + rotation + size + colors
   ├─ StaminaBar
   ├─ EitrBar             only while the player's max eitr is above 0
   ├─ AdrenalineBar       only while the player's max adrenaline is above 0 (e.g. a trinket)
   ├─ ForsakenPower
   ├─ Food1
   ├─ Food2
   └─ Food3

X/Y/anchor/rotation/scale/offset changes only move elements (no rebuild). The upcoming Edit mode (drag with the mouse) will write to those same settings through IHudMovable.

Configuration (grouped by element)

BepInEx/config/valhud.customhud.cfg, or ConfigurationManager (F1 in game): every number has a slider plus a text field for exact values, and changes apply instantly.

Section Contents
00. General Layout panel (see Layouts), Enabled, Scale, OffsetX/Y, NumberFont, TextFont
01. Health / 02. Stamina / 03. Eitr / 04. Adrenaline Bar Shape: Visible, Anchor, X, Y, Rotation, Orientation, FillDirection, Length, Thickness, StartShape, StartSlant, EndShape, EndSlant, ScaleLengthWithMax, ScaleFullAt · Colors: Color, ColorEnd, Gradient, BackgroundColor, OutlineThickness, OutlineColor, TrailColor · Divisions: Divisions, DivisionRule, DivisionColor, DivisionWidth · Value: ShowValue, ValueFormat, ValueFontSize, ValueColor, ValueAttach, ValueAlign, ValueX, ValueY · Icon: ShowIcon, IconFile, IconSize, IconColor, IconAttach, IconX, IconY, IconShadow*, IconOutline*, IconGlow* · Text: TextOutline*, TextShadow* · Effects: Shadow*, Glow*, Shine*
05. Forsaken Power Visible, Anchor, X, Y, Rotation, Size, Shape, Color, ColorEnd, Gradient, BorderWidth, BorderColor, IconSize/X/Y, TextColor, LabelFontSize/X/Y (cooldown), ShowName, NameFontSize/X/Y, Text*, Shadow*, Glow*, GlowWhenReady, ReadyGlowPulse, CustomIcons, ShowBackground, GlowAround, EmptyMarkerColor
06. Food 1 … 08. Food 3 Same as the power (the label is the timer, no name) + BlinkWhenEdible, ShowWhenEmpty, ApplyStyleToOtherFoods
92. Vanilla HUD Which vanilla elements to hide (adrenaline included), HideKeyHints (the control hints: "Attack Mouse-1", "Block", "Dodge", build/inventory hints)

Bars

  • ForceVisible (eitr and adrenaline only): keeps the bar on screen at 75 % even if the player has no eitr or adrenaline, so it can be placed and styled. It only changes what is drawn, never the player's values, and it is not saved in layouts. Turn it off when you are done.
  • FillDirection: Normal fills left → right (bottom → top when vertical); Reversed fills right → left (top → bottom). X/Y is always the point where the fill starts.
  • StartShape / EndShape: each end has its own shape, Flat, Forward /, Backward \, Notch (cut inward) or Point (tip outward), and its own depth (StartSlant / EndSlant, in pixels). Forward on both ends makes a parallelogram; Point on both ends makes a hexagon.
  • ScaleLengthWithMax: the bar grows with the max value (like vanilla) and reaches its full Length at ScaleFullAt points (default 300). It never gets longer than Length, so it can't run off the screen.
  • Divisions: a mark every N points, N chosen from the bar's max with DivisionRule (default 100:10, 200:20, 25 = up to 100 → every 10, up to 200 → every 20, above → every 25). The spacing updates by itself as the max changes (food, armor, trinkets).
  • Value and icon positions: ValueAttach / IconAttach pick a point of the bar as seen on screen: the middle of its Left, Right, Top or Bottom side, or its Center (inside it). Picking one also resets ValueX/ValueY (or IconX/IconY) to a small gap outward and ValueAlign to match, so the value lands where you picked; then fine-tune with X/Y. ValueAlign says which side of the text touches the point (Left = the text starts there, Right = it ends there). Number inside the bar: ValueAttach = Center.

Icons

IconFile names a PNG in plugins/ValHUD/icons/ (white on transparent; it is tinted with IconColor). Empty = the built-in vector icon. Bundled, from Phosphor Icons (MIT, see icons/LICENSE-Phosphor.txt): first-aid.png (health), sneaker-move.png (stamina; person-simple-run.png is still included), sparkle.png (eitr), fire.png (adrenaline). Any other PNG dropped in that folder can be used by name.

Icon effects (each bar, separate from the bar's own effects): IconShadow (+ color, offset), IconOutlineWidth (+ color; 0 = none) and IconGlow (+ color, size, intensity). Outline and glow follow the icon's own shape; they are made once per icon from the PNG (the built-in vector icons only get the shadow).

Forsaken power icons

Any power's icon can be replaced with your own PNG: put it in plugins/ValHUD/icons/powers/ named after the power's internal name. The names don't depend on the game's language:

Power File
Eikthyr GP_Eikthyr.png
The Elder GP_TheElder.png
Bonemass GP_Bonemass.png
Moder GP_Moder.png
Yagluth GP_Yagluth.png
The Queen GP_Queen.png
Fader GP_Fader.png

All seven are bundled (restyled from the game's icons).

The first time you select a power, the log says which file it looks for (ValHUD: Forsaken power "..."), so a power that isn't in this table (another mod's, say) works the same way. The PNG is shown with its own colors; a transparent background works best. Powers without a file keep the game's icon. 05. Forsaken Power → CustomIcons turns the feature off.

Glow per boss

Each Forsaken power has its own glow section (05.a Glow - Eikthyr, 05.b Glow - The Elder, ... 05.g Glow - Fader) with UseOwnGlow, GlowColor, GlowSize, GlowIntensity, OutlineWidth and OutlineColor (a solid outline around the icon, for icons that get lost against the background), so every boss icon can have the glow that suits it. The section replaces the glow settings of 05. Forsaken Power while that power is selected; the glow still shows only if GlowEnabled or GlowWhenReady is on there. Turn UseOwnGlow off to use the general glow instead. These settings are saved in layouts like everything else (layouts saved before these settings existed get the defaults).

Slot background and icon glow (power and foods)

  • ShowBackground off hides the slot's fill and border, leaving only the icon and its texts.
  • GlowAround = Icon makes the glow follow the icon's own silhouette (a blurred copy of the icon, made once per icon, for PNGs and game icons alike) instead of the slot's shape. GlowSize, GlowIntensity, GlowColor, GlowWhenReady and ReadyGlowPulse work the same way.

Fonts

00. General → NumberFont (bar values, timers, cooldowns) and TextFont (the power's name) are lists of every .ttf/.otf in plugins/ValHUD/ or plugins/ValHUD/fonts/, plus Game (the game's font). To add a font, drop the file in one of those folders and restart the game; it then appears in both lists. Characters a font doesn't have are taken from the game font. If a font can't be loaded, the log says why and the game font is used.

Food slots

ApplyStyleToOtherFoods works as a button: turn it on in one food section and its whole style (everything except Visible, Anchor, X and Y) is copied to the other two food slots; it then switches itself off.

Effects (per element)

  • Shadow: ShadowEnabled, ShadowColor, ShadowOffsetX/Y (always falls the same way on screen, even on rotated, vertical or reversed elements).
  • Glow: GlowEnabled, GlowColor, GlowSize, GlowIntensity (1 = soft fade; up to 3 = brighter and more solid; below 1 = fainter). Forsaken power: GlowWhenReady shows the glow only while the power can be used, and ReadyGlowPulse makes it pulse gently.
  • Shine (bars): a glass-like highlight plus a soft shade; ShineEnabled, ShineStrength.
  • Text: outline and drop shadow of each element's texts (TextOutlineWidth/Color, TextShadow*).

Built-in layouts

Embedded in ValHUD.dll (source: assets/layouts/*.json), read-only, loaded from the layout panel:

Layout
DarthVladi The default on a fresh install
DarthVladi Green DarthVladi with green stamina
Flat
Skyrim
Tilted

To change one, load it and use Save as. A saved layout with the same name as a built-in one takes its place. To add a built-in layout, put its .json in assets/layouts/ and rebuild.

The default value of every setting (used for settings a layout file doesn't have) comes from src/Config/Presets.Data.cs, generated by tools/preset-design/emit.py.

Layouts (loading, saving, sharing)

Layouts work like documents in any editor. Everything is in one panel at the top of 00. General in the settings window (F1):

Layout: My Skyrim Classic   your layout
● Unsaved changes. Save writes them to "My Skyrim Classic"; Revert drops them.
[ Save ] [ Revert ] [ Delete ]
New name: [ My Skyrim Classic copy ] [ Save as ]
Built-in layouts:  [DarthVladi] [DarthVladi Green] [Flat] [Skyrim] [Tilted]
Your layouts:      [● My Skyrim Classic] [Raid HUD] ...
[ Open layouts folder ]
  • The HUD always shows your current values. They are kept between sessions on their own; nothing is lost when you quit, even unsaved changes.
  • The header always says which layout is loaded, whether it is a built-in layout (read-only) or one of your layouts, and whether it has unsaved changes.
  • Click a layout to load it. It replaces the current values. If you have unsaved changes, the first click warns you and a second click confirms.
  • Save writes your changes into the current layout. It is only available for your own layouts.
  • Save as writes what you see into a new layout with the name you type, and switches to it. The layout you started from is not changed. This is how you create a layout from a built-in one or copy one of your layouts.
  • Revert drops your unsaved changes by loading the current layout again.
  • Delete removes the current layout's file (your layouts only). The values stay on screen as an unsaved layout.

Edits are never written to a layout file by themselves, so trying things out is always safe.

Layout files live in BepInEx/config/ValHUD/layouts/<name>.json. A layout stores every element's settings plus Scale, OffsetX/Y and NumberFont. It does not store Enabled, the vanilla-HUD switches or the ForceVisible testing switches. Settings missing from a file get their default value and unknown ones are ignored, so files keep working across mod versions.

Safety: reading a layout never stops the game. A file that is empty, too large, not valid JSON or has no settings is renamed to <name>.json.corrupt, the panel says why, and your HUD stays as it was. Files are written to a temporary file first, so a crash can't leave a half-written layout.

Sharing: send the .json file. Whoever receives it puts it in the layouts folder (the panel has a button that opens it) and clicks it in the panel. If the layout uses custom icons (IconFile), the PNGs go in plugins/ValHUD/icons/ too. Bundled icons need nothing extra.

Without the settings window: with the game closed, write a layout name in 00. General → Layout in valhud.customhud.cfg; it is loaded at startup.

Structure

src/Plugin.cs                  Bootstrap + Harmony + change routing
src/HudPatches.cs              Postfix on Hud.Awake / Hud.Update
src/ValHudController.cs        Container, element creation, relayout
src/Config/HudConfig.cs        Global sections, resolution, food style copy
src/Config/HudConfig.Layouts.cs Layout model: load, save, save as, revert, delete, unsaved-changes tracking
src/Config/LayoutPanel.cs      The layout panel drawn in the settings window (F1)
src/Persistence/LayoutStore.cs Layout files: safe read/write
src/Persistence/Json.cs        Small JSON reader/writer (no dependencies)
src/KeyHintsPatch.cs           Hides the vanilla control hints
src/Config/ElementConfig.cs    Per-element sections (BarConfig, SlotConfig)
src/Config/HudLayout.cs        Enums and resolved specs (bars, slots, text style, effects)
src/Config/LayoutDefaults.cs   Default placement of values, icons and labels
src/Config/DivisionRule.cs     "100:10, 200:20, 25" → division spacing
src/Config/Presets*.cs         Default value of every setting
src/Core/FontManager.cs        Game font + Russo One, per-style text materials
src/Core/IconLoader.cs         PNG icons from the icons folder
src/Core/VanillaHud.cs         Hides vanilla elements (and restores them)
src/Widgets/HudWidget.cs       Base element + IHudMovable (Edit mode contract)
src/Widgets/BarWidget.cs       Health / stamina / eitr / adrenaline bar
src/Widgets/GuardianWidget.cs  Forsaken power
src/Widgets/FoodWidget.cs      One food slot
src/UI/ShapeGraphic.cs         Mesh shapes: bars (any end shape), divisions, borders, glow, gradients
src/UI/StatBar.cs              Bar view (direction, end shapes, trail, divisions, shine, value, icon)
src/UI/SlotView.cs             Slot view (fill, border, icon, label, name)
src/UI/UiUtil.cs               UI helpers, drop shadow
assets/                        Russo One + license (SIL OFL 1.1), icons + license (MIT)
docs/                          Research on the vanilla HUD

Credits

  • Russo One by Jovanny Lemonad, SIL Open Font License 1.1 (assets/OFL-RussoOne.txt).
  • Icons by Phosphor Icons, MIT License (assets/icons/LICENSE-Phosphor.txt).

Roadmap

  • Edit mode: drag elements with the mouse.
  • Status effects, animated shine sweep.

CHANGELOG

1.2.1

  • New NumberBold and TextBold settings (in 00. General, next to the fonts) to make the numbers and the names bold. Names stay bold by default and numbers stay regular, so nothing changes unless you turn them on or off. Both are saved in layouts.
  • The Game font now takes the font the vanilla HUD uses for each kind of text (numbers and names) instead of the first font found in the HUD.

1.2.1

  • New NumberBold and TextBold settings (00. General) to make the numbers and the names bold. Names are bold by default, as before; they are saved in layouts.
  • The Game font now takes the font of the matching vanilla text (the power's name for names, the health value for numbers) instead of the first font found in the HUD.

1.2.0

  • New edit mode: press F8 in game (the key is configurable with EditModeKey) and move the HUD with your mouse. Drag an element to move it, use the mouse wheel to rotate it (Shift for fine steps), the arrow keys to nudge it (Shift for bigger steps), R to reset it, F8 to save and exit, Esc to undo your changes.
  • A grid helps you line elements up, and snap pulls them to it (hold Ctrl to move freely). G shows/hides the grid, S turns snap on/off and H hides the on-screen help. New settings ShowGrid, GridSize and SnapToGrid (not saved in layouts).
  • While edit mode is open the game ignores your keyboard and mouse, so the inventory, map, chat, console and build menu can't be opened by accident. Edit mode closes by itself, and says why in the log, if the game needs your attention (for example when you die or open the settings window).
  • Eitr and Adrenaline bars are shown while editing even if your character has none, so you can place them.

1.1.0

  • New AutoHide option for every bar (with AutoHideDelay and FadeTime). Health, Stamina and Eitr hide when they are full and come back as soon as they drop; Adrenaline hides when it is 0 and appears when you gain some. The bar waits a few seconds, then fades smoothly. It is off by default, and these settings are not saved in layouts, so loading a layout never changes them.

1.0.3

  • The settings file is now DarthVladi.ValHUD.cfg (it was valhud.customhud.cfg). Your old settings are copied automatically on the first launch.
  • Food icons: BlinkWhenEdible is replaced by EdibleStyle (Blink, Dim or None), plus a new BlinkSpeed drop-down (Vanilla, TwiceVanilla, ThreeTimesVanilla) to make the blink slower and less distracting. BlinkWhenEdible = false is carried over as None.
  • Removed HideKeyHints: it cost a lot of FPS. Use the game's own "Key hints" option instead.
  • Icon glow and outline no longer pile up in memory when moving the sliders, and the outline is about 15 times faster.
  • If one HUD element fails, only that element is hidden; if the whole HUD can't be built, the vanilla HUD is shown. The log lists each different error once, and thousands of "LiberationSans" warnings are gone.
  • Layouts are saved through a temporary file, "Save as" explains names Windows doesn't allow (CON, NUL...), an invalid ValueFormat no longer throws errors, and DivisionRule accepts limits in any order.
  • All setting descriptions rewritten in plainer language, with examples.

1.0.2

  • Fixed the package layout so mod managers keep the icons and fonts folders next to ValHUD.dll (the Forsaken power icons were not found).

1.0.1

  • New description page with screenshots. No changes to the mod itself.

1.0.0

  • First public release.
  • Customizable bars (health, stamina, eitr, adrenaline), food slots and Forsaken power slot.
  • Layouts: save, load, revert and share as .json; five built-in layouts (DarthVladi, DarthVladi Green, Flat, Skyrim, Tilted).
  • Custom icons for every Forsaken power, with per-boss glow and outline.
  • Fonts: Russo One bundled; add any .ttf/.otf.
  • Option to hide the vanilla HUD and key hints.