Skip to content

Commit

Permalink
Polish inventory (#1340)
Browse files Browse the repository at this point in the history
* Make icon look better

* Make icon look even better

* Add more icons

* Improve spacing

* Slightly improve spacing more

* Fix off-centered trash icon
  • Loading branch information
a-blob authored Aug 16, 2024
1 parent 3c05995 commit e7543d7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions mods/other/crafting/gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,22 @@ function crafting.make_result_selector(player, size, context)
table_insert(formspec, "style_type[item_image_button;border=false]")

table_insert(formspec, "field_close_on_enter[query;false]")
table_insert(formspec, "field[-4.75,0.81;3,0.8;query;;")
table_insert(formspec, "field[-4.75,1.21;3,0.8;query;;")
table_insert(formspec, context.crafting_query)
table_insert(formspec, "]button[-2.2,0.5;0.8,0.8;search;?]")
table_insert(formspec, "button[-1.4,0.5;0.8,0.8;prev;<]")
table_insert(formspec, "button[-0.8,0.5;0.8,0.8;next;>]")
table_insert(formspec, "]image_button[-2.2,0.9;0.8,0.8;crafting_search_icon.png;search;]")
table_insert(formspec, "image_button[-1.4,0.9;0.8,0.8;crafting_prev_icon.png;prev;]")
table_insert(formspec, "image_button[-0.8,0.9;0.8,0.8;crafting_next_icon.png;next;]")

table_insert(formspec, "container_end[]")

table_insert(formspec, "label[0,-0.25;")
table_insert(formspec, "label[0,-0.1;")
table_insert(formspec, minetest.formspec_escape(
"Page: " .. page .. "/" .. max_pages)
)
table_insert(formspec, "]")

local x = 0
local y = 0
local y = 0.3
local y_offset = 0.2
for i = start_i, math.min(#recipes, start_i * num_per_page) do
local result = recipes[i]
Expand Down Expand Up @@ -200,9 +200,9 @@ if minetest.global_exists("sfinv") then
crafting.calc_inventory_list_hash(player:get_inventory(), "main")

local formspec = crafting.make_result_selector(player, { x = 8, y = 3 }, context)
formspec = formspec .. "list[detached:crafting_trash;main;0,3.4;1,1;]" ..
"image[0.05,3.5;0.8,0.8;crafting_trash_icon.png]" ..
"image_button[1,3.4;1,1;crafting_save_icon.png;save_inv_order;]" ..
formspec = formspec .. "list[detached:crafting_trash;main;0,3.8;1,1;]" ..
"image[0.07,3.9;0.8,0.8;crafting_trash_icon.png]" ..
"image_button[1,3.8;1,1;crafting_save_icon.png;save_inv_order;]" ..
"tooltip[save_inv_order;Saves the order of the items in your inventory" ..
"\n(Your saved order is used when you respawn, and is per-mode)]"

Expand Down
Binary file added mods/other/crafting/textures/crafting_next_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mods/other/crafting/textures/crafting_prev_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mods/other/crafting/textures/crafting_save_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e7543d7

Please sign in to comment.