octacian/hudlib

Widget Stacking

Opened this issue · 4 comments

I found your mod while looking to alternatives to hud_hunger, which seems to have some deficiencies. I suggest that since you are in the early stages you keep something in mind that could make your mod better than the hud in hud_hunger: widget stacking. In hud (including tenplus1's updated version in his fork of hud_hunger), when more meters are added they may overlap (sprint overlaps armor in current version). A better solution would be to just give an alignment (such as topleft, bottomleft, bottomright, bottomleft--maybe even topcenter, bottomcenter) for each meter, then keep track of where they are, so if another meter is added, it is automatically placed in an empty spot. You could have spacing variables for x and y, and an object for each position (tl, bl, br, bl) and each of those objects could store a list, and you could use the last one in the list's location with those spacing variables. Eventually you could have the ability either a graphical heart bar or a text label which could be added and removed (such as for mods that want to display timers or game/quest state messages for all players or certain players permanently until the mod wants to remove the label) and alignment could be reprocessed at that time in case any widgets are higher in the list.

I'd really like this feature as I'm going to try and build a notification system.

I've been very busy on other projects, and I'm not actually sure as to whether or not I will continue working on HUDLib aside from a few basic bugfixes and improvements. The reason for this is that most (if not all) of the features of HUDLib would be even more beneficial if they were implemented in the engine. So yes, this feature will be added eventually, but don't expect it too soon as I'd like to move all the features implemented by HUDLib into the engine.

I didn't want to sidetrack you before since you were working on your own hud, but since this discussion I moved on from the old (unmaintained BlockMen original version of) hud_hunger, so now that HUDPlus is in maintenance status I recommend the following set of mods as a possible alternative:

if [ ! -d ../hunger ]; then
  echo "You have to be in the hunger directory for this to work"
  exit 1
else
  cd ../hunger
fi

if [ -f "functions_UNUSED_sprint.lua" ]; then
  sudo rm "functions_UNUSED_sprint.lua"
fi
sudo mv "functions.lua" "functions_UNUSED_sprint.lua"
sudo mv "functions_(nosprint).lua" "functions.lua"
if [ -f "init_UNUSED_sprint.lua" ]; then
  sudo rm "init_UNUSED_sprint.lua"
fi
sudo mv "init.lua" "init_UNUSED_sprint.lua"
sudo mv "init_(nosprint).lua" "init.lua"

Works fine with:

If you have any suggestions beyond the mods above, or reasons why HUDPlus might be better or may have more potential than this combination of mods above, I'd like to know your thoughts or plans.

Whoops, I didn't write that comment properly. Only HUDLib is now in maintenance state. I will continue to develop HUDPlus using HUDLib features until they are implemented in the engine, hence the reason why I bother with HUDLib bugfixes at all. Will edit my comment.

Also, I recently wrote my own sprinting mod. It is much like GunshiPenguin's, however, works much nicer (e.g. particles change depending on what node you are walking one rather than just displaying a dirt particle). It specifically has no sprinting HUD or attachments with hunger. I really hate the concept of a sprinting HUD but will implement attachments with hunger soon-ish.