mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2024-11-05 01:30:27 +01:00
increase size and tweak position of "give/to grid" buttons
and make them vary in pos with lite vs full mode
This commit is contained in:
parent
5ec4b986bb
commit
a0c06516f4
1
init.lua
1
init.lua
|
@ -45,6 +45,7 @@ unified_inventory = {
|
||||||
craft_x = 2.8,
|
craft_x = 2.8,
|
||||||
craft_y = 1.15,
|
craft_y = 1.15,
|
||||||
resultstr_y = 0.6,
|
resultstr_y = 0.6,
|
||||||
|
give_btn_x = 0.25,
|
||||||
main_button_x = 0.4,
|
main_button_x = 0.4,
|
||||||
main_button_y = 11.0,
|
main_button_y = 11.0,
|
||||||
page_buttons_x = 11.60,
|
page_buttons_x = 11.60,
|
||||||
|
|
|
@ -31,6 +31,7 @@ function unified_inventory.get_per_player_formspec(player_name)
|
||||||
ui.craft_x = unified_inventory.craft_x
|
ui.craft_x = unified_inventory.craft_x
|
||||||
ui.craft_y = unified_inventory.craft_y
|
ui.craft_y = unified_inventory.craft_y
|
||||||
ui.resultstr_y = unified_inventory.resultstr_y
|
ui.resultstr_y = unified_inventory.resultstr_y
|
||||||
|
ui.give_btn_x = unified_inventory.give_btn_x
|
||||||
ui.main_button_x = unified_inventory.main_button_x
|
ui.main_button_x = unified_inventory.main_button_x
|
||||||
ui.main_button_y = unified_inventory.main_button_y
|
ui.main_button_y = unified_inventory.main_button_y
|
||||||
ui.page_buttons_x = unified_inventory.page_buttons_x
|
ui.page_buttons_x = unified_inventory.page_buttons_x
|
||||||
|
@ -56,6 +57,7 @@ function unified_inventory.get_per_player_formspec(player_name)
|
||||||
ui.craft_x = 2.6
|
ui.craft_x = 2.6
|
||||||
ui.craft_y = 0.75
|
ui.craft_y = 0.75
|
||||||
ui.resultstr_y = 0.35
|
ui.resultstr_y = 0.35
|
||||||
|
ui.give_btn_x = 0.15
|
||||||
ui.main_button_x = ui.page_x
|
ui.main_button_x = ui.page_x
|
||||||
ui.main_button_y = 7.8
|
ui.main_button_y = 7.8
|
||||||
ui.page_buttons_x = ui.page_x
|
ui.page_buttons_x = ui.page_x
|
||||||
|
|
17
register.lua
17
register.lua
|
@ -268,6 +268,7 @@ unified_inventory.register_page("craftguide", {
|
||||||
local craftresultx = craftx + 5
|
local craftresultx = craftx + 5
|
||||||
local formheaderx = perplayer_formspec.form_header_x
|
local formheaderx = perplayer_formspec.form_header_x
|
||||||
local formheadery = perplayer_formspec.form_header_y
|
local formheadery = perplayer_formspec.form_header_y
|
||||||
|
local give_x = perplayer_formspec.give_btn_x
|
||||||
|
|
||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
local player_privs = minetest.get_player_privs(player_name)
|
local player_privs = minetest.get_player_privs(player_name)
|
||||||
|
@ -307,10 +308,10 @@ unified_inventory.register_page("craftguide", {
|
||||||
craftx-2.3, perplayer_formspec.resultstr_y, F(role_text[dir]), item_name_shown)
|
craftx-2.3, perplayer_formspec.resultstr_y, F(role_text[dir]), item_name_shown)
|
||||||
|
|
||||||
local giveme_form = table.concat({
|
local giveme_form = table.concat({
|
||||||
"label[".. (craftx-2.3).."," .. (crafty + 2.7) .. ";" .. F(S("Give me:")) .. "]",
|
"label[".. (give_x+0.1)..",".. (crafty + 2.7) .. ";" .. F(S("Give me:")) .. "]",
|
||||||
"button["..(craftx-2.4).."," .. (crafty + 2.9) .. ";0.5,0.5;craftguide_giveme_1;1]",
|
"button["..(give_x)..",".. (crafty + 2.9) .. ";0.75,0.5;craftguide_giveme_1;1]",
|
||||||
"button["..(craftx-1.85).."," .. (crafty + 2.9) .. ";0.5,0.5;craftguide_giveme_10;10]",
|
"button["..(give_x+0.8)..",".. (crafty + 2.9) .. ";0.75,0.5;craftguide_giveme_10;10]",
|
||||||
"button["..(craftx-1.3).."," .. (crafty + 2.9) .. ";0.5,0.5;craftguide_giveme_99;99]"
|
"button["..(give_x+1.6)..",".. (crafty + 2.9) .. ";0.75,0.5;craftguide_giveme_99;99]"
|
||||||
})
|
})
|
||||||
|
|
||||||
if not craft then
|
if not craft then
|
||||||
|
@ -400,10 +401,10 @@ unified_inventory.register_page("craftguide", {
|
||||||
end
|
end
|
||||||
|
|
||||||
if craft_type.uses_crafting_grid and display_size.width <= 3 then
|
if craft_type.uses_crafting_grid and display_size.width <= 3 then
|
||||||
fs[#fs + 1] = "label["..(craftx-2.3).."," .. (crafty + 1.7) .. ";" .. F(S("To craft grid:")) .. "]"
|
fs[#fs + 1] = "label["..(give_x+0.1)..",".. (crafty + 1.7) .. ";" .. F(S("To craft grid:")) .. "]"
|
||||||
.. "button[".. (craftx-2.4).."," .. (crafty + 1.9) .. ";0.5,0.5;craftguide_craft_1;1]"
|
.. "button[".. (give_x)..",".. (crafty + 1.9) .. ";0.75,0.5;craftguide_craft_1;1]"
|
||||||
.. "button[".. (craftx-1.85)..",".. (crafty + 1.9) .. ";0.5,0.5;craftguide_craft_10;10]"
|
.. "button[".. (give_x+0.8)..",".. (crafty + 1.9) .. ";0.75,0.5;craftguide_craft_10;10]"
|
||||||
.. "button[".. (craftx-1.3).."," .. (crafty + 1.9) .. ";0.5,0.5;craftguide_craft_max;" .. F(S("All")) .. "]"
|
.. "button[".. (give_x+1.6)..",".. (crafty + 1.9) .. ";0.75,0.5;craftguide_craft_max;" .. F(S("All")) .. "]"
|
||||||
end
|
end
|
||||||
if has_give then
|
if has_give then
|
||||||
fs[#fs + 1] = giveme_form
|
fs[#fs + 1] = giveme_form
|
||||||
|
|
Loading…
Reference in New Issue
Block a user