mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2025-07-01 16:00:31 +02:00
added support for intllib translation mod
This commit is contained in:
24
bags.lua
24
bags.lua
@ -3,15 +3,23 @@
|
|||||||
-- Copyright (c) 2012 cornernote, Brett O'Donnell <cornernote@gmail.com>
|
-- Copyright (c) 2012 cornernote, Brett O'Donnell <cornernote@gmail.com>
|
||||||
-- License: GPLv3
|
-- License: GPLv3
|
||||||
|
|
||||||
|
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||||
|
local S
|
||||||
|
if intllib then
|
||||||
|
S = intllib.Getter()
|
||||||
|
else
|
||||||
|
S = function(s) return s end
|
||||||
|
end
|
||||||
|
|
||||||
unified_inventory.register_page("bags", {
|
unified_inventory.register_page("bags", {
|
||||||
get_formspec = function(player)
|
get_formspec = function(player)
|
||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
local formspec = "background[0.06,0.99;7.92,7.52;ui_bags_main_form.png]"
|
local formspec = "background[0.06,0.99;7.92,7.52;ui_bags_main_form.png]"
|
||||||
formspec = formspec.."label[0,0;Bags]"
|
formspec = formspec.."label[0,0;"..S("Bags").."]"
|
||||||
formspec = formspec.."button[0,2;2,0.5;bag1;Bag 1]"
|
formspec = formspec.."button[0,2;2,0.5;bag1;"..S("Bag 1").."]"
|
||||||
formspec = formspec.."button[2,2;2,0.5;bag2;Bag 2]"
|
formspec = formspec.."button[2,2;2,0.5;bag2;"..S("Bag 2").."]"
|
||||||
formspec = formspec.."button[4,2;2,0.5;bag3;Bag 3]"
|
formspec = formspec.."button[4,2;2,0.5;bag3;"..S("Bag 3").."]"
|
||||||
formspec = formspec.."button[6,2;2,0.5;bag4;Bag 4]"
|
formspec = formspec.."button[6,2;2,0.5;bag4;"..S("Bag 4").."]"
|
||||||
formspec = formspec.."listcolors[#00000000;#00000000]"
|
formspec = formspec.."listcolors[#00000000;#00000000]"
|
||||||
formspec = formspec.."list[detached:"..player_name.."_bags;bag1;0.5,1;1,1;]"
|
formspec = formspec.."list[detached:"..player_name.."_bags;bag1;0.5,1;1,1;]"
|
||||||
formspec = formspec.."list[detached:"..player_name.."_bags;bag2;2.5,1;1,1;]"
|
formspec = formspec.."list[detached:"..player_name.."_bags;bag2;2.5,1;1,1;]"
|
||||||
@ -102,19 +110,19 @@ end)
|
|||||||
|
|
||||||
-- register bag tools
|
-- register bag tools
|
||||||
minetest.register_tool("unified_inventory:bag_small", {
|
minetest.register_tool("unified_inventory:bag_small", {
|
||||||
description = "Small Bag",
|
description = S("Small Bag"),
|
||||||
inventory_image = "bags_small.png",
|
inventory_image = "bags_small.png",
|
||||||
groups = {bagslots=8},
|
groups = {bagslots=8},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("unified_inventory:bag_medium", {
|
minetest.register_tool("unified_inventory:bag_medium", {
|
||||||
description = "Medium Bag",
|
description = S("Medium Bag"),
|
||||||
inventory_image = "bags_medium.png",
|
inventory_image = "bags_medium.png",
|
||||||
groups = {bagslots=16},
|
groups = {bagslots=16},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("unified_inventory:bag_large", {
|
minetest.register_tool("unified_inventory:bag_large", {
|
||||||
description = "Large Bag",
|
description = S("Large Bag"),
|
||||||
inventory_image = "bags_large.png",
|
inventory_image = "bags_large.png",
|
||||||
groups = {bagslots=24},
|
groups = {bagslots=24},
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user