Mods / HudUI

Tags:
Graphics HUD
Author:
ripls
Side:
Both
Created:
May 10th at 10:05 AM
Last modified:
4 days ago
Downloads:
447
Follow Unfollow 65
Recommended download (for Vintage Story 1.22.0 - 1.22.3):
hudui_1.2.0.zip  1-click install

Overview

HudUI replaces the vanilla hotbar, world interaction help, block info with a custom UI built on libGUI.

If your mod adds a new stat, you can register a bar into the edge-bar system — no patching required.

Theming

To switch themes, set "theme" in ModConfig/libgui.json. The UI redraws the moment you save the file — no game restart, no reload command.

Looking for more looks? Check here.

For Mod Authors — Adding a Bar

HudUI exposes EdgeBarController.Instance — initialized during StartClientSide.

1. Register the bar

Create two ValueNotifier<float> fields and call AddBar in StartClientSide. Update .Value whenever your stat changes — the GUI redraws automatically.

public override void StartClientSide(ICoreClientAPI api)
{
    if (!api.ModLoader.IsModEnabled("hudui")) return;

    _myStatNotifier = new ValueNotifier<float>(1f);
    _myStatDisplay  = new ValueNotifier<float>(0f);

    api.Event.RegisterGameTickListener(_ =>
    {
        float current = /* your current value */;
        float max     = /* your max value */;
        if (max <= 0) return;

        _myStatNotifier!.Value = current / max;
        _myStatDisplay!.Value  = current;
    }, 20);

    EdgeBarController.Instance!.AddBar(
        "mymod:mystat",
        EdgeBarSide.Right,
        new EdgeBarConfig(
            "#48cae4".FromHex(),
            _myStatNotifier,
            displayValueSource: _myStatDisplay,
            flashThreshold: 0.2f,
            tooltipBuilder: (_, _) =>
                new BarTooltipContent("My Stat", _currentMyStat, _maxMyStat),
            iconDomain: "mymod",
            iconPath: "textures/hud/mystat.svg"
        )
    );
}

2. Dynamic bars (optional)

Show a bar only when needed — add and remove it on the fly:

var controller = EdgeBarController.Instance!;
bool isActive  = /* your condition */;
bool hasBar    = controller.HasBar("mymod:mystat");

if (isActive && !hasBar) controller.AddBar("mymod:mystat", ...);
if (!isActive && hasBar) controller.RemoveBar("mymod:mystat");

3. Cleanup

Dispose your notifiers in ModSystem.Dispose:

public override void Dispose()
{
    _myStatNotifier?.Dispose();
    _myStatDisplay?.Dispose();
    base.Dispose();
}

Compatible mods

HydrateOrDiedrate — thirst bar

Vigor — stamina bar

Mod Version Mod IdentifierFor Game version Downloads Released Changelog Download 1-click mod install*
1.2.0 hudui
1.22.0 - 1.22.3
101 4 days ago hudui_1.2.0.zip 1-click install

make mod universal, so server can force download, still can be used client side only

rebuild for libgui 2.0.0

itemrarity compat

1.1.2 hudui
1.22.0 - 1.22.2
179 May 23rd at 10:40 AM hudui_1.1.2.zip 1-click install

Theme support
Colors now pull from whatever theme you have active in the Gui mod. Swap themes, and the hotbar, slots, and panels
follow along.

Config file
A hudui.json file shows up in your ModConfig folder on first launch. Two settings for now: UseDefaultTheme (keeps the
mod on its built-in colors instead of your Gui theme) and OffhandGap — the space between the offhand slot and the main
hotbar.

1.1.1 hudui
1.22.0 - 1.22.2
86 May 20th at 7:37 AM hudui_1.1.1.zip 1-click install

add AddStandaloneBar / TryGetBar

add DisplayValueWidth to prevent layout shifting

1.1.0 hudui
1.22.0 - 1.22.2
24 May 19th at 1:10 PM hudui_1.1.0.zip 1-click install

added block info hud, fixed HoD compatibility

1.0.1 hudui
1.22.0 - 1.22.2
57 May 13th at 8:53 AM Release Retracted

Retraction Reason:

HoD compatibility bug

Changelog:

1.0.0 hudui
1.22.0 - 1.22.2
0 May 12th at 2:10 PM Release Retracted

Retraction Reason:

libgui release retracted

Changelog:


71 Comments (oldest first | newest first) (threaded | flat)

pngwn, 4 days ago

It would be great to see the rest of the UI elements in this style!

Latiad82, 5 days ago (modified 4 days ago)

Could you add sleepneeds to the hud? Please please

Willownezz, Jun 3rd at 1:18 AM (modified Jun 3rd at 2:00 AM)

how do I make it so they all stay in the same level ? (The number under it makes it go up, it goes down when goes to 99 or bellow)

image

RedRockG, May 31st at 2:24 AM

The HUD disappears; I use Linux too

ripls , May 31st at 7:57 AM
@RedRockG: The HUD disappears; I use Linux too

Will be fixed in next release

MacroAggressor, May 28th at 11:57 AM

Is this compatible with Status HUD Continued?

uneivi, May 27th at 6:50 AM

I don't know If its just me, or happened with anybody else, but the UI dissaper using this Mod - the hotbar and the screen tips. I don't know If could problably be something with Linux. 

Moltenhead, May 26th at 2:44 PM

Hello. This is cool.
Would adding bars for items be complex?
This is incompatible with Toolsmith

Zanklev, May 23rd at 10:44 PM

This looks awesome and fits perfectly in the game. Do you think you could add support for "Item Rarity"? Currently the text for an item is just numbers for the color code instead of the correct colored text of the item tier.

 

https://mods.vintagestory.at/itemrarity

Quartofel, May 23rd at 9:24 PM

Nice and clean! Great job!

I do miss the gear tho.

DigitalHare, May 23rd at 5:27 PM

I apologize to add to the questions and 'wants', but is there a setting that would make this play well with Minimal Compass (https://mods.vintagestory.at/minimalcompass)? I adore the HUD and it's look but they don't seem to play well and I completely admit in the hour play test I managed to get turned around in the forest about 100m from my dang house lol

DigitalHare, May 24th at 1:25 AM
@ripls: You can try using hudshelf to move hud below.

Your comment made me realize and test something. I'm sorry for bothering you hah.. There was an "Bypass HUD check" option that worked. Well, can add that as a 'these two work together', just need to choose that option'.

DanaCraluminum, May 23rd at 12:55 PM (modified May 23rd at 12:56 PM)

Do you think you could make crosshair at center of the screen customizable? (SystemRenderAim)

Also, is it possible to change icons like X for closing menu etc.?

Partexedd, May 20th at 12:21 PM

Could you make it so the hotbar shows the current amount of liquid in the model preview on liquid containers like vanilla does? Also maybe a text indicator saying the current amount of liquid would be cool

image


Lexith, May 20th at 4:24 PM
@Partexedd: Could you make it so the hotbar shows the current amount of liquid in the model preview on liquid containers like vanilla does? Also maybe a text indicator saying the current amount of liquid would be cool

I think it actually does this with the weapon durability as well. I didn't even think about it last night when I was playing, but my weapon and tools all showed green dur. bar, but in inventory my wep was below half yellow.

JimmyMac, May 20th at 11:39 AM

I could be wrong but I don't think that hotbar on the screenshot will be good when you are doing the devastation. Doesn't there need to be a gap between the left hand slot and the first right hand slot?

JimmyMac, May 20th at 1:27 PM
@ripls: There's a pretty noticeable gap between the slots

I don't want to be to spolier but notice on the vanilla hot bar there is a gap between the left hand slot and the first right hand slot that is the exact size of another slot - There's a reason for that - Just saying

flexioo, May 20th at 4:20 PM
@PapitoPapz: lowkey agreed haha cause I sometimes did confuse it for first slot lol

Truee
There is a gap, but it's too small for me to differentiate the left hand and right hand slots.

JimmyMac, May 20th at 6:59 PM
@JimmyMac: I don't want to be to spolier but notice on the vanilla hot bar there is a gap between the left hand slot and the first right hand slot that is the exact size of another slot - There's a reason for that - Just saying

If you ever do the devastation story quest you will find out the real reason there NEEDS to be a gap in the hot bar and it NEEDS to be the size of a normal hotbar slot

JimmyMac, May 21st at 8:08 PM
@PapitoPapz: what is the devastation story quest ?

Its chapter 2 of the main story of quests in Vintage Story. One of the Traders start you on the quests

Partexedd, May 20th at 11:01 AM

This looks so good no idea how it went under the radar for this long

Elocrypt, May 20th at 3:10 AM

Hey ripls,

I'm the author of HudShelf, a positioning/persistence library that lets players drag HUD elements around the screen. I just shipped HudShelf: Essentials 0.3.0 with reflection-based compat for HudUI, players can now drag the hotbar+edge-bars cluster as a unit and the position persists across sessions. Works great.

The next thing I assume my users will ask for is per-bar dragging: health pinned top-left, saturation top-right, that kind of thing. With the current EdgeBarPanel architecture I can't really deliver that without forking, since the bars are flex-row children inside HudHotbar's GuiBase window rather than independent dialogs.

If you're ever working on the bar system, a couple of small additions would unblock this cleanly without me having to reach into your internals:

  1. An optional flag on AddBar (or a separate AddStandaloneBar method) that spawns the bar in its own GuiBase dialog instead of adding it to EdgeBarPanel. Any positioning library can then pick that dialog up the normal way.
  2. A read accessor on EdgeBarController for already-registered bars, even just TryGetBar(id, out side, out config). Right now the data is there internally but Bars is internal-only, so I can't rehome a bar without re-implementing it from scratch. With that one method exposed I could do the rehoming entirely on my end.

Either of these would also help whoever ends up writing integrations for your planned ChatUI and PlayerInvUI down the road.

No urgency on my end, happy to ship cluster-only for the moment. Just flagging it for when you're poking around in there.

On the source-publishing thread above: adding my voice. Even an explicit license on the public API surface (the controller, the configs, the value notifiers) would let folks like me build against you without resorting to reflection.

Thanks for libGUI. The framework is genuinely a pleasure to work against.

ArsenikMilk, May 19th at 11:41 PM

This looks great! I look forward to adding this to my game.

What do your future plans look like? Do you intend to remake the other UI elements, like inventory, character screen? Perhaps add customisability? 

Leraie, May 19th at 11:02 PM

BRO YOU  DID THE CONTAINER UI. IT'S EVEN  SICKER!!!! I hope you plan on doing the inventory  UI T_T Thank  you for getting inven tweaks  working too!!!!!

ripls , May 20th at 5:19 AM
@Leraie: BRO YOU DID THE CONTAINER UI. IT'S EVEN SICKER!!!! I hope you plan on doing the inventory UI T_T Thank you for getting inven tweaks working too!!!!!

oh it shouldn't have been there, I forgot to disable it, this is a test version, it will be in a separate mod

Michaloid , May 19th at 7:57 PM

The low download count for this mod is criminal. Looks mighty good.

ripls , May 19th at 5:38 PM

Lexith PapitoPapz redownload libgui i somehow forgot include some dependecies

Lexith, May 20th at 3:49 AM
@ripls: Lexith PapitoPapz redownload libgui i somehow forgot include some dependecies

Yay! It works. Thank you so much. Love the looks of this hud <3

Lexith, May 19th at 10:10 AM

I feel like I am overlooking something that I could possibly fix in my mods/menu, but for some reason while I have this mod loaded and it shows the thirst, stam, etc. I am still getting the normal thirst bar from hydtrade of diedrate mod. So it is overlapping the icons about the thirst, stam, etc.

Not sure if this is just something I need to fix on my end as fas as maybe another mod is keeping it active or if this is something between hydrate and this mod.

Lexith, May 19th at 2:23 PM
@ripls: fixed

Sorry, I only just seen this. It does seem that it did remove that, but now the entire HUD is also gone, haha. When I log into a world (tried both multiplayer and single player) my hud showing stam, health, hot key bars, etc. are all gone and cycliong through the hot keys does nothing to bring up the hud.

Lexith, May 19th at 3:07 PM
@ripls: u have the latest libgui version?

Yeah, I grabbed it right after getting the update for this one.

 

ripls , May 19th at 3:55 PM
@Lexith: Yeah, I grabbed it right after getting the update for this one.

I'll create a thread in the official discord a little later to make it easier to communicate about bugs

Hatrune_Cubic, May 16th at 12:54 AM

Awesome mod can't wait for the inventory gui to be changed too :3

PapitoPapz, May 13th at 11:15 PM

The temporal gear :( it was so unique 

PapitoPapz, May 19th at 2:56 PM
@PapitoPapz: The temporal gear :( it was so unique

Never mind I have gotten used to it lol

PapitoPapz, May 19th at 3:08 PM
@ripls: 😀

Hi goat ! I was wondering will there be more gui changes like inventory and stats ? 

ripls , May 19th at 3:56 PM
@PapitoPapz: Hi goat ! I was wondering will there be more gui changes like inventory and stats ?

I already have them, I'm just polishing them

chrisunfocused, May 13th at 10:38 AM

Nice mod! I have added compatibility to Vigor.
Vigor - Vintage Story Mod DB

Some feedback on the stat bar implementation.

1. It would be good to support an optional secondary bar, like the main health bar uses in 1.22 for damage and healing. Vigor uses this vanilla behaviour for a recovery threshold.
2. There is no flashing when empty. This is a good visual indicator. You expose a flash threshold, but it doesn't seem to work, unless it's just me.
3. The layout seems to be flexing. eg when a stat goes from 3 char to 2 char, it gets narrower and the layout adjusts. You should reserve some space for UI to avoid this layout shifting.

DanaCraluminum, May 13th at 10:30 AM

Do you think you could remake block and item tooltips as well?

ripls , May 13th at 10:35 AM
@DanaCraluminum: Do you think you could remake block and item tooltips as well?

If you're talking about the tooltip when hovering over the itemslot, then it's already been redone at the library level.

ripls , May 13th at 10:42 AM
@DanaCraluminum: I mean block tooltips when you look at placed block

You mean the one at the top of the screen?

ripls , May 13th at 11:05 AM
@DanaCraluminum: yes

I think so, I might add

Leraie, May 13th at 9:52 AM

I love this. Could you make the inventory match it? Please!