Increase hotbar count

This commit is contained in:
Jean-Patrick Guerrero 2021-01-24 16:08:46 +01:00
parent fc851eade2
commit 6add8a03e5
6 changed files with 18 additions and 14 deletions

View File

@ -29,6 +29,7 @@ Licenses of media (textures)
paramat (CC BY-SA 3.0): paramat (CC BY-SA 3.0):
i3_arrow.png - derived from a texture by BlockMen (CC BY-SA 3.0) i3_arrow.png - derived from a texture by BlockMen (CC BY-SA 3.0)
i3_hotbar.png
You are free to: You are free to:
Share — copy and redistribute the material in any medium or format. Share — copy and redistribute the material in any medium or format.

View File

@ -35,8 +35,7 @@ To use this mod in the best conditions, it's recommended to follow these recomme
- Use LuaJIT - Use LuaJIT
- Use [Minetest Game](https://github.com/minetest/minetest_game) - Use [Minetest Game](https://github.com/minetest/minetest_game)
- Use the default font style with Freetype - Use the default font style with Freetype
- Use the english locale - Use a HiDPI widescreen display
- Use a HiDPI display
- **DON'T** change the default font size settings - **DON'T** change the default font size settings
- **DON'T** change the default GUI scaling setting - **DON'T** change the default GUI scaling setting

View File

@ -76,7 +76,8 @@ local IPP = ROWS * LINES
local MAX_FAVS = 6 local MAX_FAVS = 6
local ITEM_BTN_SIZE = 1.1 local ITEM_BTN_SIZE = 1.1
local INV_SIZE = 35 local INV_SIZE = 36
local HOTBAR_COUNT = 9
-- Progressive mode -- Progressive mode
local POLL_FREQ = 0.25 local POLL_FREQ = 0.25
@ -95,6 +96,7 @@ local BAG_SIZES = {
local PNG = { local PNG = {
bg = "i3_bg.png", bg = "i3_bg.png",
bg_full = "i3_bg_full.png", bg_full = "i3_bg_full.png",
hotbar = "i3_hotbar.png",
search = "i3_search.png", search = "i3_search.png",
heart = "i3_heart.png", heart = "i3_heart.png",
heart_half = "i3_heart_half.png", heart_half = "i3_heart_half.png",
@ -2168,16 +2170,16 @@ local function panel_fields(player, data, fields)
end end
local function get_inv_slots(data, fs) local function get_inv_slots(data, fs)
local inv_x, inv_y = 0.58334, 6.5 local inv_x, inv_y = 0.234, 6.6
local width, size, spacing, extra = HOTBAR_COUNT, 0.96, 0.15, 0
local bag = data.bag_size local bag = data.bag_size
for i = 0, 7 do for i = 0, HOTBAR_COUNT - 1 do
fs(fmt("image", i + inv_x + (i * 0.15), inv_y, 1, 1, "i3_hb_bg.png")) fs(fmt("image", i + inv_x + (i * 0.1), inv_y, size, size, "i3_hb_bg.png"))
end end
fs("style_type[list;size=1;spacing=0.15]", fmt("list[current_player;main;%f,%f;8,1;]", inv_x, inv_y)) fs(fmt("style_type[list;size=%f;spacing=%f]", size, spacing),
fmt("list[current_player;main;%f,%f;%u,1;]", inv_x, inv_y, HOTBAR_COUNT))
local width, size, spacing, extra = 9, 0.96, 0.15, 0
if bag then if bag then
if bag == "small" then if bag == "small" then
@ -2190,8 +2192,8 @@ local function get_inv_slots(data, fs)
end end
fs(fmt("style_type[list;size=%f;spacing=%f]", size, spacing), fs(fmt("style_type[list;size=%f;spacing=%f]", size, spacing),
fmt("list[current_player;main;%f,%f;%u,%u;8]", 0.234 + extra, inv_y + 1.25, fmt("list[current_player;main;%f,%f;%u,%u;%u]", inv_x + extra, inv_y + 1.15,
width, (bag and BAG_SIZES[data.bag_size] or INV_SIZE) / width), width, (bag and BAG_SIZES[data.bag_size] or INV_SIZE) / width, HOTBAR_COUNT),
"style_type[list;size=1;spacing=0.15]") "style_type[list;size=1;spacing=0.15]")
end end
@ -2240,10 +2242,10 @@ local function get_inventory_fs(player, data, fs)
end end
end end
max_val = max_val + (award_list_nb * 13.13) max_val = max_val + (award_list_nb * 13.11)
end end
local ctn_len, ctn_hgt = 5.6, 5.85 local ctn_len, ctn_hgt = 5.6, 5.95
local xoffset, yoffset = 0, 0 local xoffset, yoffset = 0, 0
fs(fmt([[ fs(fmt([[
@ -2724,6 +2726,9 @@ on_joinplayer(function(player)
init_data(player, info) init_data(player, info)
init_backpack(player) init_backpack(player)
player:hud_set_hotbar_itemcount(HOTBAR_COUNT)
player:hud_set_hotbar_image(PNG.hotbar)
end) end)
core.register_on_dieplayer(function(player) core.register_on_dieplayer(function(player)

View File

@ -53,7 +53,6 @@ Compress items=
Cooking= Cooking=
Cooking time: @1= Cooking time: @1=
Craft (x@1)= Craft (x@1)=
Crafting Guide=
Digging= Digging=
Digging (by chance)= Digging (by chance)=
Heal= Heal=

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 B

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
textures/i3_hotbar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB