forked from minetest-mods/unified_inventory
Improve consistency of inventory (and alike) imagery
In a number of places, background[] is misused to place the inventory backdrop images. Where appropriate, image[] is used instead, so that "ui_form_bg.png" actually serves as the one and only true background image. In so doing, I was able to remake the bag inventory images, making them only big as is actually needed to hold 1, 2, or 3 rows of inventory slots. This, in turn, allows a standardized main inventory image to occupy the lower part of the window, which allows for consistent inventory image positioning and sizing from one page to another. I also removed ui_misc_form.png. Nothing in UI uses it, and any external mods that used it can just use the standard inventory and its background. Lastly, I reduced the background image to 512x384 px. It was unnecessarily large before, considering it has no real detail. The larger inventory images are all 512px wide, and multiples of 64px in height. Before, they were oddly sized.
This commit is contained in:
committed by
SmallJoker
parent
0f756a5d33
commit
ebd1d1f245
@ -65,13 +65,13 @@ function unified_inventory.get_formspec(player, page)
|
||||
local formspec = {
|
||||
"size[14,10]",
|
||||
pagedef.formspec_prepend and "" or "no_prepend[]",
|
||||
"background[-0.19,-0.25;14.4,10.75;ui_form_bg.png]" -- Background
|
||||
unified_inventory.standard_background -- Background
|
||||
}
|
||||
local n = 4
|
||||
|
||||
if draw_lite_mode then
|
||||
formspec[1] = "size[11,7.7]"
|
||||
formspec[3] = "background[-0.19,-0.2;11.4,8.4;ui_form_bg.png]"
|
||||
formspec[3] = unified_inventory.standard_background
|
||||
end
|
||||
|
||||
if unified_inventory.is_creative(player_name)
|
||||
@ -130,7 +130,7 @@ function unified_inventory.get_formspec(player, page)
|
||||
if fsdata.draw_inventory ~= false then
|
||||
-- Player inventory
|
||||
formspec[n] = "listcolors[#00000000;#00000000]"
|
||||
formspec[n+1] = "list[current_player;main;0,"..(ui_peruser.formspec_y + 3.5)..";8,4;]"
|
||||
formspec[n+1] = string.gsub(unified_inventory.standard_inv, "YYY", ui_peruser.formspec_y + 3.5)
|
||||
n = n+2
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user