Alternative hotbar approach

We still change the background, but only depend
on the state of the slot, not on wield index.  Go
back to a traditional slot selection ring for the
selection index.

Slot backgrounds are a little bolder normally, and
when broken, especially bold around the broken
areas.

The selection ring itself is broken so that the
gaps in broken slots are still "open" to the outside
when the selection ring is in place.
This commit is contained in:
Aaron Suen 2020-09-04 19:59:12 -04:00
parent 5c73331ec2
commit 5059f9b3c3
6 changed files with 228 additions and 110 deletions

View File

@ -18,13 +18,14 @@ nodecore.register_playerstep({
for i = 1, hotbar_slots do
local stack = inv:get_stack("main", i)
local def = stack and (not stack:is_empty()) and stack:get_definition()
local suff = (i == player:get_wield_index()) and "_sel" or "_slot"
local suff = "_sel"
if def and def.hotbar_type then
suff = suff .. "_" .. def.hotbar_type
end
bar = bar .. ":" .. (i * bar_scale - bar_scale + bar_margin)
.. "," .. bar_margin .. "=" .. modname .. suff
.. ".png\\^[resize\\:" .. bar_scale .. "x" .. bar_scale
.. "\\^[opacity\\:192"
end
if data.slots ~= hotbar_slots then

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 81 KiB