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.
@ -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
|
||||
|
Before Width: | Height: | Size: 251 B After Width: | Height: | Size: 634 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 81 KiB |