diff --git a/LICENSE b/LICENSE index 385c231..7854fd0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,6 @@ +License of source code +---------------------- + « Copyright © 2015-2018, Jean-Patrick Guerrero Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: @@ -7,3 +10,36 @@ The above copyright notice and this permission notice shall be included in all c The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders X be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software. Except as contained in this notice, the name of the shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the . » + +Licenses of media (textures) +---------------------------- + +Copyright © Diego Martínez (kaeza): craftguide_*_icon.png (CC BY-SA 3.0) + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/3.0/ diff --git a/README.md b/README.md index 218339e..2896ced 100644 --- a/README.md +++ b/README.md @@ -12,4 +12,4 @@ The progressive mode can be enabled with `craftguide_progressive_mode = true` in `craftguide` is also integrated in `sfinv` (Minetest Game inventory) when you enable it with `craftguide_sfinv_only = true` in `minetest.conf`. -![Preview2](http://i.imgur.com/3q7rVSo.png) +![Preview2](https://i.imgur.com/bToFH38.png) diff --git a/init.lua b/init.lua index d020f59..934441d 100644 --- a/init.lua +++ b/init.lua @@ -110,7 +110,7 @@ function craftguide:get_recipe(iX, iY, xoffset, recipe_num, recipes, show_usage) formspec = formspec .. "button[" .. (iX - (sfinv_only and 2.2 or 2.6)) .. "," .. (iY + (sfinv_only and 3.9 or 3.3)) .. ";2.2,1;alternate;" .. - (show_usage and S("Usage") or S("Recipe")) .. ": " .. + (show_usage and S("Usage") or S("Recipe")) .. " " .. S("@1 of @2", recipe_num, recipes_total) .. "]" end @@ -135,7 +135,7 @@ function craftguide:get_recipe(iX, iY, xoffset, recipe_num, recipes, show_usage) return formspec else for i, v in pairs(items) do - local X = math.ceil((i - 1) % width + xoffset - width) - + local X = ceil((i - 1) % width + xoffset - width) - (sfinv_only and 0 or 0.2) local Y = ceil(i / width + (iY + 2) - min(2, rows)) @@ -223,25 +223,28 @@ function craftguide:get_formspec(player_name, is_fuel) "background[1,1;1,1;craftguide_bg.png;true]" .. "tooltip[size_inc;" .. S("Increase window size") .. "]" .. "tooltip[size_dec;" .. S("Decrease window size") .. "]" .. - "button[" .. (data.iX * 0.48) .. ",0;0.7,1;size_inc;+]" .. - "button[" .. ((data.iX * 0.48) + 0.5) .. ",0;0.7,1;size_dec;-]" + "image_button[" .. (data.iX * 0.47) .. + ",0.12;0.8,0.8;craftguide_zoomin_icon.png;size_inc;]" .. + "image_button[" .. ((data.iX * 0.47) + 0.6) .. + ",0.12;0.8,0.8;craftguide_zoomout_icon.png;size_dec;]" end formspec = formspec .. [[ - button[2.4,0.23;0.8,0.5;search;?] - button[3.05,0.23;0.8,0.5;clear;X] + image_button[2.4,0.12;0.8,0.8;craftguide_search_icon.png;search;] + image_button[3.05,0.12;0.8,0.8;craftguide_clear_icon.png;clear;] field_close_on_enter[filter;false] ]] .. "tooltip[search;" .. S("Search") .. "]" .. "tooltip[clear;" .. S("Reset") .. "]" .. "tooltip[prev;" .. S("Previous page") .. "]" .. "tooltip[next;" .. S("Next page") .. "]" .. - "button[" .. (data.iX - (sfinv_only and 2.6 or 3.1)) .. - ",0.03;0.8,0.95;prev;<]" .. - "label[" .. (data.iX - (sfinv_only and 1.7 or 2.2)) .. ",0.21;" .. + "image_button[" .. (data.iX - (sfinv_only and 2.6 or 3.1)) .. + ",0.12;0.8,0.8;craftguide_prev_icon.png;prev;]" .. + "label[" .. (data.iX - (sfinv_only and 1.7 or 2.2)) .. ",0.22;" .. colorize(data.pagenum) .. " / " .. data.pagemax .. "]" .. - "button[" .. (data.iX - (sfinv_only and 0.7 or 1.2) - - (data.iX >= 11 and 0.08 or 0)) .. ",0.03;0.8,0.95;next;>]" .. + "image_button[" .. (data.iX - (sfinv_only and 0.7 or 1.2) - + (data.iX >= 11 and 0.08 or 0)) .. + ",0.12;0.8,0.8;craftguide_next_icon.png;next;]" .. "field[0.3,0.32;2.5,1;filter;;" .. mt.formspec_escape(data.filter) .. "]" local xoffset = data.iX / 2.15 @@ -267,7 +270,7 @@ function craftguide:get_formspec(player_name, is_fuel) if data.item and reg_items[data.item] then if not data.recipes_item or (is_fuel and not get_recipe(data.item).items) then - local X = math.floor(xoffset) - (sfinv_only and 0 or 0.2) + local X = floor(xoffset) - (sfinv_only and 0 or 0.2) formspec = formspec .. "item_image_button[" .. X .. "," .. (iY + (sfinv_only and 2.7 or 2.2)) .. diff --git a/textures/craftguide_clear_icon.png b/textures/craftguide_clear_icon.png new file mode 100644 index 0000000..9244264 Binary files /dev/null and b/textures/craftguide_clear_icon.png differ diff --git a/textures/craftguide_next_icon.png b/textures/craftguide_next_icon.png new file mode 100644 index 0000000..82cf3d3 Binary files /dev/null and b/textures/craftguide_next_icon.png differ diff --git a/textures/craftguide_prev_icon.png b/textures/craftguide_prev_icon.png new file mode 100644 index 0000000..b26cd15 Binary files /dev/null and b/textures/craftguide_prev_icon.png differ diff --git a/textures/craftguide_search_icon.png b/textures/craftguide_search_icon.png new file mode 100644 index 0000000..aace804 Binary files /dev/null and b/textures/craftguide_search_icon.png differ diff --git a/textures/craftguide_zoomin_icon.png b/textures/craftguide_zoomin_icon.png new file mode 100644 index 0000000..5b8ecc2 Binary files /dev/null and b/textures/craftguide_zoomin_icon.png differ diff --git a/textures/craftguide_zoomout_icon.png b/textures/craftguide_zoomout_icon.png new file mode 100644 index 0000000..7db747f Binary files /dev/null and b/textures/craftguide_zoomout_icon.png differ