mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2025-06-29 23:10:45 +02:00
Merge remote-tracking branch 'github/master'
This commit is contained in:
15
register.lua
15
register.lua
@ -49,7 +49,7 @@ ui.register_button("misc_set_day", {
|
||||
action = function(player)
|
||||
local player_name = player:get_player_name()
|
||||
if minetest.check_player_privs(player_name, {settime=true}) then
|
||||
minetest.sound_play("birds",
|
||||
minetest.sound_play("ui_morning",
|
||||
{to_player=player_name, gain = 1.0})
|
||||
minetest.set_timeofday((6000 % 24000) / 24000)
|
||||
minetest.chat_send_player(player_name,
|
||||
@ -73,7 +73,7 @@ ui.register_button("misc_set_night", {
|
||||
action = function(player)
|
||||
local player_name = player:get_player_name()
|
||||
if minetest.check_player_privs(player_name, {settime=true}) then
|
||||
minetest.sound_play("owl",
|
||||
minetest.sound_play("ui_owl",
|
||||
{to_player=player_name, gain = 1.0})
|
||||
minetest.set_timeofday((21000 % 24000) / 24000)
|
||||
minetest.chat_send_player(player_name,
|
||||
@ -134,14 +134,14 @@ ui.register_page("craft", {
|
||||
local n=#formspec+1
|
||||
|
||||
if ui.trash_enabled or ui.is_creative(player_name) or minetest.get_player_privs(player_name).give then
|
||||
formspec[n] = string.format("label[%f,%f;%s]", craftx + 6.45, crafty + 2.4, F(S("Trash:")))
|
||||
formspec[n] = string.format("label[%f,%f;%s]", craftx + 6.35, crafty + 2.3, F(S("Trash:")))
|
||||
formspec[n+1] = ui.make_trash_slot(craftx + 6.25, crafty + 2.5)
|
||||
n=n + 2
|
||||
end
|
||||
|
||||
if ui.is_creative(player_name) then
|
||||
formspec[n] = ui.single_slot(craftx - 2.5, crafty + 2.5)
|
||||
formspec[n+1] = string.format("label[%f,%f;%s]", craftx - 2.3, crafty + 2.4,F(S("Refill:")))
|
||||
formspec[n+1] = string.format("label[%f,%f;%s]", craftx - 2.4, crafty + 2.3, F(S("Refill:")))
|
||||
formspec[n+2] = string.format("list[detached:%srefill;main;%f,%f;1,1;]",
|
||||
F(player_name), craftx - 2.5 + ui.list_img_offset, crafty + 2.5 + ui.list_img_offset)
|
||||
end
|
||||
@ -158,11 +158,9 @@ ui.register_page("craft", {
|
||||
|
||||
local function stack_image_button(x, y, w, h, buttonname_prefix, item)
|
||||
local name = item:get_name()
|
||||
local count = item:get_count()
|
||||
local wear = item:get_wear()
|
||||
local description = item:get_meta():get_string("description")
|
||||
local show_is_group = false
|
||||
local displayitem = name.." "..count.." "..wear
|
||||
local displayitem = item:to_string()
|
||||
local selectitem = name
|
||||
if name:sub(1, 6) == "group:" then
|
||||
local group_name = name:sub(7)
|
||||
@ -196,6 +194,9 @@ local function stack_image_button(x, y, w, h, buttonname_prefix, item)
|
||||
return button
|
||||
end
|
||||
|
||||
-- The recipe text contains parameters, hence they can yet not be translated.
|
||||
-- Instead, use a dummy translation call so that it can be picked up by the
|
||||
-- static parsing of the translation string update script
|
||||
local recipe_text = {
|
||||
recipe = NS("Recipe @1 of @2"),
|
||||
usage = NS("Usage @1 of @2"),
|
||||
|
Reference in New Issue
Block a user