Hotbar changes

Post Reply
User avatar
Skamiz Kazzarch
Member
Posts: 618
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Hotbar changes

by Skamiz Kazzarch » Post

So after two hours of fruitless searching didn't yield any results I finaly turn to you for advice and my question is this:
Is there any way to change the location of the hotbar?

There are several functions that affect it, but none seems to be able to change it's location.
hud_change(id, stat, value) seems like the likeliest way it might work, but I know of no way to get the id.
minetest.hud_replace_builtin(name, hud_definition) looked promissing until I noticed that the documation claims it only works for "breath" and "health".

The closest I have gotten was to hide the origial bar with :hud_set_flags({hotbar = false}) and creating my own bar via :hud_add(). Only there is no way to link it up with the original scrolling behavior.
That could be of course rectified by player:hud_change(hud_id, "item", player:get_wield_index()), were there a consisten way to detect a change in the wield index. Alas I know no such thing and so I come here to hear your wisom.

PS: While we are at it. Any way to change the alingment of the "inventory" hud element?

User avatar
Skamiz Kazzarch
Member
Posts: 618
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: Hotbar changes

by Skamiz Kazzarch » Post

I just learned about the 'register_globalstep' function which allows me to keep my new hotbar up to date with the invisible original. Though a bit laggy, it does it's job well enough.

Still, if anyone knows of a solution which isn't so messy or a way to apply alingment to the inventory hud element I would love to hear about it.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests