From 830ae628af68d27ab90a04ae4fd46301e1bb1616 Mon Sep 17 00:00:00 2001 From: runs Date: Sat, 2 Jan 2021 15:53:56 +0100 Subject: [PATCH] fixes --- init.lua | 24 +++++++++++++++--------- locale/pickp.es.tr | 2 ++ textures/pickp_thief_face.png | Bin 0 -> 855 bytes 3 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 textures/pickp_thief_face.png diff --git a/init.lua b/init.lua index 86a0fce..7a40e08 100644 --- a/init.lua +++ b/init.lua @@ -106,33 +106,39 @@ local function get_rob_list(clicked) end --minetest.chat_send_all("hotbar_after="..tostring(#list_hotbar)) local i = 1 - local item_stack, item_name - for y= 0, 3 do + local item_stack, item_name, columns + for y= 1, 4 do if i > #list_hotbar then break end + columns = y for x= 0,3 do if list_hotbar[i] then item_stack = list_hotbar[i].itemstack item_name = item_stack:get_name() - rob_list = rob_list .. " item_image_button [".. tostring(x)..",".. tostring(y) ..";1,1;" + rob_list = rob_list .. " item_image_button [".. tostring(x)..".3"..",".. tostring(y)..".6"..";1,1;" .. item_name .. ";item_name;"..tostring(i).."]" i = i + 1 else i = i + 1 end if i > #list_hotbar then - break + break end end end --minetest.chat_send_all("rob_list="..rob_list) - return rob_list, list_hotbar + return rob_list, list_hotbar, columns end -local function get_formspec(clicker, clicked, rob_list) +local function get_formspec(clicker, clicked, rob_list,columns) + columns = columns + 1 local formspec = - "size[4,4]" .. + "formspec_version[4]" .. + "size[4.6,"..tostring(columns)..".9]" .. + "image[0.30,0.30;1,1;pickp_thief_face.png]" .. + "label[1.5,0.65;"..S("Pick up an object").."]" .. + "label[1.5,1;"..S("quickly!").."]" .. rob_list return formspec end @@ -270,10 +276,10 @@ end local function pickpocketing(clicker, clicked) local clicker_name = clicker:get_player_name() - local rob_list, rob_table = get_rob_list(clicked) + local rob_list, rob_table, columns = get_rob_list(clicked) if not(rob_list == "") then minetest.show_formspec(clicker_name, - "pickp:form", get_formspec(clicker, clicked, rob_list)) + "pickp:form", get_formspec(clicker, clicked, rob_list, columns)) local angle_2d = get_angle(clicker, clicked) enable_steal(clicker, clicked, rob_table, angle_2d) --mark as stealing minetest.after(pickp.settings["stealth_timing"], stealth, clicker, clicked) diff --git a/locale/pickp.es.tr b/locale/pickp.es.tr index e42bcde..4821cb8 100644 --- a/locale/pickp.es.tr +++ b/locale/pickp.es.tr @@ -8,3 +8,5 @@ tried to steal from you!=intentó robarte! The victim has walked away!=¡La victima se ha alejado! Successful robbery!=¡Robo exitoso! Someone has stolen from you!=¡Alguien te ha robado! +Pick up an object=¡Agarra un objeto +quickly!=rápidamente! diff --git a/textures/pickp_thief_face.png b/textures/pickp_thief_face.png new file mode 100644 index 0000000000000000000000000000000000000000..1e902083832468e89c6e06589072b5c131857ac7 GIT binary patch literal 855 zcmV-d1E~CoP)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00O^BL_t(o!_8McZxk^QeKYo6 zM9_r_T0~6)Jq;za`~avZp`k<6NJupBFA$a%6R~m z)+3v>L=?W)1J=Ez!9Yf%ddv#|FwLv6a9}*LqOYn&ze;OcI$+~~L6zkT?S9?_M{5i1 zsZhgenY6#oqN%0r7~d<*cTfHZ_z zD8-mrhNrNxb`faD+TGg!*|-)QfIzY85KJXcmUg+vi{{$%OF8iT(F2V3o4Bo2Rg?2# zSU-0mW=lQxcXuakN&(cnV!hwn+bMhwf@iPaMo$eYehLD?;LwPT7ne@z2zV>w>x7L? z5TKRm=Qxi10EhtOBt$qW2Q>bc%>A~;P~nq8#W&3{K`N|aGcv+B?l8O^bBYvBh`98Q zFc)QoNbN8u4**~UCTmI|!qG6LV)F#{cHp##(QIQ6!A9q7c6Ckse>KmYRKU0k`i zkp}KOeu0BI4$Tu95kUx{uqmDayn1p!%TW(+X2m8v<`d4l3qW=`Ag4({0&1-tdBQR8 zknq>{uh`gKOM2}A441rING`PB+S<&@H(!S!=xRc6HgsT`N75nYG2t>rxBbD`uy@#$ zSWoZWgv3-45xn{E5#!8(TUW2oCEWWjpNg^DH?C##z|LTl9n3@7^6Gz-up?T;!nM!B zU7%2rtXRnEV