Hotbar changes

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

Hotbar changes

by Skamiz Kazzarch » Thu Jan 10, 2019 16:01

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?
 

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

Re: Hotbar changes

by Skamiz Kazzarch » Fri Jan 11, 2019 20:29

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.
 


Return to Modding Discussion



Who is online

Users browsing this forum: texmex and 1 guest