Remove trailing whitespace
This commit is contained in:
parent
d560bcd6f0
commit
26473a8346
2
api.lua
2
api.lua
@ -11,7 +11,7 @@ minetest.after(0.01, function()
|
|||||||
if unified_inventory.crafts_table[name] == nil then
|
if unified_inventory.crafts_table[name] == nil then
|
||||||
unified_inventory.crafts_table[name] = {}
|
unified_inventory.crafts_table[name] = {}
|
||||||
end
|
end
|
||||||
if recipes then
|
if recipes then
|
||||||
for i=1,#recipes,1 do
|
for i=1,#recipes,1 do
|
||||||
table.insert(unified_inventory.crafts_table[name],recipes[i])
|
table.insert(unified_inventory.crafts_table[name],recipes[i])
|
||||||
end
|
end
|
||||||
|
@ -11,7 +11,7 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
unified_inventory.current_item[player_name] = nil
|
unified_inventory.current_item[player_name] = nil
|
||||||
unified_inventory.set_inventory_formspec(player,
|
unified_inventory.set_inventory_formspec(player,
|
||||||
unified_inventory.default)
|
unified_inventory.default)
|
||||||
|
|
||||||
-- Crafting guide inventories
|
-- Crafting guide inventories
|
||||||
local inv = minetest.create_detached_inventory(player_name.."craftrecipe", {
|
local inv = minetest.create_detached_inventory(player_name.."craftrecipe", {
|
||||||
allow_put = function(inv, listname, index, stack, player)
|
allow_put = function(inv, listname, index, stack, player)
|
||||||
@ -62,7 +62,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Inventory page controls
|
-- Inventory page controls
|
||||||
local start = math.floor(
|
local start = math.floor(
|
||||||
unified_inventory.current_index[player_name] / 80 + 1)
|
unified_inventory.current_index[player_name] / 80 + 1)
|
||||||
@ -70,7 +70,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
local pagemax = math.floor(
|
local pagemax = math.floor(
|
||||||
(#unified_inventory.filtered_items_list[player_name] - 1)
|
(#unified_inventory.filtered_items_list[player_name] - 1)
|
||||||
/ (80) + 1)
|
/ (80) + 1)
|
||||||
|
|
||||||
if fields.start_list then
|
if fields.start_list then
|
||||||
minetest.sound_play("paperflip1",
|
minetest.sound_play("paperflip1",
|
||||||
{to_player=player_name, gain = 1.0})
|
{to_player=player_name, gain = 1.0})
|
||||||
@ -155,8 +155,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
unified_inventory.current_page[player_name])
|
unified_inventory.current_page[player_name])
|
||||||
minetest.sound_play("paperflip2",
|
minetest.sound_play("paperflip2",
|
||||||
{to_player=player_name, gain = 1.0})
|
{to_player=player_name, gain = 1.0})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- alternate button
|
-- alternate button
|
||||||
if fields.alternate then
|
if fields.alternate then
|
||||||
minetest.sound_play("click",
|
minetest.sound_play("click",
|
||||||
@ -174,7 +174,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
if alternate > alternates then
|
if alternate > alternates then
|
||||||
alternate = 1
|
alternate = 1
|
||||||
end
|
end
|
||||||
unified_inventory.alternate[player_name] = alternate
|
unified_inventory.alternate[player_name] = alternate
|
||||||
unified_inventory.set_inventory_formspec(player,
|
unified_inventory.set_inventory_formspec(player,
|
||||||
unified_inventory.current_page[player_name])
|
unified_inventory.current_page[player_name])
|
||||||
end
|
end
|
||||||
|
4
init.lua
4
init.lua
@ -24,12 +24,12 @@ unified_inventory.buttons = {}
|
|||||||
unified_inventory.home_pos = {}
|
unified_inventory.home_pos = {}
|
||||||
unified_inventory.home_filename =
|
unified_inventory.home_filename =
|
||||||
worldpath.."/unified_inventory_home.home"
|
worldpath.."/unified_inventory_home.home"
|
||||||
|
|
||||||
-- Default inventory page
|
-- Default inventory page
|
||||||
unified_inventory.default = "craft"
|
unified_inventory.default = "craft"
|
||||||
|
|
||||||
-- Disable default creative inventory
|
-- Disable default creative inventory
|
||||||
if creative_inventory then
|
if creative_inventory then
|
||||||
function creative_inventory.set_creative_formspec(player, start_i, pagenum)
|
function creative_inventory.set_creative_formspec(player, start_i, pagenum)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -62,7 +62,7 @@ function unified_inventory.get_formspec(player, page)
|
|||||||
local item = {}
|
local item = {}
|
||||||
for y = 0, 9 do
|
for y = 0, 9 do
|
||||||
for x = 0, 7 do
|
for x = 0, 7 do
|
||||||
local name = unified_inventory.filtered_items_list[player_name][list_index]
|
local name = unified_inventory.filtered_items_list[player_name][list_index]
|
||||||
if minetest.registered_items[name] then
|
if minetest.registered_items[name] then
|
||||||
formspec = formspec.."item_image_button["
|
formspec = formspec.."item_image_button["
|
||||||
..(8.2 + x * 0.7)..","
|
..(8.2 + x * 0.7)..","
|
||||||
@ -89,7 +89,7 @@ end
|
|||||||
|
|
||||||
--apply filter to the inventory list (create filtered copy of full one)
|
--apply filter to the inventory list (create filtered copy of full one)
|
||||||
function unified_inventory.apply_filter(player, filter)
|
function unified_inventory.apply_filter(player, filter)
|
||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
local size = 0
|
local size = 0
|
||||||
local lfilter = string.lower(filter)
|
local lfilter = string.lower(filter)
|
||||||
if not pcall(function() ("technic:test"):find(lfilter) end) then
|
if not pcall(function() ("technic:test"):find(lfilter) end) then
|
||||||
|
@ -62,7 +62,7 @@ unified_inventory.register_button("misc_set_day", {
|
|||||||
image = "ui_sun_icon.png",
|
image = "ui_sun_icon.png",
|
||||||
action = function(player)
|
action = function(player)
|
||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
if minetest.check_player_privs(player_name, {settime=true}) then
|
if minetest.check_player_privs(player_name, {settime=true}) then
|
||||||
minetest.sound_play("birds",
|
minetest.sound_play("birds",
|
||||||
{to_player=player_name, gain = 1.0})
|
{to_player=player_name, gain = 1.0})
|
||||||
minetest.set_timeofday((6000 % 24000) / 24000)
|
minetest.set_timeofday((6000 % 24000) / 24000)
|
||||||
@ -90,7 +90,7 @@ unified_inventory.register_button("misc_set_night", {
|
|||||||
else
|
else
|
||||||
minetest.chat_send_player(player_name,
|
minetest.chat_send_player(player_name,
|
||||||
"You don't have the"
|
"You don't have the"
|
||||||
.." settime priviledge!")
|
.." settime priviledge!")
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user