-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Better HUD display #52
Comments
Would be added by #47, but there's not much going on with that PR... |
That PR is just a "dump-all-my-changes" thing, i asked him what he changed for your-land... so.. |
It's looking much better. Perhaps the icon can go to the left of the Rank name, so it takes up less room on the screen. [icon] Cobble Peasant Also I'd love to see an option to remove the icons showing over heads. (I can make this a second feature request if need be.) Thank you for your contributions in improving this mod. |
This should already be possible: Line 10 in 081a016
just set |
@Git-Forked i think this is "just" a mock-up:
if you want to try to change/implement this, feel free, that's why we are having PR's 😉 |
Positioning icon next to text is difficult to achieve so that it looks good on various screen sizes. The good thing about git repos, is that we can roll back easily if players don't like what we did. |
Here is what I changed in hud.lua to achieve this. In case somebody wants to pick up and improve on it. @@ -23,16 +23,6 @@ local setup_hud = function(player)
player:get_meta():set_string(xp_redo.HUD_DISPLAY_STATE_NAME, "on")
- data.info = player:hud_add({
- hud_elem_type = "text",
- position = HUD_POSITION,
- offset = {x = 0, y = 0},
- text = "",
- alignment = HUD_ALIGNMENT,
- scale = {x = 100, y = 100},
- number = 0x0000FF
- })
-
data.rank = player:hud_add({
hud_elem_type = "text",
position = HUD_POSITION,
@@ -45,7 +35,7 @@ local setup_hud = function(player)
-- rank img
- local RANK_IMG_OFFSET = {x = 0, y = 90}
+ local RANK_IMG_OFFSET = {x = -37, y = 31}
data.rankimg = player:hud_add({
hud_elem_type = "image",
@@ -63,26 +53,36 @@ local setup_hud = function(player)
else
local XP_PROGRESS_OFFSET = {x = 0, y = 40}
-
+--[[
data.background = player:hud_add({
hud_elem_type = "image",
position = HUD_POSITION,
offset = XP_PROGRESS_OFFSET,
text = "xp_progress_bg.png",
alignment = HUD_ALIGNMENT,
- scale = {x = 1, y = 1}
+ scale = {x = 1, y = 2.3}
})
-
+--]]
data.progressimg = player:hud_add({
hud_elem_type = "image",
position = HUD_POSITION,
offset = XP_PROGRESS_OFFSET,
text = "xp_progress_fg.png",
alignment = HUD_ALIGNMENT,
- scale = {x = 0, y = 1}
+ scale = {x = 0, y = 2.3}
})
end
+ data.info = player:hud_add({
+ hud_elem_type = "text",
+ position = HUD_POSITION,
+ offset = {x = 2, y = 41},
+ text = "",
+ alignment = HUD_ALIGNMENT,
+ scale = {x = 100, y = 100},
+ number = 0xFFffFF
+ })
+
hud[playername] = data
end
@@ -177,7 +177,7 @@ xp_redo.update_hud = function(player, xp, rank, next_rank)
if has_hudbars then
hb.change_hudbar(player, "xp_progress", progress)
else
- player:hud_change(data.progressimg, "scale", { x=progress, y=1 })
+ player:hud_change(data.progressimg, "scale", { x = progress, y = 2.3 })
end
if not xp_redo.disable_nametag then
@@ -214,3 +214,4 @@ minetest.register_on_leaveplayer(function(player)
local playername = player:get_player_name()
hud[playername] = nil
end) |
Make it display percentage of next rank on right hand side instead of absolute value of XP (there's no way to determine maximum). So instead of Saved space can be significant especially when it comes to high amounts of XP: |
Instead of showing an XP bar and a separate HUD for Rank and experience, this should all be on the XP bar.
Current XP Bar:
[ XP: % Fulfilled ]
Suggested XP Bar:
Rank:
[ XP: % Fulfilled, Current XP/Next Level XP ]
Rank listed above XP bar.
The text was updated successfully, but these errors were encountered: