From 6add8a03e540f48b53079b0f747e9af584692c37 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Sun, 24 Jan 2021 16:08:46 +0100 Subject: [PATCH] Increase hotbar count --- LICENSE | 1 + README.md | 3 +-- init.lua | 27 ++++++++++++++++----------- locale/template | 1 - textures/i3_hb_bg.png | Bin 509 -> 1284 bytes textures/i3_hotbar.png | Bin 0 -> 2993 bytes 6 files changed, 18 insertions(+), 14 deletions(-) create mode 100644 textures/i3_hotbar.png diff --git a/LICENSE b/LICENSE index 574f444..1abebab 100644 --- a/LICENSE +++ b/LICENSE @@ -29,6 +29,7 @@ Licenses of media (textures) paramat (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: Share — copy and redistribute the material in any medium or format. diff --git a/README.md b/README.md index ab931ce..98eed60 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,7 @@ To use this mod in the best conditions, it's recommended to follow these recomme - Use LuaJIT - Use [Minetest Game](https://github.com/minetest/minetest_game) - Use the default font style with Freetype - - Use the english locale - - Use a HiDPI display + - Use a HiDPI widescreen display - **DON'T** change the default font size settings - **DON'T** change the default GUI scaling setting diff --git a/init.lua b/init.lua index 21a1462..bcf9da5 100644 --- a/init.lua +++ b/init.lua @@ -76,7 +76,8 @@ local IPP = ROWS * LINES local MAX_FAVS = 6 local ITEM_BTN_SIZE = 1.1 -local INV_SIZE = 35 +local INV_SIZE = 36 +local HOTBAR_COUNT = 9 -- Progressive mode local POLL_FREQ = 0.25 @@ -95,6 +96,7 @@ local BAG_SIZES = { local PNG = { bg = "i3_bg.png", bg_full = "i3_bg_full.png", + hotbar = "i3_hotbar.png", search = "i3_search.png", heart = "i3_heart.png", heart_half = "i3_heart_half.png", @@ -2168,16 +2170,16 @@ local function panel_fields(player, data, fields) end 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 - for i = 0, 7 do - fs(fmt("image", i + inv_x + (i * 0.15), inv_y, 1, 1, "i3_hb_bg.png")) + for i = 0, HOTBAR_COUNT - 1 do + fs(fmt("image", i + inv_x + (i * 0.1), inv_y, size, size, "i3_hb_bg.png")) end - fs("style_type[list;size=1;spacing=0.15]", fmt("list[current_player;main;%f,%f;8,1;]", inv_x, inv_y)) - - local width, size, spacing, extra = 9, 0.96, 0.15, 0 + 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)) if bag then if bag == "small" then @@ -2190,8 +2192,8 @@ local function get_inv_slots(data, fs) end 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, - width, (bag and BAG_SIZES[data.bag_size] or INV_SIZE) / width), + 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, HOTBAR_COUNT), "style_type[list;size=1;spacing=0.15]") end @@ -2240,10 +2242,10 @@ local function get_inventory_fs(player, data, fs) end end - max_val = max_val + (award_list_nb * 13.13) + max_val = max_val + (award_list_nb * 13.11) end - local ctn_len, ctn_hgt = 5.6, 5.85 + local ctn_len, ctn_hgt = 5.6, 5.95 local xoffset, yoffset = 0, 0 fs(fmt([[ @@ -2724,6 +2726,9 @@ on_joinplayer(function(player) init_data(player, info) init_backpack(player) + + player:hud_set_hotbar_itemcount(HOTBAR_COUNT) + player:hud_set_hotbar_image(PNG.hotbar) end) core.register_on_dieplayer(function(player) diff --git a/locale/template b/locale/template index 0dd079c..f195230 100644 --- a/locale/template +++ b/locale/template @@ -53,7 +53,6 @@ Compress items= Cooking= Cooking time: @1= Craft (x@1)= -Crafting Guide= Digging= Digging (by chance)= Heal= diff --git a/textures/i3_hb_bg.png b/textures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ou~| zDYS_3;J6>}?mh0_0Yam~bh~F9&<)2*ClgXOwmC8V z-o<&A|G7U$zm~Td5RiyxnQ1x18^qI_j>&nSSY#zdBR(e{v*?1vk6c$he&bwhvA{D$ zE0dll7Kx=|7pq;&N|sJMMI6&~gYt!}#~SA?&U&TB+V|uyjO2}#Wvxm0qM!N{?IDs(6J>YT&7~)`a_YigW_V1Z?e?L`ma+?DyvTc*M z1RgKs3>+6a0HXe#o&W#<4M{{nR0!8&$jHd}4*&$L0yx_tEp7k+002ovPDHLkV1ncL B)C2$k diff --git a/textures/i3_hotbar.png b/textures/i3_hotbar.png new file mode 100644 index 0000000000000000000000000000000000000000..b487f4bfb62c0b2923c2add2139a51d0b1dfd902 GIT binary patch literal 2993 zcma);XHe747RLW{X$qnO(uE*JX^Qk-B$P;pNRt)~ozN1HY5?gSL5Z}WB25GdQdI&< z4X6;2CJ;e*=`BJ4FT8i0VeY59GrPZi&di?k?CzJ7U<$d(%5;$l00367fv!0KP(MA| zLr&2jtqH^nIRJ3#a;T+kpt*C1pdZ2)2KRCo3`F_43%VoWFaSV)uX?nQK~g@A{_`bK zUQ1OoeQqro$zQoki8kNfQo1JXVl)9dub06nk{&g_x2iFA5P!=6)F^Tr(Z4&BjNqLBO?t-ffE?IsbI%%&b(^eDOO|67Oo^_mw)|Zd;2 z^3=z!(Ka39_tofs&XuYtI5y0rpP6eNAZ|};2^8!%Aqrbp=g9+Smh;&)cI7nGXJ*ED z9Mw}k;to0}DYHB!YwK}43UTdWYVNjl4J*afsK4t8R^MHCG8KW@T%&m?URhM2!^P(A3i5d2%-fa87r~GsKVbXA z7yZ-4O|iv!{q9ug4o};w%`Icrr=6;4`^d(riG79mv9P?P7A20w0~5bjjr4J{cc=Pd z*xCgqNs7ONRJWW~sgq1&wUm6MxV}|KNDp=XNvuL5Q~NjuLYPp`H=zJ$Ee`0q$<-(~ zv|87GopzgF6ny=uy>c37g)lT=CVQam7}`V@UPess8y1+Hz?NX%q)>Wz+Mj{H2-;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