Combining HUD and Formspec

Post Reply
matyilona200
Member
Posts: 14
Joined: Sun May 20, 2018 14:41
GitHub: matyilona

Combining HUD and Formspec

by matyilona200 » Post

I just started looking into modding, and as far as I understand:
Frormspecs: can be used as input, but can not be updated once sent to client
HUD: can not be used for input, can be updated any time
In my first mod viewtopic.php?f=9&t=20149 I tried to use both for an interactive GUI.

My questions are:
Are there any other mods that do this, that I can take a look at?
Is there a way of aligning the HUD and the Formspec, so that on every screen they are at the same position?

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Combining HUD and Formspec

by Krock » Post

Now that's a lovingly new concept! I love this HUD and formspec combination, even though the HUD could be replaced and combined with the formspec. You are right that formspecs don't allow dynamic content, but they can be made to look like being dynamic by re-sending a new version of the formspec after each input/visual change. Only one formspec is shown at once, which means that such that are sent afterwards, will overwrite the current formspec.
However, this requires to re-send the formspec after each pressed button - unless it's done with rather bad looking checkboxes and an "Apply" button. In singleplayer this is by far not a problem, but on servers with a delay of a few hundred milliseconds it becomes already quite annoying.

Currently the HUDs are always hidden by formspecs, so combining them in an usable manner is very hard. And because of that, I don't think that there's a mod which uses this combination actively.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: Combining HUD and Formspec

by rubenwardy » Post

I'd like to make it so the hypothetical/eventual formspec replacement also replaces HUDs. Reuse!
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests