Add clientside translations, more expensive crafts
This commit is contained in:
parent
f957841e0a
commit
19f26db01f
@ -1,12 +1,15 @@
|
|||||||
|
local S = upgrade_packs.translator
|
||||||
|
|
||||||
minetest.register_chatcommand("upgrade_packs", {
|
minetest.register_chatcommand("upgrade_packs", {
|
||||||
description = "Allows inserting upgrade packs without CSM",
|
description = S("Allows using upgrade packs without CSM"),
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
minetest.show_formspec(name, "upgrade_packs:gui_plain",
|
minetest.show_formspec(name, "upgrade_packs:gui_plain", ([[
|
||||||
"size[8,7]" ..
|
size[8,7]
|
||||||
"label[3,0;Upgrade Packs]" ..
|
label[3,0;%s]
|
||||||
"list[current_player;ugpacks;2,1;4,1;]" ..
|
list[current_player;ugpacks;2,1;4,1;]
|
||||||
"list[current_player;main;0,3;8,4;]" ..
|
list[current_player;main;0,3;8,4;]
|
||||||
"listring[]"
|
listring[]
|
||||||
|
]]):format(S("Upgrade Packs"))
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
})
|
})
|
@ -1,12 +1,14 @@
|
|||||||
|
local S = upgrade_packs.translator
|
||||||
|
|
||||||
sfinv.register_page("upgrade_packs:ugpacks", {
|
sfinv.register_page("upgrade_packs:ugpacks", {
|
||||||
title = "Upgrade Packs",
|
title = S("Upgrade Packs"),
|
||||||
get = function(self, player, context)
|
get = function(self, player, context)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
return sfinv.make_formspec(player, context,
|
return sfinv.make_formspec(player, context, ([[
|
||||||
"label[3,0.7;Upgrade Packs]" ..
|
label[3,0.7;%s]
|
||||||
"list[current_player;ugpacks;3,1.5;2,2;]" ..
|
list[current_player;ugpacks;3,1.5;2,2;]
|
||||||
"listring[current_player;main]" ..
|
listring[current_player;main]"
|
||||||
"listring[current_player;ugpacks]"
|
listring[current_player;ugpacks]
|
||||||
, true)
|
]]):format(S("Upgrade Packs")), true)
|
||||||
end
|
end
|
||||||
})
|
})
|
@ -1,7 +1,9 @@
|
|||||||
|
local S = upgrade_packs.translator
|
||||||
|
|
||||||
unified_inventory.register_button("ugpacks", {
|
unified_inventory.register_button("ugpacks", {
|
||||||
type = "image",
|
type = "image",
|
||||||
image = "heart.png",
|
image = "heart.png",
|
||||||
tooltip = "Upgrade Packs"
|
tooltip = S("Upgrade Packs")
|
||||||
})
|
})
|
||||||
|
|
||||||
unified_inventory.register_page("ugpacks", {
|
unified_inventory.register_page("ugpacks", {
|
||||||
@ -11,7 +13,7 @@ unified_inventory.register_page("ugpacks", {
|
|||||||
return { formspec = (
|
return { formspec = (
|
||||||
"no_prepend[]" ..
|
"no_prepend[]" ..
|
||||||
"listcolors[#888;#AAA;#111]" ..
|
"listcolors[#888;#AAA;#111]" ..
|
||||||
"label[3," .. (y - 0.1) .. ";Upgrade Packs]" ..
|
"label[3," .. (y - 0.1) .. ";" .. S("Upgrade Packs") .. "]" ..
|
||||||
"list[current_player;ugpacks;3," .. (y + 0.7) .. ";2,2;]" ..
|
"list[current_player;ugpacks;3," .. (y + 0.7) .. ";2,2;]" ..
|
||||||
"list[current_player;main;0," .. (y + 3.5) .. ";8,4;]" ..
|
"list[current_player;main;0," .. (y + 3.5) .. ";8,4;]" ..
|
||||||
"listring[]"
|
"listring[]"
|
||||||
|
1
init.lua
1
init.lua
@ -5,6 +5,7 @@ end
|
|||||||
upgrade_packs = {}
|
upgrade_packs = {}
|
||||||
upgrade_packs.health_items = {}
|
upgrade_packs.health_items = {}
|
||||||
upgrade_packs.breath_items = {}
|
upgrade_packs.breath_items = {}
|
||||||
|
upgrade_packs.translator = minetest.get_translator("upgrade_packs")
|
||||||
|
|
||||||
local modpath = minetest.get_modpath("upgrade_packs")
|
local modpath = minetest.get_modpath("upgrade_packs")
|
||||||
|
|
||||||
|
6
locale/template.txt
Normal file
6
locale/template.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# textdomain: upgrade_packs
|
||||||
|
|
||||||
|
+10 HP =
|
||||||
|
+5 Breath =
|
||||||
|
Allows inserting upgrade packs without CSM =
|
||||||
|
Upgrade Packs =
|
6
locale/upgrade_packs.de.tr
Normal file
6
locale/upgrade_packs.de.tr
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# textdomain: upgrade_packs
|
||||||
|
|
||||||
|
+10 HP=+10 Lebenspunkte
|
||||||
|
+5 Breath=+5 Atem
|
||||||
|
Allows using upgrade packs without CSM=Ermöglicht die Nutzung von Upgrade-Paketen ohne CSM
|
||||||
|
Upgrade Packs=Upgrade-Pakete
|
19
packs.lua
19
packs.lua
@ -1,22 +1,25 @@
|
|||||||
|
local S = upgrade_packs.translator
|
||||||
|
|
||||||
upgrade_packs.register_pack("upgrade_packs:hp_10", "health", {
|
upgrade_packs.register_pack("upgrade_packs:hp_10", "health", {
|
||||||
description = "+10 HP",
|
description = S("+10 HP"),
|
||||||
strength = 10,
|
strength = 10,
|
||||||
image = "heart.png"
|
image = "heart.png"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local mc = "default:mese_crystal"
|
||||||
local gb = "vessels:glass_bottle"
|
local gb = "vessels:glass_bottle"
|
||||||
local ci = "default:copper_ingot"
|
local ci = "default:copper_ingot"
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "upgrade_packs:hp_10",
|
output = "upgrade_packs:hp_10",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ci, gb, ci},
|
{ci, mc, ci},
|
||||||
{gb, "", gb},
|
{mc, gb, mc},
|
||||||
{ci, gb, ci}
|
{ci, mc, ci}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
upgrade_packs.register_pack("upgrade_packs:breath_5", "breath", {
|
upgrade_packs.register_pack("upgrade_packs:breath_5", "breath", {
|
||||||
description = "+5 Breath",
|
description = S("+5 Breath"),
|
||||||
strength = 5,
|
strength = 5,
|
||||||
image = "bubble.png"
|
image = "bubble.png"
|
||||||
})
|
})
|
||||||
@ -26,9 +29,9 @@ local ti = "default:tin_ingot"
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "upgrade_packs:breath_5",
|
output = "upgrade_packs:breath_5",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ti, sb, ti},
|
{ti, mc, ti},
|
||||||
{sb, "", sb},
|
{mc, sb, mc},
|
||||||
{ti, sb, ti}
|
{ti, mc, ti}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user