diff --git a/anvil/locale/anvil.fr.tr b/anvil/locale/anvil.fr.tr index ff8838c8..3ec48a19 100644 --- a/anvil/locale/anvil.fr.tr +++ b/anvil/locale/anvil.fr.tr @@ -2,8 +2,8 @@ # ./init.lua -@1 cannot be repaired with an anvil.= -@1's anvil= +@1 cannot be repaired with an anvil.=@1 ne peut pas être réparé avec une enclume. +@1's anvil=enclume de @1 A tool for repairing other tools at a blacksmith's anvil.=Un outil pour réparer les autres outils avec une enclume de forgeron. A tool for repairing other tools in conjunction with a blacksmith's hammer.=Un outil pour réparer les autres outils à utiliser avec un marteau de forgeron. Anvil=Enclume @@ -11,4 +11,4 @@ Right-click on this anvil with a damaged tool to place the damaged tool upon it. Steel blacksmithing hammer=Marteau de forgeron en acier This anvil is for damaged tools only.=L'enclume s'utilise sur les outils endommagés. Use this hammer to strike blows upon an anvil bearing a damaged tool and you can repair it. It can also be used for smashing stone, but it is not well suited to this task.=Utilisez ce marteau pour frapper une enclume contenant un outil endommagé, ainsi vous pourrez le réparer. Il peut être aussi utilisé pour casser de la pierre, mais il n'est pas adapté à cette tâche. -Your @1 has been repaired successfully.=Votre @1 a été réparé avec succès. \ No newline at end of file +Your @1 has been repaired successfully.=Votre @1 a été réparé avec succès. diff --git a/areas/.luacheckrc b/areas/.luacheckrc index c0ea9915..fc9c1483 100644 --- a/areas/.luacheckrc +++ b/areas/.luacheckrc @@ -9,7 +9,6 @@ read_globals = { "VoxelManip", "VoxelArea", "PseudoRandom", "ItemStack", "AreaStore", - "intllib", "default", table = { fields = { "copy", "getn" } } } diff --git a/areas/chatcommands.lua b/areas/chatcommands.lua index faffb03a..9152e39d 100644 --- a/areas/chatcommands.lua +++ b/areas/chatcommands.lua @@ -1,15 +1,16 @@ +local S = minetest.get_translator("areas") minetest.register_chatcommand("protect", { - params = "", - description = "Protect your own area", + params = S(""), + description = S("Protect your own area"), privs = {[areas.config.self_protection_privilege]=true}, func = function(name, param) if param == "" then - return false, "Invalid usage, see /help protect." + return false, S("Invalid usage, see /help @1.", "protect") end local pos1, pos2 = areas:getPos(name) if not (pos1 and pos2) then - return false, "You need to select an area first." + return false, S("You need to select an area first.") end minetest.log("action", "/protect invoked, owner="..name.. @@ -19,38 +20,37 @@ minetest.register_chatcommand("protect", { local canAdd, errMsg = areas:canPlayerAddArea(pos1, pos2, name) if not canAdd then - return false, "You can't protect that area: "..errMsg + return false, S("You can't protect that area: @1", errMsg) end local id = areas:add(name, param, pos1, pos2, nil) areas:save() - return true, "Area protected. ID: "..id + return true, S("Area protected. ID: @1", id) end }) minetest.register_chatcommand("set_owner", { - params = " ", - description = "Protect an area beetween two positions and give" + params = S("").." "..S(""), + description = S("Protect an area between two positions and give" .." a player access to it without setting the parent of the" - .." area to any existing area", + .." area to any existing area"), privs = areas.adminPrivs, func = function(name, param) local ownerName, areaName = param:match('^(%S+)%s(.+)$') if not ownerName then - return false, "Incorrect usage, see /help set_owner." + return false, S("Invalid usage, see /help @1.", "set_owner") end local pos1, pos2 = areas:getPos(name) if not (pos1 and pos2) then - return false, "You need to select an area first." + return false, S("You need to select an area first.") end if not areas:player_exists(ownerName) then - return false, "The player \"" - ..ownerName.."\" does not exist." + return false, S("The player \"@1\" does not exist.", ownerName) end minetest.log("action", name.." runs /set_owner. Owner = "..ownerName.. @@ -62,34 +62,34 @@ minetest.register_chatcommand("set_owner", { areas:save() minetest.chat_send_player(ownerName, - "You have been granted control over area #".. - id..". Type /list_areas to show your areas.") - return true, "Area protected. ID: "..id + S("You have been granted control over area #@1. ".. + "Type /list_areas to show your areas.", id)) + return true, S("Area protected. ID: @1", id) end }) minetest.register_chatcommand("add_owner", { - params = " ", - description = "Give a player access to a sub-area beetween two" + params = S("").." "..S("").." "..S(""), + description = S("Give a player access to a sub-area beetween two" .." positions that have already been protected," - .." Use set_owner if you don't want the parent to be set.", + .." Use set_owner if you don't want the parent to be set."), func = function(name, param) local pid, ownerName, areaName = param:match('^(%d+) ([^ ]+) (.+)$') if not pid then - minetest.chat_send_player(name, "Incorrect usage, see /help add_owner") + minetest.chat_send_player(name, S("Invalid usage, see /help @1.", "add_owner")) return end local pos1, pos2 = areas:getPos(name) if not (pos1 and pos2) then - return false, "You need to select an area first." + return false, S("You need to select an area first.") end if not areas:player_exists(ownerName) then - return false, "The player \""..ownerName.."\" does not exist." + return false, S("The player \"@1\" does not exist.", ownerName) end minetest.log("action", name.." runs /add_owner. Owner = "..ownerName.. @@ -101,52 +101,52 @@ minetest.register_chatcommand("add_owner", { pid = tonumber(pid) if (not areas:isAreaOwner(pid, name)) or (not areas:isSubarea(pos1, pos2, pid)) then - return false, "You can't protect that area." + return false, S("You can't protect that area.") end local id = areas:add(ownerName, areaName, pos1, pos2, pid) areas:save() minetest.chat_send_player(ownerName, - "You have been granted control over area #".. - id..". Type /list_areas to show your areas.") - return true, "Area protected. ID: "..id + S("You have been granted control over area #@1. ".. + "Type /list_areas to show your areas.", id)) + return true, S("Area protected. ID: @1", id) end }) minetest.register_chatcommand("rename_area", { - params = " ", - description = "Rename a area that you own", + params = S("").." "..S(""), + description = S("Rename an area that you own"), func = function(name, param) local id, newName = param:match("^(%d+)%s(.+)$") if not id then - return false, "Invalid usage, see /help rename_area." + return false, S("Invalid usage, see /help @1.", "rename_area") end id = tonumber(id) if not id then - return false, "That area doesn't exist." + return false, S("That area doesn't exist.") end if not areas:isAreaOwner(id, name) then - return true, "You don't own that area." + return true, S("You don't own that area.") end areas.areas[id].name = newName areas:save() - return true, "Area renamed." + return true, S("Area renamed.") end }) minetest.register_chatcommand("find_areas", { params = "", - description = "Find areas using a Lua regular expression", + description = S("Find areas using a Lua regular expression"), privs = areas.adminPrivs, func = function(name, param) if param == "" then - return false, "A regular expression is required." + return false, S("A regular expression is required.") end -- Check expression for validity @@ -154,7 +154,7 @@ minetest.register_chatcommand("find_areas", { ("Test [1]: Player (0,0,0) (0,0,0)"):find(param) end if not pcall(testRegExp) then - return false, "Invalid regular expression." + return false, S("Invalid regular expression.") end local matches = {} @@ -167,14 +167,14 @@ minetest.register_chatcommand("find_areas", { if #matches > 0 then return true, table.concat(matches, "\n") else - return true, "No matches found." + return true, S("No matches found.") end end }) minetest.register_chatcommand("list_areas", { - description = "List your areas, or all areas if you are an admin.", + description = S("List your areas, or all areas if you are an admin."), func = function(name, param) local admin = minetest.check_player_privs(name, areas.adminPrivs) local areaStrings = {} @@ -184,7 +184,7 @@ minetest.register_chatcommand("list_areas", { end end if #areaStrings == 0 then - return true, "No visible areas." + return true, S("No visible areas.") end return true, table.concat(areaStrings, "\n") end @@ -192,154 +192,154 @@ minetest.register_chatcommand("list_areas", { minetest.register_chatcommand("recursive_remove_areas", { - params = "", - description = "Recursively remove areas using an id", + params = S(""), + description = S("Recursively remove areas using an ID"), func = function(name, param) local id = tonumber(param) if not id then - return false, "Invalid usage, see" - .." /help recursive_remove_areas" + return false, S("Invalid usage, see" + .." /help @1.", "recursive_remove_areas") end if not areas:isAreaOwner(id, name) then - return false, "Area "..id.." does not exist or is" - .." not owned by you." + return false, S("Area @1 does not exist or is" + .." not owned by you.", id) end areas:remove(id, true) areas:save() - return true, "Removed area "..id.." and it's sub areas." + return true, S("Removed area @1 and it's sub areas.", id) end }) minetest.register_chatcommand("remove_area", { - params = "", - description = "Remove an area using an id", + params = S(""), + description = S("Remove an area using an ID"), func = function(name, param) local id = tonumber(param) if not id then - return false, "Invalid usage, see /help remove_area" + return false, S("Invalid usage, see /help @1.", "remove_area") end if not areas:isAreaOwner(id, name) then - return false, "Area "..id.." does not exist or" - .." is not owned by you." + return false, S("Area @1 does not exist or" + .." is not owned by you.", id) end areas:remove(id) areas:save() - return true, "Removed area "..id + return true, S("Removed area @1", id) end }) minetest.register_chatcommand("change_owner", { - params = " ", - description = "Change the owner of an area using it's ID", + params = S("").." "..S(""), + description = S("Change the owner of an area using its ID"), func = function(name, param) local id, newOwner = param:match("^(%d+)%s(%S+)$") if not id then - return false, "Invalid usage, see" - .." /help change_owner." + return false, S("Invalid usage, see" + .." /help @1.", "change_owner") end if not areas:player_exists(newOwner) then - return false, "The player \""..newOwner - .."\" does not exist." + return false, S("The player \"@1\" does not exist.", newOwner) end id = tonumber(id) if not areas:isAreaOwner(id, name) then - return false, "Area "..id.." does not exist" - .." or is not owned by you." + return false, S("Area @1 does not exist" + .." or is not owned by you.", id) end areas.areas[id].owner = newOwner areas:save() minetest.chat_send_player(newOwner, - ("%s has given you control over the area %q (ID %d).") - :format(name, areas.areas[id].name, id)) - return true, "Owner changed." + S("@1 has given you control over the area \"@2\" (ID @3).", + name, areas.areas[id].name, id)) + return true, S("Owner changed.") end }) minetest.register_chatcommand("area_open", { - params = "", - description = "Toggle an area open (anyone can interact) or closed", + params = S(""), + description = S("Toggle an area open (anyone can interact) or closed"), func = function(name, param) local id = tonumber(param) if not id then - return false, "Invalid usage, see /help area_open." + return false, S("Invalid usage, see /help @1.", "area_open") end if not areas:isAreaOwner(id, name) then - return false, "Area "..id.." does not exist" - .." or is not owned by you." + return false, S("Area @1 does not exist" + .." or is not owned by you.", id) end local open = not areas.areas[id].open -- Save false as nil to avoid inflating the DB. areas.areas[id].open = open or nil areas:save() - return true, ("Area %s."):format(open and "opened" or "closed") + return true, open and S("Area opened.") or S("Area closed.") end }) if areas.factions_available then minetest.register_chatcommand("area_faction_open", { - params = "", - description = "Toggle an area open/closed for members in your faction.", + params = S(""), + description = S("Toggle an area open/closed for members in your faction."), func = function(name, param) local id = tonumber(param) if not id then - return false, "Invalid usage, see /help area_faction_open." + return false, S("Invalid usage, see /help @1.", "area_faction_open") end if not areas:isAreaOwner(id, name) then - return false, "Area "..id.." does not exist" - .." or is not owned by you." + return false, S("Area @1 does not exist" + .." or is not owned by you.", id) end local open = not areas.areas[id].faction_open -- Save false as nil to avoid inflating the DB. areas.areas[id].faction_open = open or nil areas:save() - return true, ("Area %s for faction members."):format(open and "opened" or "closed") + return true, open and S("Area opened for faction members.") + or S("Area closed for faction members.") end }) end minetest.register_chatcommand("move_area", { - params = "", - description = "Move (or resize) an area to the current positions.", + params = S(""), + description = S("Move (or resize) an area to the current positions."), privs = areas.adminPrivs, func = function(name, param) local id = tonumber(param) if not id then - return false, "Invalid usage, see /help move_area." + return false, S("Invalid usage, see /help @1.", "move_area") end local area = areas.areas[id] if not area then - return false, "Area does not exist." + return false, S("Area does not exist.") end local pos1, pos2 = areas:getPos(name) if not pos1 then - return false, "You need to select an area first." + return false, S("You need to select an area first.") end areas:move(id, area, pos1, pos2) areas:save() - return true, "Area successfully moved." + return true, S("Area successfully moved.") end, }) minetest.register_chatcommand("area_info", { - description = "Get information about area configuration and usage.", + description = S("Get information about area configuration and usage."), func = function(name, param) local lines = {} local privs = minetest.get_player_privs(name) @@ -361,27 +361,22 @@ minetest.register_chatcommand("area_info", { local max_size = has_high_limit and size_limit_high or size_limit - -- Privilege information - local self_prot_line = ("Self protection is %sabled"):format( - self_prot and "en" or "dis") - if self_prot and prot_priv then - self_prot_line = self_prot_line.. - (" %s have the neccessary privilege (%q).") - :format( - has_prot_priv and "and you" or - "but you don't", - prot_priv) - else - self_prot_line = self_prot_line.."." - end + -- Self protection information + local self_prot_line = self_prot and S("Self protection is enabled.") or + S("Self protection is disabled.") table.insert(lines, self_prot_line) + -- Privilege information + local priv_line = has_prot_priv and + S("You have the necessary privilege (\"@1\").", prot_priv) or + S("You don't have the necessary privilege (\"@1\").", prot_priv) + table.insert(lines, priv_line) if privs.areas then - table.insert(lines, "You are an area".. - " administrator (\"areas\" privilege).") + table.insert(lines, S("You are an area".. + " administrator (\"areas\" privilege).")) elseif has_high_limit then table.insert(lines, - "You have extended area protection".. - " limits (\"areas_high_limit\" privilege).") + S("You have extended area protection".. + " limits (\"areas_high_limit\" privilege).")) end -- Area count @@ -391,26 +386,23 @@ minetest.register_chatcommand("area_info", { area_num = area_num + 1 end end - local count_line = ("You have %d area%s"):format( - area_num, area_num == 1 and "" or "s") - if privs.areas then - count_line = count_line.. - " and have no area protection limits." - elseif can_prot then - count_line = count_line..(", out of a maximum of %d.") - :format(max_count) - end - table.insert(lines, count_line) + table.insert(lines, S("You have @1 areas.", area_num)) + + -- Area limit + local area_limit_line = privs.areas and + S("Limit: no area count limit") or + S("Limit: @1 areas", max_count) + table.insert(lines, area_limit_line) -- Area size limits local function size_info(str, size) - table.insert(lines, ("%s spanning up to %dx%dx%d.") - :format(str, size.x, size.y, size.z)) + table.insert(lines, S("@1 spanning up to @2x@3x@4.", + str, size.x, size.y, size.z)) end local function priv_limit_info(lpriv, lmax_count, lmax_size) - size_info(("Players with the %q privilege".. - " can protect up to %d areas"):format( - lpriv, lmax_count), lmax_size) + size_info(S("Players with the \"@1\" privilege".. + " can protect up to @2 areas", lpriv, lmax_count), + lmax_size) end if self_prot then if privs.areas then @@ -419,7 +411,7 @@ minetest.register_chatcommand("area_info", { priv_limit_info("areas_high_limit", limit_high, size_limit_high) elseif has_prot_priv then - size_info("You can protect areas", max_size) + size_info(S("You can protect areas"), max_size) end end diff --git a/areas/hud.lua b/areas/hud.lua index ffe764ea..9d13b80a 100644 --- a/areas/hud.lua +++ b/areas/hud.lua @@ -1,5 +1,5 @@ -- This is inspired by the landrush mod by Bremaweb - +local S = minetest.get_translator("areas") areas.hud = {} areas.hud.refresh = 0 @@ -26,7 +26,7 @@ minetest.register_globalstep(function(dtime) area.faction_open = faction_info table.insert(areaStrings, ("%s [%u] (%s%s%s)") :format(area.name, id, area.owner, - area.open and ":open" or "", + area.open and S(":open") or "", faction_info and ":"..faction_info or "")) end @@ -38,7 +38,7 @@ minetest.register_globalstep(function(dtime) table.insert(areaStrings, str) end - local areaString = "Areas:" + local areaString = S("Areas:") if #areaStrings > 0 then areaString = areaString.."\n".. table.concat(areaStrings, "\n") diff --git a/areas/interact.lua b/areas/interact.lua index 2e548001..4e575fbf 100644 --- a/areas/interact.lua +++ b/areas/interact.lua @@ -1,3 +1,4 @@ +local S = minetest.get_translator("areas") local old_is_protected = minetest.is_protected function minetest.is_protected(pos, name) @@ -11,7 +12,7 @@ minetest.register_on_protection_violation(function(pos, name) if not areas:canInteract(pos, name) then local owners = areas:getNodeOwners(pos) minetest.chat_send_player(name, - ("%s is protected by %s."):format( + S("@1 is protected by @2.", minetest.pos_to_string(pos), table.concat(owners, ", "))) end diff --git a/areas/internal.lua b/areas/internal.lua index 27f85edc..a7979e51 100644 --- a/areas/internal.lua +++ b/areas/internal.lua @@ -1,3 +1,4 @@ +local S = minetest.get_translator("areas") function areas:player_exists(name) return minetest.get_auth_handler().get_auth(name) ~= nil @@ -212,8 +213,8 @@ function areas:canPlayerAddArea(pos1, pos2, name) -- and if the area is too big. if not self.config.self_protection or not privs[areas.config.self_protection_privilege] then - return false, "Self protection is disabled or you do not have" - .." the necessary privilege." + return false, S("Self protection is disabled or you do not have" + .." the necessary privilege.") end local max_size = privs.areas_high_limit and @@ -223,7 +224,7 @@ function areas:canPlayerAddArea(pos1, pos2, name) (pos2.x - pos1.x) > max_size.x or (pos2.y - pos1.y) > max_size.y or (pos2.z - pos1.z) > max_size.z then - return false, "Area is too big." + return false, S("Area is too big.") end -- Check number of areas the user has and make sure it not above the max @@ -237,16 +238,16 @@ function areas:canPlayerAddArea(pos1, pos2, name) self.config.self_protection_max_areas_high or self.config.self_protection_max_areas if count >= max_areas then - return false, "You have reached the maximum amount of" - .." areas that you are allowed to protect." + return false, S("You have reached the maximum amount of" + .." areas that you are allowed to protect.") end -- Check intersecting areas local can, id = self:canInteractInArea(pos1, pos2, name) if not can then local area = self.areas[id] - return false, ("The area intersects with %s [%u] (%s).") - :format(area.name, id, area.owner) + return false, S("The area intersects with @1 [@2] (@3).", + area.name, id, area.owner) end return true diff --git a/areas/legacy.lua b/areas/legacy.lua index 876b88d2..c68afb20 100644 --- a/areas/legacy.lua +++ b/areas/legacy.lua @@ -1,25 +1,26 @@ -- This file contains functions to convert from -- the old areas format and other compatability code. +local S = minetest.get_translator("areas") minetest.register_chatcommand("legacy_load_areas", { - params = "", - description = "Loads, converts, and saves the areas from" - .." a legacy save file.", + params = S(""), + description = S("Loads, converts, and saves the areas from" + .." a legacy save file."), privs = {areas=true, server=true}, func = function(name, param) - minetest.chat_send_player(name, "Converting areas...") + minetest.chat_send_player(name, S("Converting areas…")) local version = tonumber(param) if version == 0 then local err = areas:node_ownership_load() if err then - minetest.chat_send_player(name, "Error loading legacy file: "..err) + minetest.chat_send_player(name, S("Error loading legacy file: @1", err)) return end else - minetest.chat_send_player(name, "Invalid version number. (0 allowed)") + minetest.chat_send_player(name, S("Invalid version number. (0 allowed)")) return end - minetest.chat_send_player(name, "Legacy file loaded.") + minetest.chat_send_player(name, S("Legacy file loaded.")) for k, area in pairs(areas.areas) do -- New position format @@ -34,15 +35,15 @@ minetest.register_chatcommand("legacy_load_areas", { areas:sortPos(area.pos1, area.pos2) -- Add name - area.name = "unnamed" + area.name = S("unnamed") -- Remove ID area.id = nil end - minetest.chat_send_player(name, "Table format updated.") + minetest.chat_send_player(name, S("Table format updated.")) areas:save() - minetest.chat_send_player(name, "Converted areas saved. Done.") + minetest.chat_send_player(name, S("Converted areas saved. Done.")) end }) @@ -130,7 +131,7 @@ if areas.config.legacy_table then {x=a.x2, y=a.y2, z=a.z2} a.x1, a.y1, a.z1, a.x2, a.y2, a.z2 = nil, nil, nil, nil, nil, nil - a.name = a.name or "unnamed" + a.name = a.name or S("unnamed") a.id = nil return rawset(areas.areas, key, a) end diff --git a/areas/locale/areas.fr.tr b/areas/locale/areas.fr.tr new file mode 100644 index 00000000..52b08a95 --- /dev/null +++ b/areas/locale/areas.fr.tr @@ -0,0 +1,125 @@ +# textdomain: areas + + +### chatcommands.lua ### + += += += += += +@1 has given you control over the area "@2" (ID @3).=@1 vous a donné le contrôle de la zone "@2" (ID @3). +@1 spanning up to @2x@3x@4.=@1 s’étendant jusqu’à @2x@3x@4. +A regular expression is required.=Une expression régulière est requise. +Area @1 does not exist or is not owned by you.=La zone @1 n’existe pas ou ne vous appartient pas. +Area closed for faction members.=Zone fermée aux membres de la faction. +Area closed.=Zone fermée. +Area does not exist.=La zone n’existe pas. +Area opened for faction members.=Zone ouverte aux membres de la faction. +Area opened.=Zone ouverte. +Area protected. ID: @1=Zone protégée. ID : @1 +Area renamed.=Zone renommée. +Area successfully moved.=Zone déplacée avec succès. +Change the owner of an area using its ID=Change le propriétaire d’une zone en utilisant son ID. +Find areas using a Lua regular expression=Trouve les zones en utilisant une expression régulière Lua. +Get information about area configuration and usage.=Obtient des informations sur la configuration des zones et l’utilisation des zones. + +Give a player access to a sub-area beetween two positions that have already been protected, Use set_owner if you don't want the parent to be set.=Donne au joueur accès aux sous-zones entre deux positions qui ont déjà été protégées ; utilisez set_owner si vous ne voulez pas que la zone pricipale soit définie. + +Invalid regular expression.=Expression régulière invalide. +Limit: @1 areas=Limite: @1 zones. +Limit: no area count limit=Limite: pas de limite de nombre de zones. +List your areas, or all areas if you are an admin.=Liste vos zones, ou toutes les zones si vous êtes administrateur. +Move (or resize) an area to the current positions.=Déplace (ou redimensionne) une zone aux positions actuelles. +No matches found.=Aucun résultat. +No visible areas.=Pas de zone visible. +Owner changed.=Propriétaire changé. +Players with the "@1" privilege can protect up to @2 areas=Les joueurs avec le privilège "@1" peuvent protéger jusqu’à @2 zones + +Protect an area between two positions and give a player access to it without setting the parent of the area to any existing area=Protège une zone entre deux positions et donne à un joueur accès à cette zone sans définir la zone principale de cette zone ni aucune zone existante. + +Protect your own area=Protège votre zone. +Recursively remove areas using an ID=Supprime les zones récursivement en utilisant un ID. +Remove an area using an ID=Supprime une zone en utilisant son ID. +Removed area @1=Zone @1 supprimée. +Removed area @1 and it's sub areas.=Zone @1 et ses sous-zones supprimées. +Rename an area that you own=Renomme une zone qui vous appartient. +Self protection is disabled.=L’autoprotection est désactivée. +Self protection is enabled.=L’autoprotection est activée. +That area doesn't exist.=La zone n’existe pas. +The player "@1" does not exist.=Le joueur "@1" n’existe pas. +Toggle an area open (anyone can interact) or closed=Bascule entre zone ouverte (tout le monde peut intéragir) ou fermée. +Toggle an area open/closed for members in your faction.=Bascule entre zone ouverte/fermée pour les membres de votre faction. +You are an area administrator ("areas" privilege).=Vous êtes un administrateur de zone (privilège "areas"). +You can protect areas=Vous pouvez protéger des zones. +You can't protect that area.=Vous ne pouvez pas protéger cette zone. +You can't protect that area: @1=Vous ne pouvez pas protéger cette zone : @1. +You don't have the necessary privilege ("@1").=Vous n’avez pas le privilège nécessaire ("@1"). +You don't own that area.=Vous ne possédez pas cette zone. +You have @1 areas.=Vous avez @1 zones. + +You have been granted control over area #@1. Type /list_areas to show your areas.=Vous avez reçu l’autorisation de contrôler la zone #@1. + +You have extended area protection limits ("areas_high_limit" privilege).=Votre limite de protection de zones est étendue (privilège "areas_high_limit"). + +You have the necessary privilege ("@1").=Vous avez le privilège nécessaire ("@1"). +You need to select an area first.=Vous devez sélectionner une zone d’abord. + +### chatcommands.lua ### +### pos.lua ### + += +Invalid usage, see /help @1.=Utilisation incorrecte, voir /help @1. + +### hud.lua ### + +:open= : ouverte +Areas:=Zones : + +### interact.lua ### + +@1 is protected by @2.=@1 est protégée par @2. + +### internal.lua ### + +Area is too big.=La zone est trop grande. + +Self protection is disabled or you do not have the necessary privilege.=L’autoprotection est désactivée ou vous n’avez pas le privilège nécessaire. + +The area intersects with @1 [@2] (@3).=La zone a une intersection avec @1 [@2] (@3). + +You have reached the maximum amount of areas that you are allowed to protect.=Vous avez atteint le nombre maximum de zones que vous êtes autorisé à protéger. + + +### legacy.lua ### + += +Converted areas saved. Done.=Zones converties sauvegardées. Fait. +Converting areas…=Conversion des zones… +Error loading legacy file: @1=Erreur lors du chargement du fichier : @1 +Invalid version number. (0 allowed)=Numéro de version invalide. (0 autorisé) +Legacy file loaded.=Fichier obsolète chargé. + +Loads, converts, and saves the areas from a legacy save file.=Charge, fait la conversion et sauvegarde les zones depuis un fichier de sauvegarde obsolète. + +Table format updated.=Format de tableau mis à jour. +unnamed=Non nommé + +### pos.lua ### + += +Area @1 selected.=Zone @1 sélectionnée. +Area position @1 set to @2=Position @1 de la zone définie à @2. +Position @1 set to @2=Position @1 définie à @2. +Position @1: =Position @1 : +Select an area by ID.=Sélectionnez une zone par son ID. +Select position @1 by punching a node.=Sélectionnez une position en frappant un bloc. +Select positions by punching two nodes.=Sélectionnez une position en frappant deux blocs. + +Set area protection region position @1 to your location or the one specified=Définit la position @1 de la région de protection de zone à votre position ou à celle spécifiée. + +Set area protection region, position 1, or position 2 by punching nodes, or display the region=Définit la région de protection de zone, la position 1, ou la position 2 en frappant des blocs, ou en affichant la région. + +The area @1 does not exist.=La zone @1 n’existe pas. +Unable to get position.=Impossible d’obtenir la position. +Unknown subcommand: @1=Sous-commande inconnue : @1 diff --git a/areas/locale/template.txt b/areas/locale/template.txt new file mode 100644 index 00000000..ba62e977 --- /dev/null +++ b/areas/locale/template.txt @@ -0,0 +1,125 @@ +# textdomain: areas + + +### chatcommands.lua ### + += += += += += +@1 has given you control over the area "@2" (ID @3).= +@1 spanning up to @2x@3x@4.= +A regular expression is required.= +Area @1 does not exist or is not owned by you.= +Area closed for faction members.= +Area closed.= +Area does not exist.= +Area opened for faction members.= +Area opened.= +Area protected. ID: @1= +Area renamed.= +Area successfully moved.= +Change the owner of an area using its ID= +Find areas using a Lua regular expression= +Get information about area configuration and usage.= + +Give a player access to a sub-area beetween two positions that have already been protected, Use set_owner if you don't want the parent to be set.= + +Invalid regular expression.= +Limit: @1 areas= +Limit: no area count limit= +List your areas, or all areas if you are an admin.= +Move (or resize) an area to the current positions.= +No matches found.= +No visible areas.= +Owner changed.= +Players with the "@1" privilege can protect up to @2 areas= + +Protect an area between two positions and give a player access to it without setting the parent of the area to any existing area= + +Protect your own area= +Recursively remove areas using an ID= +Remove an area using an ID= +Removed area @1= +Removed area @1 and it's sub areas.= +Rename an area that you own= +Self protection is disabled.= +Self protection is enabled.= +That area doesn't exist.= +The player "@1" does not exist.= +Toggle an area open (anyone can interact) or closed= +Toggle an area open/closed for members in your faction.= +You are an area administrator ("areas" privilege).= +You can protect areas= +You can't protect that area.= +You can't protect that area: @1= +You don't have the necessary privilege ("@1").= +You don't own that area.= +You have @1 areas.= + +You have been granted control over area #@1. Type /list_areas to show your areas.= + +You have extended area protection limits ("areas_high_limit" privilege).= + +You have the necessary privilege ("@1").= +You need to select an area first.= + +### chatcommands.lua ### +### pos.lua ### + += +Invalid usage, see /help @1.= + +### hud.lua ### + +:open= +Areas:= + +### interact.lua ### + +@1 is protected by @2.= + +### internal.lua ### + +Area is too big.= + +Self protection is disabled or you do not have the necessary privilege.= + +The area intersects with @1 [@2] (@3).= + +You have reached the maximum amount of areas that you are allowed to protect.= + + +### legacy.lua ### + += +Converted areas saved. Done.= +Converting areas…= +Error loading legacy file: @1= +Invalid version number. (0 allowed)= +Legacy file loaded.= + +Loads, converts, and saves the areas from a legacy save file.= + +Table format updated.= +unnamed= + +### pos.lua ### + += +Area @1 selected.= +Area position @1 set to @2= +Position @1 set to @2= +Position @1: = +Select an area by ID.= +Select position @1 by punching a node.= +Select positions by punching two nodes.= + +Set area protection region position @1 to your location or the one specified= + +Set area protection region, position 1, or position 2 by punching nodes, or display the region= + +The area @1 does not exist.= +Unable to get position.= +Unknown subcommand: @1= diff --git a/areas/pos.lua b/areas/pos.lua index 323d55df..5ca92f61 100644 --- a/areas/pos.lua +++ b/areas/pos.lua @@ -1,4 +1,4 @@ - +local S = minetest.get_translator("areas") -- I could depend on WorldEdit for this, but you need to have the 'worldedit' -- permission to use those commands and you don't have -- /area_pos{1,2} [X Y Z|X,Y,Z]. @@ -22,27 +22,27 @@ local function posLimit(pos) end minetest.register_chatcommand("select_area", { - params = "", - description = "Select a area by id.", + params = S(""), + description = S("Select an area by ID."), func = function(name, param) local id = tonumber(param) if not id then - return false, "Invalid usage, see /help select_area." + return false, S("Invalid usage, see /help @1.", "select_area") end if not areas.areas[id] then - return false, "The area "..id.." does not exist." + return false, S("The area @1 does not exist.", id) end areas:setPos1(name, areas.areas[id].pos1) areas:setPos2(name, areas.areas[id].pos2) - return true, "Area "..id.." selected." + return true, S("Area @1 selected.", id) end, }) minetest.register_chatcommand("area_pos1", { params = "[X Y Z|X,Y,Z]", - description = "Set area protection region position 1 to your" - .." location or the one specified", + description = S("Set area protection region position @1 to your" + .." location or the one specified", "1"), privs = {}, func = function(name, param) local pos @@ -55,22 +55,22 @@ minetest.register_chatcommand("area_pos1", { if player then pos = player:get_pos() else - return false, "Unable to get position." + return false, S("Unable to get position.") end else - return false, "Invalid usage, see /help area_pos1." + return false, S("Invalid usage, see /help @1.", "area_pos1") end pos = posLimit(vector.round(pos)) areas:setPos1(name, pos) - return true, "Area position 1 set to " - ..minetest.pos_to_string(pos) + return true, S("Area position @1 set to @2", "1", + minetest.pos_to_string(pos)) end, }) minetest.register_chatcommand("area_pos2", { params = "[X Y Z|X,Y,Z]", - description = "Set area protection region position 2 to your" - .." location or the one specified", + description = S("Set area protection region position @1 to your" + .." location or the one specified", "2"), func = function(name, param) local pos local found, _, x, y, z = param:find( @@ -82,48 +82,48 @@ minetest.register_chatcommand("area_pos2", { if player then pos = player:get_pos() else - return false, "Unable to get position." + return false, S("Unable to get position.") end else - return false, "Invalid usage, see /help area_pos2." + return false, S("Invalid usage, see /help @1.", "area_pos2") end pos = posLimit(vector.round(pos)) areas:setPos2(name, pos) - return true, "Area position 2 set to " - ..minetest.pos_to_string(pos) + return true, S("Area position @1 set to @2", "2", + minetest.pos_to_string(pos)) end, }) minetest.register_chatcommand("area_pos", { params = "set/set1/set2/get", - description = "Set area protection region, position 1, or position 2" - .." by punching nodes, or display the region", + description = S("Set area protection region, position 1, or position 2" + .." by punching nodes, or display the region"), func = function(name, param) if param == "set" then -- Set both area positions areas.set_pos[name] = "pos1" - return true, "Select positions by punching two nodes." + return true, S("Select positions by punching two nodes.") elseif param == "set1" then -- Set area position 1 areas.set_pos[name] = "pos1only" - return true, "Select position 1 by punching a node." + return true, S("Select position @1 by punching a node.", "1") elseif param == "set2" then -- Set area position 2 areas.set_pos[name] = "pos2" - return true, "Select position 2 by punching a node." + return true, S("Select position @1 by punching a node.", "2") elseif param == "get" then -- Display current area positions - local pos1str, pos2str = "Position 1: ", "Position 2: " + local pos1str, pos2str = S("Position @1: ", "1"), S("Position @1: ", "2") if areas.pos1[name] then pos1str = pos1str..minetest.pos_to_string(areas.pos1[name]) else - pos1str = pos1str.."" + pos1str = pos1str..S("") end if areas.pos2[name] then pos2str = pos2str..minetest.pos_to_string(areas.pos2[name]) else - pos2str = pos2str.."" + pos2str = pos2str..S("") end return true, pos1str.."\n"..pos2str else - return false, "Unknown subcommand: "..param + return false, S("Unknown subcommand: @1", param) end end, }) @@ -159,22 +159,22 @@ minetest.register_on_punchnode(function(pos, node, puncher) areas.markPos1(name) areas.set_pos[name] = "pos2" minetest.chat_send_player(name, - "Position 1 set to " - ..minetest.pos_to_string(pos)) + S("Position @1 set to @2", "1", + minetest.pos_to_string(pos))) elseif areas.set_pos[name] == "pos1only" then areas.pos1[name] = pos areas.markPos1(name) areas.set_pos[name] = nil minetest.chat_send_player(name, - "Position 1 set to " - ..minetest.pos_to_string(pos)) + S("Position @1 set to @2", "1", + minetest.pos_to_string(pos))) elseif areas.set_pos[name] == "pos2" then areas.pos2[name] = pos areas.markPos2(name) areas.set_pos[name] = nil minetest.chat_send_player(name, - "Position 2 set to " - ..minetest.pos_to_string(pos)) + S("Position @1 set to @2", "2", + minetest.pos_to_string(pos))) end end end) diff --git a/bakedclay/init.lua b/bakedclay/init.lua index 7b04233f..bf76c721 100644 --- a/bakedclay/init.lua +++ b/bakedclay/init.lua @@ -108,11 +108,14 @@ minetest.register_craft( { recipe = {"dye:black", "dye:black", "dye:white"} }) +-- only add light grey recipe if unifieddye mod isnt present (conflict) +if not minetest.get_modpath("unifieddyes") then minetest.register_craft( { type = "shapeless", output = "dye:grey 3", recipe = {"dye:black", "dye:white", "dye:white"} }) +end minetest.register_craft( { type = "shapeless", diff --git a/basic_materials/locale/basic_materials.de.tr b/basic_materials/locale/basic_materials.de.tr new file mode 100644 index 00000000..e661fcd8 --- /dev/null +++ b/basic_materials/locale/basic_materials.de.tr @@ -0,0 +1,33 @@ +# textdomain: basic_materials +Silicon lump=Silikonklumpen +Simple Integrated Circuit=einfacher Integrierter Schaltkreis +Simple Motor=einfacher Motor +Heating element=Heizelement +Simple energy crystal=einfacher Energiekristall + +Spool of steel wire=Spule mit Stahldraht +Spool of copper wire=Spule mit Kupferdraht +Spool of silver wire=Spule mit Silberdraht +Spool of gold wire=Spule mit Golddraht +Steel Strip=Stahlstreifen +Copper Strip=Kupferstreifen +Steel Bar=Stahlstab +Chainlinks (brass)=Messing-Kettenglieder +Chainlinks (steel)=Stahl-Kettenglieder +Brass Ingot=Messingbarren +Steel gear=Stahlzahnrad +Padlock=Vorhängeschloss +Chain (steel, hanging)=Stahlkette +Chain (brass, hanging)=Messingkette +Brass Block=Messingblock + +Oil extract=raffiniertes Öl +Unprocessed paraffin=unbearbeitetes Paraffin +Uncooked Terracotta Base=ungebranntes Terrakotta +Wet Cement=nasser Zement +Cement=Zement +Concrete Block=Betonblock + +Plastic sheet=Kunststoffplatte +Plastic strips=Kunststoffstreifen +Empty wire spool=leere Drahtspule diff --git a/basic_materials/metals.lua b/basic_materials/metals.lua index cae56d79..37685f8f 100644 --- a/basic_materials/metals.lua +++ b/basic_materials/metals.lua @@ -245,6 +245,18 @@ minetest.register_craft( { }, }) +if not minetest.get_modpath("moreores") then + -- Without moreores, there still should be a way to create brass. + minetest.register_craft( { + output = "basic_materials:brass_ingot 9", + recipe = { + {"default:copper_ingot", "default:tin_ingot", "default:copper_ingot"}, + {"default:gold_ingot", "default:copper_ingot", "default:gold_ingot"}, + {"default:copper_ingot", "default:tin_ingot", "default:copper_ingot"}, + }, + }) +end + minetest.register_craft( { type = "shapeless", output = "basic_materials:brass_ingot 9", diff --git a/castle_farming/depends.txt b/castle_farming/depends.txt index 6bfb3360..8d8cdfb3 100644 --- a/castle_farming/depends.txt +++ b/castle_farming/depends.txt @@ -1,6 +1,5 @@ default farming -intllib? wool bucket ropes? \ No newline at end of file diff --git a/castle_farming/hides.lua b/castle_farming/hides.lua index 73a9df2f..527fe00c 100644 --- a/castle_farming/hides.lua +++ b/castle_farming/hides.lua @@ -1,6 +1,4 @@ --- internationalization boilerplate -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") +local S = minetest.get_translator(minetest.get_current_modname()) minetest.register_alias("castle:hides", "castle_farming:hides") diff --git a/castle_farming/i18n.py b/castle_farming/i18n.py new file mode 100644 index 00000000..d33bbb04 --- /dev/null +++ b/castle_farming/i18n.py @@ -0,0 +1,418 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Script to generate the template file and update the translation files. +# Copy the script into the mod or modpack root folder and run it there. +# +# Copyright (C) 2019 Joachim Stolberg, 2020 FaceDeer, 2020 Louis Royer +# LGPLv2.1+ + +from __future__ import print_function +import os, fnmatch, re, shutil, errno +from sys import argv as _argv + +# Running params +params = {"recursive": False, + "help": False, + "mods": False, + "verbose": False, + "folders": [] +} +# Available CLI options +options = {"recursive": ['--recursive', '-r'], + "help": ['--help', '-h'], + "mods": ['--installed-mods'], + "verbose": ['--verbose', '-v'] +} + +# Strings longer than this will have extra space added between +# them in the translation files to make it easier to distinguish their +# beginnings and endings at a glance +doublespace_threshold = 60 + +def set_params_folders(tab: list): + '''Initialize params["folders"] from CLI arguments.''' + # Discarding argument 0 (tool name) + for param in tab[1:]: + stop_param = False + for option in options: + if param in options[option]: + stop_param = True + break + if not stop_param: + params["folders"].append(os.path.abspath(param)) + +def set_params(tab: list): + '''Initialize params from CLI arguments.''' + for option in options: + for option_name in options[option]: + if option_name in tab: + params[option] = True + break + +def print_help(name): + '''Prints some help message.''' + print(f'''SYNOPSIS + {name} [OPTIONS] [PATHS...] +DESCRIPTION + {', '.join(options["help"])} + prints this help message + {', '.join(options["recursive"])} + run on all subfolders of paths given + {', '.join(options["mods"])} + run on locally installed modules + {', '.join(options["verbose"])} + add output information +''') + + +def main(): + '''Main function''' + set_params(_argv) + set_params_folders(_argv) + if params["help"]: + print_help(_argv[0]) + elif params["recursive"] and params["mods"]: + print("Option --installed-mods is incompatible with --recursive") + else: + # Add recursivity message + print("Running ", end='') + if params["recursive"]: + print("recursively ", end='') + # Running + if params["mods"]: + print(f"on all locally installed modules in {os.path.abspath('~/.minetest/mods/')}") + run_all_subfolders("~/.minetest/mods") + elif len(params["folders"]) >= 2: + print("on folder list:", params["folders"]) + for f in params["folders"]: + if params["recursive"]: + run_all_subfolders(f) + else: + update_folder(f) + elif len(params["folders"]) == 1: + print("on folder", params["folders"][0]) + if params["recursive"]: + run_all_subfolders(params["folders"][0]) + else: + update_folder(params["folders"][0]) + else: + print("on folder", os.path.abspath("./")) + if params["recursive"]: + run_all_subfolders(os.path.abspath("./")) + else: + update_folder(os.path.abspath("./")) + +#group 2 will be the string, groups 1 and 3 will be the delimiters (" or ') +#See https://stackoverflow.com/questions/46967465/regex-match-text-in-either-single-or-double-quote +pattern_lua = re.compile(r'[\.=^\t,{\(\s]N?S\(\s*(["\'])((?:\\\1|(?:(?!\1)).)*)(\1)[\s,\)]', re.DOTALL) +pattern_lua_bracketed = re.compile(r'[\.=^\t,{\(\s]N?S\(\s*\[\[(.*?)\]\][\s,\)]', re.DOTALL) + +# Handles "concatenation" .. " of strings" +pattern_concat = re.compile(r'["\'][\s]*\.\.[\s]*["\']', re.DOTALL) + +pattern_tr = re.compile(r'(.+?[^@])=(.*)') +pattern_name = re.compile(r'^name[ ]*=[ ]*([^ \n]*)') +pattern_tr_filename = re.compile(r'\.tr$') +pattern_po_language_code = re.compile(r'(.*)\.po$') + +#attempt to read the mod's name from the mod.conf file. Returns None on failure +def get_modname(folder): + try: + with open(os.path.join(folder, "mod.conf"), "r", encoding='utf-8') as mod_conf: + for line in mod_conf: + match = pattern_name.match(line) + if match: + return match.group(1) + except FileNotFoundError: + pass + return None + +#If there are already .tr files in /locale, returns a list of their names +def get_existing_tr_files(folder): + out = [] + for root, dirs, files in os.walk(os.path.join(folder, 'locale/')): + for name in files: + if pattern_tr_filename.search(name): + out.append(name) + return out + +# A series of search and replaces that massage a .po file's contents into +# a .tr file's equivalent +def process_po_file(text): + # The first three items are for unused matches + text = re.sub(r'#~ msgid "', "", text) + text = re.sub(r'"\n#~ msgstr ""\n"', "=", text) + text = re.sub(r'"\n#~ msgstr "', "=", text) + # comment lines + text = re.sub(r'#.*\n', "", text) + # converting msg pairs into "=" pairs + text = re.sub(r'msgid "', "", text) + text = re.sub(r'"\nmsgstr ""\n"', "=", text) + text = re.sub(r'"\nmsgstr "', "=", text) + # various line breaks and escape codes + text = re.sub(r'"\n"', "", text) + text = re.sub(r'"\n', "\n", text) + text = re.sub(r'\\"', '"', text) + text = re.sub(r'\\n', '@n', text) + # remove header text + text = re.sub(r'=Project-Id-Version:.*\n', "", text) + # remove double-spaced lines + text = re.sub(r'\n\n', '\n', text) + return text + +# Go through existing .po files and, if a .tr file for that language +# *doesn't* exist, convert it and create it. +# The .tr file that results will subsequently be reprocessed so +# any "no longer used" strings will be preserved. +# Note that "fuzzy" tags will be lost in this process. +def process_po_files(folder, modname): + for root, dirs, files in os.walk(os.path.join(folder, 'locale/')): + for name in files: + code_match = pattern_po_language_code.match(name) + if code_match == None: + continue + language_code = code_match.group(1) + tr_name = modname + "." + language_code + ".tr" + tr_file = os.path.join(root, tr_name) + if os.path.exists(tr_file): + if params["verbose"]: + print(f"{tr_name} already exists, ignoring {name}") + continue + fname = os.path.join(root, name) + with open(fname, "r", encoding='utf-8') as po_file: + if params["verbose"]: + print(f"Importing translations from {name}") + text = process_po_file(po_file.read()) + with open(tr_file, "wt", encoding='utf-8') as tr_out: + tr_out.write(text) + +# from https://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python/600612#600612 +# Creates a directory if it doesn't exist, silently does +# nothing if it already exists +def mkdir_p(path): + try: + os.makedirs(path) + except OSError as exc: # Python >2.5 + if exc.errno == errno.EEXIST and os.path.isdir(path): + pass + else: raise + +# Converts the template dictionary to a text to be written as a file +# dKeyStrings is a dictionary of localized string to source file sets +# dOld is a dictionary of existing translations and comments from +# the previous version of this text +def strings_to_text(dkeyStrings, dOld, mod_name): + lOut = [f"# textdomain: {mod_name}\n"] + + dGroupedBySource = {} + + for key in dkeyStrings: + sourceList = list(dkeyStrings[key]) + sourceList.sort() + sourceString = "\n".join(sourceList) + listForSource = dGroupedBySource.get(sourceString, []) + listForSource.append(key) + dGroupedBySource[sourceString] = listForSource + + lSourceKeys = list(dGroupedBySource.keys()) + lSourceKeys.sort() + for source in lSourceKeys: + localizedStrings = dGroupedBySource[source] + localizedStrings.sort() + lOut.append("") + lOut.append(source) + lOut.append("") + for localizedString in localizedStrings: + val = dOld.get(localizedString, {}) + translation = val.get("translation", "") + comment = val.get("comment") + if len(localizedString) > doublespace_threshold and not lOut[-1] == "": + lOut.append("") + if comment != None: + lOut.append(comment) + lOut.append(f"{localizedString}={translation}") + if len(localizedString) > doublespace_threshold: + lOut.append("") + + + unusedExist = False + for key in dOld: + if key not in dkeyStrings: + val = dOld[key] + translation = val.get("translation") + comment = val.get("comment") + # only keep an unused translation if there was translated + # text or a comment associated with it + if translation != None and (translation != "" or comment): + if not unusedExist: + unusedExist = True + lOut.append("\n\n##### not used anymore #####\n") + if len(key) > doublespace_threshold and not lOut[-1] == "": + lOut.append("") + if comment != None: + lOut.append(comment) + lOut.append(f"{key}={translation}") + if len(key) > doublespace_threshold: + lOut.append("") + return "\n".join(lOut) + '\n' + +# Writes a template.txt file +# dkeyStrings is the dictionary returned by generate_template +def write_template(templ_file, dkeyStrings, mod_name): + # read existing template file to preserve comments + existing_template = import_tr_file(templ_file) + + text = strings_to_text(dkeyStrings, existing_template[0], mod_name) + mkdir_p(os.path.dirname(templ_file)) + with open(templ_file, "wt", encoding='utf-8') as template_file: + template_file.write(text) + + +# Gets all translatable strings from a lua file +def read_lua_file_strings(lua_file): + lOut = [] + with open(lua_file, encoding='utf-8') as text_file: + text = text_file.read() + #TODO remove comments here + + text = re.sub(pattern_concat, "", text) + + strings = [] + for s in pattern_lua.findall(text): + strings.append(s[1]) + for s in pattern_lua_bracketed.findall(text): + strings.append(s) + + for s in strings: + s = re.sub(r'"\.\.\s+"', "", s) + s = re.sub("@[^@=0-9]", "@@", s) + s = s.replace('\\"', '"') + s = s.replace("\\'", "'") + s = s.replace("\n", "@n") + s = s.replace("\\n", "@n") + s = s.replace("=", "@=") + lOut.append(s) + return lOut + +# Gets strings from an existing translation file +# returns both a dictionary of translations +# and the full original source text so that the new text +# can be compared to it for changes. +def import_tr_file(tr_file): + dOut = {} + text = None + if os.path.exists(tr_file): + with open(tr_file, "r", encoding='utf-8') as existing_file : + # save the full text to allow for comparison + # of the old version with the new output + text = existing_file.read() + existing_file.seek(0) + # a running record of the current comment block + # we're inside, to allow preceeding multi-line comments + # to be retained for a translation line + latest_comment_block = None + for line in existing_file.readlines(): + line = line.rstrip('\n') + if line[:3] == "###": + # Reset comment block if we hit a header + latest_comment_block = None + continue + if line[:1] == "#": + # Save the comment we're inside + if not latest_comment_block: + latest_comment_block = line + else: + latest_comment_block = latest_comment_block + "\n" + line + continue + match = pattern_tr.match(line) + if match: + # this line is a translated line + outval = {} + outval["translation"] = match.group(2) + if latest_comment_block: + # if there was a comment, record that. + outval["comment"] = latest_comment_block + latest_comment_block = None + dOut[match.group(1)] = outval + return (dOut, text) + +# Walks all lua files in the mod folder, collects translatable strings, +# and writes it to a template.txt file +# Returns a dictionary of localized strings to source file sets +# that can be used with the strings_to_text function. +def generate_template(folder, mod_name): + dOut = {} + for root, dirs, files in os.walk(folder): + for name in files: + if fnmatch.fnmatch(name, "*.lua"): + fname = os.path.join(root, name) + found = read_lua_file_strings(fname) + if params["verbose"]: + print(f"{fname}: {str(len(found))} translatable strings") + + for s in found: + sources = dOut.get(s, set()) + sources.add(f"### {os.path.basename(fname)} ###") + dOut[s] = sources + + if len(dOut) == 0: + return None + templ_file = os.path.join(folder, "locale/template.txt") + write_template(templ_file, dOut, mod_name) + return dOut + +# Updates an existing .tr file, copying the old one to a ".old" file +# if any changes have happened +# dNew is the data used to generate the template, it has all the +# currently-existing localized strings +def update_tr_file(dNew, mod_name, tr_file): + if params["verbose"]: + print(f"updating {tr_file}") + + tr_import = import_tr_file(tr_file) + dOld = tr_import[0] + textOld = tr_import[1] + + textNew = strings_to_text(dNew, dOld, mod_name) + + if textOld and textOld != textNew: + print(f"{tr_file} has changed.") + shutil.copyfile(tr_file, f"{tr_file}.old") + + with open(tr_file, "w", encoding='utf-8') as new_tr_file: + new_tr_file.write(textNew) + +# Updates translation files for the mod in the given folder +def update_mod(folder): + modname = get_modname(folder) + if modname is not None: + process_po_files(folder, modname) + print(f"Updating translations for {modname}") + data = generate_template(folder, modname) + if data == None: + print(f"No translatable strings found in {modname}") + else: + for tr_file in get_existing_tr_files(folder): + update_tr_file(data, modname, os.path.join(folder, "locale/", tr_file)) + else: + print("Unable to find modname in folder " + folder) + +# Determines if the folder being pointed to is a mod or a mod pack +# and then runs update_mod accordingly +def update_folder(folder): + is_modpack = os.path.exists(os.path.join(folder, "modpack.txt")) or os.path.exists(os.path.join(folder, "modpack.conf")) + if is_modpack: + subfolders = [f.path for f in os.scandir(folder) if f.is_dir()] + for subfolder in subfolders: + update_mod(subfolder + "/") + else: + update_mod(folder) + print("Done.") + +def run_all_subfolders(folder): + for modfolder in [f.path for f in os.scandir(folder) if f.is_dir()]: + update_folder(modfolder + "/") + + +main() diff --git a/castle_farming/intllib.lua b/castle_farming/intllib.lua deleted file mode 100644 index 6669d720..00000000 --- a/castle_farming/intllib.lua +++ /dev/null @@ -1,45 +0,0 @@ - --- Fallback functions for when `intllib` is not installed. --- Code released under Unlicense . - --- Get the latest version of this file at: --- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua - -local function format(str, ...) - local args = { ... } - local function repl(escape, open, num, close) - if escape == "" then - local replacement = tostring(args[tonumber(num)]) - if open == "" then - replacement = replacement..close - end - return replacement - else - return "@"..open..num..close - end - end - return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) -end - -local gettext, ngettext -if minetest.get_modpath("intllib") then - if intllib.make_gettext_pair then - -- New method using gettext. - gettext, ngettext = intllib.make_gettext_pair() - else - -- Old method using text files. - gettext = intllib.Getter() - end -end - --- Fill in missing functions. - -gettext = gettext or function(msgid, ...) - return format(msgid, ...) -end - -ngettext = ngettext or function(msgid, msgid_plural, n, ...) - return format(n==1 and msgid or msgid_plural, ...) -end - -return gettext, ngettext diff --git a/castle_farming/locale/castle_farming.es.tr b/castle_farming/locale/castle_farming.es.tr new file mode 100644 index 00000000..2edc6d39 --- /dev/null +++ b/castle_farming/locale/castle_farming.es.tr @@ -0,0 +1,11 @@ +# textdomain: castle_farming + + +### hides.lua ### + +Hides=Escondite + +### straw.lua ### + +Bound Straw=Paja amarrada +Training Dummy=Maniqui de Entrenamiento diff --git a/castle_farming/locale/castle_farming.pt_br.tr b/castle_farming/locale/castle_farming.pt_br.tr new file mode 100644 index 00000000..b65a20d3 --- /dev/null +++ b/castle_farming/locale/castle_farming.pt_br.tr @@ -0,0 +1,11 @@ +# textdomain: castle_farming + + +### hides.lua ### + +Hides=Esconde-se + +### straw.lua ### + +Bound Straw=Palha Amarrada +Training Dummy=Vaca Parada de Madeira (para Laço) diff --git a/castle_farming/locale/es.po b/castle_farming/locale/es.po deleted file mode 100644 index 72983b33..00000000 --- a/castle_farming/locale/es.po +++ /dev/null @@ -1,30 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-27 00:59-0700\n" -"PO-Revision-Date: 2017-04-21 19:47-0500\n" -"Last-Translator: Carlos Barraza \n" -"Language-Team: LANGUAGE \n" -"Language: Español\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: hides.lua:9 -msgid "Hides" -msgstr "Escondite" - -#: straw.lua:13 -msgid "Bound Straw" -msgstr "Paja amarrada" - -#: straw.lua:22 -msgid "Training Dummy" -msgstr "Maniqui de Entrenamiento" diff --git a/castle_farming/locale/pt_br.po b/castle_farming/locale/pt_br.po deleted file mode 100644 index 6030f978..00000000 --- a/castle_farming/locale/pt_br.po +++ /dev/null @@ -1,30 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2017 -# This file is distributed under the same license as the castle_farming package. -# Caio Roberto , 2017. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-27 00:59-0700\n" -"PO-Revision-Date: 2017-06-29 13:00-0330\n" -"Last-Translator: Caio Roberto \n" -"Language-Team: Paulo Slomp FACED UFRGS <00009228@ufrgs.br>\n" -"Language: Brazilian Portuguese\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: hides.lua:9 -msgid "Hides" -msgstr "Esconde-se" - -#: straw.lua:13 -msgid "Bound Straw" -msgstr "Palha Amarrada" - -#: straw.lua:22 -msgid "Training Dummy" -msgstr "Vaca Parada de Madeira (para Laço)" diff --git a/castle_farming/locale/template.pot b/castle_farming/locale/template.pot deleted file mode 100644 index 233f90fd..00000000 --- a/castle_farming/locale/template.pot +++ /dev/null @@ -1,30 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-27 00:59-0700\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: hides.lua:9 -msgid "Hides" -msgstr "" - -#: straw.lua:13 -msgid "Bound Straw" -msgstr "" - -#: straw.lua:22 -msgid "Training Dummy" -msgstr "" diff --git a/castle_farming/locale/template.txt b/castle_farming/locale/template.txt new file mode 100644 index 00000000..db51a5f7 --- /dev/null +++ b/castle_farming/locale/template.txt @@ -0,0 +1,11 @@ +# textdomain: castle_farming + + +### hides.lua ### + +Hides= + +### straw.lua ### + +Bound Straw= +Training Dummy= diff --git a/castle_farming/mod.conf b/castle_farming/mod.conf index 5095d9a5..4b844040 100644 --- a/castle_farming/mod.conf +++ b/castle_farming/mod.conf @@ -1 +1,4 @@ name = castle_farming +depends = default, farming, wool, bucket +optional_depends = ropes +description = Contains farming products useful for decorating a castle \ No newline at end of file diff --git a/castle_farming/straw.lua b/castle_farming/straw.lua index aef53127..6c582e25 100644 --- a/castle_farming/straw.lua +++ b/castle_farming/straw.lua @@ -5,9 +5,7 @@ minetest.register_alias_force("cottages:straw_bale", "castle_farming:bound_straw minetest.register_alias_force("darkage:straw_bale", "castle_farming:bound_straw") minetest.register_alias_force("castle:bound_straw", "castle_farming:bound_straw") --- internationalization boilerplate -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") +local S = minetest.get_translator(minetest.get_current_modname()) minetest.register_node("castle_farming:bound_straw", { description = S("Bound Straw"), diff --git a/castle_farming/textures/castle_hide.png b/castle_farming/textures/castle_hide.png index 3e6f6c46..bc462959 100644 Binary files a/castle_farming/textures/castle_hide.png and b/castle_farming/textures/castle_hide.png differ diff --git a/castle_farming/textures/castle_straw_bale.png b/castle_farming/textures/castle_straw_bale.png index ad56330d..9d06a0c2 100644 Binary files a/castle_farming/textures/castle_straw_bale.png and b/castle_farming/textures/castle_straw_bale.png differ diff --git a/castle_farming/textures/castle_straw_dummy.png b/castle_farming/textures/castle_straw_dummy.png index 265f5324..fc715297 100644 Binary files a/castle_farming/textures/castle_straw_dummy.png and b/castle_farming/textures/castle_straw_dummy.png differ diff --git a/castle_lighting/brasier.lua b/castle_lighting/brasier.lua index b461e52d..e8b08c34 100644 --- a/castle_lighting/brasier.lua +++ b/castle_lighting/brasier.lua @@ -1,8 +1,6 @@ if not minetest.get_modpath("fire") then return end --- internationalization boilerplate -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") +local S = minetest.get_translator(minetest.get_current_modname()) local brasier_longdesc = S("A brasier for producing copious amounts of light and heat.") local brasier_usagehelp = S("To ignite the brasier place a flammable fuel in its inventory slot. A lump of coal will burn for about half an hour.") diff --git a/castle_lighting/depends.txt b/castle_lighting/depends.txt index ad949078..74887e16 100644 --- a/castle_lighting/depends.txt +++ b/castle_lighting/depends.txt @@ -1,5 +1,4 @@ default -intllib? fire? castle_masonry? hopper? diff --git a/castle_lighting/i18n.py b/castle_lighting/i18n.py new file mode 100644 index 00000000..d33bbb04 --- /dev/null +++ b/castle_lighting/i18n.py @@ -0,0 +1,418 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Script to generate the template file and update the translation files. +# Copy the script into the mod or modpack root folder and run it there. +# +# Copyright (C) 2019 Joachim Stolberg, 2020 FaceDeer, 2020 Louis Royer +# LGPLv2.1+ + +from __future__ import print_function +import os, fnmatch, re, shutil, errno +from sys import argv as _argv + +# Running params +params = {"recursive": False, + "help": False, + "mods": False, + "verbose": False, + "folders": [] +} +# Available CLI options +options = {"recursive": ['--recursive', '-r'], + "help": ['--help', '-h'], + "mods": ['--installed-mods'], + "verbose": ['--verbose', '-v'] +} + +# Strings longer than this will have extra space added between +# them in the translation files to make it easier to distinguish their +# beginnings and endings at a glance +doublespace_threshold = 60 + +def set_params_folders(tab: list): + '''Initialize params["folders"] from CLI arguments.''' + # Discarding argument 0 (tool name) + for param in tab[1:]: + stop_param = False + for option in options: + if param in options[option]: + stop_param = True + break + if not stop_param: + params["folders"].append(os.path.abspath(param)) + +def set_params(tab: list): + '''Initialize params from CLI arguments.''' + for option in options: + for option_name in options[option]: + if option_name in tab: + params[option] = True + break + +def print_help(name): + '''Prints some help message.''' + print(f'''SYNOPSIS + {name} [OPTIONS] [PATHS...] +DESCRIPTION + {', '.join(options["help"])} + prints this help message + {', '.join(options["recursive"])} + run on all subfolders of paths given + {', '.join(options["mods"])} + run on locally installed modules + {', '.join(options["verbose"])} + add output information +''') + + +def main(): + '''Main function''' + set_params(_argv) + set_params_folders(_argv) + if params["help"]: + print_help(_argv[0]) + elif params["recursive"] and params["mods"]: + print("Option --installed-mods is incompatible with --recursive") + else: + # Add recursivity message + print("Running ", end='') + if params["recursive"]: + print("recursively ", end='') + # Running + if params["mods"]: + print(f"on all locally installed modules in {os.path.abspath('~/.minetest/mods/')}") + run_all_subfolders("~/.minetest/mods") + elif len(params["folders"]) >= 2: + print("on folder list:", params["folders"]) + for f in params["folders"]: + if params["recursive"]: + run_all_subfolders(f) + else: + update_folder(f) + elif len(params["folders"]) == 1: + print("on folder", params["folders"][0]) + if params["recursive"]: + run_all_subfolders(params["folders"][0]) + else: + update_folder(params["folders"][0]) + else: + print("on folder", os.path.abspath("./")) + if params["recursive"]: + run_all_subfolders(os.path.abspath("./")) + else: + update_folder(os.path.abspath("./")) + +#group 2 will be the string, groups 1 and 3 will be the delimiters (" or ') +#See https://stackoverflow.com/questions/46967465/regex-match-text-in-either-single-or-double-quote +pattern_lua = re.compile(r'[\.=^\t,{\(\s]N?S\(\s*(["\'])((?:\\\1|(?:(?!\1)).)*)(\1)[\s,\)]', re.DOTALL) +pattern_lua_bracketed = re.compile(r'[\.=^\t,{\(\s]N?S\(\s*\[\[(.*?)\]\][\s,\)]', re.DOTALL) + +# Handles "concatenation" .. " of strings" +pattern_concat = re.compile(r'["\'][\s]*\.\.[\s]*["\']', re.DOTALL) + +pattern_tr = re.compile(r'(.+?[^@])=(.*)') +pattern_name = re.compile(r'^name[ ]*=[ ]*([^ \n]*)') +pattern_tr_filename = re.compile(r'\.tr$') +pattern_po_language_code = re.compile(r'(.*)\.po$') + +#attempt to read the mod's name from the mod.conf file. Returns None on failure +def get_modname(folder): + try: + with open(os.path.join(folder, "mod.conf"), "r", encoding='utf-8') as mod_conf: + for line in mod_conf: + match = pattern_name.match(line) + if match: + return match.group(1) + except FileNotFoundError: + pass + return None + +#If there are already .tr files in /locale, returns a list of their names +def get_existing_tr_files(folder): + out = [] + for root, dirs, files in os.walk(os.path.join(folder, 'locale/')): + for name in files: + if pattern_tr_filename.search(name): + out.append(name) + return out + +# A series of search and replaces that massage a .po file's contents into +# a .tr file's equivalent +def process_po_file(text): + # The first three items are for unused matches + text = re.sub(r'#~ msgid "', "", text) + text = re.sub(r'"\n#~ msgstr ""\n"', "=", text) + text = re.sub(r'"\n#~ msgstr "', "=", text) + # comment lines + text = re.sub(r'#.*\n', "", text) + # converting msg pairs into "=" pairs + text = re.sub(r'msgid "', "", text) + text = re.sub(r'"\nmsgstr ""\n"', "=", text) + text = re.sub(r'"\nmsgstr "', "=", text) + # various line breaks and escape codes + text = re.sub(r'"\n"', "", text) + text = re.sub(r'"\n', "\n", text) + text = re.sub(r'\\"', '"', text) + text = re.sub(r'\\n', '@n', text) + # remove header text + text = re.sub(r'=Project-Id-Version:.*\n', "", text) + # remove double-spaced lines + text = re.sub(r'\n\n', '\n', text) + return text + +# Go through existing .po files and, if a .tr file for that language +# *doesn't* exist, convert it and create it. +# The .tr file that results will subsequently be reprocessed so +# any "no longer used" strings will be preserved. +# Note that "fuzzy" tags will be lost in this process. +def process_po_files(folder, modname): + for root, dirs, files in os.walk(os.path.join(folder, 'locale/')): + for name in files: + code_match = pattern_po_language_code.match(name) + if code_match == None: + continue + language_code = code_match.group(1) + tr_name = modname + "." + language_code + ".tr" + tr_file = os.path.join(root, tr_name) + if os.path.exists(tr_file): + if params["verbose"]: + print(f"{tr_name} already exists, ignoring {name}") + continue + fname = os.path.join(root, name) + with open(fname, "r", encoding='utf-8') as po_file: + if params["verbose"]: + print(f"Importing translations from {name}") + text = process_po_file(po_file.read()) + with open(tr_file, "wt", encoding='utf-8') as tr_out: + tr_out.write(text) + +# from https://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python/600612#600612 +# Creates a directory if it doesn't exist, silently does +# nothing if it already exists +def mkdir_p(path): + try: + os.makedirs(path) + except OSError as exc: # Python >2.5 + if exc.errno == errno.EEXIST and os.path.isdir(path): + pass + else: raise + +# Converts the template dictionary to a text to be written as a file +# dKeyStrings is a dictionary of localized string to source file sets +# dOld is a dictionary of existing translations and comments from +# the previous version of this text +def strings_to_text(dkeyStrings, dOld, mod_name): + lOut = [f"# textdomain: {mod_name}\n"] + + dGroupedBySource = {} + + for key in dkeyStrings: + sourceList = list(dkeyStrings[key]) + sourceList.sort() + sourceString = "\n".join(sourceList) + listForSource = dGroupedBySource.get(sourceString, []) + listForSource.append(key) + dGroupedBySource[sourceString] = listForSource + + lSourceKeys = list(dGroupedBySource.keys()) + lSourceKeys.sort() + for source in lSourceKeys: + localizedStrings = dGroupedBySource[source] + localizedStrings.sort() + lOut.append("") + lOut.append(source) + lOut.append("") + for localizedString in localizedStrings: + val = dOld.get(localizedString, {}) + translation = val.get("translation", "") + comment = val.get("comment") + if len(localizedString) > doublespace_threshold and not lOut[-1] == "": + lOut.append("") + if comment != None: + lOut.append(comment) + lOut.append(f"{localizedString}={translation}") + if len(localizedString) > doublespace_threshold: + lOut.append("") + + + unusedExist = False + for key in dOld: + if key not in dkeyStrings: + val = dOld[key] + translation = val.get("translation") + comment = val.get("comment") + # only keep an unused translation if there was translated + # text or a comment associated with it + if translation != None and (translation != "" or comment): + if not unusedExist: + unusedExist = True + lOut.append("\n\n##### not used anymore #####\n") + if len(key) > doublespace_threshold and not lOut[-1] == "": + lOut.append("") + if comment != None: + lOut.append(comment) + lOut.append(f"{key}={translation}") + if len(key) > doublespace_threshold: + lOut.append("") + return "\n".join(lOut) + '\n' + +# Writes a template.txt file +# dkeyStrings is the dictionary returned by generate_template +def write_template(templ_file, dkeyStrings, mod_name): + # read existing template file to preserve comments + existing_template = import_tr_file(templ_file) + + text = strings_to_text(dkeyStrings, existing_template[0], mod_name) + mkdir_p(os.path.dirname(templ_file)) + with open(templ_file, "wt", encoding='utf-8') as template_file: + template_file.write(text) + + +# Gets all translatable strings from a lua file +def read_lua_file_strings(lua_file): + lOut = [] + with open(lua_file, encoding='utf-8') as text_file: + text = text_file.read() + #TODO remove comments here + + text = re.sub(pattern_concat, "", text) + + strings = [] + for s in pattern_lua.findall(text): + strings.append(s[1]) + for s in pattern_lua_bracketed.findall(text): + strings.append(s) + + for s in strings: + s = re.sub(r'"\.\.\s+"', "", s) + s = re.sub("@[^@=0-9]", "@@", s) + s = s.replace('\\"', '"') + s = s.replace("\\'", "'") + s = s.replace("\n", "@n") + s = s.replace("\\n", "@n") + s = s.replace("=", "@=") + lOut.append(s) + return lOut + +# Gets strings from an existing translation file +# returns both a dictionary of translations +# and the full original source text so that the new text +# can be compared to it for changes. +def import_tr_file(tr_file): + dOut = {} + text = None + if os.path.exists(tr_file): + with open(tr_file, "r", encoding='utf-8') as existing_file : + # save the full text to allow for comparison + # of the old version with the new output + text = existing_file.read() + existing_file.seek(0) + # a running record of the current comment block + # we're inside, to allow preceeding multi-line comments + # to be retained for a translation line + latest_comment_block = None + for line in existing_file.readlines(): + line = line.rstrip('\n') + if line[:3] == "###": + # Reset comment block if we hit a header + latest_comment_block = None + continue + if line[:1] == "#": + # Save the comment we're inside + if not latest_comment_block: + latest_comment_block = line + else: + latest_comment_block = latest_comment_block + "\n" + line + continue + match = pattern_tr.match(line) + if match: + # this line is a translated line + outval = {} + outval["translation"] = match.group(2) + if latest_comment_block: + # if there was a comment, record that. + outval["comment"] = latest_comment_block + latest_comment_block = None + dOut[match.group(1)] = outval + return (dOut, text) + +# Walks all lua files in the mod folder, collects translatable strings, +# and writes it to a template.txt file +# Returns a dictionary of localized strings to source file sets +# that can be used with the strings_to_text function. +def generate_template(folder, mod_name): + dOut = {} + for root, dirs, files in os.walk(folder): + for name in files: + if fnmatch.fnmatch(name, "*.lua"): + fname = os.path.join(root, name) + found = read_lua_file_strings(fname) + if params["verbose"]: + print(f"{fname}: {str(len(found))} translatable strings") + + for s in found: + sources = dOut.get(s, set()) + sources.add(f"### {os.path.basename(fname)} ###") + dOut[s] = sources + + if len(dOut) == 0: + return None + templ_file = os.path.join(folder, "locale/template.txt") + write_template(templ_file, dOut, mod_name) + return dOut + +# Updates an existing .tr file, copying the old one to a ".old" file +# if any changes have happened +# dNew is the data used to generate the template, it has all the +# currently-existing localized strings +def update_tr_file(dNew, mod_name, tr_file): + if params["verbose"]: + print(f"updating {tr_file}") + + tr_import = import_tr_file(tr_file) + dOld = tr_import[0] + textOld = tr_import[1] + + textNew = strings_to_text(dNew, dOld, mod_name) + + if textOld and textOld != textNew: + print(f"{tr_file} has changed.") + shutil.copyfile(tr_file, f"{tr_file}.old") + + with open(tr_file, "w", encoding='utf-8') as new_tr_file: + new_tr_file.write(textNew) + +# Updates translation files for the mod in the given folder +def update_mod(folder): + modname = get_modname(folder) + if modname is not None: + process_po_files(folder, modname) + print(f"Updating translations for {modname}") + data = generate_template(folder, modname) + if data == None: + print(f"No translatable strings found in {modname}") + else: + for tr_file in get_existing_tr_files(folder): + update_tr_file(data, modname, os.path.join(folder, "locale/", tr_file)) + else: + print("Unable to find modname in folder " + folder) + +# Determines if the folder being pointed to is a mod or a mod pack +# and then runs update_mod accordingly +def update_folder(folder): + is_modpack = os.path.exists(os.path.join(folder, "modpack.txt")) or os.path.exists(os.path.join(folder, "modpack.conf")) + if is_modpack: + subfolders = [f.path for f in os.scandir(folder) if f.is_dir()] + for subfolder in subfolders: + update_mod(subfolder + "/") + else: + update_mod(folder) + print("Done.") + +def run_all_subfolders(folder): + for modfolder in [f.path for f in os.scandir(folder) if f.is_dir()]: + update_folder(modfolder + "/") + + +main() diff --git a/castle_lighting/init.lua b/castle_lighting/init.lua index 34eb1c30..a3f16559 100644 --- a/castle_lighting/init.lua +++ b/castle_lighting/init.lua @@ -4,9 +4,8 @@ minetest.register_alias("castle:light", "castle_lighting:light") minetest.register_alias("castle:chandelier", "castle_lighting:chandelier") minetest.register_alias("castle:chandelier_chain", "castle_lighting:chandelier_chain") --- internationalization boilerplate local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") +local S = minetest.get_translator(minetest.get_current_modname()) castle_lighting = {} diff --git a/castle_lighting/intllib.lua b/castle_lighting/intllib.lua deleted file mode 100644 index 6669d720..00000000 --- a/castle_lighting/intllib.lua +++ /dev/null @@ -1,45 +0,0 @@ - --- Fallback functions for when `intllib` is not installed. --- Code released under Unlicense . - --- Get the latest version of this file at: --- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua - -local function format(str, ...) - local args = { ... } - local function repl(escape, open, num, close) - if escape == "" then - local replacement = tostring(args[tonumber(num)]) - if open == "" then - replacement = replacement..close - end - return replacement - else - return "@"..open..num..close - end - end - return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) -end - -local gettext, ngettext -if minetest.get_modpath("intllib") then - if intllib.make_gettext_pair then - -- New method using gettext. - gettext, ngettext = intllib.make_gettext_pair() - else - -- Old method using text files. - gettext = intllib.Getter() - end -end - --- Fill in missing functions. - -gettext = gettext or function(msgid, ...) - return format(msgid, ...) -end - -ngettext = ngettext or function(msgid, msgid_plural, n, ...) - return format(n==1 and msgid or msgid_plural, ...) -end - -return gettext, ngettext diff --git a/castle_lighting/locale/castle_lighting.es.tr b/castle_lighting/locale/castle_lighting.es.tr new file mode 100644 index 00000000..1c0fb782 --- /dev/null +++ b/castle_lighting/locale/castle_lighting.es.tr @@ -0,0 +1,18 @@ +# textdomain: castle_lighting + + +### brasier.lua ### + +@1 Brasier=Brasero de @1 +A brasier for producing copious amounts of light and heat.=Un brasero para producir grandes cantidades de luz y calor. +Floor Brasier=Brasero con Patas +Stonebrick=Ladrillo de piedra + +To ignite the brasier place a flammable fuel in its inventory slot. A lump of coal will burn for about half an hour.=Para encender el brasero coloque un combustible inflamable en su ranura de inventario. Un trozo de carbón arderá durante media hora. + + +### init.lua ### + +Chandelier=Candelero +Chandelier Chain=Colgante de Candelero +Light Block=Bloque de luz diff --git a/castle_lighting/locale/castle_lighting.it.tr b/castle_lighting/locale/castle_lighting.it.tr new file mode 100644 index 00000000..95d27242 --- /dev/null +++ b/castle_lighting/locale/castle_lighting.it.tr @@ -0,0 +1,18 @@ +# textdomain: castle_lighting + + +### brasier.lua ### + +@1 Brasier=Braciere di @1 +A brasier for producing copious amounts of light and heat.=Un braciere per produrre grandi quantità di luce e calore. +Floor Brasier=Braciere da pavimento +Stonebrick=Mattoni di pietra + +To ignite the brasier place a flammable fuel in its inventory slot. A lump of coal will burn for about half an hour.=Per accendere il braciere mettete del combustibile nella sua casella di inventario. Un grumo di carbone brucerà per circa mezz'ora. + + +### init.lua ### + +Chandelier=Candeliere +Chandelier Chain=Catena per candeliere +Light Block=Lampada diff --git a/castle_lighting/locale/es.po b/castle_lighting/locale/es.po deleted file mode 100644 index f0faee9b..00000000 --- a/castle_lighting/locale/es.po +++ /dev/null @@ -1,54 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-01 23:52-0700\n" -"PO-Revision-Date: 2017-04-28 12:40-0400\n" -"Last-Translator: Carlos Barraza\n" -"Language-Team: LANGUAGE \n" -"Language: Español\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: brasier.lua:7 -msgid "A brasier for producing copious amounts of light and heat." -msgstr "Un brasero para producir grandes cantidades de luz y calor." - -#: brasier.lua:8 -msgid "" -"To ignite the brasier place a flammable fuel in its inventory slot. A lump " -"of coal will burn for about half an hour." -msgstr "" -"Para encender el brasero coloque un combustible inflamable en su ranura de " -"inventario. Un trozo de carbón arderá durante media hora." - -#: brasier.lua:107 -msgid "Floor Brasier" -msgstr "Brasero con Patas" - -#: brasier.lua:156 -msgid "Stonebrick" -msgstr "Ladrillo de piedra" - -#: brasier.lua:228 -msgid "@1 Brasier" -msgstr "Brasero de @1" - -#: init.lua:17 -msgid "Light Block" -msgstr "Bloque de luz" - -#: init.lua:37 -msgid "Chandelier" -msgstr "Candelero" - -#: init.lua:76 -msgid "Chandelier Chain" -msgstr "Colgante de Candelero" diff --git a/castle_lighting/locale/it.po b/castle_lighting/locale/it.po deleted file mode 100644 index 5acbb713..00000000 --- a/castle_lighting/locale/it.po +++ /dev/null @@ -1,55 +0,0 @@ -# ITALIAN LOCALE FILE FOR THE CASTLE LIGHTING MODULE -# Copyright (C) 2017 Philipbenr And DanDuncombe -# This file is distributed under the same license as the CASTLE LIGHTING package. -# Hamlet , 2017. -# -msgid "" -msgstr "" -"Project-Id-Version: Castle Lighting\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-01 23:52-0700\n" -"PO-Revision-Date: 2017-09-10 22:00+0100\n" -"Last-Translator: H4mlet \n" -"Language-Team: \n" -"Language: it\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 1.6.10\n" - -#: brasier.lua:7 -msgid "A brasier for producing copious amounts of light and heat." -msgstr "Un braciere per produrre grandi quantità di luce e calore." - -#: brasier.lua:8 -msgid "" -"To ignite the brasier place a flammable fuel in its inventory slot. A lump " -"of coal will burn for about half an hour." -msgstr "" -"Per accendere il braciere mettete del combustibile nella sua casella di " -"inventario. Un grumo di carbone brucerà per circa mezz'ora." - -#: brasier.lua:107 -msgid "Floor Brasier" -msgstr "Braciere da pavimento" - -#: brasier.lua:156 -msgid "Stonebrick" -msgstr "Mattoni di pietra" - -#: brasier.lua:228 -msgid "@1 Brasier" -msgstr "Braciere di @1" - -#: init.lua:17 -msgid "Light Block" -msgstr "Lampada" - -#: init.lua:37 -msgid "Chandelier" -msgstr "Candeliere" - -#: init.lua:76 -msgid "Chandelier Chain" -msgstr "Catena per candeliere" diff --git a/castle_lighting/locale/template.pot b/castle_lighting/locale/template.pot deleted file mode 100644 index e7f0768b..00000000 --- a/castle_lighting/locale/template.pot +++ /dev/null @@ -1,52 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-01 23:52-0700\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: brasier.lua:7 -msgid "A brasier for producing copious amounts of light and heat." -msgstr "" - -#: brasier.lua:8 -msgid "" -"To ignite the brasier place a flammable fuel in its inventory slot. A lump " -"of coal will burn for about half an hour." -msgstr "" - -#: brasier.lua:107 -msgid "Floor Brasier" -msgstr "" - -#: brasier.lua:156 -msgid "Stonebrick" -msgstr "" - -#: brasier.lua:228 -msgid "@1 Brasier" -msgstr "" - -#: init.lua:17 -msgid "Light Block" -msgstr "" - -#: init.lua:37 -msgid "Chandelier" -msgstr "" - -#: init.lua:76 -msgid "Chandelier Chain" -msgstr "" diff --git a/castle_lighting/locale/template.txt b/castle_lighting/locale/template.txt new file mode 100644 index 00000000..0a8fa346 --- /dev/null +++ b/castle_lighting/locale/template.txt @@ -0,0 +1,18 @@ +# textdomain: castle_lighting + + +### brasier.lua ### + +@1 Brasier= +A brasier for producing copious amounts of light and heat.= +Floor Brasier= +Stonebrick= + +To ignite the brasier place a flammable fuel in its inventory slot. A lump of coal will burn for about half an hour.= + + +### init.lua ### + +Chandelier= +Chandelier Chain= +Light Block= diff --git a/castle_lighting/mod.conf b/castle_lighting/mod.conf index b894c976..6324a218 100644 --- a/castle_lighting/mod.conf +++ b/castle_lighting/mod.conf @@ -1 +1,4 @@ name = castle_lighting +depends = default +optional_depends = fire, castle_masonry, hopper, doc +description = This mod contains medieval castle lighting solutions diff --git a/castle_lighting/textures/castle_chandelier.png b/castle_lighting/textures/castle_chandelier.png index fbc00394..5713f93d 100644 Binary files a/castle_lighting/textures/castle_chandelier.png and b/castle_lighting/textures/castle_chandelier.png differ diff --git a/castle_lighting/textures/castle_chandelier_chain.png b/castle_lighting/textures/castle_chandelier_chain.png index 47a526ae..6952e965 100644 Binary files a/castle_lighting/textures/castle_chandelier_chain.png and b/castle_lighting/textures/castle_chandelier_chain.png differ diff --git a/castle_lighting/textures/castle_chandelier_wield.png b/castle_lighting/textures/castle_chandelier_wield.png index 59dae960..72ace823 100644 Binary files a/castle_lighting/textures/castle_chandelier_wield.png and b/castle_lighting/textures/castle_chandelier_wield.png differ diff --git a/castle_lighting/textures/castle_coal_bed.png b/castle_lighting/textures/castle_coal_bed.png index e263bcd3..854b0a13 100644 Binary files a/castle_lighting/textures/castle_coal_bed.png and b/castle_lighting/textures/castle_coal_bed.png differ diff --git a/castle_lighting/textures/castle_steel.png b/castle_lighting/textures/castle_steel.png index 28ecd602..8f069fda 100644 Binary files a/castle_lighting/textures/castle_steel.png and b/castle_lighting/textures/castle_steel.png differ diff --git a/castle_lighting/textures/castle_street_light.png b/castle_lighting/textures/castle_street_light.png index dc3f72ef..26cd407a 100644 Binary files a/castle_lighting/textures/castle_street_light.png and b/castle_lighting/textures/castle_street_light.png differ diff --git a/castle_storage/crate.lua b/castle_storage/crate.lua index e0e697f8..a374228c 100644 --- a/castle_storage/crate.lua +++ b/castle_storage/crate.lua @@ -1,9 +1,7 @@ minetest.register_alias("darkage:box", "castle_storage:crate") minetest.register_alias("castle:crate", "castle_storage:crate") --- internationalization boilerplate -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") +local S = minetest.get_translator(minetest.get_current_modname()) minetest.register_node("castle_storage:crate", { description = S("Crate"), diff --git a/castle_storage/depends.txt b/castle_storage/depends.txt index 9dd7d9bc..d660791d 100644 --- a/castle_storage/depends.txt +++ b/castle_storage/depends.txt @@ -1,3 +1,2 @@ default -intllib? hopper? diff --git a/castle_storage/i18n.py b/castle_storage/i18n.py new file mode 100644 index 00000000..d33bbb04 --- /dev/null +++ b/castle_storage/i18n.py @@ -0,0 +1,418 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Script to generate the template file and update the translation files. +# Copy the script into the mod or modpack root folder and run it there. +# +# Copyright (C) 2019 Joachim Stolberg, 2020 FaceDeer, 2020 Louis Royer +# LGPLv2.1+ + +from __future__ import print_function +import os, fnmatch, re, shutil, errno +from sys import argv as _argv + +# Running params +params = {"recursive": False, + "help": False, + "mods": False, + "verbose": False, + "folders": [] +} +# Available CLI options +options = {"recursive": ['--recursive', '-r'], + "help": ['--help', '-h'], + "mods": ['--installed-mods'], + "verbose": ['--verbose', '-v'] +} + +# Strings longer than this will have extra space added between +# them in the translation files to make it easier to distinguish their +# beginnings and endings at a glance +doublespace_threshold = 60 + +def set_params_folders(tab: list): + '''Initialize params["folders"] from CLI arguments.''' + # Discarding argument 0 (tool name) + for param in tab[1:]: + stop_param = False + for option in options: + if param in options[option]: + stop_param = True + break + if not stop_param: + params["folders"].append(os.path.abspath(param)) + +def set_params(tab: list): + '''Initialize params from CLI arguments.''' + for option in options: + for option_name in options[option]: + if option_name in tab: + params[option] = True + break + +def print_help(name): + '''Prints some help message.''' + print(f'''SYNOPSIS + {name} [OPTIONS] [PATHS...] +DESCRIPTION + {', '.join(options["help"])} + prints this help message + {', '.join(options["recursive"])} + run on all subfolders of paths given + {', '.join(options["mods"])} + run on locally installed modules + {', '.join(options["verbose"])} + add output information +''') + + +def main(): + '''Main function''' + set_params(_argv) + set_params_folders(_argv) + if params["help"]: + print_help(_argv[0]) + elif params["recursive"] and params["mods"]: + print("Option --installed-mods is incompatible with --recursive") + else: + # Add recursivity message + print("Running ", end='') + if params["recursive"]: + print("recursively ", end='') + # Running + if params["mods"]: + print(f"on all locally installed modules in {os.path.abspath('~/.minetest/mods/')}") + run_all_subfolders("~/.minetest/mods") + elif len(params["folders"]) >= 2: + print("on folder list:", params["folders"]) + for f in params["folders"]: + if params["recursive"]: + run_all_subfolders(f) + else: + update_folder(f) + elif len(params["folders"]) == 1: + print("on folder", params["folders"][0]) + if params["recursive"]: + run_all_subfolders(params["folders"][0]) + else: + update_folder(params["folders"][0]) + else: + print("on folder", os.path.abspath("./")) + if params["recursive"]: + run_all_subfolders(os.path.abspath("./")) + else: + update_folder(os.path.abspath("./")) + +#group 2 will be the string, groups 1 and 3 will be the delimiters (" or ') +#See https://stackoverflow.com/questions/46967465/regex-match-text-in-either-single-or-double-quote +pattern_lua = re.compile(r'[\.=^\t,{\(\s]N?S\(\s*(["\'])((?:\\\1|(?:(?!\1)).)*)(\1)[\s,\)]', re.DOTALL) +pattern_lua_bracketed = re.compile(r'[\.=^\t,{\(\s]N?S\(\s*\[\[(.*?)\]\][\s,\)]', re.DOTALL) + +# Handles "concatenation" .. " of strings" +pattern_concat = re.compile(r'["\'][\s]*\.\.[\s]*["\']', re.DOTALL) + +pattern_tr = re.compile(r'(.+?[^@])=(.*)') +pattern_name = re.compile(r'^name[ ]*=[ ]*([^ \n]*)') +pattern_tr_filename = re.compile(r'\.tr$') +pattern_po_language_code = re.compile(r'(.*)\.po$') + +#attempt to read the mod's name from the mod.conf file. Returns None on failure +def get_modname(folder): + try: + with open(os.path.join(folder, "mod.conf"), "r", encoding='utf-8') as mod_conf: + for line in mod_conf: + match = pattern_name.match(line) + if match: + return match.group(1) + except FileNotFoundError: + pass + return None + +#If there are already .tr files in /locale, returns a list of their names +def get_existing_tr_files(folder): + out = [] + for root, dirs, files in os.walk(os.path.join(folder, 'locale/')): + for name in files: + if pattern_tr_filename.search(name): + out.append(name) + return out + +# A series of search and replaces that massage a .po file's contents into +# a .tr file's equivalent +def process_po_file(text): + # The first three items are for unused matches + text = re.sub(r'#~ msgid "', "", text) + text = re.sub(r'"\n#~ msgstr ""\n"', "=", text) + text = re.sub(r'"\n#~ msgstr "', "=", text) + # comment lines + text = re.sub(r'#.*\n', "", text) + # converting msg pairs into "=" pairs + text = re.sub(r'msgid "', "", text) + text = re.sub(r'"\nmsgstr ""\n"', "=", text) + text = re.sub(r'"\nmsgstr "', "=", text) + # various line breaks and escape codes + text = re.sub(r'"\n"', "", text) + text = re.sub(r'"\n', "\n", text) + text = re.sub(r'\\"', '"', text) + text = re.sub(r'\\n', '@n', text) + # remove header text + text = re.sub(r'=Project-Id-Version:.*\n', "", text) + # remove double-spaced lines + text = re.sub(r'\n\n', '\n', text) + return text + +# Go through existing .po files and, if a .tr file for that language +# *doesn't* exist, convert it and create it. +# The .tr file that results will subsequently be reprocessed so +# any "no longer used" strings will be preserved. +# Note that "fuzzy" tags will be lost in this process. +def process_po_files(folder, modname): + for root, dirs, files in os.walk(os.path.join(folder, 'locale/')): + for name in files: + code_match = pattern_po_language_code.match(name) + if code_match == None: + continue + language_code = code_match.group(1) + tr_name = modname + "." + language_code + ".tr" + tr_file = os.path.join(root, tr_name) + if os.path.exists(tr_file): + if params["verbose"]: + print(f"{tr_name} already exists, ignoring {name}") + continue + fname = os.path.join(root, name) + with open(fname, "r", encoding='utf-8') as po_file: + if params["verbose"]: + print(f"Importing translations from {name}") + text = process_po_file(po_file.read()) + with open(tr_file, "wt", encoding='utf-8') as tr_out: + tr_out.write(text) + +# from https://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python/600612#600612 +# Creates a directory if it doesn't exist, silently does +# nothing if it already exists +def mkdir_p(path): + try: + os.makedirs(path) + except OSError as exc: # Python >2.5 + if exc.errno == errno.EEXIST and os.path.isdir(path): + pass + else: raise + +# Converts the template dictionary to a text to be written as a file +# dKeyStrings is a dictionary of localized string to source file sets +# dOld is a dictionary of existing translations and comments from +# the previous version of this text +def strings_to_text(dkeyStrings, dOld, mod_name): + lOut = [f"# textdomain: {mod_name}\n"] + + dGroupedBySource = {} + + for key in dkeyStrings: + sourceList = list(dkeyStrings[key]) + sourceList.sort() + sourceString = "\n".join(sourceList) + listForSource = dGroupedBySource.get(sourceString, []) + listForSource.append(key) + dGroupedBySource[sourceString] = listForSource + + lSourceKeys = list(dGroupedBySource.keys()) + lSourceKeys.sort() + for source in lSourceKeys: + localizedStrings = dGroupedBySource[source] + localizedStrings.sort() + lOut.append("") + lOut.append(source) + lOut.append("") + for localizedString in localizedStrings: + val = dOld.get(localizedString, {}) + translation = val.get("translation", "") + comment = val.get("comment") + if len(localizedString) > doublespace_threshold and not lOut[-1] == "": + lOut.append("") + if comment != None: + lOut.append(comment) + lOut.append(f"{localizedString}={translation}") + if len(localizedString) > doublespace_threshold: + lOut.append("") + + + unusedExist = False + for key in dOld: + if key not in dkeyStrings: + val = dOld[key] + translation = val.get("translation") + comment = val.get("comment") + # only keep an unused translation if there was translated + # text or a comment associated with it + if translation != None and (translation != "" or comment): + if not unusedExist: + unusedExist = True + lOut.append("\n\n##### not used anymore #####\n") + if len(key) > doublespace_threshold and not lOut[-1] == "": + lOut.append("") + if comment != None: + lOut.append(comment) + lOut.append(f"{key}={translation}") + if len(key) > doublespace_threshold: + lOut.append("") + return "\n".join(lOut) + '\n' + +# Writes a template.txt file +# dkeyStrings is the dictionary returned by generate_template +def write_template(templ_file, dkeyStrings, mod_name): + # read existing template file to preserve comments + existing_template = import_tr_file(templ_file) + + text = strings_to_text(dkeyStrings, existing_template[0], mod_name) + mkdir_p(os.path.dirname(templ_file)) + with open(templ_file, "wt", encoding='utf-8') as template_file: + template_file.write(text) + + +# Gets all translatable strings from a lua file +def read_lua_file_strings(lua_file): + lOut = [] + with open(lua_file, encoding='utf-8') as text_file: + text = text_file.read() + #TODO remove comments here + + text = re.sub(pattern_concat, "", text) + + strings = [] + for s in pattern_lua.findall(text): + strings.append(s[1]) + for s in pattern_lua_bracketed.findall(text): + strings.append(s) + + for s in strings: + s = re.sub(r'"\.\.\s+"', "", s) + s = re.sub("@[^@=0-9]", "@@", s) + s = s.replace('\\"', '"') + s = s.replace("\\'", "'") + s = s.replace("\n", "@n") + s = s.replace("\\n", "@n") + s = s.replace("=", "@=") + lOut.append(s) + return lOut + +# Gets strings from an existing translation file +# returns both a dictionary of translations +# and the full original source text so that the new text +# can be compared to it for changes. +def import_tr_file(tr_file): + dOut = {} + text = None + if os.path.exists(tr_file): + with open(tr_file, "r", encoding='utf-8') as existing_file : + # save the full text to allow for comparison + # of the old version with the new output + text = existing_file.read() + existing_file.seek(0) + # a running record of the current comment block + # we're inside, to allow preceeding multi-line comments + # to be retained for a translation line + latest_comment_block = None + for line in existing_file.readlines(): + line = line.rstrip('\n') + if line[:3] == "###": + # Reset comment block if we hit a header + latest_comment_block = None + continue + if line[:1] == "#": + # Save the comment we're inside + if not latest_comment_block: + latest_comment_block = line + else: + latest_comment_block = latest_comment_block + "\n" + line + continue + match = pattern_tr.match(line) + if match: + # this line is a translated line + outval = {} + outval["translation"] = match.group(2) + if latest_comment_block: + # if there was a comment, record that. + outval["comment"] = latest_comment_block + latest_comment_block = None + dOut[match.group(1)] = outval + return (dOut, text) + +# Walks all lua files in the mod folder, collects translatable strings, +# and writes it to a template.txt file +# Returns a dictionary of localized strings to source file sets +# that can be used with the strings_to_text function. +def generate_template(folder, mod_name): + dOut = {} + for root, dirs, files in os.walk(folder): + for name in files: + if fnmatch.fnmatch(name, "*.lua"): + fname = os.path.join(root, name) + found = read_lua_file_strings(fname) + if params["verbose"]: + print(f"{fname}: {str(len(found))} translatable strings") + + for s in found: + sources = dOut.get(s, set()) + sources.add(f"### {os.path.basename(fname)} ###") + dOut[s] = sources + + if len(dOut) == 0: + return None + templ_file = os.path.join(folder, "locale/template.txt") + write_template(templ_file, dOut, mod_name) + return dOut + +# Updates an existing .tr file, copying the old one to a ".old" file +# if any changes have happened +# dNew is the data used to generate the template, it has all the +# currently-existing localized strings +def update_tr_file(dNew, mod_name, tr_file): + if params["verbose"]: + print(f"updating {tr_file}") + + tr_import = import_tr_file(tr_file) + dOld = tr_import[0] + textOld = tr_import[1] + + textNew = strings_to_text(dNew, dOld, mod_name) + + if textOld and textOld != textNew: + print(f"{tr_file} has changed.") + shutil.copyfile(tr_file, f"{tr_file}.old") + + with open(tr_file, "w", encoding='utf-8') as new_tr_file: + new_tr_file.write(textNew) + +# Updates translation files for the mod in the given folder +def update_mod(folder): + modname = get_modname(folder) + if modname is not None: + process_po_files(folder, modname) + print(f"Updating translations for {modname}") + data = generate_template(folder, modname) + if data == None: + print(f"No translatable strings found in {modname}") + else: + for tr_file in get_existing_tr_files(folder): + update_tr_file(data, modname, os.path.join(folder, "locale/", tr_file)) + else: + print("Unable to find modname in folder " + folder) + +# Determines if the folder being pointed to is a mod or a mod pack +# and then runs update_mod accordingly +def update_folder(folder): + is_modpack = os.path.exists(os.path.join(folder, "modpack.txt")) or os.path.exists(os.path.join(folder, "modpack.conf")) + if is_modpack: + subfolders = [f.path for f in os.scandir(folder) if f.is_dir()] + for subfolder in subfolders: + update_mod(subfolder + "/") + else: + update_mod(folder) + print("Done.") + +def run_all_subfolders(folder): + for modfolder in [f.path for f in os.scandir(folder) if f.is_dir()]: + update_folder(modfolder + "/") + + +main() diff --git a/castle_storage/intllib.lua b/castle_storage/intllib.lua deleted file mode 100644 index 6669d720..00000000 --- a/castle_storage/intllib.lua +++ /dev/null @@ -1,45 +0,0 @@ - --- Fallback functions for when `intllib` is not installed. --- Code released under Unlicense . - --- Get the latest version of this file at: --- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua - -local function format(str, ...) - local args = { ... } - local function repl(escape, open, num, close) - if escape == "" then - local replacement = tostring(args[tonumber(num)]) - if open == "" then - replacement = replacement..close - end - return replacement - else - return "@"..open..num..close - end - end - return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) -end - -local gettext, ngettext -if minetest.get_modpath("intllib") then - if intllib.make_gettext_pair then - -- New method using gettext. - gettext, ngettext = intllib.make_gettext_pair() - else - -- Old method using text files. - gettext = intllib.Getter() - end -end - --- Fill in missing functions. - -gettext = gettext or function(msgid, ...) - return format(msgid, ...) -end - -ngettext = ngettext or function(msgid, msgid_plural, n, ...) - return format(n==1 and msgid or msgid_plural, ...) -end - -return gettext, ngettext diff --git a/castle_storage/ironbound_chest.lua b/castle_storage/ironbound_chest.lua index 7cc8c89d..d6afd555 100644 --- a/castle_storage/ironbound_chest.lua +++ b/castle_storage/ironbound_chest.lua @@ -1,8 +1,6 @@ minetest.register_alias("castle:ironbound_chest", "castle_storage:ironbound_chest") --- internationalization boilerplate -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") +local S = minetest.get_translator(minetest.get_current_modname()) local get_ironbound_chest_formspec = function(pos) local spos = pos.x .. "," .. pos.y .. "," ..pos.z diff --git a/castle_storage/locale/castle_storage.it.tr b/castle_storage/locale/castle_storage.it.tr new file mode 100644 index 00000000..e5d383a8 --- /dev/null +++ b/castle_storage/locale/castle_storage.it.tr @@ -0,0 +1,21 @@ +# textdomain: castle_storage + + +### crate.lua ### + +@1 moves stuff in crate at @2=@1 mette delle cose nella cassa alle coordinate @2 +@1 moves stuff to crate at @2=@1 prende delle cose dalla cassa alle coordinate @2 +Crate=Cassa + +### crate.lua ### +### ironbound_chest.lua ### + +@1 takes stuff from locked chest at @2=@1 prende delle cose dal baule chiuso a chiave alle coordinate @2 + +### ironbound_chest.lua ### + +@1 moves stuff in locked chest at @2=@1 sposta delle cose nel baule chiuso a chiave alle coordinate @2 +@1 moves stuff to locked chest at @2=@1 mette delle cose nel baule chiuso a chiave alle coordinate @2 +@1 tried to access a locked chest belonging to @2 at @3=@1 ha tentato di aprire un baule chiuso a chiave di @2 alle coordinate @3 +Ironbound Chest=Baule rinforzato col ferro +Ironbound Chest (owned by @1)=Baule rinforzato col ferro (di @1) diff --git a/castle_storage/locale/it.po b/castle_storage/locale/it.po deleted file mode 100644 index a512bbe0..00000000 --- a/castle_storage/locale/it.po +++ /dev/null @@ -1,56 +0,0 @@ -# ITALIAN LOCALE FILE FOR THE CASTLE STORAGE MODULE -# Copyright (C) 2017 Philipbenr And DanDuncombe -# This file is distributed under the same license as the CASTLE STORAGE package. -# Hamlet , 2017. -# -msgid "" -msgstr "" -"Project-Id-Version: Castle Storage\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-25 19:18-0700\n" -"PO-Revision-Date: 2017-09-10 22:46+0100\n" -"Last-Translator: H4mlet \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"Language: it\n" -"X-Generator: Poedit 1.6.10\n" - -#: crate.lua:9 crate.lua:24 -msgid "Crate" -msgstr "Cassa" - -#: crate.lua:34 -msgid "@1 moves stuff in crate at @2" -msgstr "@1 mette delle cose nella cassa alle coordinate @2" - -#: crate.lua:37 -msgid "@1 moves stuff to crate at @2" -msgstr "@1 prende delle cose dalla cassa alle coordinate @2" - -#: crate.lua:40 ironbound_chest.lua:113 -msgid "@1 takes stuff from locked chest at @2" -msgstr "@1 prende delle cose dal baule chiuso a chiave alle coordinate @2" - -#: ironbound_chest.lua:35 ironbound_chest.lua:69 -msgid "Ironbound Chest" -msgstr "Baule rinforzato col ferro" - -#: ironbound_chest.lua:65 -msgid "Ironbound Chest (owned by @1)" -msgstr "Baule rinforzato col ferro (di @1)" - -#: ironbound_chest.lua:82 ironbound_chest.lua:91 ironbound_chest.lua:100 -msgid "@1 tried to access a locked chest belonging to @2 at @3" -msgstr "" -"@1 ha tentato di aprire un baule chiuso a chiave di @2 alle coordinate @3" - -#: ironbound_chest.lua:107 -msgid "@1 moves stuff in locked chest at @2" -msgstr "@1 sposta delle cose nel baule chiuso a chiave alle coordinate @2" - -#: ironbound_chest.lua:110 -msgid "@1 moves stuff to locked chest at @2" -msgstr "@1 mette delle cose nel baule chiuso a chiave alle coordinate @2" diff --git a/castle_storage/locale/template.pot b/castle_storage/locale/template.pot deleted file mode 100644 index 07535842..00000000 --- a/castle_storage/locale/template.pot +++ /dev/null @@ -1,53 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-25 19:18-0700\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: crate.lua:9 crate.lua:24 -msgid "Crate" -msgstr "" - -#: crate.lua:34 -msgid "@1 moves stuff in crate at @2" -msgstr "" - -#: crate.lua:37 -msgid "@1 moves stuff to crate at @2" -msgstr "" - -#: crate.lua:40 ironbound_chest.lua:113 -msgid "@1 takes stuff from locked chest at @2" -msgstr "" - -#: ironbound_chest.lua:35 ironbound_chest.lua:69 -msgid "Ironbound Chest" -msgstr "" - -#: ironbound_chest.lua:65 -msgid "Ironbound Chest (owned by @1)" -msgstr "" - -#: ironbound_chest.lua:82 ironbound_chest.lua:91 ironbound_chest.lua:100 -msgid "@1 tried to access a locked chest belonging to @2 at @3" -msgstr "" - -#: ironbound_chest.lua:107 -msgid "@1 moves stuff in locked chest at @2" -msgstr "" - -#: ironbound_chest.lua:110 -msgid "@1 moves stuff to locked chest at @2" -msgstr "" diff --git a/castle_storage/locale/template.txt b/castle_storage/locale/template.txt new file mode 100644 index 00000000..44f69a9d --- /dev/null +++ b/castle_storage/locale/template.txt @@ -0,0 +1,21 @@ +# textdomain: castle_storage + + +### crate.lua ### + +@1 moves stuff in crate at @2= +@1 moves stuff to crate at @2= +Crate= + +### crate.lua ### +### ironbound_chest.lua ### + +@1 takes stuff from locked chest at @2= + +### ironbound_chest.lua ### + +@1 moves stuff in locked chest at @2= +@1 moves stuff to locked chest at @2= +@1 tried to access a locked chest belonging to @2 at @3= +Ironbound Chest= +Ironbound Chest (owned by @1)= diff --git a/castle_storage/mod.conf b/castle_storage/mod.conf index b2b64963..dfff665f 100644 --- a/castle_storage/mod.conf +++ b/castle_storage/mod.conf @@ -1 +1,4 @@ -name = castle_storage \ No newline at end of file +name = castle_storage +depends = default +optional_depends = hopper +description = This mod contains storage containers one might find contained in a castle. diff --git a/castle_storage/textures/castle_ironbound_chest_side.png b/castle_storage/textures/castle_ironbound_chest_side.png index 3a94f81f..6bb6c6bf 100644 Binary files a/castle_storage/textures/castle_ironbound_chest_side.png and b/castle_storage/textures/castle_ironbound_chest_side.png differ diff --git a/castle_weapons/battleaxe.lua b/castle_weapons/battleaxe.lua index f882cf90..98e7a516 100644 --- a/castle_weapons/battleaxe.lua +++ b/castle_weapons/battleaxe.lua @@ -1,6 +1,7 @@ --- internationalization boilerplate -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") + +-- Used for localization, choose either built-in or intllib. + +local S = minetest.get_translator(minetest.get_current_modname()) minetest.register_alias("castle:battleaxe", "castle_weapons:battleaxe") diff --git a/castle_weapons/crossbow.lua b/castle_weapons/crossbow.lua index 439f99bb..220a01ec 100644 --- a/castle_weapons/crossbow.lua +++ b/castle_weapons/crossbow.lua @@ -18,9 +18,7 @@ minetest.register_alias("castle:bolt", "castle_weapons:crossbow_bolt") minetest.register_alias("castle:crossbow_bolt", "castle_weapons:crossbow_bolt") minetest.register_alias("castle:crossbow_loaded", "castle_weapons:crossbow_loaded") --- internationalization boilerplate -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") +local S = minetest.get_translator(minetest.get_current_modname()) local crossbow={} @@ -458,4 +456,4 @@ minetest.register_craft({ recipe = { {'default:stick', 'default:stick', 'default:steel_ingot'}, } -}) \ No newline at end of file +}) diff --git a/castle_weapons/i18n.py b/castle_weapons/i18n.py new file mode 100644 index 00000000..d33bbb04 --- /dev/null +++ b/castle_weapons/i18n.py @@ -0,0 +1,418 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Script to generate the template file and update the translation files. +# Copy the script into the mod or modpack root folder and run it there. +# +# Copyright (C) 2019 Joachim Stolberg, 2020 FaceDeer, 2020 Louis Royer +# LGPLv2.1+ + +from __future__ import print_function +import os, fnmatch, re, shutil, errno +from sys import argv as _argv + +# Running params +params = {"recursive": False, + "help": False, + "mods": False, + "verbose": False, + "folders": [] +} +# Available CLI options +options = {"recursive": ['--recursive', '-r'], + "help": ['--help', '-h'], + "mods": ['--installed-mods'], + "verbose": ['--verbose', '-v'] +} + +# Strings longer than this will have extra space added between +# them in the translation files to make it easier to distinguish their +# beginnings and endings at a glance +doublespace_threshold = 60 + +def set_params_folders(tab: list): + '''Initialize params["folders"] from CLI arguments.''' + # Discarding argument 0 (tool name) + for param in tab[1:]: + stop_param = False + for option in options: + if param in options[option]: + stop_param = True + break + if not stop_param: + params["folders"].append(os.path.abspath(param)) + +def set_params(tab: list): + '''Initialize params from CLI arguments.''' + for option in options: + for option_name in options[option]: + if option_name in tab: + params[option] = True + break + +def print_help(name): + '''Prints some help message.''' + print(f'''SYNOPSIS + {name} [OPTIONS] [PATHS...] +DESCRIPTION + {', '.join(options["help"])} + prints this help message + {', '.join(options["recursive"])} + run on all subfolders of paths given + {', '.join(options["mods"])} + run on locally installed modules + {', '.join(options["verbose"])} + add output information +''') + + +def main(): + '''Main function''' + set_params(_argv) + set_params_folders(_argv) + if params["help"]: + print_help(_argv[0]) + elif params["recursive"] and params["mods"]: + print("Option --installed-mods is incompatible with --recursive") + else: + # Add recursivity message + print("Running ", end='') + if params["recursive"]: + print("recursively ", end='') + # Running + if params["mods"]: + print(f"on all locally installed modules in {os.path.abspath('~/.minetest/mods/')}") + run_all_subfolders("~/.minetest/mods") + elif len(params["folders"]) >= 2: + print("on folder list:", params["folders"]) + for f in params["folders"]: + if params["recursive"]: + run_all_subfolders(f) + else: + update_folder(f) + elif len(params["folders"]) == 1: + print("on folder", params["folders"][0]) + if params["recursive"]: + run_all_subfolders(params["folders"][0]) + else: + update_folder(params["folders"][0]) + else: + print("on folder", os.path.abspath("./")) + if params["recursive"]: + run_all_subfolders(os.path.abspath("./")) + else: + update_folder(os.path.abspath("./")) + +#group 2 will be the string, groups 1 and 3 will be the delimiters (" or ') +#See https://stackoverflow.com/questions/46967465/regex-match-text-in-either-single-or-double-quote +pattern_lua = re.compile(r'[\.=^\t,{\(\s]N?S\(\s*(["\'])((?:\\\1|(?:(?!\1)).)*)(\1)[\s,\)]', re.DOTALL) +pattern_lua_bracketed = re.compile(r'[\.=^\t,{\(\s]N?S\(\s*\[\[(.*?)\]\][\s,\)]', re.DOTALL) + +# Handles "concatenation" .. " of strings" +pattern_concat = re.compile(r'["\'][\s]*\.\.[\s]*["\']', re.DOTALL) + +pattern_tr = re.compile(r'(.+?[^@])=(.*)') +pattern_name = re.compile(r'^name[ ]*=[ ]*([^ \n]*)') +pattern_tr_filename = re.compile(r'\.tr$') +pattern_po_language_code = re.compile(r'(.*)\.po$') + +#attempt to read the mod's name from the mod.conf file. Returns None on failure +def get_modname(folder): + try: + with open(os.path.join(folder, "mod.conf"), "r", encoding='utf-8') as mod_conf: + for line in mod_conf: + match = pattern_name.match(line) + if match: + return match.group(1) + except FileNotFoundError: + pass + return None + +#If there are already .tr files in /locale, returns a list of their names +def get_existing_tr_files(folder): + out = [] + for root, dirs, files in os.walk(os.path.join(folder, 'locale/')): + for name in files: + if pattern_tr_filename.search(name): + out.append(name) + return out + +# A series of search and replaces that massage a .po file's contents into +# a .tr file's equivalent +def process_po_file(text): + # The first three items are for unused matches + text = re.sub(r'#~ msgid "', "", text) + text = re.sub(r'"\n#~ msgstr ""\n"', "=", text) + text = re.sub(r'"\n#~ msgstr "', "=", text) + # comment lines + text = re.sub(r'#.*\n', "", text) + # converting msg pairs into "=" pairs + text = re.sub(r'msgid "', "", text) + text = re.sub(r'"\nmsgstr ""\n"', "=", text) + text = re.sub(r'"\nmsgstr "', "=", text) + # various line breaks and escape codes + text = re.sub(r'"\n"', "", text) + text = re.sub(r'"\n', "\n", text) + text = re.sub(r'\\"', '"', text) + text = re.sub(r'\\n', '@n', text) + # remove header text + text = re.sub(r'=Project-Id-Version:.*\n', "", text) + # remove double-spaced lines + text = re.sub(r'\n\n', '\n', text) + return text + +# Go through existing .po files and, if a .tr file for that language +# *doesn't* exist, convert it and create it. +# The .tr file that results will subsequently be reprocessed so +# any "no longer used" strings will be preserved. +# Note that "fuzzy" tags will be lost in this process. +def process_po_files(folder, modname): + for root, dirs, files in os.walk(os.path.join(folder, 'locale/')): + for name in files: + code_match = pattern_po_language_code.match(name) + if code_match == None: + continue + language_code = code_match.group(1) + tr_name = modname + "." + language_code + ".tr" + tr_file = os.path.join(root, tr_name) + if os.path.exists(tr_file): + if params["verbose"]: + print(f"{tr_name} already exists, ignoring {name}") + continue + fname = os.path.join(root, name) + with open(fname, "r", encoding='utf-8') as po_file: + if params["verbose"]: + print(f"Importing translations from {name}") + text = process_po_file(po_file.read()) + with open(tr_file, "wt", encoding='utf-8') as tr_out: + tr_out.write(text) + +# from https://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python/600612#600612 +# Creates a directory if it doesn't exist, silently does +# nothing if it already exists +def mkdir_p(path): + try: + os.makedirs(path) + except OSError as exc: # Python >2.5 + if exc.errno == errno.EEXIST and os.path.isdir(path): + pass + else: raise + +# Converts the template dictionary to a text to be written as a file +# dKeyStrings is a dictionary of localized string to source file sets +# dOld is a dictionary of existing translations and comments from +# the previous version of this text +def strings_to_text(dkeyStrings, dOld, mod_name): + lOut = [f"# textdomain: {mod_name}\n"] + + dGroupedBySource = {} + + for key in dkeyStrings: + sourceList = list(dkeyStrings[key]) + sourceList.sort() + sourceString = "\n".join(sourceList) + listForSource = dGroupedBySource.get(sourceString, []) + listForSource.append(key) + dGroupedBySource[sourceString] = listForSource + + lSourceKeys = list(dGroupedBySource.keys()) + lSourceKeys.sort() + for source in lSourceKeys: + localizedStrings = dGroupedBySource[source] + localizedStrings.sort() + lOut.append("") + lOut.append(source) + lOut.append("") + for localizedString in localizedStrings: + val = dOld.get(localizedString, {}) + translation = val.get("translation", "") + comment = val.get("comment") + if len(localizedString) > doublespace_threshold and not lOut[-1] == "": + lOut.append("") + if comment != None: + lOut.append(comment) + lOut.append(f"{localizedString}={translation}") + if len(localizedString) > doublespace_threshold: + lOut.append("") + + + unusedExist = False + for key in dOld: + if key not in dkeyStrings: + val = dOld[key] + translation = val.get("translation") + comment = val.get("comment") + # only keep an unused translation if there was translated + # text or a comment associated with it + if translation != None and (translation != "" or comment): + if not unusedExist: + unusedExist = True + lOut.append("\n\n##### not used anymore #####\n") + if len(key) > doublespace_threshold and not lOut[-1] == "": + lOut.append("") + if comment != None: + lOut.append(comment) + lOut.append(f"{key}={translation}") + if len(key) > doublespace_threshold: + lOut.append("") + return "\n".join(lOut) + '\n' + +# Writes a template.txt file +# dkeyStrings is the dictionary returned by generate_template +def write_template(templ_file, dkeyStrings, mod_name): + # read existing template file to preserve comments + existing_template = import_tr_file(templ_file) + + text = strings_to_text(dkeyStrings, existing_template[0], mod_name) + mkdir_p(os.path.dirname(templ_file)) + with open(templ_file, "wt", encoding='utf-8') as template_file: + template_file.write(text) + + +# Gets all translatable strings from a lua file +def read_lua_file_strings(lua_file): + lOut = [] + with open(lua_file, encoding='utf-8') as text_file: + text = text_file.read() + #TODO remove comments here + + text = re.sub(pattern_concat, "", text) + + strings = [] + for s in pattern_lua.findall(text): + strings.append(s[1]) + for s in pattern_lua_bracketed.findall(text): + strings.append(s) + + for s in strings: + s = re.sub(r'"\.\.\s+"', "", s) + s = re.sub("@[^@=0-9]", "@@", s) + s = s.replace('\\"', '"') + s = s.replace("\\'", "'") + s = s.replace("\n", "@n") + s = s.replace("\\n", "@n") + s = s.replace("=", "@=") + lOut.append(s) + return lOut + +# Gets strings from an existing translation file +# returns both a dictionary of translations +# and the full original source text so that the new text +# can be compared to it for changes. +def import_tr_file(tr_file): + dOut = {} + text = None + if os.path.exists(tr_file): + with open(tr_file, "r", encoding='utf-8') as existing_file : + # save the full text to allow for comparison + # of the old version with the new output + text = existing_file.read() + existing_file.seek(0) + # a running record of the current comment block + # we're inside, to allow preceeding multi-line comments + # to be retained for a translation line + latest_comment_block = None + for line in existing_file.readlines(): + line = line.rstrip('\n') + if line[:3] == "###": + # Reset comment block if we hit a header + latest_comment_block = None + continue + if line[:1] == "#": + # Save the comment we're inside + if not latest_comment_block: + latest_comment_block = line + else: + latest_comment_block = latest_comment_block + "\n" + line + continue + match = pattern_tr.match(line) + if match: + # this line is a translated line + outval = {} + outval["translation"] = match.group(2) + if latest_comment_block: + # if there was a comment, record that. + outval["comment"] = latest_comment_block + latest_comment_block = None + dOut[match.group(1)] = outval + return (dOut, text) + +# Walks all lua files in the mod folder, collects translatable strings, +# and writes it to a template.txt file +# Returns a dictionary of localized strings to source file sets +# that can be used with the strings_to_text function. +def generate_template(folder, mod_name): + dOut = {} + for root, dirs, files in os.walk(folder): + for name in files: + if fnmatch.fnmatch(name, "*.lua"): + fname = os.path.join(root, name) + found = read_lua_file_strings(fname) + if params["verbose"]: + print(f"{fname}: {str(len(found))} translatable strings") + + for s in found: + sources = dOut.get(s, set()) + sources.add(f"### {os.path.basename(fname)} ###") + dOut[s] = sources + + if len(dOut) == 0: + return None + templ_file = os.path.join(folder, "locale/template.txt") + write_template(templ_file, dOut, mod_name) + return dOut + +# Updates an existing .tr file, copying the old one to a ".old" file +# if any changes have happened +# dNew is the data used to generate the template, it has all the +# currently-existing localized strings +def update_tr_file(dNew, mod_name, tr_file): + if params["verbose"]: + print(f"updating {tr_file}") + + tr_import = import_tr_file(tr_file) + dOld = tr_import[0] + textOld = tr_import[1] + + textNew = strings_to_text(dNew, dOld, mod_name) + + if textOld and textOld != textNew: + print(f"{tr_file} has changed.") + shutil.copyfile(tr_file, f"{tr_file}.old") + + with open(tr_file, "w", encoding='utf-8') as new_tr_file: + new_tr_file.write(textNew) + +# Updates translation files for the mod in the given folder +def update_mod(folder): + modname = get_modname(folder) + if modname is not None: + process_po_files(folder, modname) + print(f"Updating translations for {modname}") + data = generate_template(folder, modname) + if data == None: + print(f"No translatable strings found in {modname}") + else: + for tr_file in get_existing_tr_files(folder): + update_tr_file(data, modname, os.path.join(folder, "locale/", tr_file)) + else: + print("Unable to find modname in folder " + folder) + +# Determines if the folder being pointed to is a mod or a mod pack +# and then runs update_mod accordingly +def update_folder(folder): + is_modpack = os.path.exists(os.path.join(folder, "modpack.txt")) or os.path.exists(os.path.join(folder, "modpack.conf")) + if is_modpack: + subfolders = [f.path for f in os.scandir(folder) if f.is_dir()] + for subfolder in subfolders: + update_mod(subfolder + "/") + else: + update_mod(folder) + print("Done.") + +def run_all_subfolders(folder): + for modfolder in [f.path for f in os.scandir(folder) if f.is_dir()]: + update_folder(modfolder + "/") + + +main() diff --git a/castle_weapons/intllib.lua b/castle_weapons/intllib.lua deleted file mode 100644 index 6669d720..00000000 --- a/castle_weapons/intllib.lua +++ /dev/null @@ -1,45 +0,0 @@ - --- Fallback functions for when `intllib` is not installed. --- Code released under Unlicense . - --- Get the latest version of this file at: --- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua - -local function format(str, ...) - local args = { ... } - local function repl(escape, open, num, close) - if escape == "" then - local replacement = tostring(args[tonumber(num)]) - if open == "" then - replacement = replacement..close - end - return replacement - else - return "@"..open..num..close - end - end - return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) -end - -local gettext, ngettext -if minetest.get_modpath("intllib") then - if intllib.make_gettext_pair then - -- New method using gettext. - gettext, ngettext = intllib.make_gettext_pair() - else - -- Old method using text files. - gettext = intllib.Getter() - end -end - --- Fill in missing functions. - -gettext = gettext or function(msgid, ...) - return format(msgid, ...) -end - -ngettext = ngettext or function(msgid, msgid_plural, n, ...) - return format(n==1 and msgid or msgid_plural, ...) -end - -return gettext, ngettext diff --git a/castle_weapons/locale/castle_weapons.it.tr b/castle_weapons/locale/castle_weapons.it.tr new file mode 100644 index 00000000..6f55d326 --- /dev/null +++ b/castle_weapons/locale/castle_weapons.it.tr @@ -0,0 +1,12 @@ +# textdomain: castle_weapons + + +### battleaxe.lua ### + +# textdomain:castle_weapons +Battleaxe=Ascia da guerra + +### crossbow.lua ### + +Bolt=Quadrello +Crossbow=Balestra diff --git a/castle_weapons/locale/it.po b/castle_weapons/locale/it.po deleted file mode 100644 index e83b45fd..00000000 --- a/castle_weapons/locale/it.po +++ /dev/null @@ -1,31 +0,0 @@ -# ITALIAN LOCALE FILE FOR THE CASTLE WEAPONS MODULE -# Copyright (C) 2017 Philipbenr And DanDuncombe -# This file is distributed under the same license as the CASTLE WEAPONS package. -# Hamlet , 2017. -# -msgid "" -msgstr "" -"Project-Id-Version: Castle Weapons\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-25 19:35-0700\n" -"PO-Revision-Date: 2017-09-10 22:49+0100\n" -"Last-Translator: H4mlet \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"Language: it\n" -"X-Generator: Poedit 1.6.10\n" - -#: battleaxe.lua:8 -msgid "Battleaxe" -msgstr "Ascia da guerra" - -#: crossbow.lua:244 -msgid "Bolt" -msgstr "Quadrello" - -#: crossbow.lua:357 crossbow.lua:416 -msgid "Crossbow" -msgstr "Balestra" diff --git a/castle_weapons/locale/template.pot b/castle_weapons/locale/template.pot deleted file mode 100644 index 79f7a198..00000000 --- a/castle_weapons/locale/template.pot +++ /dev/null @@ -1,29 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-25 19:35-0700\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: battleaxe.lua:8 -msgid "Battleaxe" -msgstr "" - -#: crossbow.lua:244 -msgid "Bolt" -msgstr "" - -#: crossbow.lua:357 crossbow.lua:416 -msgid "Crossbow" -msgstr "" diff --git a/castle_weapons/locale/template.txt b/castle_weapons/locale/template.txt new file mode 100644 index 00000000..b1359cfb --- /dev/null +++ b/castle_weapons/locale/template.txt @@ -0,0 +1,12 @@ +# textdomain: castle_weapons + + +### battleaxe.lua ### + +# textdomain:castle_weapons +Battleaxe= + +### crossbow.lua ### + +Bolt= +Crossbow= diff --git a/castle_weapons/mod.conf b/castle_weapons/mod.conf index 456a415e..5c656ff3 100644 --- a/castle_weapons/mod.conf +++ b/castle_weapons/mod.conf @@ -1 +1,3 @@ name = castle_weapons +description = Provides several medieval weapons for use around castles +depends = default diff --git a/castle_weapons/screenshot.png b/castle_weapons/screenshot.png index d23d1815..4fe167d4 100644 Binary files a/castle_weapons/screenshot.png and b/castle_weapons/screenshot.png differ diff --git a/castle_weapons/textures/castle_battleaxe.png b/castle_weapons/textures/castle_battleaxe.png index 4f7f7382..7c1a6f9e 100644 Binary files a/castle_weapons/textures/castle_battleaxe.png and b/castle_weapons/textures/castle_battleaxe.png differ diff --git a/castle_weapons/textures/castle_crossbow_inv.png b/castle_weapons/textures/castle_crossbow_inv.png index 39bcf07a..a6a50506 100644 Binary files a/castle_weapons/textures/castle_crossbow_inv.png and b/castle_weapons/textures/castle_crossbow_inv.png differ diff --git a/castle_weapons/textures/castle_crossbow_loaded.png b/castle_weapons/textures/castle_crossbow_loaded.png index ca2dca7a..ee6c990d 100644 Binary files a/castle_weapons/textures/castle_crossbow_loaded.png and b/castle_weapons/textures/castle_crossbow_loaded.png differ diff --git a/crafting_bench/depends.txt b/crafting_bench/depends.txt deleted file mode 100644 index 3e4cdce8..00000000 --- a/crafting_bench/depends.txt +++ /dev/null @@ -1,4 +0,0 @@ -default -intllib? -hopper? -doc? \ No newline at end of file diff --git a/crafting_bench/description.txt b/crafting_bench/description.txt deleted file mode 100644 index 728c8368..00000000 --- a/crafting_bench/description.txt +++ /dev/null @@ -1 +0,0 @@ -An auto-crafting bench diff --git a/crafting_bench/i18n.py b/crafting_bench/i18n.py new file mode 100644 index 00000000..dd901e9a --- /dev/null +++ b/crafting_bench/i18n.py @@ -0,0 +1,421 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Script to generate the template file and update the translation files. +# Copy the script into the mod or modpack root folder and run it there. +# +# Copyright (C) 2019 Joachim Stolberg, 2020 FaceDeer, 2020 Louis Royer +# LGPLv2.1+ +# +# See https://github.com/minetest-tools/update_translations for +# potential future updates to this script. + +from __future__ import print_function +import os, fnmatch, re, shutil, errno +from sys import argv as _argv + +# Running params +params = {"recursive": False, + "help": False, + "mods": False, + "verbose": False, + "folders": [] +} +# Available CLI options +options = {"recursive": ['--recursive', '-r'], + "help": ['--help', '-h'], + "mods": ['--installed-mods'], + "verbose": ['--verbose', '-v'] +} + +# Strings longer than this will have extra space added between +# them in the translation files to make it easier to distinguish their +# beginnings and endings at a glance +doublespace_threshold = 60 + +def set_params_folders(tab: list): + '''Initialize params["folders"] from CLI arguments.''' + # Discarding argument 0 (tool name) + for param in tab[1:]: + stop_param = False + for option in options: + if param in options[option]: + stop_param = True + break + if not stop_param: + params["folders"].append(os.path.abspath(param)) + +def set_params(tab: list): + '''Initialize params from CLI arguments.''' + for option in options: + for option_name in options[option]: + if option_name in tab: + params[option] = True + break + +def print_help(name): + '''Prints some help message.''' + print(f'''SYNOPSIS + {name} [OPTIONS] [PATHS...] +DESCRIPTION + {', '.join(options["help"])} + prints this help message + {', '.join(options["recursive"])} + run on all subfolders of paths given + {', '.join(options["mods"])} + run on locally installed modules + {', '.join(options["verbose"])} + add output information +''') + + +def main(): + '''Main function''' + set_params(_argv) + set_params_folders(_argv) + if params["help"]: + print_help(_argv[0]) + elif params["recursive"] and params["mods"]: + print("Option --installed-mods is incompatible with --recursive") + else: + # Add recursivity message + print("Running ", end='') + if params["recursive"]: + print("recursively ", end='') + # Running + if params["mods"]: + print(f"on all locally installed modules in {os.path.abspath('~/.minetest/mods/')}") + run_all_subfolders("~/.minetest/mods") + elif len(params["folders"]) >= 2: + print("on folder list:", params["folders"]) + for f in params["folders"]: + if params["recursive"]: + run_all_subfolders(f) + else: + update_folder(f) + elif len(params["folders"]) == 1: + print("on folder", params["folders"][0]) + if params["recursive"]: + run_all_subfolders(params["folders"][0]) + else: + update_folder(params["folders"][0]) + else: + print("on folder", os.path.abspath("./")) + if params["recursive"]: + run_all_subfolders(os.path.abspath("./")) + else: + update_folder(os.path.abspath("./")) + +#group 2 will be the string, groups 1 and 3 will be the delimiters (" or ') +#See https://stackoverflow.com/questions/46967465/regex-match-text-in-either-single-or-double-quote +pattern_lua = re.compile(r'[\.=^\t,{\(\s]N?S\(\s*(["\'])((?:\\\1|(?:(?!\1)).)*)(\1)[\s,\)]', re.DOTALL) +pattern_lua_bracketed = re.compile(r'[\.=^\t,{\(\s]N?S\(\s*\[\[(.*?)\]\][\s,\)]', re.DOTALL) + +# Handles "concatenation" .. " of strings" +pattern_concat = re.compile(r'["\'][\s]*\.\.[\s]*["\']', re.DOTALL) + +pattern_tr = re.compile(r'(.+?[^@])=(.*)') +pattern_name = re.compile(r'^name[ ]*=[ ]*([^ \n]*)') +pattern_tr_filename = re.compile(r'\.tr$') +pattern_po_language_code = re.compile(r'(.*)\.po$') + +#attempt to read the mod's name from the mod.conf file. Returns None on failure +def get_modname(folder): + try: + with open(os.path.join(folder, "mod.conf"), "r", encoding='utf-8') as mod_conf: + for line in mod_conf: + match = pattern_name.match(line) + if match: + return match.group(1) + except FileNotFoundError: + pass + return None + +#If there are already .tr files in /locale, returns a list of their names +def get_existing_tr_files(folder): + out = [] + for root, dirs, files in os.walk(os.path.join(folder, 'locale/')): + for name in files: + if pattern_tr_filename.search(name): + out.append(name) + return out + +# A series of search and replaces that massage a .po file's contents into +# a .tr file's equivalent +def process_po_file(text): + # The first three items are for unused matches + text = re.sub(r'#~ msgid "', "", text) + text = re.sub(r'"\n#~ msgstr ""\n"', "=", text) + text = re.sub(r'"\n#~ msgstr "', "=", text) + # comment lines + text = re.sub(r'#.*\n', "", text) + # converting msg pairs into "=" pairs + text = re.sub(r'msgid "', "", text) + text = re.sub(r'"\nmsgstr ""\n"', "=", text) + text = re.sub(r'"\nmsgstr "', "=", text) + # various line breaks and escape codes + text = re.sub(r'"\n"', "", text) + text = re.sub(r'"\n', "\n", text) + text = re.sub(r'\\"', '"', text) + text = re.sub(r'\\n', '@n', text) + # remove header text + text = re.sub(r'=Project-Id-Version:.*\n', "", text) + # remove double-spaced lines + text = re.sub(r'\n\n', '\n', text) + return text + +# Go through existing .po files and, if a .tr file for that language +# *doesn't* exist, convert it and create it. +# The .tr file that results will subsequently be reprocessed so +# any "no longer used" strings will be preserved. +# Note that "fuzzy" tags will be lost in this process. +def process_po_files(folder, modname): + for root, dirs, files in os.walk(os.path.join(folder, 'locale/')): + for name in files: + code_match = pattern_po_language_code.match(name) + if code_match == None: + continue + language_code = code_match.group(1) + tr_name = modname + "." + language_code + ".tr" + tr_file = os.path.join(root, tr_name) + if os.path.exists(tr_file): + if params["verbose"]: + print(f"{tr_name} already exists, ignoring {name}") + continue + fname = os.path.join(root, name) + with open(fname, "r", encoding='utf-8') as po_file: + if params["verbose"]: + print(f"Importing translations from {name}") + text = process_po_file(po_file.read()) + with open(tr_file, "wt", encoding='utf-8') as tr_out: + tr_out.write(text) + +# from https://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python/600612#600612 +# Creates a directory if it doesn't exist, silently does +# nothing if it already exists +def mkdir_p(path): + try: + os.makedirs(path) + except OSError as exc: # Python >2.5 + if exc.errno == errno.EEXIST and os.path.isdir(path): + pass + else: raise + +# Converts the template dictionary to a text to be written as a file +# dKeyStrings is a dictionary of localized string to source file sets +# dOld is a dictionary of existing translations and comments from +# the previous version of this text +def strings_to_text(dkeyStrings, dOld, mod_name): + lOut = [f"# textdomain: {mod_name}\n"] + + dGroupedBySource = {} + + for key in dkeyStrings: + sourceList = list(dkeyStrings[key]) + sourceList.sort() + sourceString = "\n".join(sourceList) + listForSource = dGroupedBySource.get(sourceString, []) + listForSource.append(key) + dGroupedBySource[sourceString] = listForSource + + lSourceKeys = list(dGroupedBySource.keys()) + lSourceKeys.sort() + for source in lSourceKeys: + localizedStrings = dGroupedBySource[source] + localizedStrings.sort() + lOut.append("") + lOut.append(source) + lOut.append("") + for localizedString in localizedStrings: + val = dOld.get(localizedString, {}) + translation = val.get("translation", "") + comment = val.get("comment") + if len(localizedString) > doublespace_threshold and not lOut[-1] == "": + lOut.append("") + if comment != None: + lOut.append(comment) + lOut.append(f"{localizedString}={translation}") + if len(localizedString) > doublespace_threshold: + lOut.append("") + + + unusedExist = False + for key in dOld: + if key not in dkeyStrings: + val = dOld[key] + translation = val.get("translation") + comment = val.get("comment") + # only keep an unused translation if there was translated + # text or a comment associated with it + if translation != None and (translation != "" or comment): + if not unusedExist: + unusedExist = True + lOut.append("\n\n##### not used anymore #####\n") + if len(key) > doublespace_threshold and not lOut[-1] == "": + lOut.append("") + if comment != None: + lOut.append(comment) + lOut.append(f"{key}={translation}") + if len(key) > doublespace_threshold: + lOut.append("") + return "\n".join(lOut) + '\n' + +# Writes a template.txt file +# dkeyStrings is the dictionary returned by generate_template +def write_template(templ_file, dkeyStrings, mod_name): + # read existing template file to preserve comments + existing_template = import_tr_file(templ_file) + + text = strings_to_text(dkeyStrings, existing_template[0], mod_name) + mkdir_p(os.path.dirname(templ_file)) + with open(templ_file, "wt", encoding='utf-8') as template_file: + template_file.write(text) + + +# Gets all translatable strings from a lua file +def read_lua_file_strings(lua_file): + lOut = [] + with open(lua_file, encoding='utf-8') as text_file: + text = text_file.read() + #TODO remove comments here + + text = re.sub(pattern_concat, "", text) + + strings = [] + for s in pattern_lua.findall(text): + strings.append(s[1]) + for s in pattern_lua_bracketed.findall(text): + strings.append(s) + + for s in strings: + s = re.sub(r'"\.\.\s+"', "", s) + s = re.sub("@[^@=0-9]", "@@", s) + s = s.replace('\\"', '"') + s = s.replace("\\'", "'") + s = s.replace("\n", "@n") + s = s.replace("\\n", "@n") + s = s.replace("=", "@=") + lOut.append(s) + return lOut + +# Gets strings from an existing translation file +# returns both a dictionary of translations +# and the full original source text so that the new text +# can be compared to it for changes. +def import_tr_file(tr_file): + dOut = {} + text = None + if os.path.exists(tr_file): + with open(tr_file, "r", encoding='utf-8') as existing_file : + # save the full text to allow for comparison + # of the old version with the new output + text = existing_file.read() + existing_file.seek(0) + # a running record of the current comment block + # we're inside, to allow preceeding multi-line comments + # to be retained for a translation line + latest_comment_block = None + for line in existing_file.readlines(): + line = line.rstrip('\n') + if line[:3] == "###": + # Reset comment block if we hit a header + latest_comment_block = None + continue + if line[:1] == "#": + # Save the comment we're inside + if not latest_comment_block: + latest_comment_block = line + else: + latest_comment_block = latest_comment_block + "\n" + line + continue + match = pattern_tr.match(line) + if match: + # this line is a translated line + outval = {} + outval["translation"] = match.group(2) + if latest_comment_block: + # if there was a comment, record that. + outval["comment"] = latest_comment_block + latest_comment_block = None + dOut[match.group(1)] = outval + return (dOut, text) + +# Walks all lua files in the mod folder, collects translatable strings, +# and writes it to a template.txt file +# Returns a dictionary of localized strings to source file sets +# that can be used with the strings_to_text function. +def generate_template(folder, mod_name): + dOut = {} + for root, dirs, files in os.walk(folder): + for name in files: + if fnmatch.fnmatch(name, "*.lua"): + fname = os.path.join(root, name) + found = read_lua_file_strings(fname) + if params["verbose"]: + print(f"{fname}: {str(len(found))} translatable strings") + + for s in found: + sources = dOut.get(s, set()) + sources.add(f"### {os.path.basename(fname)} ###") + dOut[s] = sources + + if len(dOut) == 0: + return None + templ_file = os.path.join(folder, "locale/template.txt") + write_template(templ_file, dOut, mod_name) + return dOut + +# Updates an existing .tr file, copying the old one to a ".old" file +# if any changes have happened +# dNew is the data used to generate the template, it has all the +# currently-existing localized strings +def update_tr_file(dNew, mod_name, tr_file): + if params["verbose"]: + print(f"updating {tr_file}") + + tr_import = import_tr_file(tr_file) + dOld = tr_import[0] + textOld = tr_import[1] + + textNew = strings_to_text(dNew, dOld, mod_name) + + if textOld and textOld != textNew: + print(f"{tr_file} has changed.") + shutil.copyfile(tr_file, f"{tr_file}.old") + + with open(tr_file, "w", encoding='utf-8') as new_tr_file: + new_tr_file.write(textNew) + +# Updates translation files for the mod in the given folder +def update_mod(folder): + modname = get_modname(folder) + if modname is not None: + process_po_files(folder, modname) + print(f"Updating translations for {modname}") + data = generate_template(folder, modname) + if data == None: + print(f"No translatable strings found in {modname}") + else: + for tr_file in get_existing_tr_files(folder): + update_tr_file(data, modname, os.path.join(folder, "locale/", tr_file)) + else: + print("Unable to find modname in folder " + folder) + +# Determines if the folder being pointed to is a mod or a mod pack +# and then runs update_mod accordingly +def update_folder(folder): + is_modpack = os.path.exists(os.path.join(folder, "modpack.txt")) or os.path.exists(os.path.join(folder, "modpack.conf")) + if is_modpack: + subfolders = [f.path for f in os.scandir(folder) if f.is_dir()] + for subfolder in subfolders: + update_mod(subfolder + "/") + else: + update_mod(folder) + print("Done.") + +def run_all_subfolders(folder): + for modfolder in [f.path for f in os.scandir(folder) if f.is_dir()]: + update_folder(modfolder + "/") + + +main() diff --git a/crafting_bench/init.lua b/crafting_bench/init.lua index bab8d278..554e3cd2 100644 --- a/crafting_bench/init.lua +++ b/crafting_bench/init.lua @@ -1,6 +1,4 @@ --- internationalization boilerplate -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") +local S = minetest.get_translator("crafting_bench") minetest.register_alias("castle:workbench", "crafting_bench:workbench") @@ -17,7 +15,7 @@ if crafting_rate == nil then crafting_rate = 5 end minetest.register_node("crafting_bench:workbench",{ description = S("Workbench"), - _doc_items_longdesc = string.format(S("A workbench that does work for you. Set a crafting recipe and provide raw materials and items will magically craft themselves once every %i seconds."), crafting_rate), + _doc_items_longdesc = S("A workbench that does work for you. Set a crafting recipe and provide raw materials and items will magically craft themselves once every @1 seconds.", crafting_rate), _doc_items_usagehelp = usage_help, tiles = { "crafting_bench_workbench_top.png", @@ -58,13 +56,13 @@ minetest.register_node("crafting_bench:workbench",{ return inv:is_empty("main") end, on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) - minetest.log("action", S("@1 moves stuff in workbench at @2", player:get_player_name(), minetest.pos_to_string(pos))) + minetest.log("action", player:get_player_name().." moves stuff in workbench at "..minetest.pos_to_string(pos)) end, on_metadata_inventory_put = function(pos, listname, index, stack, player) - minetest.log("action", S("@1 moves stuff to workbench at @2", player:get_player_name(), minetest.pos_to_string(pos))) + minetest.log("action", player:get_player_name().." moves stuff to workbench at "..minetest.pos_to_string(pos)) end, on_metadata_inventory_take = function(pos, listname, index, stack, player) - minetest.log("action", S("@1 takes stuff from workbench at @2", player:get_player_name(), minetest.pos_to_string(pos))) + minetest.log("action", player:get_player_name().." takes stuff from workbench at "..minetest.pos_to_string(pos)) end, }) local get_recipe = function ( inv ) diff --git a/crafting_bench/intllib.lua b/crafting_bench/intllib.lua deleted file mode 100644 index 6669d720..00000000 --- a/crafting_bench/intllib.lua +++ /dev/null @@ -1,45 +0,0 @@ - --- Fallback functions for when `intllib` is not installed. --- Code released under Unlicense . - --- Get the latest version of this file at: --- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua - -local function format(str, ...) - local args = { ... } - local function repl(escape, open, num, close) - if escape == "" then - local replacement = tostring(args[tonumber(num)]) - if open == "" then - replacement = replacement..close - end - return replacement - else - return "@"..open..num..close - end - end - return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) -end - -local gettext, ngettext -if minetest.get_modpath("intllib") then - if intllib.make_gettext_pair then - -- New method using gettext. - gettext, ngettext = intllib.make_gettext_pair() - else - -- Old method using text files. - gettext = intllib.Getter() - end -end - --- Fill in missing functions. - -gettext = gettext or function(msgid, ...) - return format(msgid, ...) -end - -ngettext = ngettext or function(msgid, msgid_plural, n, ...) - return format(n==1 and msgid or msgid_plural, ...) -end - -return gettext, ngettext diff --git a/crafting_bench/locale/crafting_bench.fr.tr b/crafting_bench/locale/crafting_bench.fr.tr new file mode 100644 index 00000000..093961f4 --- /dev/null +++ b/crafting_bench/locale/crafting_bench.fr.tr @@ -0,0 +1,16 @@ +# textdomain: crafting_bench + + +### init.lua ### + +A workbench that does work for you. Set a crafting recipe and provide raw materials and items will magically craft themselves once every @1 seconds.=Un établi qui travaille pour vous. Définissez une recette de fabrication et fournissez les matériaux, et le résultat se fabriquera par magie toutes les @1 secondes. + +Craft Output=Produits finis +Recipe to Use=Recette à utiliser +Source Material=Matériaux à utiliser + +The inventory on the left is for raw materials, the inventory on the right holds finished products. The crafting grid in the center defines what recipe this workbench will make use of; place raw materials into it in the crafting pattern corresponding to what you want to build.=L’inventaire de gauche est pour les matériaux à utiliser, l’inventaire de droite contient les produits finis. La grille de fabrication au centre définit la recette que l’établi utilisera ; placez des matériaux dans la grille en suivant le pattern qui correspond à ce que vous voulez fabriquer. + +This workbench is compatible with hoppers. Hoppers will insert into the raw material inventory and remove items from the finished goods inventory.=Cet établi est compatible avec les entonnoirs. Les entonoirs peuvent insérer des matériaux à utiliser et retirer les produits finis depuis les bons inventaires. + +Workbench=Établi diff --git a/crafting_bench/locale/template.pot b/crafting_bench/locale/template.pot deleted file mode 100644 index 7ac578ed..00000000 --- a/crafting_bench/locale/template.pot +++ /dev/null @@ -1,67 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-28 21:08-0700\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: init.lua:7 -msgid "" -"The inventory on the left is for raw materials, the inventory on the right " -"holds finished products. The crafting grid in the center defines what recipe " -"this workbench will make use of; place raw materials into it in the crafting " -"pattern corresponding to what you want to build." -msgstr "" - -#: init.lua:10 -msgid "" -"This workbench is compatible with hoppers. Hoppers will insert into the raw " -"material inventory and remove items from the finished goods inventory." -msgstr "" - -#: init.lua:19 init.lua:49 -msgid "Workbench" -msgstr "" - -#: init.lua:20 -#, lua-format -msgid "" -"A workbench that does work for you. Set a crafting recipe and provide raw " -"materials and items will magically craft themselves once every %i seconds." -msgstr "" - -#: init.lua:42 -msgid "Source Material" -msgstr "" - -#: init.lua:44 -msgid "Recipe to Use" -msgstr "" - -#: init.lua:46 -msgid "Craft Output" -msgstr "" - -#: init.lua:61 -msgid "@1 moves stuff in workbench at @2" -msgstr "" - -#: init.lua:64 -msgid "@1 moves stuff to workbench at @2" -msgstr "" - -#: init.lua:67 -msgid "@1 takes stuff from workbench at @2" -msgstr "" diff --git a/crafting_bench/locale/template.txt b/crafting_bench/locale/template.txt new file mode 100644 index 00000000..427c0272 --- /dev/null +++ b/crafting_bench/locale/template.txt @@ -0,0 +1,16 @@ +# textdomain: crafting_bench + + +### init.lua ### + +A workbench that does work for you. Set a crafting recipe and provide raw materials and items will magically craft themselves once every @1 seconds.= + +Craft Output= +Recipe to Use= +Source Material= + +The inventory on the left is for raw materials, the inventory on the right holds finished products. The crafting grid in the center defines what recipe this workbench will make use of; place raw materials into it in the crafting pattern corresponding to what you want to build.= + +This workbench is compatible with hoppers. Hoppers will insert into the raw material inventory and remove items from the finished goods inventory.= + +Workbench= diff --git a/crafting_bench/mod.conf b/crafting_bench/mod.conf index 9d51c806..910d9370 100644 --- a/crafting_bench/mod.conf +++ b/crafting_bench/mod.conf @@ -1 +1,4 @@ name = crafting_bench +description = An auto-crafting bench +depends = default +optional_depends = hopper, doc diff --git a/currency/barter.lua b/currency/barter.lua index 39d6601a..6d8e1534 100644 --- a/currency/barter.lua +++ b/currency/barter.lua @@ -1,8 +1,6 @@ barter = {} --- internationalization boilerplate -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") +local S = minetest.get_translator("currency") barter.chest = {} barter.chest.expire_after = tonumber(minetest.settings:get('barter.chest.expireafter')) or 15 * 60 @@ -12,20 +10,20 @@ barter.chest.formspec = { "list[current_name;pl2;5,0;3,4;]".. "list[current_player;main;0,5;8,4;]", pl1 = { - start = "button[3,1;1,1;pl1_start;" .. S("Start") .. "]", - player = function(name) return "label[3,0;"..name.."]" end, - accept1 = "button[3,1;1,1;pl1_accept1;" .. S("Confirm") .. "]".. - "button[3,2;1,1;pl1_cancel;" .. S("Cancel") .. "]", - accept2 = "button[3,1;1,1;pl1_accept2;" .. S("Exchange") .. "]".. - "button[3,2;1,1;pl1_cancel;" .. S("Cancel") .. "]", + start = "button[0,4;3,1;pl1_start;" .. S("Start") .. "]", + player = function(name) return "label[0,4;"..name.."]" end, + accept1 = "button[2.9,1;1.2,1;pl1_accept1;" .. S("Confirm") .. "]".. + "button[2.9,2;1.2,1;pl1_cancel;" .. S("Cancel") .. "]", + accept2 = "button[2.9,1;1.2,1;pl1_accept2;" .. S("Exchange") .. "]".. + "button[2.9,2;1.2,1;pl1_cancel;" .. S("Cancel") .. "]", }, pl2 = { - start = "button[4,1;1,1;pl2_start;" .. S("Start") .. "]", - player = function(name) return "label[4,0;"..name.."]" end, - accept1 = "button[4,1;1,1;pl2_accept1;" .. S("Confirm") .. "]".. - "button[4,2;1,1;pl2_cancel;" .. S("Cancel") .. "]", - accept2 = "button[4,1;1,1;pl2_accept2;" .. S("Exchange") .. "]".. - "button[4,2;1,1;pl2_cancel;" .. S("Cancel") .. "]", + start = "button[5,4;3,1;pl2_start;" .. S("Start") .. "]", + player = function(name) return "label[5,4;"..name.."]" end, + accept1 = "button[3.9,1;1.2,1;pl2_accept1;" .. S("Confirm") .. "]".. + "button[3.9,2;1.2,1;pl2_cancel;" .. S("Cancel") .. "]", + accept2 = "button[3.9,1;1.2,1;pl2_accept2;" .. S("Exchange") .. "]".. + "button[3.9,2;1.2,1;pl2_cancel;" .. S("Cancel") .. "]", }, } diff --git a/currency/craftitems.lua b/currency/craftitems.lua index 079bcb52..bbf0701a 100644 --- a/currency/craftitems.lua +++ b/currency/craftitems.lua @@ -1,58 +1,56 @@ --- internationalization boilerplate -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") +local S = minetest.get_translator("currency") minetest.register_craftitem("currency:minegeld_cent_5", { - description = S("5 Minegeld cent coin"), + description = S("@1 Minegeld cent coin", "5"), inventory_image = "minegeld_cent_5.png", stack_max = 1000, groups = {minegeld = 1} }) minetest.register_craftitem("currency:minegeld_cent_10", { - description = S("10 Minegeld cent coin"), + description = S("@1 Minegeld cent coin", "10"), inventory_image = "minegeld_cent_10.png", stack_max = 1000, groups = {minegeld = 1} }) minetest.register_craftitem("currency:minegeld_cent_25", { - description = S("25 Minegeld cent coin"), + description = S("@1 Minegeld cent coin", "25"), inventory_image = "minegeld_cent_25.png", stack_max = 1000, groups = {minegeld = 1} }) minetest.register_craftitem("currency:minegeld", { - description = S("1 Minegeld Note"), + description = S("@1 Minegeld Note", "1"), inventory_image = "minegeld.png", stack_max = 65535, groups = {minegeld = 1} }) minetest.register_craftitem("currency:minegeld_5", { - description = S("5 Minegeld Note"), + description = S("@1 Minegeld Note", "5"), inventory_image = "minegeld_5.png", stack_max = 65535, groups = {minegeld = 1} }) minetest.register_craftitem("currency:minegeld_10", { - description = S("10 Minegeld Note"), + description = S("@1 Minegeld Note", "10"), inventory_image = "minegeld_10.png", stack_max = 65535, groups = {minegeld = 1} }) minetest.register_craftitem("currency:minegeld_50", { - description = S("50 Minegeld Note"), + description = S("@1 Minegeld Note", "50"), inventory_image = "minegeld_50.png", stack_max = 65535, groups = {minegeld = 1} }) minetest.register_craftitem("currency:minegeld_100", { - description = S("100 Minegeld Note"), + description = S("@1 Minegeld Note", "100"), inventory_image = "minegeld_100.png", stack_max = 65535, groups = {minegeld = 1} diff --git a/currency/depends.txt b/currency/depends.txt deleted file mode 100644 index 1b01adf2..00000000 --- a/currency/depends.txt +++ /dev/null @@ -1,4 +0,0 @@ -default -intllib? -loot? -pipeworks? diff --git a/currency/description.txt b/currency/description.txt deleted file mode 100644 index e6e28988..00000000 --- a/currency/description.txt +++ /dev/null @@ -1 +0,0 @@ -Provides shops, barter tables, safes, and multiple denominations of currency, called "Minegeld". diff --git a/currency/income.lua b/currency/income.lua index a1052e2b..da1cfd78 100644 --- a/currency/income.lua +++ b/currency/income.lua @@ -1,9 +1,5 @@ local players_income = {} --- internationalization boilerplate -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") - local income_enabled = minetest.settings:get_bool("currency.income_enabled", true) local income_item = minetest.settings:get("currency.income_item") or "currency:minegeld_10" local income_count = tonumber(minetest.settings:get("currency.income_count")) or 1 @@ -18,7 +14,7 @@ if income_enabled then for _, player in ipairs(minetest.get_connected_players()) do local name = player:get_player_name() players_income[name] = income_count - minetest.log("info", "[Currency] "..S("basic income for @1", name)) + minetest.log("info", "[Currency] basic income for "..name) end end end) @@ -32,7 +28,7 @@ if income_enabled then local inv = player:get_inventory() inv:add_item("main", {name=income_item, count=income_count}) players_income[name] = nil - minetest.log("info", "[Currency] "..S("added basic income for @1 to inventory", name)) + minetest.log("info", "[Currency] added basic income for "..name.." to inventory") end end diff --git a/currency/init.lua b/currency/init.lua index 27cb054f..c3298f61 100644 --- a/currency/init.lua +++ b/currency/init.lua @@ -1,24 +1,21 @@ local modpath = minetest.get_modpath("currency") --- internationalization boilerplate -local S, NS = dofile(modpath.."/intllib.lua") - -minetest.log("info", S("Currency mod loading...")) +minetest.log("info", "Currency mod loading...") dofile(modpath.."/craftitems.lua") -minetest.log("info", "[Currency] "..S("Craft_items Loaded!")) +minetest.log("info", "[Currency] Craft_items Loaded!") dofile(modpath.."/shop.lua") -minetest.log("info", "[Currency] "..S("Shop Loaded!")) +minetest.log("info", "[Currency] Shop Loaded!") dofile(modpath.."/barter.lua") -minetest.log("info", "[Currency] "..S("Barter Loaded!")) +minetest.log("info", "[Currency] Barter Loaded!") dofile(modpath.."/safe.lua") -minetest.log("info", "[Currency] "..S("Safe Loaded!")) +minetest.log("info", "[Currency] Safe Loaded!") dofile(modpath.."/crafting.lua") -minetest.log("info", "[Currency] "..S("Crafting Loaded!")) +minetest.log("info", "[Currency] Crafting Loaded!") if minetest.settings:get_bool("creative_mode") then - minetest.log("info", "[Currency] "..S("Creative mode in use, skipping basic income.")) + minetest.log("info", "[Currency] Creative mode in use, skipping basic income.") else dofile(modpath.."/income.lua") - minetest.log("info", "[Currency] "..S("Income Loaded!")) + minetest.log("info", "[Currency] Income Loaded!") end diff --git a/currency/intllib.lua b/currency/intllib.lua deleted file mode 100644 index 6669d720..00000000 --- a/currency/intllib.lua +++ /dev/null @@ -1,45 +0,0 @@ - --- Fallback functions for when `intllib` is not installed. --- Code released under Unlicense . - --- Get the latest version of this file at: --- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua - -local function format(str, ...) - local args = { ... } - local function repl(escape, open, num, close) - if escape == "" then - local replacement = tostring(args[tonumber(num)]) - if open == "" then - replacement = replacement..close - end - return replacement - else - return "@"..open..num..close - end - end - return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) -end - -local gettext, ngettext -if minetest.get_modpath("intllib") then - if intllib.make_gettext_pair then - -- New method using gettext. - gettext, ngettext = intllib.make_gettext_pair() - else - -- Old method using text files. - gettext = intllib.Getter() - end -end - --- Fill in missing functions. - -gettext = gettext or function(msgid, ...) - return format(msgid, ...) -end - -ngettext = ngettext or function(msgid, msgid_plural, n, ...) - return format(n==1 and msgid or msgid_plural, ...) -end - -return gettext, ngettext diff --git a/currency/locale/currency.de.tr b/currency/locale/currency.de.tr new file mode 100644 index 00000000..71991516 --- /dev/null +++ b/currency/locale/currency.de.tr @@ -0,0 +1,46 @@ +# textdomain: currency +# A.C.M. , 2018 + +### barter.lua ### + +Barter Table=Tausch Tisch +Cancel=Abbruch +Confirm=Bestätigen +Start=Start + +### shop.lua ### + +Exchange=Tausch + +### craftitems.lua ### + +@1 Minegeld Note=@1 Minegeld Banknote +@1 Minegeld cent coin= +Bundle of random Minegeld notes=Bündel von verschiedenen Minegeld Banknoten + +### safe.lua ### + +Safe=Safe +Safe (owned by @1)=Safe (gehört @1) + +### shop.lua ### + +Customer gets:=Kunde bekommt: +Customer gives (pay here!)=Kunde gibt (bezahl hier!) +Customers gave:=Kunde gab: +Exchange can not be done, check if you put all items!=Tausch kann nicht abgeschlossen werden, prüfe nochmal alles was du hinein gelegt hast! +Exchange can not be done, contact the shop owner.=Tausch kann nicht abgeschlossen werden, benachrichtige den Geschäftsinhaber. +Exchange shop (owned by @1)=Tauschgeschäft (gehört @1) +Exchanged!=Getauscht! +In exchange, you give:=Im Tausch, du gibst: +Owner gives:=Inhaber gibt: +Owner wants:=Inhaber will: + +Owner, Use (E)+Place (right mouse button) for customer interface=Inhaber, Benutze (E)+Platziere (rechte Maustaste) für Kunde ... + +Shop=Geschäft +This is your own shop, you can't exchange to yourself!=Das ist dein eigenes Geschäft, du kannst nicht mit dir selbst tauschen! +You want:=Du willst: +Your stock:=Dein Lager: + + diff --git a/currency/locale/currency.fr.tr b/currency/locale/currency.fr.tr new file mode 100644 index 00000000..55d13ef2 --- /dev/null +++ b/currency/locale/currency.fr.tr @@ -0,0 +1,47 @@ +# textdomain: currency +# Papou30, 2018. +# Louis Royer, 2020. + +### barter.lua ### + +Barter Table=Table de troc +Cancel=Annuler +Confirm=Valider +Start=Commencer + +### shop.lua ### + +Exchange=Troquer + +### craftitems.lua ### + +@1 Minegeld Note=@1 MineGeld +@1 Minegeld cent coin=Pièce de @1 centimes de MineGeld +Bundle of random Minegeld notes=Liasse de Minegeld de diverses valeurs + +### safe.lua ### + +Safe=Coffre-fort +Safe (owned by @1)=Coffre-fort (appartenant à @1) + +### shop.lua ### + +Customer gets:=Client obtient: +Customer gives (pay here!)=Client donne (payer ici!) +Customers gave:=Le client a donné: +Exchange can not be done, check if you put all items!=L'echange ne peut pas être fait, vérifiez que vous avez placé tous les articles! +Exchange can not be done, contact the shop owner.=L'échange ne peut être fait, contactez le propriétaire du magasin. +Exchange shop (owned by @1)=Boutique d'échange (appartenant à @1) +Exchanged!=Échangé! +In exchange, you give:=En échange, vous donnez : +Owner gives:=Le propriétaire donne : +Owner wants:=Le propriétaire veut : + +Owner, Use (E)+Place (right mouse button) for customer interface=Propriétaire, utilisez Spécial+clic droit pour l'interface client + +Shop=Boutique +This is your own shop, you can't exchange to yourself!=C'est votre propre boutique, vous ne pouvez pas échanger avec vous-même! +You want:=Vous voulez : +Your stock:=Votre stock : + + diff --git a/currency/locale/currency.ms.tr b/currency/locale/currency.ms.tr new file mode 100644 index 00000000..99b70887 --- /dev/null +++ b/currency/locale/currency.ms.tr @@ -0,0 +1,46 @@ +# textdomain: currency + + +### barter.lua ### + +Barter Table=Meja Barter +Cancel=Batal +Confirm=Sah +Start=Mula + +### shop.lua ### + +Exchange=Tukar + +### craftitems.lua ### + +@1 Minegeld Note=Wang @1 MineGeld +@1 Minegeld cent coin= +Bundle of random Minegeld notes=Seberkas wang Minegeld rawak + +### safe.lua ### + +Safe=Peti besi +Safe (owned by @1)=Peti besi (pemilik: @1) + +### shop.lua ### + +Customer gets:=Pelanggan dapat: +Customer gives (pay here!)=Pelanggan beri (bayar sini!) +Customers gave:=Pelanggan berikan: +Exchange can not be done, check if you put all items!=Tak boleh jual, pastikan anda ada apa yang penjual mahukan! +Exchange can not be done, contact the shop owner.=Tak boleh jual, hubungi penjual. +Exchange shop (owned by @1)=Kedai (pemilik: @1) +Exchanged!=Jual! +In exchange, you give:=Anda berikan: +Owner gives:=Penjual berikan: +Owner wants:=Penjual inginkan: + +Owner, Use (E)+Place (right mouse button) for customer interface=Penjual, Gunakan (E) + Letak (butang tetikus kanan) untuk antaramuka pelanggan + +Shop=Kedai +This is your own shop, you can't exchange to yourself!=Ini kedai anda, anda tidak boleh menjual kepada diri sendiri! +You want:=Anda mahukan: +Your stock:=Stok anda: + + diff --git a/currency/locale/currency.ru.tr b/currency/locale/currency.ru.tr new file mode 100644 index 00000000..add53413 --- /dev/null +++ b/currency/locale/currency.ru.tr @@ -0,0 +1,46 @@ +# textdomain: currency + + +### barter.lua ### + +Barter Table=Таблица бартера +Cancel=Отмена +Confirm=Подтверждение +Start=Старт + +### shop.lua ### + +Exchange=Обмен + +### craftitems.lua ### + +@1 Minegeld Note=Банкнота в @1 MineGeld +@1 Minegeld cent coin= +Bundle of random Minegeld notes=Пачка случайных банкнот Minegeld + +### safe.lua ### + +Safe=Сейф +Safe (owned by @1)=Сейф (принадлежит @1) + +### shop.lua ### + +Customer gets:=Покупатель получает: +Customer gives (pay here!)=Покупатель отдаёт (здесь оплата!) +Customers gave:=Покупатель отдал: +Exchange can not be done, check if you put all items!=Обмен невозможен, проверьте, что вы положили все предметы! +Exchange can not be done, contact the shop owner.=Обмен невозможен, свяжитесь с владельцем магазина. +Exchange shop (owned by @1)=Пункт обмена (принадлежит @1) +Exchanged!=Обмен произведён! +In exchange, you give:=Взамен вы даёте: +Owner gives:=Владелец отдаёт: +Owner wants:=Владелец хочет: + +Owner, Use (E)+Place (right mouse button) for customer interface=Владелец, используйте (E)+Разместить (правая кнопка мыши) для открытия интерфейса покупателя + +Shop=Магазин +This is your own shop, you can't exchange to yourself!=Это ваш собственный магазин, вы не можете обмениваться с самим собой! +You want:=Вы хотите: +Your stock:=Ваш запас: + + diff --git a/currency/locale/de.po b/currency/locale/de.po deleted file mode 100644 index ba2e853a..00000000 --- a/currency/locale/de.po +++ /dev/null @@ -1,183 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-24 22:01+0200\n" -"PO-Revision-Date: 2018-05-24 22:48+0200\n" -"Last-Translator: A.C.M. \n" -"Language-Team: \n" -"Language: de\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.0.7\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: barter.lua -msgid "Start" -msgstr "Start" - -#: barter.lua -msgid "Confirm" -msgstr "Bestätigen" - -#: barter.lua -msgid "Cancel" -msgstr "Abbruch" - -#: barter.lua shop.lua -msgid "Exchange" -msgstr "Tausch" - -#: barter.lua -msgid "Barter Table" -msgstr "Tausch Tisch" - -#: craftitems.lua -msgid "1 MineGeld Note" -msgstr "1 Minegeld Banknote" - -#: craftitems.lua -msgid "5 MineGeld Note" -msgstr "5 Minegeld Banknote" - -#: craftitems.lua -msgid "10 MineGeld Note" -msgstr "10 Minegeld Banknote" - -#: craftitems.lua -msgid "50 MineGeld Note" -msgstr "50 Minegeld Banknote" - -#: craftitems.lua -msgid "Bundle of random Minegeld notes" -msgstr "Bündel von verschiedenen Minegeld Banknoten" - -#: income.lua -msgid "basic income for @1" -msgstr "Grundeinkommen für @1" - -#: income.lua -msgid "added basic income for @1 to inventory" -msgstr "Grundeinkommen für @1 ins Inventar gelegt" - -#: init.lua -msgid "Currency mod loading..." -msgstr "Currency mod lädt..." - -#: init.lua -msgid "Craft_items Loaded!" -msgstr "Craft_items geladen!" - -#: init.lua -msgid "Shop Loaded!" -msgstr "Geschäft geladen!" - -#: init.lua -msgid "Barter Loaded!" -msgstr "Tauschtisch geladen!" - -#: init.lua -msgid "Safe Loaded!" -msgstr "Safe geladen!" - -#: init.lua -msgid "Crafting Loaded!" -msgstr "Crafting geladen!" - -#: init.lua -msgid "Creative mode in use, skipping basic income." -msgstr "Kreativmodus eingeschalten, überspringe Grundeinkommen." - -#: init.lua -msgid "Income Loaded!" -msgstr "Income geladen!" - -#: safe.lua -msgid "Safe" -msgstr "Safe" - -#: safe.lua -msgid "Safe (owned by @1)" -msgstr "Safe (gehört @1)" - -#: safe.lua -msgid "@1 tried to access a safe belonging to @2 at @3" -msgstr "@1 versuchte den Zugriff auf Safe von @2 bei @3" - -#: safe.lua -msgid "@1 moves stuff in safe at @2" -msgstr "@1 verschiebt Gegenstände in den Safe bei @2" - -#: safe.lua -msgid "@1 moves stuff to safe at @2" -msgstr "@1 verschiebt Gegenstände nach Safe bei @2" - -#: safe.lua -msgid "@1 takes stuff from safe at @2" -msgstr "@1 nimmt Gegenstände aus Safe bei @2" - -#: shop.lua -msgid "Customer gives (pay here!)" -msgstr "Kunde gibt (bezahl hier!)" - -#: shop.lua -msgid "Customer gets:" -msgstr "Kunde bekommt:" - -#: shop.lua -msgid "Owner wants:" -msgstr "Inhaber will:" - -#: shop.lua -msgid "Owner gives:" -msgstr "Inhaber gibt:" - -#: shop.lua -msgid "Customers gave:" -msgstr "Kunde gab:" - -#: shop.lua -msgid "Your stock:" -msgstr "Dein Lager:" - -#: shop.lua -msgid "You want:" -msgstr "Du willst:" - -#: shop.lua -msgid "In exchange, you give:" -msgstr "Im Tausch, du gibst:" - -#: shop.lua -msgid "Owner, Use (E)+Place (right mouse button) for customer interface" -msgstr "Inhaber, Benutze (E)+Platziere (rechte Maustaste) für Kunde ..." - -#: shop.lua -msgid "Shop" -msgstr "Geschäft" - -#: shop.lua -msgid "Exchange shop (owned by @1)" -msgstr "Tauschgeschäft (gehört @1)" - -#: shop.lua -msgid "This is your own shop, you can't exchange to yourself!" -msgstr "Das ist dein eigenes Geschäft, du kannst nicht mit dir selbst tauschen!" - -#: shop.lua -msgid "Exchanged!" -msgstr "Getauscht!" - -#: shop.lua -msgid "Exchange can not be done, contact the shop owner." -msgstr "Tausch kann nicht abgeschlossen werden, benachrichtige den Geschäftsinhaber." - -#: shop.lua -msgid "Exchange can not be done, check if you put all items!" -msgstr "Tausch kann nicht abgeschlossen werden, prüfe nochmal alles was du hinein gelegt hast!" diff --git a/currency/locale/fr.po b/currency/locale/fr.po deleted file mode 100644 index cdc803b0..00000000 --- a/currency/locale/fr.po +++ /dev/null @@ -1,187 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-24 23:06+0200\n" -"PO-Revision-Date: 2018-05-12 14:55+0200\n" -"Last-Translator: Papou30\n" -"Language-Team: \n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.0.7\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: barter.lua -msgid "Start" -msgstr "Début" - -#: barter.lua -msgid "Confirm" -msgstr "Confirmer" - -#: barter.lua -msgid "Cancel" -msgstr "Annuler" - -#: barter.lua shop.lua -msgid "Exchange" -msgstr "Échange" - -#: barter.lua -msgid "Barter Table" -msgstr "Table de troc" - -#: craftitems.lua -msgid "1 MineGeld Note" -msgstr "1 MineGeld" - -#: craftitems.lua -msgid "5 MineGeld Note" -msgstr "5 MineGeld" - -#: craftitems.lua -msgid "10 MineGeld Note" -msgstr "10 MineGeld" - -#: craftitems.lua -#, fuzzy -msgid "50 MineGeld Note" -msgstr "5 MineGeld" - -#: craftitems.lua -msgid "Bundle of random Minegeld notes" -msgstr "Liasse de Minegeld aléatoire" - -#: income.lua -msgid "basic income for @1" -msgstr "revenu de base pour @1" - -#: income.lua -msgid "added basic income for @1 to inventory" -msgstr "revenu de base ajouté pour @1 à l'inventaire" - -#: init.lua -msgid "Currency mod loading..." -msgstr "Chargement du mod Currency..." - -#: init.lua -msgid "Craft_items Loaded!" -msgstr "Fabrication d'objets (Craft_items) chargé!" - -#: init.lua -msgid "Shop Loaded!" -msgstr "Boutique (Shop) chargée!" - -#: init.lua -msgid "Barter Loaded!" -msgstr "Troc (Barter) chargé!" - -#: init.lua -msgid "Safe Loaded!" -msgstr "Coffre-fort (Safe) chargé!" - -#: init.lua -msgid "Crafting Loaded!" -msgstr "Artisanat (Crafting) chargé!" - -#: init.lua -msgid "Creative mode in use, skipping basic income." -msgstr "Mod créatif en cours d'utilisation, ignoré le revenu de base." - -#: init.lua -msgid "Income Loaded!" -msgstr "Revenu de base (Income) chargé!" - -#: safe.lua -msgid "Safe" -msgstr "Coffre-fort" - -#: safe.lua -msgid "Safe (owned by @1)" -msgstr "Coffre-fort (appartenant à @1)" - -#: safe.lua -msgid "@1 tried to access a safe belonging to @2 at @3" -msgstr "@1 a tenté d'accéder à un coffre-fort appartenant à @2 à @3" - -#: safe.lua -msgid "@1 moves stuff in safe at @2" -msgstr "@1 déplace le matériel dans coffre-fort à @2" - -#: safe.lua -msgid "@1 moves stuff to safe at @2" -msgstr "@1 déplace le matériel vers coffre-fort à @2" - -#: safe.lua -msgid "@1 takes stuff from safe at @2" -msgstr "@1 prend le matériel dans le coffre-fort à @2" - -#: shop.lua -msgid "Customer gives (pay here!)" -msgstr "Client donne (payer ici!)" - -#: shop.lua -msgid "Customer gets:" -msgstr "Client obtient:" - -#: shop.lua -msgid "Owner wants:" -msgstr "Le propriétaire veut:" - -#: shop.lua -msgid "Owner gives:" -msgstr "Propriétaire donne:" - -#: shop.lua -msgid "Customers gave:" -msgstr "Le client a donné:" - -#: shop.lua -msgid "Your stock:" -msgstr "Votre stock:" - -#: shop.lua -msgid "You want:" -msgstr "Vous voulez:" - -#: shop.lua -msgid "In exchange, you give:" -msgstr "En échange, vous donnez:" - -#: shop.lua -msgid "Owner, Use (E)+Place (right mouse button) for customer interface" -msgstr "" -"Propriétaire, utilisez (E) + place (bouton droit de la souris) pour " -"l'interface client" - -#: shop.lua -msgid "Shop" -msgstr "Boutique" - -#: shop.lua -msgid "Exchange shop (owned by @1)" -msgstr "Boutique d'échange (détenue par @1)" - -#: shop.lua -msgid "This is your own shop, you can't exchange to yourself!" -msgstr "C'est ta propre boutique, tu ne peux pas échanger avec toi-même!" - -#: shop.lua -msgid "Exchanged!" -msgstr "Échangé!" - -#: shop.lua -msgid "Exchange can not be done, contact the shop owner." -msgstr "L'échange ne peut être fait, contactez le propriétaire du magasin." - -#: shop.lua -msgid "Exchange can not be done, check if you put all items!" -msgstr "" -"L'echange ne peut pas etre fait, verifiez si vous mettez tous les articles!" diff --git a/currency/locale/ms.po b/currency/locale/ms.po deleted file mode 100644 index f6a3f5b3..00000000 --- a/currency/locale/ms.po +++ /dev/null @@ -1,186 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-24 23:06+0200\n" -"PO-Revision-Date: 2017-10-17 02:03+0800\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: ms\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.0.4\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: barter.lua -msgid "Start" -msgstr "Mula" - -#: barter.lua -msgid "Confirm" -msgstr "Sah" - -#: barter.lua -msgid "Cancel" -msgstr "Batal" - -#: barter.lua shop.lua -msgid "Exchange" -msgstr "Tukar" - -#: barter.lua -msgid "Barter Table" -msgstr "Meja Barter" - -#: craftitems.lua -msgid "1 MineGeld Note" -msgstr "Wang 1 MineGeld" - -#: craftitems.lua -msgid "5 MineGeld Note" -msgstr "Wang 5 MineGeld" - -#: craftitems.lua -msgid "10 MineGeld Note" -msgstr "Wang 10 MineGeld" - -#: craftitems.lua -#, fuzzy -msgid "50 MineGeld Note" -msgstr "Wang 5 MineGeld" - -#: craftitems.lua -msgid "Bundle of random Minegeld notes" -msgstr "Seberkas wang Minegeld rawak" - -#: income.lua -msgid "basic income for @1" -msgstr "pendapatan asas untuk @1" - -#: income.lua -msgid "added basic income for @1 to inventory" -msgstr "pendapatan asas untuk @1 ditambah masuk ke dalam inventori" - -#: init.lua -msgid "Currency mod loading..." -msgstr "Memuatkan mods Currency..." - -#: init.lua -msgid "Craft_items Loaded!" -msgstr "Item pertukangan dimuatkan!" - -#: init.lua -msgid "Shop Loaded!" -msgstr "Kedai dimuatkan!" - -#: init.lua -msgid "Barter Loaded!" -msgstr "Meja barter dimuatkan!" - -#: init.lua -msgid "Safe Loaded!" -msgstr "Peti besi dimuatkan!" - -#: init.lua -msgid "Crafting Loaded!" -msgstr "Pertukangan dimuatkan!" - -#: init.lua -msgid "Creative mode in use, skipping basic income." -msgstr "Dalam mod kreatif, pendapatan asas diabaikan." - -#: init.lua -msgid "Income Loaded!" -msgstr "Pendapatan dimuatkan!" - -#: safe.lua -msgid "Safe" -msgstr "Peti besi" - -#: safe.lua -msgid "Safe (owned by @1)" -msgstr "Peti besi (pemilik: @1)" - -#: safe.lua -msgid "@1 tried to access a safe belonging to @2 at @3" -msgstr "@1 cuba untuk mengakses peti besi milik @2 di @3" - -#: safe.lua -msgid "@1 moves stuff in safe at @2" -msgstr "@1 pindahkan barang dalam peti besi di @2" - -#: safe.lua -msgid "@1 moves stuff to safe at @2" -msgstr "@1 masukkan barang dalam peti besi di @2" - -#: safe.lua -msgid "@1 takes stuff from safe at @2" -msgstr "@1 keluarkan barang dari peti besi di @2" - -#: shop.lua -msgid "Customer gives (pay here!)" -msgstr "Pelanggan beri (bayar sini!)" - -#: shop.lua -msgid "Customer gets:" -msgstr "Pelanggan dapat:" - -#: shop.lua -msgid "Owner wants:" -msgstr "Penjual inginkan:" - -#: shop.lua -msgid "Owner gives:" -msgstr "Penjual berikan:" - -#: shop.lua -msgid "Customers gave:" -msgstr "Pelanggan berikan:" - -#: shop.lua -msgid "Your stock:" -msgstr "Stok anda:" - -#: shop.lua -msgid "You want:" -msgstr "Anda mahukan:" - -#: shop.lua -msgid "In exchange, you give:" -msgstr "Anda berikan:" - -#: shop.lua -msgid "Owner, Use (E)+Place (right mouse button) for customer interface" -msgstr "" -"Penjual, Gunakan (E) + Letak (butang tetikus kanan) untuk antaramuka " -"pelanggan" - -#: shop.lua -msgid "Shop" -msgstr "Kedai" - -#: shop.lua -msgid "Exchange shop (owned by @1)" -msgstr "Kedai (pemilik: @1)" - -#: shop.lua -msgid "This is your own shop, you can't exchange to yourself!" -msgstr "Ini kedai anda, anda tidak boleh menjual kepada diri sendiri!" - -#: shop.lua -msgid "Exchanged!" -msgstr "Jual!" - -#: shop.lua -msgid "Exchange can not be done, contact the shop owner." -msgstr "Tak boleh jual, hubungi penjual." - -#: shop.lua -msgid "Exchange can not be done, check if you put all items!" -msgstr "Tak boleh jual, pastikan anda ada apa yang penjual mahukan!" diff --git a/currency/locale/ru.po b/currency/locale/ru.po deleted file mode 100644 index 8084d682..00000000 --- a/currency/locale/ru.po +++ /dev/null @@ -1,187 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-24 23:06+0200\n" -"PO-Revision-Date: 2017-08-11 19:03+0300\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: ru\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.0.3\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" - -#: barter.lua -msgid "Start" -msgstr "Старт" - -#: barter.lua -msgid "Confirm" -msgstr "Подтверждение" - -#: barter.lua -msgid "Cancel" -msgstr "Отмена" - -#: barter.lua shop.lua -msgid "Exchange" -msgstr "Обмен" - -#: barter.lua -msgid "Barter Table" -msgstr "Таблица бартера" - -#: craftitems.lua -msgid "1 MineGeld Note" -msgstr "Банкнота в 1 MineGeld" - -#: craftitems.lua -msgid "5 MineGeld Note" -msgstr "Банкнота в 5 MineGeld" - -#: craftitems.lua -msgid "10 MineGeld Note" -msgstr "Банкнота в 10 MineGeld" - -#: craftitems.lua -#, fuzzy -msgid "50 MineGeld Note" -msgstr "Банкнота в 5 MineGeld" - -#: craftitems.lua -msgid "Bundle of random Minegeld notes" -msgstr "Пачка случайных банкнот Minegeld" - -#: income.lua -msgid "basic income for @1" -msgstr "базовая прибыль для @1" - -#: income.lua -msgid "added basic income for @1 to inventory" -msgstr "базовая прибыль для @1 добавлена в инвентарь" - -#: init.lua -msgid "Currency mod loading..." -msgstr "Загружается мод Currency..." - -#: init.lua -msgid "Craft_items Loaded!" -msgstr "Предметы для сборки загружены!" - -#: init.lua -msgid "Shop Loaded!" -msgstr "Магазин загружен!" - -#: init.lua -msgid "Barter Loaded!" -msgstr "Бартер загружен!" - -#: init.lua -msgid "Safe Loaded!" -msgstr "Сейф загружен!" - -#: init.lua -msgid "Crafting Loaded!" -msgstr "Механизм сборки загружен!" - -#: init.lua -msgid "Creative mode in use, skipping basic income." -msgstr "Используется режим творчества, пропускаем базовую прибыль." - -#: init.lua -msgid "Income Loaded!" -msgstr "Прибыль загружена!" - -#: safe.lua -msgid "Safe" -msgstr "Сейф" - -#: safe.lua -msgid "Safe (owned by @1)" -msgstr "Сейф (принадлежит @1)" - -#: safe.lua -msgid "@1 tried to access a safe belonging to @2 at @3" -msgstr "@1 попробовал открыть сейф, принадлежащий @2 в @3" - -#: safe.lua -msgid "@1 moves stuff in safe at @2" -msgstr "@1 перемещает вещи в сейфе в @2" - -#: safe.lua -msgid "@1 moves stuff to safe at @2" -msgstr "@1 кладёт вещи в сейф в @2" - -#: safe.lua -msgid "@1 takes stuff from safe at @2" -msgstr "@1 забирает вещи из сейфа в @2" - -#: shop.lua -msgid "Customer gives (pay here!)" -msgstr "Покупатель отдаёт (здесь оплата!)" - -#: shop.lua -msgid "Customer gets:" -msgstr "Покупатель получает:" - -#: shop.lua -msgid "Owner wants:" -msgstr "Владелец хочет:" - -#: shop.lua -msgid "Owner gives:" -msgstr "Владелец отдаёт:" - -#: shop.lua -msgid "Customers gave:" -msgstr "Покупатель отдал:" - -#: shop.lua -msgid "Your stock:" -msgstr "Ваш запас:" - -#: shop.lua -msgid "You want:" -msgstr "Вы хотите:" - -#: shop.lua -msgid "In exchange, you give:" -msgstr "Взамен вы даёте:" - -#: shop.lua -msgid "Owner, Use (E)+Place (right mouse button) for customer interface" -msgstr "" -"Владелец, используйте (E)+Разместить (правая кнопка мыши) для открытия " -"интерфейса покупателя" - -#: shop.lua -msgid "Shop" -msgstr "Магазин" - -#: shop.lua -msgid "Exchange shop (owned by @1)" -msgstr "Пункт обмена (принадлежит @1)" - -#: shop.lua -msgid "This is your own shop, you can't exchange to yourself!" -msgstr "Это ваш собственный магазин, вы не можете обмениваться с самим собой!" - -#: shop.lua -msgid "Exchanged!" -msgstr "Обмен произведён!" - -#: shop.lua -msgid "Exchange can not be done, contact the shop owner." -msgstr "Обмен невозможен, свяжитесь с владельцем магазина." - -#: shop.lua -msgid "Exchange can not be done, check if you put all items!" -msgstr "Обмен невозможен, проверьте, что вы положили все предметы!" diff --git a/currency/locale/template.pot b/currency/locale/template.pot deleted file mode 100644 index 396dde0f..00000000 --- a/currency/locale/template.pot +++ /dev/null @@ -1,182 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-24 23:06+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: barter.lua -msgid "Start" -msgstr "" - -#: barter.lua -msgid "Confirm" -msgstr "" - -#: barter.lua -msgid "Cancel" -msgstr "" - -#: barter.lua shop.lua -msgid "Exchange" -msgstr "" - -#: barter.lua -msgid "Barter Table" -msgstr "" - -#: craftitems.lua -msgid "1 MineGeld Note" -msgstr "" - -#: craftitems.lua -msgid "5 MineGeld Note" -msgstr "" - -#: craftitems.lua -msgid "10 MineGeld Note" -msgstr "" - -#: craftitems.lua -msgid "50 MineGeld Note" -msgstr "" - -#: craftitems.lua -msgid "Bundle of random Minegeld notes" -msgstr "" - -#: income.lua -msgid "basic income for @1" -msgstr "" - -#: income.lua -msgid "added basic income for @1 to inventory" -msgstr "" - -#: init.lua -msgid "Currency mod loading..." -msgstr "" - -#: init.lua -msgid "Craft_items Loaded!" -msgstr "" - -#: init.lua -msgid "Shop Loaded!" -msgstr "" - -#: init.lua -msgid "Barter Loaded!" -msgstr "" - -#: init.lua -msgid "Safe Loaded!" -msgstr "" - -#: init.lua -msgid "Crafting Loaded!" -msgstr "" - -#: init.lua -msgid "Creative mode in use, skipping basic income." -msgstr "" - -#: init.lua -msgid "Income Loaded!" -msgstr "" - -#: safe.lua -msgid "Safe" -msgstr "" - -#: safe.lua -msgid "Safe (owned by @1)" -msgstr "" - -#: safe.lua -msgid "@1 tried to access a safe belonging to @2 at @3" -msgstr "" - -#: safe.lua -msgid "@1 moves stuff in safe at @2" -msgstr "" - -#: safe.lua -msgid "@1 moves stuff to safe at @2" -msgstr "" - -#: safe.lua -msgid "@1 takes stuff from safe at @2" -msgstr "" - -#: shop.lua -msgid "Customer gives (pay here!)" -msgstr "" - -#: shop.lua -msgid "Customer gets:" -msgstr "" - -#: shop.lua -msgid "Owner wants:" -msgstr "" - -#: shop.lua -msgid "Owner gives:" -msgstr "" - -#: shop.lua -msgid "Customers gave:" -msgstr "" - -#: shop.lua -msgid "Your stock:" -msgstr "" - -#: shop.lua -msgid "You want:" -msgstr "" - -#: shop.lua -msgid "In exchange, you give:" -msgstr "" - -#: shop.lua -msgid "Owner, Use (E)+Place (right mouse button) for customer interface" -msgstr "" - -#: shop.lua -msgid "Shop" -msgstr "" - -#: shop.lua -msgid "Exchange shop (owned by @1)" -msgstr "" - -#: shop.lua -msgid "This is your own shop, you can't exchange to yourself!" -msgstr "" - -#: shop.lua -msgid "Exchanged!" -msgstr "" - -#: shop.lua -msgid "Exchange can not be done, contact the shop owner." -msgstr "" - -#: shop.lua -msgid "Exchange can not be done, check if you put all items!" -msgstr "" diff --git a/currency/locale/template.txt b/currency/locale/template.txt new file mode 100644 index 00000000..115e9888 --- /dev/null +++ b/currency/locale/template.txt @@ -0,0 +1,44 @@ +# textdomain: currency + + +### barter.lua ### + +Barter Table= +Cancel= +Confirm= +Start= + +### shop.lua ### + +Exchange= + +### craftitems.lua ### + +@1 Minegeld Note= +@1 Minegeld cent coin= +Bundle of random Minegeld notes= + +### safe.lua ### + +Safe= +Safe (owned by @1)= + +### shop.lua ### + +Customer gets:= +Customer gives (pay here!)= +Customers gave:= +Exchange can not be done, check if you put all items!= +Exchange can not be done, contact the shop owner.= +Exchange shop (owned by @1)= +Exchanged!= +In exchange, you give:= +Owner gives:= +Owner wants:= + +Owner, Use (E)+Place (right mouse button) for customer interface= + +Shop= +This is your own shop, you can't exchange to yourself!= +You want:= +Your stock:= diff --git a/currency/mod.conf b/currency/mod.conf index d2ba601f..b89297f6 100644 --- a/currency/mod.conf +++ b/currency/mod.conf @@ -1,3 +1,4 @@ name = currency depends = default -optional_depends = intllib,loot,pipeworks +optional_depends = loot, pipeworks +description = Provides shops, barter tables, safes, and multiple denominations of currency, called "Minegeld". diff --git a/currency/safe.lua b/currency/safe.lua index ad243e5c..a8dddee6 100644 --- a/currency/safe.lua +++ b/currency/safe.lua @@ -1,6 +1,4 @@ --- internationalization boilerplate -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") +local S = minetest.get_translator("currency") function default.get_safe_formspec(pos) local spos = pos.x .. "," .. pos.y .. "," ..pos.z @@ -60,8 +58,9 @@ minetest.register_node("currency:safe", { allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) local meta = minetest.get_meta(pos) if not has_safe_privilege(meta, player) then - minetest.log("action", S("@1 tried to access a safe belonging to @2 at @3", - player:get_player_name(), meta:get_string("owner"), minetest.pos_to_string(pos))) + minetest.log("action", player:get_player_name().." tried to access a safe belonging to " + ..meta:get_string("owner").." at " + ..minetest.pos_to_string(pos)) return 0 end return count @@ -69,8 +68,9 @@ minetest.register_node("currency:safe", { allow_metadata_inventory_put = function(pos, listname, index, stack, player) local meta = minetest.get_meta(pos) if not has_safe_privilege(meta, player) then - minetest.log("action", S("@1 tried to access a safe belonging to @2 at @3", - player:get_player_name(), meta:get_string("owner"), minetest.pos_to_string(pos))) + minetest.log("action", player:get_player_name().." tried to access a safe belonging to " + ..meta:get_string("owner").." at " + ..minetest.pos_to_string(pos)) return 0 end return stack:get_count() @@ -78,20 +78,21 @@ minetest.register_node("currency:safe", { allow_metadata_inventory_take = function(pos, listname, index, stack, player) local meta = minetest.get_meta(pos) if not has_safe_privilege(meta, player) then - minetest.log("action", S("@1 tried to access a safe belonging to @2 at @3", - player:get_player_name(), meta:get_string("owner"), minetest.pos_to_string(pos))) + minetest.log("action", player:get_player_name().." tried to access a safe belonging to " + ..meta:get_string("owner").." at " + ..minetest.pos_to_string(pos)) return 0 end return stack:get_count() end, on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) - minetest.log("action", S("@1 moves stuff in safe at @2", player:get_player_name(), minetest.pos_to_string(pos))) + minetest.log("action", player:get_player_name().." moves stuff in safe at "..minetest.pos_to_string(pos)) end, on_metadata_inventory_put = function(pos, listname, index, stack, player) - minetest.log("action", S("@1 moves stuff to safe at @2", player:get_player_name(), minetest.pos_to_string(pos))) + minetest.log("action", player:get_player_name().." moves stuff to safe at "..minetest.pos_to_string(pos)) end, on_metadata_inventory_take = function(pos, listname, index, stack, player) - minetest.log("action", S("@1 takes stuff from safe at @2", player:get_player_name(), minetest.pos_to_string(pos))) + minetest.log("action", player:get_player_name().." takes stuff from safe at "..minetest.pos_to_string(pos)) end, on_rightclick = function(pos, node, clicker) local meta = minetest.get_meta(pos) diff --git a/currency/shop.lua b/currency/shop.lua index 6f7d2646..0935a820 100644 --- a/currency/shop.lua +++ b/currency/shop.lua @@ -1,6 +1,4 @@ --- internationalization boilerplate -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") +local S = minetest.get_translator("currency") default.shop = {} default.shop.current_shop = {} @@ -27,10 +25,10 @@ default.shop.formspec = { "list["..list_name..";customers_gave;0,0.5;3,2;]".. "label[0,2.5;" .. S("Your stock:") .. "]".. "list["..list_name..";stock;0,3;3,2;]".. - "label[5,0;" .. S("You want:") .. "]".. - "list["..list_name..";owner_wants;5,0.5;3,2;]".. - "label[5,2.5;" .. S("In exchange, you give:") .. "]".. - "list["..list_name..";owner_gives;5,3;3,2;]".. + "label[4,0;" .. S("You want:") .. "]".. + "list["..list_name..";owner_wants;4,0.5;3,2;]".. + "label[4,2.5;" .. S("In exchange, you give:") .. "]".. + "list["..list_name..";owner_gives;4,3;3,2;]".. "label[0,5;" .. S("Owner, Use (E)+Place (right mouse button) for customer interface") .. "]".. "list[current_player;main;0,5.5;8,4;]" return formspec @@ -102,7 +100,7 @@ minetest.register_node("currency:shop", { local owner = placer:get_player_name() local meta = minetest.get_meta(pos) meta:set_string("infotext", S("Exchange shop (owned by @1)", owner)) - meta:set_string("owner",owner) + meta:set_string("owner", owner) --[[meta:set_string("pl1","") meta:set_string("pl2","")]] local inv = meta:get_inventory() @@ -166,7 +164,7 @@ minetest.register_on_player_receive_fields(function(sender, formname, fields) local pos = default.shop.current_shop[name] local meta = minetest.get_meta(pos) if meta:get_string("owner") == name then - minetest.chat_send_player(name,S("This is your own shop, you can't exchange to yourself!")) + minetest.chat_send_player(name, S("This is your own shop, you can't exchange to yourself!")) else local minv = meta:get_inventory() local pinv = sender:get_inventory() @@ -203,12 +201,12 @@ minetest.register_on_player_receive_fields(function(sender, formname, fields) minv:remove_item("stock",item) pinv:add_item("customer_gets",item) end - minetest.chat_send_player(name,S("Exchanged!")) + minetest.chat_send_player(name, S("Exchanged!")) else if owners_fault then - minetest.chat_send_player(name,S("Exchange can not be done, contact the shop owner.")) + minetest.chat_send_player(name, S("Exchange can not be done, contact the shop owner.")) else - minetest.chat_send_player(name,S("Exchange can not be done, check if you put all items!")) + minetest.chat_send_player(name, S("Exchange can not be done, check if you put all items!")) end end end diff --git a/digistuff/README b/digistuff/README index 79f68c76..d04d661b 100644 --- a/digistuff/README +++ b/digistuff/README @@ -71,3 +71,12 @@ As in, [digiline][junction box][dirt][junction box][digiline] will work to trans How to use the I/O expander: After setting a channel, send a table (same format as a Luacontroller's "port" table) to set the output states. A table in this same format will be sent back whenever an input changes or you manually poll it by sending a "GET" message. + +How to use the card reader: +After setting a channel, swiping a card (punch the reader with the card to swipe) will send a message in the following format: + {event = "read",data = "The data that was on the card"} +To write a card, send a command in the following format: + {command = "write",data = "The data to put on the card",description = "A description of what the card is for"} +After sending the write command, swipe the card to be written and the reader will send back the following message: + {event = "write"} +Both blank and previously written cards can be written to. If the card was not blank, it will be overwritten. diff --git a/digistuff/cardreader.lua b/digistuff/cardreader.lua new file mode 100644 index 00000000..3279e90b --- /dev/null +++ b/digistuff/cardreader.lua @@ -0,0 +1,119 @@ +local cardreader_rules = { + {x = 1, y = 0,z = 0,}, + {x = 2, y = 0,z = 0,}, + {x = -1, y = 0,z = 0,}, + {x = -2, y = 0,z = 0,}, + {x = 0, y = 1,z = 0,}, + {x = 0, y = 2,z = 0,}, + {x = 0, y = -1,z = 0,}, + {x = 0, y = -2,z = 0,}, + {x = 0, y = 0,z = 1,}, + {x = 0, y = 0,z = 2,}, + {x = 0, y = 0,z = -1,}, + {x = 0, y = 0,z = -2,}, +} + +minetest.register_craftitem("digistuff:card",{ + description = "Blank Magnetic Card", + image = "digistuff_magnetic_card.png", + stack_max = 1, + on_use = function(stack,_,pointed) + local pos = pointed.under + if not pos then return end + if minetest.get_node(pos).name ~= "digistuff:card_reader" then return end + local meta = minetest.get_meta(pos) + local channel = meta:get_string("channel") + local stackmeta = stack:get_meta() + if meta:get_int("writepending") > 0 then + local data = meta:get_string("writedata") + meta:set_int("writepending",0) + meta:set_string("infotext","Ready to Read") + digiline:receptor_send(pos,cardreader_rules,channel,{event = "write",}) + stackmeta:set_string("data",data) + stackmeta:set_string("description",string.format("Magnetic Card (%s)",meta:get_string("writedescription"))) + return stack + else + local channel = meta:get_string("channel") + local data = stackmeta:get_string("data") + digiline:receptor_send(pos,cardreader_rules,channel,{event = "read",data = data,}) + end + end, +}) + +minetest.register_node("digistuff:card_reader",{ + description = "Digilines Magnetic Card Reader/Writer", + groups = {cracky = 3,digiline_receiver = 1,}, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec","field[channel;Channel;${channel}") + meta:set_int("writepending",0) + meta:set_string("infotext","Ready to Read") + end, + on_receive_fields = function(pos, formname, fields, sender) + local name = sender:get_player_name() + if minetest.is_protected(pos,name) and not minetest.check_player_privs(name,{protection_bypass=true}) then + minetest.record_protection_violation(pos,name) + return + end + local meta = minetest.get_meta(pos) + if fields.channel then meta:set_string("channel",fields.channel) end + end, + paramtype = "light", + paramtype2 = "facedir", + tiles = { + "digistuff_cardreader_sides.png", + "digistuff_cardreader_sides.png", + "digistuff_cardreader_sides.png", + "digistuff_cardreader_sides.png", + "digistuff_cardreader_sides.png", + "digistuff_cardreader_top.png", + }, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.08,-0.12,0.4,0.08,0.12,0.5}, + } + }, + digiline = { + receptor = {}, + wire = { + rules = cardreader_rules, + }, + effector = { + action = function(pos,node,channel,msg) + local setchannel = minetest.get_meta(pos):get_string("channel") + if channel ~= setchannel or type(msg) ~= "table" then return end + if msg.command == "write" and (type(msg.data) == "string" or type(msg.data) == "number") then + local meta = minetest.get_meta(pos) + meta:set_string("infotext","Ready to Write") + meta:set_int("writepending",1) + if type(msg.data) ~= "string" then msg.data = tostring(msg.data) end + meta:set_string("writedata",string.sub(msg.data,1,256)) + if type(msg.description) == "string" then + meta:set_string("writedescription",string.sub(msg.description,1,64)) + else + meta:set_string("writedescription","no name") + end + end + end, + }, + }, +}) + +minetest.register_craft({ + output = "digistuff:card", + recipe = { + {"basic_materials:plastic_sheet",}, + {"default:iron_lump",}, + } +}) + +minetest.register_craft({ + output = "digistuff:card_reader", + recipe = { + {"basic_materials:plastic_sheet","basic_materials:plastic_sheet","digilines:wire_std_00000000",}, + {"basic_materials:plastic_sheet","basic_materials:copper_wire","mesecons_luacontroller:luacontroller0000",}, + {"basic_materials:plastic_sheet","basic_materials:plastic_sheet","",}, + } +}) diff --git a/digistuff/init.lua b/digistuff/init.lua index 4df2e65e..90d8ea0a 100644 --- a/digistuff/init.lua +++ b/digistuff/init.lua @@ -13,6 +13,7 @@ local components = { "detector", "piston", "timer", + "cardreader", } if minetest.get_modpath("mesecons_luacontroller") then table.insert(components,"ioexpander") end diff --git a/digistuff/textures/digistuff_cardreader_sides.png b/digistuff/textures/digistuff_cardreader_sides.png new file mode 100644 index 00000000..ede5f181 Binary files /dev/null and b/digistuff/textures/digistuff_cardreader_sides.png differ diff --git a/digistuff/textures/digistuff_cardreader_top.png b/digistuff/textures/digistuff_cardreader_top.png new file mode 100644 index 00000000..3dde6e9e Binary files /dev/null and b/digistuff/textures/digistuff_cardreader_top.png differ diff --git a/digistuff/textures/digistuff_magnetic_card.png b/digistuff/textures/digistuff_magnetic_card.png new file mode 100644 index 00000000..aaa22253 Binary files /dev/null and b/digistuff/textures/digistuff_magnetic_card.png differ diff --git a/digistuff/touchscreen.lua b/digistuff/touchscreen.lua index 6325f28d..71191d5a 100644 --- a/digistuff/touchscreen.lua +++ b/digistuff/touchscreen.lua @@ -216,7 +216,7 @@ digistuff.process_command = function (meta, data, msg) if not msg.choices or type(msg.choices) ~= "table" or #msg.choices < 1 then return end - local field = {type="dropdown",X=msg.X,Y=msg.Y,W=msg.W,H=msg.H,name=msg.name,selected_id=msg.selected_id,choices=msg.choices} + local field = {type="dropdown",X=msg.X,Y=msg.Y,W=msg.W,H=msg.H,name=minetest.formspec_escape(msg.name),selected_id=msg.selected_id,choices=msg.choices} table.insert(data,field) elseif msg.command == "addtextlist" then for _,i in pairs({"X","Y","W","H","selected_id"}) do @@ -233,7 +233,7 @@ digistuff.process_command = function (meta, data, msg) if not msg.transparent or type(msg.transparent) ~= "boolean" then msg.transparent = false end - local field = {type="textlist",X=msg.X,Y=msg.Y,W=msg.W,H=msg.H,name=msg.name,selected_id=msg.selected_id,listelements=msg.listelements,transparent=msg.transparent} + local field = {type="textlist",X=msg.X,Y=msg.Y,W=msg.W,H=msg.H,name=minetest.formspec_escape(msg.name),selected_id=msg.selected_id,listelements=msg.listelements,transparent=msg.transparent} table.insert(data,field) elseif msg.command == "lock" then meta:set_int("locked",1) diff --git a/farming/api.txt b/farming/api.txt index acec5a09..81092c69 100644 --- a/farming/api.txt +++ b/farming/api.txt @@ -21,7 +21,7 @@ The farming API allows you to easily register plants and hoes. { - description = "", -- Description for tooltip + description = "My Hoe", -- Description for tooltip inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image max_uses = 30, -- Uses until destroyed material = "", -- Material for recipes @@ -35,7 +35,7 @@ The farming API allows you to easily register plants and hoes. ### Plant definition { - description = "", -- Description of seed item + description = "My Plant", -- Description of seed item inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image steps = 8, -- How many steps the plant has to grow, until it can be harvested -- ^ Always provide a plant texture for each step, format: modname_plantname_i.png (i = stepnumber) diff --git a/farming/hoes.lua b/farming/hoes.lua index 5716128b..fc7823dc 100644 --- a/farming/hoes.lua +++ b/farming/hoes.lua @@ -63,8 +63,9 @@ function farming.hoe_on_use(itemstack, user, pointed_thing, uses) local pt = pointed_thing - -- check if pointing at a node - if not pt or pt.type ~= "node" then + -- am I going to hoe the top of a dirt node? + if not pt or pt.type ~= "node" + or pt.above.y ~= pt.under.y + 1 then return end @@ -100,7 +101,8 @@ function farming.hoe_on_use(itemstack, user, pointed_thing, uses) minetest.sound_play("default_dig_crumbly", {pos = pt.under, gain = 0.5}) - local wear = 65535 / (uses -1) + local wdef = itemstack:get_definition() + local wear = 65535 / (uses - 1) if farming.is_creative(user:get_player_name()) then if tr then @@ -116,6 +118,11 @@ function farming.hoe_on_use(itemstack, user, pointed_thing, uses) itemstack:add_wear(wear) end + if itemstack:get_count() == 0 and wdef.sound and wdef.sound.breaks then + minetest.sound_play(wdef.sound.breaks, {pos = pt.above, + gain = 0.5}, true) + end + return itemstack end diff --git a/farming/mapgen.lua b/farming/mapgen.lua index 6d8278d6..beacd21a 100644 --- a/farming/mapgen.lua +++ b/farming/mapgen.lua @@ -36,7 +36,8 @@ register_plant("potato_3", 15, 40, nil, "", -1, farming.potato) register_plant("tomato_7", 5, 20, nil, "", -1, farming.tomato) register_plant("corn_7", 12, 22, nil, "", -1, farming.corn) register_plant("coffee_5", 20, 45, {"default:dirt_with_dry_grass", - "default:dirt_with_rainforest_litter"}, "", -1, farming.coffee) + "default:dirt_with_rainforest_litter", + "default:dry_dirt_with_dry_grass"}, "", -1, farming.coffee) register_plant("raspberry_4", 3, 10, nil, "", -1, farming.raspberry) register_plant("rhubarb_3", 3, 15, nil, "", -1, farming.rhubarb) register_plant("blueberry_4", 3, 10, nil, "", -1, farming.blueberry) @@ -129,7 +130,7 @@ end if farming.pineapple then minetest.register_decoration({ deco_type = "simple", - place_on = {"default:dirt_with_dry_grass"}, + place_on = {"default:dirt_with_dry_grass", "default:dry_dirt_with_dry_grass"}, sidelen = 16, noise_params = { offset = 0, diff --git a/farming/soil.lua b/farming/soil.lua index d379f5dd..609fe729 100644 --- a/farming/soil.lua +++ b/farming/soil.lua @@ -22,6 +22,9 @@ minetest.register_node("farming:soil_wet", { -- sand is not soil, change existing sand-soil to use normal soil minetest.register_alias("farming:desert_sand_soil", "farming:soil") minetest.register_alias("farming:desert_sand_soil_wet", "farming:soil_wet") +-- also change new dry soil to use normal soil +minetest.register_alias("farming:dry_soil", "farming:soil") +minetest.register_alias("farming:dry_soil_wet", "farming:soil_wet") -- if water near soil then change to wet soil minetest.register_abm({ diff --git a/homedecor_common/tools/updatepo.sh b/homedecor_common/tools/updatepo.sh old mode 100755 new mode 100644 diff --git a/item_tweaks/init.lua b/item_tweaks/init.lua deleted file mode 100644 index efad17f5..00000000 --- a/item_tweaks/init.lua +++ /dev/null @@ -1,3 +0,0 @@ -local modpath = minetest.get_modpath(minetest.get_current_modname()) - -dofile(modpath.."/item_drop.lua") diff --git a/item_tweaks/item_drop.lua b/item_tweaks/item_drop.lua deleted file mode 100644 index 7f030db3..00000000 --- a/item_tweaks/item_drop.lua +++ /dev/null @@ -1,320 +0,0 @@ --- item_drop code by cyisfor --- https://github.com/cyisfor/item_drop - - -if drops == nil then - drops = {} -end - -local movers = {} - -local removedAlreadyDammit = {} - -vector.fixedNormalize = function(v) - assert(v) - local len = vector.length(v) - if len == 0 then - -- no length 1 vector will ever equal this - return vector.new(0,0,0) - else - return vector.divide(v, len) - end -end - -if not vector.dot then - vector.dot = function(p1,p2) - return p1.x * p2.x + p1.y * p2.y + p1.z * p2.z - end -end - -local function removeObject(object) - movers[object] = nil - removedAlreadyDammit[object] = true - object:remove() -end - -local function removeObjectWithSound(object) - movers[object] = nil - removedAlreadyDammit[object] = true - local pos=object:getpos() - minetest.sound_play("item_gone", { - pos=pos, - gain = 0.2, - max_hear_distance = 32, - }) - object:remove() -end - --- returns whether the pickup failed or not. --- nil pickupRadius means to infinity and beyond -local function pickup(player, inv, object, pickupRadius) - if removedAlreadyDammit[object] then - -- this gets called after the timeout, as well as when it hits the player - return true - end - if player == nil then return true end - - -- itemstring is serialized item so includes metadata - local lua = object:get_luaentity() - local item = ItemStack(lua.itemstring) - if inv and inv:room_for_item("main", item) then - inv:add_item("main", item) - if object:get_luaentity().itemstring ~= "" then - minetest.sound_play("item_drop_pickup", { - to_player = player:get_player_name(), - gain = 0.4, - }) - end - lua.itemstring = '' - removeObject(object) - return false - else - return true - end -end - -local function isGood(object) - -- only want items swooping up after players, not after chests! - if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then - return true - else - return false - end -end - -local function stop(object) - movers[object] = nil - -- no pickup, even though it's close, so - -- stop moving towards the player - object:setvelocity({x=0, y=0, z=0}) - object:setacceleration({x=0, y=0, z=0}) - -- also we can walk on it and it can push pressure plates - -- physical_state = false means "please make us physical again" - local lua = object:get_luaentity() - if lua then - lua.physical_state = false - end - --object:set_properties({ - -- physical = true - --}) -end - -local function pickupOrStop(object, inv, player, pickupRadius) - local lua = object:get_luaentity() - if object == nil or lua == nil or lua.itemstring == nil then - return - end - if pickup(player, inv, object, pickupRadius) then - stop(object) - end -end - --- GMass... it's the player's mass if the player were a giant planetlike object --- which things orbit around --- in the following units: --- if G = 6.67×10−11 then --- GMass = 1 for 14,992,503,748 kilograms -drops.playerGMass = 1.7 --- the player is faaaaaaaat - -local function moveTowards(object, player, pickupRadius, attractRadius) - -- move it towards the player, then pick it up after a delay! - local pos1 = player:getpos() - if pos1 == nil then return end - local pos2 = object:getpos() - if pos2 == nil then return end - pos1.y = pos1.y+0.5 -- head towards player's belt - local direct = vector.subtract(pos1, pos2) - local R = vector.length(direct) - local v = object:getvelocity() - local stopped = v.x == 0 and v.y == 0 and v.z == 0 - -- when direction(X) = direction(V) we passed the player - -- so project V onto X. If same, passed. If not, approaching. - -- projection = norm(X) * (length(V) * cos(theta)) - -- => length(V) * dot(V,X) / length(V) / length(X) - -- = dot(V,X) / length(X) - -- if X is normalized, length(X) == 1 so... dot product! - -- sign(dot) > 0 = same direction sign(dot)< 0 = different - direct = vector.fixedNormalize(direct) - - -- idea, set velocity not acceleration but set it - -- not to velocity + acceleration, but to the projection of that - -- onto the direction vector. object will always have velocity towards YOU - - if R > attractRadius then - stop(object) - return - end - if R < pickupRadius or (not stopped and vector.dot(v,direct) < 0) then - pickupOrStop(object,player:get_inventory(),player,nil) - return - end - -- Fg = G*M1*M2/R^2 - -- M1*A1 = G * M1 * M2 / R^2 - -- A1 = G * M2 / R ^2 - -- G = whatever it takes for stuff to orbit around the player - -- and the weight of the player is ^^^ - -- A1 = C / R^2 - local A - A = drops.playerGMass / R^2 - A = math.max(A,2*drops.playerGMass) - object:setacceleration(vector.multiply(direct,A)) -end - -if minetest.setting_get("enable_item_pickup") == "true" then - local tickets = 0 -- XXX: oy vey - moveDelay = 0 - minetest.register_globalstep(function(dtime) - -- it's much more efficient to just restart... no way to unregister_globalstep right? - if not minetest.setting_get("enable_item_pickup") then return end - moveDelay = moveDelay + dtime - local pickupRadius = tonumber(minetest.setting_get("pickup_radius")) - local attractRadius = tonumber(minetest.setting_get("attract_radius")) - if not pickupRadius then pickupRadius = 0.5 end - if not attractRadius then attractRadius = 3 end - - if moveDelay > 0.1 then - moveDelay = 0 - -- correct your trajectory while moving - for object,pair in pairs(movers) do - local player = pair[1] - moveTowards(object,player,pickupRadius,attractRadius) - end - end - for _, player in ipairs(minetest.get_connected_players()) do - if player:get_hp() > 0 or not minetest.setting_getbool("enable_damage") then - local playerPosition = player:getpos() - if playerPosition ~= nil then - playerPosition.y = playerPosition.y + 0.5 - local inv = player:get_inventory() - - for _,i in ipairs({"x","y","z"}) do - if playerPosition[i] > 31000 or playerPosition[i] < -31000 then - return - end - end - - for _, object in ipairs(minetest.get_objects_inside_radius(playerPosition, 3)) do - if isGood(object) and (object:get_luaentity().dropped_by ~= player:get_player_name() or object:get_luaentity().age > 3) and - inv and - inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) - then - local ticket = tickets - movers[object] = {player,ticket} - tickets = tickets + 1 - moveTowards(object, player, pickupRadius, attractRadius) - -- make sure object doesn't push the player around! - object:get_luaentity().physical_state = true - object:get_luaentity().object:set_properties({ - physical = false, - collide_with_objects = false, - weight = 0 - }) - -- pleeease no immortal orbiting entities - -- unless you want them to be >:) - minetest.after(30, function(object) - -- only if it's still moving - -- but what if it started moving a second time? - local pair = movers[object] - if pair and pair[2] == ticket then - stop(object) - end - end, object) - end - end - end - end - end - end) -end - -if minetest.setting_get("enable_item_drops") == "true" then - local old_handle_node_drops = minetest.handle_node_drops - - function new_handle_node_drops(pos, drops, digger) - if digger and digger.is_fake_player then - return old_handle_node_drops(pos, drops, digger) - end - local inv - -- the digger might be a node, like a constructor - if minetest.setting_getbool("creative_mode") and digger and digger:is_player() then - inv = digger:get_inventory() - end - for _, item in ipairs(drops) do - local count, name - if type(item) == "string" then - count = 1 - name = item - else - count = item:get_count() - name = item:get_name() - end - -- Only drop the item if not in creative, or if the item is not in creative inventory - if not inv or not inv:contains_item("main", ItemStack(name)) then - for i=1, count do - local obj = minetest.add_item(pos, item) - if obj ~= nil then - local x = math.random(1, 5) - if math.random(1, 2) == 1 then - x = -x - end - local z = math.random(1, 5) - if math.random(1, 2) == 1 then - z = -z - end - -- hurl it out into space at a random velocity - -- (still falling though) - obj:setvelocity({x=1/x, y=obj:getvelocity().y, z=1/z}) - end - end - end - end - -- the items have been dropped. Don't use builtin/item.lua or it could put the items - -- into an inventory! (see quarry) - -- return old_handle_node_drops(pos, drops, digger) - end - - function checkSetting(pos, drops, digger) - if minetest.setting_get("enable_item_drops") == "true" then - return new_handle_node_drops(pos, drops, digger) - else - return old_handle_node_drops(pos, drops, digger) - end - end - minetest.handle_node_drops = checkSetting - -end - -function minetest.item_drop(itemstack, dropper, pos) - if dropper and dropper.get_player_name then - local v = dropper:get_look_dir() - local p = {x=pos.x+v.x, y=pos.y+1.5+v.y, z=pos.z+v.z} - local r - if dropper:get_player_control().sneak then - r = itemstack - itemstack = itemstack:to_table() - itemstack.count = 1 - itemstack = ItemStack(itemstack) - r:take_item() - else - r = ItemStack("") - end - minetest.sound_play("item_drop", { - pos=pos, - gain = 1.0, - max_hear_distance = 32, - }) - local obj = minetest.add_item(p, itemstack) - if obj then - v.x = v.x*2 - v.y = v.y*2 + 1 - v.z = v.z*2 - obj:setvelocity(v) - obj:get_luaentity().dropped_by = dropper:get_player_name() - end - return r - else - minetest.add_item(pos, itemstack) - return ItemStack("") - end -end diff --git a/item_tweaks/sounds/item_drop.ogg b/item_tweaks/sounds/item_drop.ogg deleted file mode 100644 index ced91f89..00000000 Binary files a/item_tweaks/sounds/item_drop.ogg and /dev/null differ diff --git a/item_tweaks/sounds/item_drop_pickup.1.ogg b/item_tweaks/sounds/item_drop_pickup.1.ogg deleted file mode 100644 index 2ae432d5..00000000 Binary files a/item_tweaks/sounds/item_drop_pickup.1.ogg and /dev/null differ diff --git a/item_tweaks/sounds/item_drop_pickup.2.ogg b/item_tweaks/sounds/item_drop_pickup.2.ogg deleted file mode 100644 index f58bf08e..00000000 Binary files a/item_tweaks/sounds/item_drop_pickup.2.ogg and /dev/null differ diff --git a/item_tweaks/sounds/item_drop_pickup.3.ogg b/item_tweaks/sounds/item_drop_pickup.3.ogg deleted file mode 100644 index cf57c94c..00000000 Binary files a/item_tweaks/sounds/item_drop_pickup.3.ogg and /dev/null differ diff --git a/item_tweaks/sounds/item_drop_pickup.4.ogg b/item_tweaks/sounds/item_drop_pickup.4.ogg deleted file mode 100644 index bfe99d9a..00000000 Binary files a/item_tweaks/sounds/item_drop_pickup.4.ogg and /dev/null differ diff --git a/palm/textures/palm_coconut_slice.png b/palm/textures/palm_coconut_slice.png old mode 100755 new mode 100644 diff --git a/street_signs/screenshot.png b/street_signs/screenshot.png new file mode 100644 index 00000000..f7f3b87a Binary files /dev/null and b/street_signs/screenshot.png differ diff --git a/street_signs/screenshot_20180924_193156.png b/street_signs/screenshot_20180924_193156.png deleted file mode 100644 index 7fd5e341..00000000 Binary files a/street_signs/screenshot_20180924_193156.png and /dev/null differ diff --git a/street_signs/textures/street_signs_advisory_speed_kmh.png b/street_signs/textures/street_signs_advisory_speed_kmh.png index 95ff82b0..a6aff5e3 100644 Binary files a/street_signs/textures/street_signs_advisory_speed_kmh.png and b/street_signs/textures/street_signs_advisory_speed_kmh.png differ diff --git a/street_signs/textures/street_signs_advisory_speed_kmh_inv.png b/street_signs/textures/street_signs_advisory_speed_kmh_inv.png index 00ff77a6..efceef96 100644 Binary files a/street_signs/textures/street_signs_advisory_speed_kmh_inv.png and b/street_signs/textures/street_signs_advisory_speed_kmh_inv.png differ diff --git a/street_signs/textures/street_signs_advisory_speed_mph.png b/street_signs/textures/street_signs_advisory_speed_mph.png index 0fda1656..e144021f 100644 Binary files a/street_signs/textures/street_signs_advisory_speed_mph.png and b/street_signs/textures/street_signs_advisory_speed_mph.png differ diff --git a/street_signs/textures/street_signs_advisory_speed_mph_inv.png b/street_signs/textures/street_signs_advisory_speed_mph_inv.png index c9142dfb..446ccbc2 100644 Binary files a/street_signs/textures/street_signs_advisory_speed_mph_inv.png and b/street_signs/textures/street_signs_advisory_speed_mph_inv.png differ diff --git a/street_signs/textures/street_signs_advisory_speed_ms.png b/street_signs/textures/street_signs_advisory_speed_ms.png index 9a5a10ce..8614aeb6 100644 Binary files a/street_signs/textures/street_signs_advisory_speed_ms.png and b/street_signs/textures/street_signs_advisory_speed_ms.png differ diff --git a/street_signs/textures/street_signs_advisory_speed_ms_inv.png b/street_signs/textures/street_signs_advisory_speed_ms_inv.png index ca66f801..e25fffa4 100644 Binary files a/street_signs/textures/street_signs_advisory_speed_ms_inv.png and b/street_signs/textures/street_signs_advisory_speed_ms_inv.png differ diff --git a/street_signs/textures/street_signs_basic.png b/street_signs/textures/street_signs_basic.png index 241ff89f..79107cd8 100644 Binary files a/street_signs/textures/street_signs_basic.png and b/street_signs/textures/street_signs_basic.png differ diff --git a/street_signs/textures/street_signs_bg.png b/street_signs/textures/street_signs_bg.png index b2ea7d71..f2581356 100644 Binary files a/street_signs/textures/street_signs_bg.png and b/street_signs/textures/street_signs_bg.png differ diff --git a/street_signs/textures/street_signs_circular_intersection_ahead.png b/street_signs/textures/street_signs_circular_intersection_ahead.png index 3618e018..767389b8 100644 Binary files a/street_signs/textures/street_signs_circular_intersection_ahead.png and b/street_signs/textures/street_signs_circular_intersection_ahead.png differ diff --git a/street_signs/textures/street_signs_circular_intersection_ahead_inv.png b/street_signs/textures/street_signs_circular_intersection_ahead_inv.png index c699d8a9..c906a24b 100644 Binary files a/street_signs/textures/street_signs_circular_intersection_ahead_inv.png and b/street_signs/textures/street_signs_circular_intersection_ahead_inv.png differ diff --git a/street_signs/textures/street_signs_cross_road_ahead.png b/street_signs/textures/street_signs_cross_road_ahead.png index aacf49c5..38b1737f 100644 Binary files a/street_signs/textures/street_signs_cross_road_ahead.png and b/street_signs/textures/street_signs_cross_road_ahead.png differ diff --git a/street_signs/textures/street_signs_cross_road_ahead_inv.png b/street_signs/textures/street_signs_cross_road_ahead_inv.png index ad19ee4f..fa603176 100644 Binary files a/street_signs/textures/street_signs_cross_road_ahead_inv.png and b/street_signs/textures/street_signs_cross_road_ahead_inv.png differ diff --git a/street_signs/textures/street_signs_crosswalk_stop_on_red_light.png b/street_signs/textures/street_signs_crosswalk_stop_on_red_light.png index 0b1618d1..378633e0 100644 Binary files a/street_signs/textures/street_signs_crosswalk_stop_on_red_light.png and b/street_signs/textures/street_signs_crosswalk_stop_on_red_light.png differ diff --git a/street_signs/textures/street_signs_crosswalk_stop_on_red_light_inv.png b/street_signs/textures/street_signs_crosswalk_stop_on_red_light_inv.png index 12a6e210..502d12b1 100644 Binary files a/street_signs/textures/street_signs_crosswalk_stop_on_red_light_inv.png and b/street_signs/textures/street_signs_crosswalk_stop_on_red_light_inv.png differ diff --git a/street_signs/textures/street_signs_detour_left_m4_10.png b/street_signs/textures/street_signs_detour_left_m4_10.png index aa5d03f7..3282cd76 100644 Binary files a/street_signs/textures/street_signs_detour_left_m4_10.png and b/street_signs/textures/street_signs_detour_left_m4_10.png differ diff --git a/street_signs/textures/street_signs_detour_left_m4_10_inv.png b/street_signs/textures/street_signs_detour_left_m4_10_inv.png index bfb6f3b8..eebca840 100644 Binary files a/street_signs/textures/street_signs_detour_left_m4_10_inv.png and b/street_signs/textures/street_signs_detour_left_m4_10_inv.png differ diff --git a/street_signs/textures/street_signs_detour_right_m4_10.png b/street_signs/textures/street_signs_detour_right_m4_10.png index 79ea68af..9e946e3e 100644 Binary files a/street_signs/textures/street_signs_detour_right_m4_10.png and b/street_signs/textures/street_signs_detour_right_m4_10.png differ diff --git a/street_signs/textures/street_signs_detour_right_m4_10_inv.png b/street_signs/textures/street_signs_detour_right_m4_10_inv.png index 37be8d93..71f251be 100644 Binary files a/street_signs/textures/street_signs_detour_right_m4_10_inv.png and b/street_signs/textures/street_signs_detour_right_m4_10_inv.png differ diff --git a/street_signs/textures/street_signs_distance_2_lines.png b/street_signs/textures/street_signs_distance_2_lines.png index 8eab2487..259696ed 100644 Binary files a/street_signs/textures/street_signs_distance_2_lines.png and b/street_signs/textures/street_signs_distance_2_lines.png differ diff --git a/street_signs/textures/street_signs_distance_2_lines_inv.png b/street_signs/textures/street_signs_distance_2_lines_inv.png index 5a0aa17e..e8258be3 100644 Binary files a/street_signs/textures/street_signs_distance_2_lines_inv.png and b/street_signs/textures/street_signs_distance_2_lines_inv.png differ diff --git a/street_signs/textures/street_signs_distance_2_lines_orange.png b/street_signs/textures/street_signs_distance_2_lines_orange.png index 046eb1cd..912a1289 100644 Binary files a/street_signs/textures/street_signs_distance_2_lines_orange.png and b/street_signs/textures/street_signs_distance_2_lines_orange.png differ diff --git a/street_signs/textures/street_signs_distance_2_lines_orange_inv.png b/street_signs/textures/street_signs_distance_2_lines_orange_inv.png index d004d4a2..bc54ce1f 100644 Binary files a/street_signs/textures/street_signs_distance_2_lines_orange_inv.png and b/street_signs/textures/street_signs_distance_2_lines_orange_inv.png differ diff --git a/street_signs/textures/street_signs_divided_highway_begins.png b/street_signs/textures/street_signs_divided_highway_begins.png index 095a4d82..4299df92 100644 Binary files a/street_signs/textures/street_signs_divided_highway_begins.png and b/street_signs/textures/street_signs_divided_highway_begins.png differ diff --git a/street_signs/textures/street_signs_divided_highway_begins_inv.png b/street_signs/textures/street_signs_divided_highway_begins_inv.png index a58a77ac..9bd68e71 100644 Binary files a/street_signs/textures/street_signs_divided_highway_begins_inv.png and b/street_signs/textures/street_signs_divided_highway_begins_inv.png differ diff --git a/street_signs/textures/street_signs_divided_highway_ends.png b/street_signs/textures/street_signs_divided_highway_ends.png index 1eaf1591..d6f0df92 100644 Binary files a/street_signs/textures/street_signs_divided_highway_ends.png and b/street_signs/textures/street_signs_divided_highway_ends.png differ diff --git a/street_signs/textures/street_signs_divided_highway_ends_inv.png b/street_signs/textures/street_signs_divided_highway_ends_inv.png index 2496bdff..052dbf7c 100644 Binary files a/street_signs/textures/street_signs_divided_highway_ends_inv.png and b/street_signs/textures/street_signs_divided_highway_ends_inv.png differ diff --git a/street_signs/textures/street_signs_divided_highway_with_cross_road.png b/street_signs/textures/street_signs_divided_highway_with_cross_road.png index ab7b2474..349322e4 100644 Binary files a/street_signs/textures/street_signs_divided_highway_with_cross_road.png and b/street_signs/textures/street_signs_divided_highway_with_cross_road.png differ diff --git a/street_signs/textures/street_signs_divided_highway_with_cross_road_inv.png b/street_signs/textures/street_signs_divided_highway_with_cross_road_inv.png index 7353b282..b93651f6 100644 Binary files a/street_signs/textures/street_signs_divided_highway_with_cross_road_inv.png and b/street_signs/textures/street_signs_divided_highway_with_cross_road_inv.png differ diff --git a/street_signs/textures/street_signs_do_not_enter.png b/street_signs/textures/street_signs_do_not_enter.png index 2c77c892..9a44027d 100644 Binary files a/street_signs/textures/street_signs_do_not_enter.png and b/street_signs/textures/street_signs_do_not_enter.png differ diff --git a/street_signs/textures/street_signs_do_not_enter_inv.png b/street_signs/textures/street_signs_do_not_enter_inv.png index 59c70c1a..73115205 100644 Binary files a/street_signs/textures/street_signs_do_not_enter_inv.png and b/street_signs/textures/street_signs_do_not_enter_inv.png differ diff --git a/street_signs/textures/street_signs_do_not_stop_on_tracks.png b/street_signs/textures/street_signs_do_not_stop_on_tracks.png index 73674c96..5652e50a 100644 Binary files a/street_signs/textures/street_signs_do_not_stop_on_tracks.png and b/street_signs/textures/street_signs_do_not_stop_on_tracks.png differ diff --git a/street_signs/textures/street_signs_do_not_stop_on_tracks_inv.png b/street_signs/textures/street_signs_do_not_stop_on_tracks_inv.png index 89ae2d11..b9557735 100644 Binary files a/street_signs/textures/street_signs_do_not_stop_on_tracks_inv.png and b/street_signs/textures/street_signs_do_not_stop_on_tracks_inv.png differ diff --git a/street_signs/textures/street_signs_generic_highway_edges.png b/street_signs/textures/street_signs_generic_highway_edges.png index 8ce2f0a2..ac67fd83 100644 Binary files a/street_signs/textures/street_signs_generic_highway_edges.png and b/street_signs/textures/street_signs_generic_highway_edges.png differ diff --git a/street_signs/textures/street_signs_generic_highway_large_blue.png b/street_signs/textures/street_signs_generic_highway_large_blue.png index fbdf8098..7bd57190 100644 Binary files a/street_signs/textures/street_signs_generic_highway_large_blue.png and b/street_signs/textures/street_signs_generic_highway_large_blue.png differ diff --git a/street_signs/textures/street_signs_generic_highway_large_blue_inv.png b/street_signs/textures/street_signs_generic_highway_large_blue_inv.png index 94b53775..5071927a 100644 Binary files a/street_signs/textures/street_signs_generic_highway_large_blue_inv.png and b/street_signs/textures/street_signs_generic_highway_large_blue_inv.png differ diff --git a/street_signs/textures/street_signs_generic_highway_large_green.png b/street_signs/textures/street_signs_generic_highway_large_green.png index 70200c44..d1f439d4 100644 Binary files a/street_signs/textures/street_signs_generic_highway_large_green.png and b/street_signs/textures/street_signs_generic_highway_large_green.png differ diff --git a/street_signs/textures/street_signs_generic_highway_large_green_inv.png b/street_signs/textures/street_signs_generic_highway_large_green_inv.png index b19145ff..90a211a4 100644 Binary files a/street_signs/textures/street_signs_generic_highway_large_green_inv.png and b/street_signs/textures/street_signs_generic_highway_large_green_inv.png differ diff --git a/street_signs/textures/street_signs_generic_highway_large_orange.png b/street_signs/textures/street_signs_generic_highway_large_orange.png index df5651ab..9050b2fe 100644 Binary files a/street_signs/textures/street_signs_generic_highway_large_orange.png and b/street_signs/textures/street_signs_generic_highway_large_orange.png differ diff --git a/street_signs/textures/street_signs_generic_highway_large_orange_inv.png b/street_signs/textures/street_signs_generic_highway_large_orange_inv.png index 7298bcd2..de9f8729 100644 Binary files a/street_signs/textures/street_signs_generic_highway_large_orange_inv.png and b/street_signs/textures/street_signs_generic_highway_large_orange_inv.png differ diff --git a/street_signs/textures/street_signs_generic_highway_large_yellow.png b/street_signs/textures/street_signs_generic_highway_large_yellow.png index 07598dd9..bcf403db 100644 Binary files a/street_signs/textures/street_signs_generic_highway_large_yellow.png and b/street_signs/textures/street_signs_generic_highway_large_yellow.png differ diff --git a/street_signs/textures/street_signs_generic_highway_large_yellow_inv.png b/street_signs/textures/street_signs_generic_highway_large_yellow_inv.png index c93135a8..24be5b0d 100644 Binary files a/street_signs/textures/street_signs_generic_highway_large_yellow_inv.png and b/street_signs/textures/street_signs_generic_highway_large_yellow_inv.png differ diff --git a/street_signs/textures/street_signs_generic_highway_medium_blue.png b/street_signs/textures/street_signs_generic_highway_medium_blue.png index 9260b8e8..bc9590b9 100644 Binary files a/street_signs/textures/street_signs_generic_highway_medium_blue.png and b/street_signs/textures/street_signs_generic_highway_medium_blue.png differ diff --git a/street_signs/textures/street_signs_generic_highway_medium_blue_inv.png b/street_signs/textures/street_signs_generic_highway_medium_blue_inv.png index 90b5d1d8..c9c2da4a 100644 Binary files a/street_signs/textures/street_signs_generic_highway_medium_blue_inv.png and b/street_signs/textures/street_signs_generic_highway_medium_blue_inv.png differ diff --git a/street_signs/textures/street_signs_generic_highway_medium_green.png b/street_signs/textures/street_signs_generic_highway_medium_green.png index b12fcbd1..f765110b 100644 Binary files a/street_signs/textures/street_signs_generic_highway_medium_green.png and b/street_signs/textures/street_signs_generic_highway_medium_green.png differ diff --git a/street_signs/textures/street_signs_generic_highway_medium_green_inv.png b/street_signs/textures/street_signs_generic_highway_medium_green_inv.png index fe49082d..667afa0f 100644 Binary files a/street_signs/textures/street_signs_generic_highway_medium_green_inv.png and b/street_signs/textures/street_signs_generic_highway_medium_green_inv.png differ diff --git a/street_signs/textures/street_signs_generic_highway_medium_orange.png b/street_signs/textures/street_signs_generic_highway_medium_orange.png index f8c9fca4..0ebfd5a2 100644 Binary files a/street_signs/textures/street_signs_generic_highway_medium_orange.png and b/street_signs/textures/street_signs_generic_highway_medium_orange.png differ diff --git a/street_signs/textures/street_signs_generic_highway_medium_orange_inv.png b/street_signs/textures/street_signs_generic_highway_medium_orange_inv.png index 3cc8a89c..54382f05 100644 Binary files a/street_signs/textures/street_signs_generic_highway_medium_orange_inv.png and b/street_signs/textures/street_signs_generic_highway_medium_orange_inv.png differ diff --git a/street_signs/textures/street_signs_generic_highway_medium_yellow.png b/street_signs/textures/street_signs_generic_highway_medium_yellow.png index 6d8be8be..f74b00d6 100644 Binary files a/street_signs/textures/street_signs_generic_highway_medium_yellow.png and b/street_signs/textures/street_signs_generic_highway_medium_yellow.png differ diff --git a/street_signs/textures/street_signs_generic_highway_medium_yellow_inv.png b/street_signs/textures/street_signs_generic_highway_medium_yellow_inv.png index 2fbcf5f4..f7278824 100644 Binary files a/street_signs/textures/street_signs_generic_highway_medium_yellow_inv.png and b/street_signs/textures/street_signs_generic_highway_medium_yellow_inv.png differ diff --git a/street_signs/textures/street_signs_generic_highway_small_blue.png b/street_signs/textures/street_signs_generic_highway_small_blue.png index 677ebb30..e7fae57d 100644 Binary files a/street_signs/textures/street_signs_generic_highway_small_blue.png and b/street_signs/textures/street_signs_generic_highway_small_blue.png differ diff --git a/street_signs/textures/street_signs_generic_highway_small_blue_inv.png b/street_signs/textures/street_signs_generic_highway_small_blue_inv.png index 8af953e9..1e12549e 100644 Binary files a/street_signs/textures/street_signs_generic_highway_small_blue_inv.png and b/street_signs/textures/street_signs_generic_highway_small_blue_inv.png differ diff --git a/street_signs/textures/street_signs_generic_highway_small_green.png b/street_signs/textures/street_signs_generic_highway_small_green.png index 0fc694d2..8ac0bf52 100644 Binary files a/street_signs/textures/street_signs_generic_highway_small_green.png and b/street_signs/textures/street_signs_generic_highway_small_green.png differ diff --git a/street_signs/textures/street_signs_generic_highway_small_green_inv.png b/street_signs/textures/street_signs_generic_highway_small_green_inv.png index 7ec89950..d8116910 100644 Binary files a/street_signs/textures/street_signs_generic_highway_small_green_inv.png and b/street_signs/textures/street_signs_generic_highway_small_green_inv.png differ diff --git a/street_signs/textures/street_signs_generic_highway_small_orange.png b/street_signs/textures/street_signs_generic_highway_small_orange.png index 109d8d92..6078784e 100644 Binary files a/street_signs/textures/street_signs_generic_highway_small_orange.png and b/street_signs/textures/street_signs_generic_highway_small_orange.png differ diff --git a/street_signs/textures/street_signs_generic_highway_small_orange_inv.png b/street_signs/textures/street_signs_generic_highway_small_orange_inv.png index 64946902..a90d4153 100644 Binary files a/street_signs/textures/street_signs_generic_highway_small_orange_inv.png and b/street_signs/textures/street_signs_generic_highway_small_orange_inv.png differ diff --git a/street_signs/textures/street_signs_generic_highway_small_yellow.png b/street_signs/textures/street_signs_generic_highway_small_yellow.png index 2c287853..6423522c 100644 Binary files a/street_signs/textures/street_signs_generic_highway_small_yellow.png and b/street_signs/textures/street_signs_generic_highway_small_yellow.png differ diff --git a/street_signs/textures/street_signs_generic_highway_small_yellow_inv.png b/street_signs/textures/street_signs_generic_highway_small_yellow_inv.png index 355f8a86..d3270e75 100644 Binary files a/street_signs/textures/street_signs_generic_highway_small_yellow_inv.png and b/street_signs/textures/street_signs_generic_highway_small_yellow_inv.png differ diff --git a/street_signs/textures/street_signs_hill_with_grade_ahead.png b/street_signs/textures/street_signs_hill_with_grade_ahead.png index 23deb033..70f7d78b 100644 Binary files a/street_signs/textures/street_signs_hill_with_grade_ahead.png and b/street_signs/textures/street_signs_hill_with_grade_ahead.png differ diff --git a/street_signs/textures/street_signs_hill_with_grade_ahead_inv.png b/street_signs/textures/street_signs_hill_with_grade_ahead_inv.png index 668bd609..2f4e11a3 100644 Binary files a/street_signs/textures/street_signs_hill_with_grade_ahead_inv.png and b/street_signs/textures/street_signs_hill_with_grade_ahead_inv.png differ diff --git a/street_signs/textures/street_signs_keep_left.png b/street_signs/textures/street_signs_keep_left.png index 0439b79b..8c55e47d 100644 Binary files a/street_signs/textures/street_signs_keep_left.png and b/street_signs/textures/street_signs_keep_left.png differ diff --git a/street_signs/textures/street_signs_keep_left_inv.png b/street_signs/textures/street_signs_keep_left_inv.png index a78a11e7..b960a712 100644 Binary files a/street_signs/textures/street_signs_keep_left_inv.png and b/street_signs/textures/street_signs_keep_left_inv.png differ diff --git a/street_signs/textures/street_signs_keep_right.png b/street_signs/textures/street_signs_keep_right.png index eab90fa5..8b8687f0 100644 Binary files a/street_signs/textures/street_signs_keep_right.png and b/street_signs/textures/street_signs_keep_right.png differ diff --git a/street_signs/textures/street_signs_keep_right_inv.png b/street_signs/textures/street_signs_keep_right_inv.png index bb67c35c..d49bdbdb 100644 Binary files a/street_signs/textures/street_signs_keep_right_inv.png and b/street_signs/textures/street_signs_keep_right_inv.png differ diff --git a/street_signs/textures/street_signs_large_arrow_left.png b/street_signs/textures/street_signs_large_arrow_left.png index 748d6758..94301fc9 100644 Binary files a/street_signs/textures/street_signs_large_arrow_left.png and b/street_signs/textures/street_signs_large_arrow_left.png differ diff --git a/street_signs/textures/street_signs_large_arrow_left_inv.png b/street_signs/textures/street_signs_large_arrow_left_inv.png index d78e25dc..c791de80 100644 Binary files a/street_signs/textures/street_signs_large_arrow_left_inv.png and b/street_signs/textures/street_signs_large_arrow_left_inv.png differ diff --git a/street_signs/textures/street_signs_large_arrow_right.png b/street_signs/textures/street_signs_large_arrow_right.png index c154bb03..369420d0 100644 Binary files a/street_signs/textures/street_signs_large_arrow_right.png and b/street_signs/textures/street_signs_large_arrow_right.png differ diff --git a/street_signs/textures/street_signs_large_arrow_right_inv.png b/street_signs/textures/street_signs_large_arrow_right_inv.png index ffe483ca..550a183b 100644 Binary files a/street_signs/textures/street_signs_large_arrow_right_inv.png and b/street_signs/textures/street_signs_large_arrow_right_inv.png differ diff --git a/street_signs/textures/street_signs_left_lane_ends.png b/street_signs/textures/street_signs_left_lane_ends.png index 7f61bb71..3c4d6511 100644 Binary files a/street_signs/textures/street_signs_left_lane_ends.png and b/street_signs/textures/street_signs_left_lane_ends.png differ diff --git a/street_signs/textures/street_signs_left_lane_ends_inv.png b/street_signs/textures/street_signs_left_lane_ends_inv.png index c1de4971..24f2f632 100644 Binary files a/street_signs/textures/street_signs_left_lane_ends_inv.png and b/street_signs/textures/street_signs_left_lane_ends_inv.png differ diff --git a/street_signs/textures/street_signs_left_lane_must_turn_left.png b/street_signs/textures/street_signs_left_lane_must_turn_left.png index 6614c5be..cfbb68ca 100644 Binary files a/street_signs/textures/street_signs_left_lane_must_turn_left.png and b/street_signs/textures/street_signs_left_lane_must_turn_left.png differ diff --git a/street_signs/textures/street_signs_left_lane_must_turn_left_inv.png b/street_signs/textures/street_signs_left_lane_must_turn_left_inv.png index 8d9a2da6..131c4c76 100644 Binary files a/street_signs/textures/street_signs_left_lane_must_turn_left_inv.png and b/street_signs/textures/street_signs_left_lane_must_turn_left_inv.png differ diff --git a/street_signs/textures/street_signs_left_on_green_arrow_only.png b/street_signs/textures/street_signs_left_on_green_arrow_only.png index e23facf1..5d89e767 100644 Binary files a/street_signs/textures/street_signs_left_on_green_arrow_only.png and b/street_signs/textures/street_signs_left_on_green_arrow_only.png differ diff --git a/street_signs/textures/street_signs_left_on_green_arrow_only_inv.png b/street_signs/textures/street_signs_left_on_green_arrow_only_inv.png index 5af646a6..d0759d33 100644 Binary files a/street_signs/textures/street_signs_left_on_green_arrow_only_inv.png and b/street_signs/textures/street_signs_left_on_green_arrow_only_inv.png differ diff --git a/street_signs/textures/street_signs_left_turn_only.png b/street_signs/textures/street_signs_left_turn_only.png index 39492e2a..7cf22768 100644 Binary files a/street_signs/textures/street_signs_left_turn_only.png and b/street_signs/textures/street_signs_left_turn_only.png differ diff --git a/street_signs/textures/street_signs_left_turn_only_inv.png b/street_signs/textures/street_signs_left_turn_only_inv.png index 33c50363..0c669d46 100644 Binary files a/street_signs/textures/street_signs_left_turn_only_inv.png and b/street_signs/textures/street_signs_left_turn_only_inv.png differ diff --git a/street_signs/textures/street_signs_left_turn_or_straight.png b/street_signs/textures/street_signs_left_turn_or_straight.png index 5ab1de96..427c9a3f 100644 Binary files a/street_signs/textures/street_signs_left_turn_or_straight.png and b/street_signs/textures/street_signs_left_turn_or_straight.png differ diff --git a/street_signs/textures/street_signs_left_turn_or_straight_inv.png b/street_signs/textures/street_signs_left_turn_or_straight_inv.png index 9c5b503d..d982e01a 100644 Binary files a/street_signs/textures/street_signs_left_turn_or_straight_inv.png and b/street_signs/textures/street_signs_left_turn_or_straight_inv.png differ diff --git a/street_signs/textures/street_signs_left_turn_yield_on_green_light.png b/street_signs/textures/street_signs_left_turn_yield_on_green_light.png index c50f2146..73049003 100644 Binary files a/street_signs/textures/street_signs_left_turn_yield_on_green_light.png and b/street_signs/textures/street_signs_left_turn_yield_on_green_light.png differ diff --git a/street_signs/textures/street_signs_left_turn_yield_on_green_light_inv.png b/street_signs/textures/street_signs_left_turn_yield_on_green_light_inv.png index 5eee5acb..a75b0516 100644 Binary files a/street_signs/textures/street_signs_left_turn_yield_on_green_light_inv.png and b/street_signs/textures/street_signs_left_turn_yield_on_green_light_inv.png differ diff --git a/street_signs/textures/street_signs_low_clearance.png b/street_signs/textures/street_signs_low_clearance.png index 214f3ce7..70b3580a 100644 Binary files a/street_signs/textures/street_signs_low_clearance.png and b/street_signs/textures/street_signs_low_clearance.png differ diff --git a/street_signs/textures/street_signs_low_clearance_inv.png b/street_signs/textures/street_signs_low_clearance_inv.png index 8a608bbd..f5e836fa 100644 Binary files a/street_signs/textures/street_signs_low_clearance_inv.png and b/street_signs/textures/street_signs_low_clearance_inv.png differ diff --git a/street_signs/textures/street_signs_merging_traffic.png b/street_signs/textures/street_signs_merging_traffic.png index 29f76172..264babfd 100644 Binary files a/street_signs/textures/street_signs_merging_traffic.png and b/street_signs/textures/street_signs_merging_traffic.png differ diff --git a/street_signs/textures/street_signs_merging_traffic_inv.png b/street_signs/textures/street_signs_merging_traffic_inv.png index 18fc825e..75d73a3e 100644 Binary files a/street_signs/textures/street_signs_merging_traffic_inv.png and b/street_signs/textures/street_signs_merging_traffic_inv.png differ diff --git a/street_signs/textures/street_signs_no_left_turn.png b/street_signs/textures/street_signs_no_left_turn.png index a60a3580..511c6808 100644 Binary files a/street_signs/textures/street_signs_no_left_turn.png and b/street_signs/textures/street_signs_no_left_turn.png differ diff --git a/street_signs/textures/street_signs_no_left_turn_inv.png b/street_signs/textures/street_signs_no_left_turn_inv.png index a9bbbe9c..a243f80c 100644 Binary files a/street_signs/textures/street_signs_no_left_turn_inv.png and b/street_signs/textures/street_signs_no_left_turn_inv.png differ diff --git a/street_signs/textures/street_signs_no_right_turn.png b/street_signs/textures/street_signs_no_right_turn.png index fdf88770..c6ffe545 100644 Binary files a/street_signs/textures/street_signs_no_right_turn.png and b/street_signs/textures/street_signs_no_right_turn.png differ diff --git a/street_signs/textures/street_signs_no_right_turn_inv.png b/street_signs/textures/street_signs_no_right_turn_inv.png index 80e39dfc..2d9c7978 100644 Binary files a/street_signs/textures/street_signs_no_right_turn_inv.png and b/street_signs/textures/street_signs_no_right_turn_inv.png differ diff --git a/street_signs/textures/street_signs_no_straight_through.png b/street_signs/textures/street_signs_no_straight_through.png index 9eda5f96..c2f8b655 100644 Binary files a/street_signs/textures/street_signs_no_straight_through.png and b/street_signs/textures/street_signs_no_straight_through.png differ diff --git a/street_signs/textures/street_signs_no_straight_through_inv.png b/street_signs/textures/street_signs_no_straight_through_inv.png index 9fd6cd8c..9636adc9 100644 Binary files a/street_signs/textures/street_signs_no_straight_through_inv.png and b/street_signs/textures/street_signs_no_straight_through_inv.png differ diff --git a/street_signs/textures/street_signs_no_turn_on_red_light.png b/street_signs/textures/street_signs_no_turn_on_red_light.png index 069c1b57..7686ae20 100644 Binary files a/street_signs/textures/street_signs_no_turn_on_red_light.png and b/street_signs/textures/street_signs_no_turn_on_red_light.png differ diff --git a/street_signs/textures/street_signs_no_turn_on_red_light_inv.png b/street_signs/textures/street_signs_no_turn_on_red_light_inv.png index 8190f99d..8fc903cc 100644 Binary files a/street_signs/textures/street_signs_no_turn_on_red_light_inv.png and b/street_signs/textures/street_signs_no_turn_on_red_light_inv.png differ diff --git a/street_signs/textures/street_signs_no_u_turn.png b/street_signs/textures/street_signs_no_u_turn.png index 56ed02b8..44592712 100644 Binary files a/street_signs/textures/street_signs_no_u_turn.png and b/street_signs/textures/street_signs_no_u_turn.png differ diff --git a/street_signs/textures/street_signs_no_u_turn_inv.png b/street_signs/textures/street_signs_no_u_turn_inv.png index 44abc959..75d44abb 100644 Binary files a/street_signs/textures/street_signs_no_u_turn_inv.png and b/street_signs/textures/street_signs_no_u_turn_inv.png differ diff --git a/street_signs/textures/street_signs_object_marker_type3_c.png b/street_signs/textures/street_signs_object_marker_type3_c.png index cc33aea7..e995b8b0 100644 Binary files a/street_signs/textures/street_signs_object_marker_type3_c.png and b/street_signs/textures/street_signs_object_marker_type3_c.png differ diff --git a/street_signs/textures/street_signs_object_marker_type3_c_inv.png b/street_signs/textures/street_signs_object_marker_type3_c_inv.png index b739120a..a90b1218 100644 Binary files a/street_signs/textures/street_signs_object_marker_type3_c_inv.png and b/street_signs/textures/street_signs_object_marker_type3_c_inv.png differ diff --git a/street_signs/textures/street_signs_object_marker_type3_l.png b/street_signs/textures/street_signs_object_marker_type3_l.png index c0d8c80c..6735a4a2 100644 Binary files a/street_signs/textures/street_signs_object_marker_type3_l.png and b/street_signs/textures/street_signs_object_marker_type3_l.png differ diff --git a/street_signs/textures/street_signs_object_marker_type3_l_inv.png b/street_signs/textures/street_signs_object_marker_type3_l_inv.png index dc84dc1e..f03a3221 100644 Binary files a/street_signs/textures/street_signs_object_marker_type3_l_inv.png and b/street_signs/textures/street_signs_object_marker_type3_l_inv.png differ diff --git a/street_signs/textures/street_signs_object_marker_type3_r.png b/street_signs/textures/street_signs_object_marker_type3_r.png index d0a73783..140dd553 100644 Binary files a/street_signs/textures/street_signs_object_marker_type3_r.png and b/street_signs/textures/street_signs_object_marker_type3_r.png differ diff --git a/street_signs/textures/street_signs_object_marker_type3_r_inv.png b/street_signs/textures/street_signs_object_marker_type3_r_inv.png index a2f8b9c8..771cb150 100644 Binary files a/street_signs/textures/street_signs_object_marker_type3_r_inv.png and b/street_signs/textures/street_signs_object_marker_type3_r_inv.png differ diff --git a/street_signs/textures/street_signs_offset_side_road_left_ahead.png b/street_signs/textures/street_signs_offset_side_road_left_ahead.png index 42f6fc8c..ae56952f 100644 Binary files a/street_signs/textures/street_signs_offset_side_road_left_ahead.png and b/street_signs/textures/street_signs_offset_side_road_left_ahead.png differ diff --git a/street_signs/textures/street_signs_offset_side_road_left_ahead_inv.png b/street_signs/textures/street_signs_offset_side_road_left_ahead_inv.png index 2db44a69..71304934 100644 Binary files a/street_signs/textures/street_signs_offset_side_road_left_ahead_inv.png and b/street_signs/textures/street_signs_offset_side_road_left_ahead_inv.png differ diff --git a/street_signs/textures/street_signs_offset_side_road_right_ahead.png b/street_signs/textures/street_signs_offset_side_road_right_ahead.png index c2bd37fe..23038295 100644 Binary files a/street_signs/textures/street_signs_offset_side_road_right_ahead.png and b/street_signs/textures/street_signs_offset_side_road_right_ahead.png differ diff --git a/street_signs/textures/street_signs_offset_side_road_right_ahead_inv.png b/street_signs/textures/street_signs_offset_side_road_right_ahead_inv.png index 1cf5222e..4a5368e2 100644 Binary files a/street_signs/textures/street_signs_offset_side_road_right_ahead_inv.png and b/street_signs/textures/street_signs_offset_side_road_right_ahead_inv.png differ diff --git a/street_signs/textures/street_signs_one_way_left.png b/street_signs/textures/street_signs_one_way_left.png index 68ab6b82..ba7f3fa7 100644 Binary files a/street_signs/textures/street_signs_one_way_left.png and b/street_signs/textures/street_signs_one_way_left.png differ diff --git a/street_signs/textures/street_signs_one_way_left_inv.png b/street_signs/textures/street_signs_one_way_left_inv.png index b317f338..4a99e3b3 100644 Binary files a/street_signs/textures/street_signs_one_way_left_inv.png and b/street_signs/textures/street_signs_one_way_left_inv.png differ diff --git a/street_signs/textures/street_signs_one_way_right.png b/street_signs/textures/street_signs_one_way_right.png index 48fa9007..9adde538 100644 Binary files a/street_signs/textures/street_signs_one_way_right.png and b/street_signs/textures/street_signs_one_way_right.png differ diff --git a/street_signs/textures/street_signs_one_way_right_inv.png b/street_signs/textures/street_signs_one_way_right_inv.png index cb51a5fe..1474d827 100644 Binary files a/street_signs/textures/street_signs_one_way_right_inv.png and b/street_signs/textures/street_signs_one_way_right_inv.png differ diff --git a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a.png b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a.png index cade57b5..b946f03e 100644 Binary files a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a.png and b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a.png differ diff --git a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_both_ways.png b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_both_ways.png index d670f24c..439b9cc6 100644 Binary files a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_both_ways.png and b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_both_ways.png differ diff --git a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_both_ways_inv.png b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_both_ways_inv.png index 1a5d35ec..bd24d77a 100644 Binary files a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_both_ways_inv.png and b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_both_ways_inv.png differ diff --git a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_inv.png b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_inv.png index 55267acc..eff34b21 100644 Binary files a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_inv.png and b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_inv.png differ diff --git a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_right.png b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_right.png index 20caa26a..a902c7ce 100644 Binary files a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_right.png and b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_right.png differ diff --git a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_right_inv.png b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_right_inv.png index c7d47319..c8eafe55 100644 Binary files a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_right_inv.png and b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3a_right_inv.png differ diff --git a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3e.png b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3e.png index 3caf6d0a..81a16a52 100644 Binary files a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3e.png and b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3e.png differ diff --git a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3e_inv.png b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3e_inv.png index 03ca96ec..25512d8f 100644 Binary files a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3e_inv.png and b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3e_inv.png differ diff --git a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3e_left.png b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3e_left.png index 6dee2f6c..dd43bf04 100644 Binary files a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3e_left.png and b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3e_left.png differ diff --git a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3e_left_inv.png b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3e_left_inv.png index 3202aee8..8981269f 100644 Binary files a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3e_left_inv.png and b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3e_left_inv.png differ diff --git a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3i.png b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3i.png index d5bcced8..65ff55e4 100644 Binary files a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3i.png and b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3i.png differ diff --git a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3i_inv.png b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3i_inv.png index 1da6142a..3109ba9d 100644 Binary files a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3i_inv.png and b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3i_inv.png differ diff --git a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3i_left.png b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3i_left.png index 98852c4c..c24332de 100644 Binary files a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3i_left.png and b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3i_left.png differ diff --git a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3i_left_inv.png b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3i_left_inv.png index 6695907e..a8363135 100644 Binary files a/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3i_left_inv.png and b/street_signs/textures/street_signs_ped_push_button_to_cross_r10_3i_left_inv.png differ diff --git a/street_signs/textures/street_signs_ped_push_button_to_turn_on_warning_lights.png b/street_signs/textures/street_signs_ped_push_button_to_turn_on_warning_lights.png index 83cdb1a1..4d83a738 100644 Binary files a/street_signs/textures/street_signs_ped_push_button_to_turn_on_warning_lights.png and b/street_signs/textures/street_signs_ped_push_button_to_turn_on_warning_lights.png differ diff --git a/street_signs/textures/street_signs_ped_push_button_to_turn_on_warning_lights_inv.png b/street_signs/textures/street_signs_ped_push_button_to_turn_on_warning_lights_inv.png index 758d2a10..0c1f96aa 100644 Binary files a/street_signs/textures/street_signs_ped_push_button_to_turn_on_warning_lights_inv.png and b/street_signs/textures/street_signs_ped_push_button_to_turn_on_warning_lights_inv.png differ diff --git a/street_signs/textures/street_signs_pedestrian_crossing.png b/street_signs/textures/street_signs_pedestrian_crossing.png index c9876a8f..00599810 100644 Binary files a/street_signs/textures/street_signs_pedestrian_crossing.png and b/street_signs/textures/street_signs_pedestrian_crossing.png differ diff --git a/street_signs/textures/street_signs_pedestrian_crossing_inv.png b/street_signs/textures/street_signs_pedestrian_crossing_inv.png index 2b91c307..6888785a 100644 Binary files a/street_signs/textures/street_signs_pedestrian_crossing_inv.png and b/street_signs/textures/street_signs_pedestrian_crossing_inv.png differ diff --git a/street_signs/textures/street_signs_right_lane_ends.png b/street_signs/textures/street_signs_right_lane_ends.png index 83cb0470..ca6145ce 100644 Binary files a/street_signs/textures/street_signs_right_lane_ends.png and b/street_signs/textures/street_signs_right_lane_ends.png differ diff --git a/street_signs/textures/street_signs_right_lane_ends_inv.png b/street_signs/textures/street_signs_right_lane_ends_inv.png index d60d29c2..a351c66c 100644 Binary files a/street_signs/textures/street_signs_right_lane_ends_inv.png and b/street_signs/textures/street_signs_right_lane_ends_inv.png differ diff --git a/street_signs/textures/street_signs_right_lane_must_turn_right.png b/street_signs/textures/street_signs_right_lane_must_turn_right.png index b47a9956..47f0e590 100644 Binary files a/street_signs/textures/street_signs_right_lane_must_turn_right.png and b/street_signs/textures/street_signs_right_lane_must_turn_right.png differ diff --git a/street_signs/textures/street_signs_right_lane_must_turn_right_inv.png b/street_signs/textures/street_signs_right_lane_must_turn_right_inv.png index 4ae140e6..107c0e82 100644 Binary files a/street_signs/textures/street_signs_right_lane_must_turn_right_inv.png and b/street_signs/textures/street_signs_right_lane_must_turn_right_inv.png differ diff --git a/street_signs/textures/street_signs_right_turn_only.png b/street_signs/textures/street_signs_right_turn_only.png index 7ca3170e..aa09ff6c 100644 Binary files a/street_signs/textures/street_signs_right_turn_only.png and b/street_signs/textures/street_signs_right_turn_only.png differ diff --git a/street_signs/textures/street_signs_right_turn_only_inv.png b/street_signs/textures/street_signs_right_turn_only_inv.png index 08fd6ef2..57335cc4 100644 Binary files a/street_signs/textures/street_signs_right_turn_only_inv.png and b/street_signs/textures/street_signs_right_turn_only_inv.png differ diff --git a/street_signs/textures/street_signs_right_turn_or_straight.png b/street_signs/textures/street_signs_right_turn_or_straight.png index 33abeda7..40b02639 100644 Binary files a/street_signs/textures/street_signs_right_turn_or_straight.png and b/street_signs/textures/street_signs_right_turn_or_straight.png differ diff --git a/street_signs/textures/street_signs_right_turn_or_straight_inv.png b/street_signs/textures/street_signs_right_turn_or_straight_inv.png index 0d3dddc8..706d77ca 100644 Binary files a/street_signs/textures/street_signs_right_turn_or_straight_inv.png and b/street_signs/textures/street_signs_right_turn_or_straight_inv.png differ diff --git a/street_signs/textures/street_signs_road_turns_270_left.png b/street_signs/textures/street_signs_road_turns_270_left.png index 8cf62e3b..d85ce614 100644 Binary files a/street_signs/textures/street_signs_road_turns_270_left.png and b/street_signs/textures/street_signs_road_turns_270_left.png differ diff --git a/street_signs/textures/street_signs_road_turns_270_left_inv.png b/street_signs/textures/street_signs_road_turns_270_left_inv.png index 084022df..9f9e2fdd 100644 Binary files a/street_signs/textures/street_signs_road_turns_270_left_inv.png and b/street_signs/textures/street_signs_road_turns_270_left_inv.png differ diff --git a/street_signs/textures/street_signs_road_turns_270_right.png b/street_signs/textures/street_signs_road_turns_270_right.png index 9ef761fa..6f628589 100644 Binary files a/street_signs/textures/street_signs_road_turns_270_right.png and b/street_signs/textures/street_signs_road_turns_270_right.png differ diff --git a/street_signs/textures/street_signs_road_turns_270_right_inv.png b/street_signs/textures/street_signs_road_turns_270_right_inv.png index 3b52b2f3..7088fab9 100644 Binary files a/street_signs/textures/street_signs_road_turns_270_right_inv.png and b/street_signs/textures/street_signs_road_turns_270_right_inv.png differ diff --git a/street_signs/textures/street_signs_road_turns_dog_leg_curve_left.png b/street_signs/textures/street_signs_road_turns_dog_leg_curve_left.png index 60654f38..a65178de 100644 Binary files a/street_signs/textures/street_signs_road_turns_dog_leg_curve_left.png and b/street_signs/textures/street_signs_road_turns_dog_leg_curve_left.png differ diff --git a/street_signs/textures/street_signs_road_turns_dog_leg_curve_left_inv.png b/street_signs/textures/street_signs_road_turns_dog_leg_curve_left_inv.png index 730eade5..bcdde752 100644 Binary files a/street_signs/textures/street_signs_road_turns_dog_leg_curve_left_inv.png and b/street_signs/textures/street_signs_road_turns_dog_leg_curve_left_inv.png differ diff --git a/street_signs/textures/street_signs_road_turns_dog_leg_curve_right.png b/street_signs/textures/street_signs_road_turns_dog_leg_curve_right.png index 3fc8d0e2..6c27e33e 100644 Binary files a/street_signs/textures/street_signs_road_turns_dog_leg_curve_right.png and b/street_signs/textures/street_signs_road_turns_dog_leg_curve_right.png differ diff --git a/street_signs/textures/street_signs_road_turns_dog_leg_curve_right_inv.png b/street_signs/textures/street_signs_road_turns_dog_leg_curve_right_inv.png index e021929e..52d71f9c 100644 Binary files a/street_signs/textures/street_signs_road_turns_dog_leg_curve_right_inv.png and b/street_signs/textures/street_signs_road_turns_dog_leg_curve_right_inv.png differ diff --git a/street_signs/textures/street_signs_road_turns_dog_leg_left.png b/street_signs/textures/street_signs_road_turns_dog_leg_left.png index f6881fa2..89a1e7d5 100644 Binary files a/street_signs/textures/street_signs_road_turns_dog_leg_left.png and b/street_signs/textures/street_signs_road_turns_dog_leg_left.png differ diff --git a/street_signs/textures/street_signs_road_turns_dog_leg_left_inv.png b/street_signs/textures/street_signs_road_turns_dog_leg_left_inv.png index d83a1530..c3c03603 100644 Binary files a/street_signs/textures/street_signs_road_turns_dog_leg_left_inv.png and b/street_signs/textures/street_signs_road_turns_dog_leg_left_inv.png differ diff --git a/street_signs/textures/street_signs_road_turns_dog_leg_right.png b/street_signs/textures/street_signs_road_turns_dog_leg_right.png index fc268900..1a25cf28 100644 Binary files a/street_signs/textures/street_signs_road_turns_dog_leg_right.png and b/street_signs/textures/street_signs_road_turns_dog_leg_right.png differ diff --git a/street_signs/textures/street_signs_road_turns_dog_leg_right_inv.png b/street_signs/textures/street_signs_road_turns_dog_leg_right_inv.png index cf12c604..f071f52d 100644 Binary files a/street_signs/textures/street_signs_road_turns_dog_leg_right_inv.png and b/street_signs/textures/street_signs_road_turns_dog_leg_right_inv.png differ diff --git a/street_signs/textures/street_signs_road_turns_hairpin_left.png b/street_signs/textures/street_signs_road_turns_hairpin_left.png index 3b0ee4e0..997c2191 100644 Binary files a/street_signs/textures/street_signs_road_turns_hairpin_left.png and b/street_signs/textures/street_signs_road_turns_hairpin_left.png differ diff --git a/street_signs/textures/street_signs_road_turns_hairpin_left_inv.png b/street_signs/textures/street_signs_road_turns_hairpin_left_inv.png index 6d39eacb..bd5412a8 100644 Binary files a/street_signs/textures/street_signs_road_turns_hairpin_left_inv.png and b/street_signs/textures/street_signs_road_turns_hairpin_left_inv.png differ diff --git a/street_signs/textures/street_signs_road_turns_hairpin_right.png b/street_signs/textures/street_signs_road_turns_hairpin_right.png index e77da841..6ffde17f 100644 Binary files a/street_signs/textures/street_signs_road_turns_hairpin_right.png and b/street_signs/textures/street_signs_road_turns_hairpin_right.png differ diff --git a/street_signs/textures/street_signs_road_turns_hairpin_right_inv.png b/street_signs/textures/street_signs_road_turns_hairpin_right_inv.png index 603b4573..00fff8c9 100644 Binary files a/street_signs/textures/street_signs_road_turns_hairpin_right_inv.png and b/street_signs/textures/street_signs_road_turns_hairpin_right_inv.png differ diff --git a/street_signs/textures/street_signs_road_turns_left.png b/street_signs/textures/street_signs_road_turns_left.png index 521195ba..8dfead1f 100644 Binary files a/street_signs/textures/street_signs_road_turns_left.png and b/street_signs/textures/street_signs_road_turns_left.png differ diff --git a/street_signs/textures/street_signs_road_turns_left_inv.png b/street_signs/textures/street_signs_road_turns_left_inv.png index 4654eb8a..1b0219c0 100644 Binary files a/street_signs/textures/street_signs_road_turns_left_inv.png and b/street_signs/textures/street_signs_road_turns_left_inv.png differ diff --git a/street_signs/textures/street_signs_road_turns_right.png b/street_signs/textures/street_signs_road_turns_right.png index 8e695ad1..a96670dc 100644 Binary files a/street_signs/textures/street_signs_road_turns_right.png and b/street_signs/textures/street_signs_road_turns_right.png differ diff --git a/street_signs/textures/street_signs_road_turns_right_inv.png b/street_signs/textures/street_signs_road_turns_right_inv.png index 334d4850..3f7ac039 100644 Binary files a/street_signs/textures/street_signs_road_turns_right_inv.png and b/street_signs/textures/street_signs_road_turns_right_inv.png differ diff --git a/street_signs/textures/street_signs_road_turns_sharp_left.png b/street_signs/textures/street_signs_road_turns_sharp_left.png index 5e068582..9bc2998b 100644 Binary files a/street_signs/textures/street_signs_road_turns_sharp_left.png and b/street_signs/textures/street_signs_road_turns_sharp_left.png differ diff --git a/street_signs/textures/street_signs_road_turns_sharp_left_inv.png b/street_signs/textures/street_signs_road_turns_sharp_left_inv.png index 0e4a3626..2bc91e9f 100644 Binary files a/street_signs/textures/street_signs_road_turns_sharp_left_inv.png and b/street_signs/textures/street_signs_road_turns_sharp_left_inv.png differ diff --git a/street_signs/textures/street_signs_road_turns_sharp_right.png b/street_signs/textures/street_signs_road_turns_sharp_right.png index 54ede850..a1893beb 100644 Binary files a/street_signs/textures/street_signs_road_turns_sharp_right.png and b/street_signs/textures/street_signs_road_turns_sharp_right.png differ diff --git a/street_signs/textures/street_signs_road_turns_sharp_right_inv.png b/street_signs/textures/street_signs_road_turns_sharp_right_inv.png index 76fa53f8..573bd70a 100644 Binary files a/street_signs/textures/street_signs_road_turns_sharp_right_inv.png and b/street_signs/textures/street_signs_road_turns_sharp_right_inv.png differ diff --git a/street_signs/textures/street_signs_road_winding.png b/street_signs/textures/street_signs_road_winding.png index b1bc51f1..dd22478c 100644 Binary files a/street_signs/textures/street_signs_road_winding.png and b/street_signs/textures/street_signs_road_winding.png differ diff --git a/street_signs/textures/street_signs_road_winding_inv.png b/street_signs/textures/street_signs_road_winding_inv.png index d74a99c9..110861c7 100644 Binary files a/street_signs/textures/street_signs_road_winding_inv.png and b/street_signs/textures/street_signs_road_winding_inv.png differ diff --git a/street_signs/textures/street_signs_roundabout_clockwise.png b/street_signs/textures/street_signs_roundabout_clockwise.png index 01824000..8648ef18 100644 Binary files a/street_signs/textures/street_signs_roundabout_clockwise.png and b/street_signs/textures/street_signs_roundabout_clockwise.png differ diff --git a/street_signs/textures/street_signs_roundabout_clockwise_inv.png b/street_signs/textures/street_signs_roundabout_clockwise_inv.png index 27d1ba1e..2fda33ca 100644 Binary files a/street_signs/textures/street_signs_roundabout_clockwise_inv.png and b/street_signs/textures/street_signs_roundabout_clockwise_inv.png differ diff --git a/street_signs/textures/street_signs_roundabout_counter_clockwise.png b/street_signs/textures/street_signs_roundabout_counter_clockwise.png index b17138a0..b0c12311 100644 Binary files a/street_signs/textures/street_signs_roundabout_counter_clockwise.png and b/street_signs/textures/street_signs_roundabout_counter_clockwise.png differ diff --git a/street_signs/textures/street_signs_roundabout_counter_clockwise_inv.png b/street_signs/textures/street_signs_roundabout_counter_clockwise_inv.png index e8d6f3ce..acd64dc1 100644 Binary files a/street_signs/textures/street_signs_roundabout_counter_clockwise_inv.png and b/street_signs/textures/street_signs_roundabout_counter_clockwise_inv.png differ diff --git a/street_signs/textures/street_signs_roundabout_directional.png b/street_signs/textures/street_signs_roundabout_directional.png index d7c5e7b8..ee5d075b 100644 Binary files a/street_signs/textures/street_signs_roundabout_directional.png and b/street_signs/textures/street_signs_roundabout_directional.png differ diff --git a/street_signs/textures/street_signs_roundabout_directional_inv.png b/street_signs/textures/street_signs_roundabout_directional_inv.png index 8d644908..2e574a8c 100644 Binary files a/street_signs/textures/street_signs_roundabout_directional_inv.png and b/street_signs/textures/street_signs_roundabout_directional_inv.png differ diff --git a/street_signs/textures/street_signs_roundabout_directional_left.png b/street_signs/textures/street_signs_roundabout_directional_left.png index cdd43a5b..e57bf4a9 100644 Binary files a/street_signs/textures/street_signs_roundabout_directional_left.png and b/street_signs/textures/street_signs_roundabout_directional_left.png differ diff --git a/street_signs/textures/street_signs_roundabout_directional_left_inv.png b/street_signs/textures/street_signs_roundabout_directional_left_inv.png index bc02c211..05528df6 100644 Binary files a/street_signs/textures/street_signs_roundabout_directional_left_inv.png and b/street_signs/textures/street_signs_roundabout_directional_left_inv.png differ diff --git a/street_signs/textures/street_signs_rr_exempt_r15_3p.png b/street_signs/textures/street_signs_rr_exempt_r15_3p.png index 7a499295..03a61537 100644 Binary files a/street_signs/textures/street_signs_rr_exempt_r15_3p.png and b/street_signs/textures/street_signs_rr_exempt_r15_3p.png differ diff --git a/street_signs/textures/street_signs_rr_exempt_r15_3p_inv.png b/street_signs/textures/street_signs_rr_exempt_r15_3p_inv.png index 6aa8a499..350e674b 100644 Binary files a/street_signs/textures/street_signs_rr_exempt_r15_3p_inv.png and b/street_signs/textures/street_signs_rr_exempt_r15_3p_inv.png differ diff --git a/street_signs/textures/street_signs_rr_exempt_w10_1ap.png b/street_signs/textures/street_signs_rr_exempt_w10_1ap.png index 9f2c8b72..7e008189 100644 Binary files a/street_signs/textures/street_signs_rr_exempt_w10_1ap.png and b/street_signs/textures/street_signs_rr_exempt_w10_1ap.png differ diff --git a/street_signs/textures/street_signs_rr_exempt_w10_1ap_inv.png b/street_signs/textures/street_signs_rr_exempt_w10_1ap_inv.png index 9d60eacf..fc2b9168 100644 Binary files a/street_signs/textures/street_signs_rr_exempt_w10_1ap_inv.png and b/street_signs/textures/street_signs_rr_exempt_w10_1ap_inv.png differ diff --git a/street_signs/textures/street_signs_rr_grade_crossbuck.png b/street_signs/textures/street_signs_rr_grade_crossbuck.png index 1d75ded2..ba4faa3a 100644 Binary files a/street_signs/textures/street_signs_rr_grade_crossbuck.png and b/street_signs/textures/street_signs_rr_grade_crossbuck.png differ diff --git a/street_signs/textures/street_signs_rr_grade_crossbuck_inv.png b/street_signs/textures/street_signs_rr_grade_crossbuck_inv.png index d1ec9303..2c376b12 100644 Binary files a/street_signs/textures/street_signs_rr_grade_crossbuck_inv.png and b/street_signs/textures/street_signs_rr_grade_crossbuck_inv.png differ diff --git a/street_signs/textures/street_signs_rr_grade_crossing_advance.png b/street_signs/textures/street_signs_rr_grade_crossing_advance.png index 471b04b5..717a6134 100644 Binary files a/street_signs/textures/street_signs_rr_grade_crossing_advance.png and b/street_signs/textures/street_signs_rr_grade_crossing_advance.png differ diff --git a/street_signs/textures/street_signs_rr_grade_crossing_advance_inv.png b/street_signs/textures/street_signs_rr_grade_crossing_advance_inv.png index 0db17f91..fd221fec 100644 Binary files a/street_signs/textures/street_signs_rr_grade_crossing_advance_inv.png and b/street_signs/textures/street_signs_rr_grade_crossing_advance_inv.png differ diff --git a/street_signs/textures/street_signs_service_ev_charging.png b/street_signs/textures/street_signs_service_ev_charging.png index dbc866c2..1fcdce21 100644 Binary files a/street_signs/textures/street_signs_service_ev_charging.png and b/street_signs/textures/street_signs_service_ev_charging.png differ diff --git a/street_signs/textures/street_signs_service_ev_charging_inv.png b/street_signs/textures/street_signs_service_ev_charging_inv.png index f25e71ea..f974f93e 100644 Binary files a/street_signs/textures/street_signs_service_ev_charging_inv.png and b/street_signs/textures/street_signs_service_ev_charging_inv.png differ diff --git a/street_signs/textures/street_signs_service_food.png b/street_signs/textures/street_signs_service_food.png index 43645463..2fb55ac9 100644 Binary files a/street_signs/textures/street_signs_service_food.png and b/street_signs/textures/street_signs_service_food.png differ diff --git a/street_signs/textures/street_signs_service_food_inv.png b/street_signs/textures/street_signs_service_food_inv.png index 0376aa2d..665a2f9f 100644 Binary files a/street_signs/textures/street_signs_service_food_inv.png and b/street_signs/textures/street_signs_service_food_inv.png differ diff --git a/street_signs/textures/street_signs_service_fuel.png b/street_signs/textures/street_signs_service_fuel.png index 6194db62..fb569de6 100644 Binary files a/street_signs/textures/street_signs_service_fuel.png and b/street_signs/textures/street_signs_service_fuel.png differ diff --git a/street_signs/textures/street_signs_service_fuel_inv.png b/street_signs/textures/street_signs_service_fuel_inv.png index bb5c952c..de67d403 100644 Binary files a/street_signs/textures/street_signs_service_fuel_inv.png and b/street_signs/textures/street_signs_service_fuel_inv.png differ diff --git a/street_signs/textures/street_signs_service_handicapped.png b/street_signs/textures/street_signs_service_handicapped.png index d6c07f11..6e526472 100644 Binary files a/street_signs/textures/street_signs_service_handicapped.png and b/street_signs/textures/street_signs_service_handicapped.png differ diff --git a/street_signs/textures/street_signs_service_handicapped_inv.png b/street_signs/textures/street_signs_service_handicapped_inv.png index 55909361..b9335d0a 100644 Binary files a/street_signs/textures/street_signs_service_handicapped_inv.png and b/street_signs/textures/street_signs_service_handicapped_inv.png differ diff --git a/street_signs/textures/street_signs_service_hospital.png b/street_signs/textures/street_signs_service_hospital.png index c5226837..4b40725c 100644 Binary files a/street_signs/textures/street_signs_service_hospital.png and b/street_signs/textures/street_signs_service_hospital.png differ diff --git a/street_signs/textures/street_signs_service_hospital_inv.png b/street_signs/textures/street_signs_service_hospital_inv.png index f3fbe482..1bcc8b03 100644 Binary files a/street_signs/textures/street_signs_service_hospital_inv.png and b/street_signs/textures/street_signs_service_hospital_inv.png differ diff --git a/street_signs/textures/street_signs_service_lodging.png b/street_signs/textures/street_signs_service_lodging.png index 8f5933d8..126fbc76 100644 Binary files a/street_signs/textures/street_signs_service_lodging.png and b/street_signs/textures/street_signs_service_lodging.png differ diff --git a/street_signs/textures/street_signs_service_lodging_inv.png b/street_signs/textures/street_signs_service_lodging_inv.png index ac6d82ea..142ab4bd 100644 Binary files a/street_signs/textures/street_signs_service_lodging_inv.png and b/street_signs/textures/street_signs_service_lodging_inv.png differ diff --git a/street_signs/textures/street_signs_side_road_left_ahead.png b/street_signs/textures/street_signs_side_road_left_ahead.png index 5b71794b..43e557c6 100644 Binary files a/street_signs/textures/street_signs_side_road_left_ahead.png and b/street_signs/textures/street_signs_side_road_left_ahead.png differ diff --git a/street_signs/textures/street_signs_side_road_left_ahead_inv.png b/street_signs/textures/street_signs_side_road_left_ahead_inv.png index 5f753fe9..94b6cbce 100644 Binary files a/street_signs/textures/street_signs_side_road_left_ahead_inv.png and b/street_signs/textures/street_signs_side_road_left_ahead_inv.png differ diff --git a/street_signs/textures/street_signs_side_road_right_ahead.png b/street_signs/textures/street_signs_side_road_right_ahead.png index f63f9565..1d2b01aa 100644 Binary files a/street_signs/textures/street_signs_side_road_right_ahead.png and b/street_signs/textures/street_signs_side_road_right_ahead.png differ diff --git a/street_signs/textures/street_signs_side_road_right_ahead_inv.png b/street_signs/textures/street_signs_side_road_right_ahead_inv.png index 8ab999d2..18759725 100644 Binary files a/street_signs/textures/street_signs_side_road_right_ahead_inv.png and b/street_signs/textures/street_signs_side_road_right_ahead_inv.png differ diff --git a/street_signs/textures/street_signs_sign_edge.png b/street_signs/textures/street_signs_sign_edge.png index 42c1f179..9a843137 100644 Binary files a/street_signs/textures/street_signs_sign_edge.png and b/street_signs/textures/street_signs_sign_edge.png differ diff --git a/street_signs/textures/street_signs_signal_ahead.png b/street_signs/textures/street_signs_signal_ahead.png index 8b9c833d..de062f9d 100644 Binary files a/street_signs/textures/street_signs_signal_ahead.png and b/street_signs/textures/street_signs_signal_ahead.png differ diff --git a/street_signs/textures/street_signs_signal_ahead_inv.png b/street_signs/textures/street_signs_signal_ahead_inv.png index 27d39cca..c5643829 100644 Binary files a/street_signs/textures/street_signs_signal_ahead_inv.png and b/street_signs/textures/street_signs_signal_ahead_inv.png differ diff --git a/street_signs/textures/street_signs_speed_limit.png b/street_signs/textures/street_signs_speed_limit.png index 8c055acc..288d1d20 100644 Binary files a/street_signs/textures/street_signs_speed_limit.png and b/street_signs/textures/street_signs_speed_limit.png differ diff --git a/street_signs/textures/street_signs_speed_limit_inv.png b/street_signs/textures/street_signs_speed_limit_inv.png index 2c0598be..df3fa556 100644 Binary files a/street_signs/textures/street_signs_speed_limit_inv.png and b/street_signs/textures/street_signs_speed_limit_inv.png differ diff --git a/street_signs/textures/street_signs_stop.png b/street_signs/textures/street_signs_stop.png index c77c073c..29b9cb6d 100644 Binary files a/street_signs/textures/street_signs_stop.png and b/street_signs/textures/street_signs_stop.png differ diff --git a/street_signs/textures/street_signs_stop_ahead.png b/street_signs/textures/street_signs_stop_ahead.png index 8da97c9f..3eaf8fe3 100644 Binary files a/street_signs/textures/street_signs_stop_ahead.png and b/street_signs/textures/street_signs_stop_ahead.png differ diff --git a/street_signs/textures/street_signs_stop_ahead_inv.png b/street_signs/textures/street_signs_stop_ahead_inv.png index a4e09c07..38435db5 100644 Binary files a/street_signs/textures/street_signs_stop_ahead_inv.png and b/street_signs/textures/street_signs_stop_ahead_inv.png differ diff --git a/street_signs/textures/street_signs_stop_all_way_inv.png b/street_signs/textures/street_signs_stop_all_way_inv.png index 0f0f9fc8..1f89655b 100644 Binary files a/street_signs/textures/street_signs_stop_all_way_inv.png and b/street_signs/textures/street_signs_stop_all_way_inv.png differ diff --git a/street_signs/textures/street_signs_stop_for_ped.png b/street_signs/textures/street_signs_stop_for_ped.png index 51295271..901e5a90 100644 Binary files a/street_signs/textures/street_signs_stop_for_ped.png and b/street_signs/textures/street_signs_stop_for_ped.png differ diff --git a/street_signs/textures/street_signs_stop_for_ped_inv.png b/street_signs/textures/street_signs_stop_for_ped_inv.png index 0ec854b0..c9100380 100644 Binary files a/street_signs/textures/street_signs_stop_for_ped_inv.png and b/street_signs/textures/street_signs_stop_for_ped_inv.png differ diff --git a/street_signs/textures/street_signs_stop_here_on_red.png b/street_signs/textures/street_signs_stop_here_on_red.png index ccd3b9b1..e0f6d2fc 100644 Binary files a/street_signs/textures/street_signs_stop_here_on_red.png and b/street_signs/textures/street_signs_stop_here_on_red.png differ diff --git a/street_signs/textures/street_signs_stop_here_on_red_inv.png b/street_signs/textures/street_signs_stop_here_on_red_inv.png index dd0d5a83..8dd2b222 100644 Binary files a/street_signs/textures/street_signs_stop_here_on_red_inv.png and b/street_signs/textures/street_signs_stop_here_on_red_inv.png differ diff --git a/street_signs/textures/street_signs_stop_inv.png b/street_signs/textures/street_signs_stop_inv.png index 8c1e8ff2..18677487 100644 Binary files a/street_signs/textures/street_signs_stop_inv.png and b/street_signs/textures/street_signs_stop_inv.png differ diff --git a/street_signs/textures/street_signs_straight_through_only.png b/street_signs/textures/street_signs_straight_through_only.png index bb395bc6..31c46d3d 100644 Binary files a/street_signs/textures/street_signs_straight_through_only.png and b/street_signs/textures/street_signs_straight_through_only.png differ diff --git a/street_signs/textures/street_signs_straight_through_only_inv.png b/street_signs/textures/street_signs_straight_through_only_inv.png index 34e6c740..8040bbe5 100644 Binary files a/street_signs/textures/street_signs_straight_through_only_inv.png and b/street_signs/textures/street_signs_straight_through_only_inv.png differ diff --git a/street_signs/textures/street_signs_t_junction_ahead.png b/street_signs/textures/street_signs_t_junction_ahead.png index 7a6e2920..67fa4dbd 100644 Binary files a/street_signs/textures/street_signs_t_junction_ahead.png and b/street_signs/textures/street_signs_t_junction_ahead.png differ diff --git a/street_signs/textures/street_signs_t_junction_ahead_inv.png b/street_signs/textures/street_signs_t_junction_ahead_inv.png index afa164ea..45b91522 100644 Binary files a/street_signs/textures/street_signs_t_junction_ahead_inv.png and b/street_signs/textures/street_signs_t_junction_ahead_inv.png differ diff --git a/street_signs/textures/street_signs_two_direction_large_arrow.png b/street_signs/textures/street_signs_two_direction_large_arrow.png index 4de0342a..2d83ee70 100644 Binary files a/street_signs/textures/street_signs_two_direction_large_arrow.png and b/street_signs/textures/street_signs_two_direction_large_arrow.png differ diff --git a/street_signs/textures/street_signs_two_direction_large_arrow_inv.png b/street_signs/textures/street_signs_two_direction_large_arrow_inv.png index 9a895cfe..6060953c 100644 Binary files a/street_signs/textures/street_signs_two_direction_large_arrow_inv.png and b/street_signs/textures/street_signs_two_direction_large_arrow_inv.png differ diff --git a/street_signs/textures/street_signs_two_way_traffic.png b/street_signs/textures/street_signs_two_way_traffic.png index 40b4aee1..8131240a 100644 Binary files a/street_signs/textures/street_signs_two_way_traffic.png and b/street_signs/textures/street_signs_two_way_traffic.png differ diff --git a/street_signs/textures/street_signs_two_way_traffic_inv.png b/street_signs/textures/street_signs_two_way_traffic_inv.png index 3d8de3d4..071bf7ab 100644 Binary files a/street_signs/textures/street_signs_two_way_traffic_inv.png and b/street_signs/textures/street_signs_two_way_traffic_inv.png differ diff --git a/street_signs/textures/street_signs_u_turn_here.png b/street_signs/textures/street_signs_u_turn_here.png index 2eabc42d..cd4aab2d 100644 Binary files a/street_signs/textures/street_signs_u_turn_here.png and b/street_signs/textures/street_signs_u_turn_here.png differ diff --git a/street_signs/textures/street_signs_u_turn_here_inv.png b/street_signs/textures/street_signs_u_turn_here_inv.png index 9b7a48e8..16de861b 100644 Binary files a/street_signs/textures/street_signs_u_turn_here_inv.png and b/street_signs/textures/street_signs_u_turn_here_inv.png differ diff --git a/street_signs/textures/street_signs_us_interstate.png b/street_signs/textures/street_signs_us_interstate.png index 30bfc560..44ff86a6 100644 Binary files a/street_signs/textures/street_signs_us_interstate.png and b/street_signs/textures/street_signs_us_interstate.png differ diff --git a/street_signs/textures/street_signs_us_interstate_inv.png b/street_signs/textures/street_signs_us_interstate_inv.png index 4fac75f9..2b0b9bc9 100644 Binary files a/street_signs/textures/street_signs_us_interstate_inv.png and b/street_signs/textures/street_signs_us_interstate_inv.png differ diff --git a/street_signs/textures/street_signs_us_route.png b/street_signs/textures/street_signs_us_route.png index 7caa0c6a..349f69b3 100644 Binary files a/street_signs/textures/street_signs_us_route.png and b/street_signs/textures/street_signs_us_route.png differ diff --git a/street_signs/textures/street_signs_us_route_inv.png b/street_signs/textures/street_signs_us_route_inv.png index d4d4fb6c..48dea96d 100644 Binary files a/street_signs/textures/street_signs_us_route_inv.png and b/street_signs/textures/street_signs_us_route_inv.png differ diff --git a/street_signs/textures/street_signs_use_lane_with_green_arrow.png b/street_signs/textures/street_signs_use_lane_with_green_arrow.png index a4ce1259..20985895 100644 Binary files a/street_signs/textures/street_signs_use_lane_with_green_arrow.png and b/street_signs/textures/street_signs_use_lane_with_green_arrow.png differ diff --git a/street_signs/textures/street_signs_use_lane_with_green_arrow_inv.png b/street_signs/textures/street_signs_use_lane_with_green_arrow_inv.png index b331518e..b41ca328 100644 Binary files a/street_signs/textures/street_signs_use_lane_with_green_arrow_inv.png and b/street_signs/textures/street_signs_use_lane_with_green_arrow_inv.png differ diff --git a/street_signs/textures/street_signs_warning.png b/street_signs/textures/street_signs_warning.png index 2d46e427..7920bf9b 100644 Binary files a/street_signs/textures/street_signs_warning.png and b/street_signs/textures/street_signs_warning.png differ diff --git a/street_signs/textures/street_signs_warning_3_line_inv.png b/street_signs/textures/street_signs_warning_3_line_inv.png index 3fd5276b..fb41b405 100644 Binary files a/street_signs/textures/street_signs_warning_3_line_inv.png and b/street_signs/textures/street_signs_warning_3_line_inv.png differ diff --git a/street_signs/textures/street_signs_warning_4_line_inv.png b/street_signs/textures/street_signs_warning_4_line_inv.png index 6336cb94..a6c82333 100644 Binary files a/street_signs/textures/street_signs_warning_4_line_inv.png and b/street_signs/textures/street_signs_warning_4_line_inv.png differ diff --git a/street_signs/textures/street_signs_warning_orange.png b/street_signs/textures/street_signs_warning_orange.png index 53238635..236b5f84 100644 Binary files a/street_signs/textures/street_signs_warning_orange.png and b/street_signs/textures/street_signs_warning_orange.png differ diff --git a/street_signs/textures/street_signs_warning_orange_3_line_inv.png b/street_signs/textures/street_signs_warning_orange_3_line_inv.png index 2aa9b1b3..50b2dfd3 100644 Binary files a/street_signs/textures/street_signs_warning_orange_3_line_inv.png and b/street_signs/textures/street_signs_warning_orange_3_line_inv.png differ diff --git a/street_signs/textures/street_signs_warning_orange_4_line_inv.png b/street_signs/textures/street_signs_warning_orange_4_line_inv.png index 35b041c9..52ebef12 100644 Binary files a/street_signs/textures/street_signs_warning_orange_4_line_inv.png and b/street_signs/textures/street_signs_warning_orange_4_line_inv.png differ diff --git a/street_signs/textures/street_signs_wrong_way.png b/street_signs/textures/street_signs_wrong_way.png index 8d330ab8..ccfed46e 100644 Binary files a/street_signs/textures/street_signs_wrong_way.png and b/street_signs/textures/street_signs_wrong_way.png differ diff --git a/street_signs/textures/street_signs_wrong_way_inv.png b/street_signs/textures/street_signs_wrong_way_inv.png index 71603025..054e8f2c 100644 Binary files a/street_signs/textures/street_signs_wrong_way_inv.png and b/street_signs/textures/street_signs_wrong_way_inv.png differ diff --git a/street_signs/textures/street_signs_yield.png b/street_signs/textures/street_signs_yield.png index 48572ea8..69fbf6c0 100644 Binary files a/street_signs/textures/street_signs_yield.png and b/street_signs/textures/street_signs_yield.png differ diff --git a/street_signs/textures/street_signs_yield_ahead.png b/street_signs/textures/street_signs_yield_ahead.png index 389368bd..b0504bff 100644 Binary files a/street_signs/textures/street_signs_yield_ahead.png and b/street_signs/textures/street_signs_yield_ahead.png differ diff --git a/street_signs/textures/street_signs_yield_ahead_inv.png b/street_signs/textures/street_signs_yield_ahead_inv.png index d2e4feb6..4b35fc8d 100644 Binary files a/street_signs/textures/street_signs_yield_ahead_inv.png and b/street_signs/textures/street_signs_yield_ahead_inv.png differ diff --git a/street_signs/textures/street_signs_yield_inv.png b/street_signs/textures/street_signs_yield_inv.png index e8753a80..79a8b904 100644 Binary files a/street_signs/textures/street_signs_yield_inv.png and b/street_signs/textures/street_signs_yield_inv.png differ diff --git a/technic/machines/register/cables.lua b/technic/machines/register/cables.lua index 63ee851f..1c609f7c 100644 --- a/technic/machines/register/cables.lua +++ b/technic/machines/register/cables.lua @@ -215,7 +215,7 @@ function technic.register_cable(tier, size) if i == 1 then def.on_place = function(itemstack, placer, pointed_thing) local pointed_thing_diff = vector.subtract(pointed_thing.above, pointed_thing.under) - local num + local num = 1 local changed for k, v in pairs(pointed_thing_diff) do if v ~= 0 then @@ -225,7 +225,7 @@ function technic.register_cable(tier, size) end end local crtl = placer:get_player_control() - if (crtl.aux1 or crtl.sneak) and not (crtl.aux1 and crtl.sneak) then + if (crtl.aux1 or crtl.sneak) and not (crtl.aux1 and crtl.sneak) and changed then local fine_pointed = minetest.pointed_thing_to_face_pos(placer, pointed_thing) fine_pointed = vector.subtract(fine_pointed, pointed_thing.above) fine_pointed[changed] = nil diff --git a/teleport_request/LICENSE.md b/teleport_request/LICENSE.md deleted file mode 100644 index 8000a6fa..00000000 --- a/teleport_request/LICENSE.md +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random - Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/teleport_request/README.md b/teleport_request/README.md deleted file mode 100644 index 300d08b4..00000000 --- a/teleport_request/README.md +++ /dev/null @@ -1,144 +0,0 @@ -# Teleport Request - -[![](https://github.com/ChaosWormz/teleport-request/workflows/Check%20&%20Release/badge.svg)](https://github.com/ChaosWormz/teleport-request/actions) -[![License](https://img.shields.io/badge/license-LGPLv2.1%2B-blue.svg)](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html) - -Allows players to request from another player to be teleported to them. - -## Privileges -Each command needs a privilege. These are the following privileges: -- `tp` is required in order to use all commands. -- `tp_tpc` is required in order to use `/tpc`. -- `tp_tpc` is required in order to use `/tpe`. -- `tp_tpc` is required in order to use `/tpj`. -- `interact` is required to use all commands. -- `tp_admin` gives more control to admins: - - Admins can teleport to players even when they haven't decided to accept, or not. - - Admins can teleport players to him/her, if the `enable_immediate_teleport` setting is enabled. - - Admins can teleport to protected coordinates. - -Players can also teleport to coordinates, however, if the area is protected, the teleport will be denied. - -## How to use -Each command does a function. "**Example usage**" is an example of how to use the command. -Note there must be 2 players in order to make the commands to work: a player must send a request to another player. - -There are two ways of sending a request: -1. A request which teleports you to the specified player (command `/tpr `). -2. A request which teleports the specified player to you (command `/tphr `). - -To accept a request some sent you, you must use `/tpy`. -These are the following commands available in-game: - -``` /tpr [playername] ``` -- **Name:** Teleport Request -- **Description:** Requests permission to teleport to another player, where [playername] is their exact name. -- **Required privileges:** `interact, tp` -- **Example usage:** `/tpr RobbieF` requests permission from RobbieF to teleport to them. -- **Notes:** Usernames are case-sensitive. If you have the `tp_admin` privilege, you will immediately teleport to the specificed player (does not apply if `enable_immediate_teleport` setting is disabled, enabled by default). - -``` /tphr [playername] ``` -- **Name:** Teleport Here Request -- **Description:** Request permission to teleport another player to you. -- **Required privileges:** `interact, tp` -- **Example usage:** `/tphr RobbieF` requests RobbieF to teleport to you. -- **Notes:** Usernames are case-sensitive. If you have the `tp_admin` privilege, RobbieF will teleport to you immediately (does not apply if `enable_immediate_teleport` setting is disabled, enabled by default). - -``` /tpc [x,y,z] ``` -- **Name:** Teleport to Coordinates -- **Description:** Teleport to coordinates. -- **Required privileges:** `interact, tp_tpc, tp` -- **Notes:** Honors area protection. If the area is protected, it must be owned by you in order to teleport to it, or you must have the `areas` privilege in order to teleport to those coordinates. - -``` /tpj [axis] [distance] ``` -- **Name:** Teleport Jump -- **Description:** Teleport a specified distance along a single specified axis. -- **Required privilege:** `interact", tp, tp_tpc` -- **Available options for *axis*:** x, y, z -- **Example usage:** `/tpj y 10` teleport 10 nodes into the air. - -``` /tpe ``` -- **Name:** Teleport Evade -- **Description:** In a sticky situation? Evade your enemy by teleporting to several nearby coordinates in random pattern. There's no knowing where you'll end up. -- **Required privileges:** `interact, tp_tpc, tp` -- **Example usage:** `/tpe` teleports you to a random number of random coordinates in an evasive pattern. - -``` /tpy ``` -- **Description:** Accept a user's request to teleport to you or teleport you to them. -- **Required privileges:** `interact, tp` - -``` /tpn ``` -- **Description:** Deny a user's request to teleport to you or teleport you to them. -- **Required privileges:** `interact, tp` - -## Optional dependencies -- [areas](https://github.com/minetest-mods/areas) -- [intllib](https://github.com/minetest-mods/intllib) -- [beerchat](https://github.com/minetest-beerchat/beerchat) -- [chat2](https://github.com/minetest-mods/chat2) -- [gamehub](https://github.com/shivajiva101/minetest-gamehub) - -## Requirements -This mod requires MT 5.0.0+ to run. -Older versions not supported. - -## Issues, suggestions, features & bugfixes -Report bugs or suggest ideas by [creating an issue](https://github.com/ChaosWormz/teleport-request/issues/new). -If you know how to fix an issue, or want something to be added, consider opening a [pull request](https://github.com/ChaosWormz/teleport-request/compare). - -## License -Copyright (C) 2014-2020 ChaosWormz and contributors. - -Teleport Request code is licensed under LGPLv2.1+, see [`LICENSE.md`](LICENSE.md). -[`tpr_warp.ogg`](sounds/tpr_warp.ogg) is licensed under [CC BY-SA 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). - -## Contributors -List of contributors (in no particular order): - -- [RobbieF](https://minetest.tv) | [GitHub](https://github.com/Cat5TV) -- [DonBatman](https://github.com/donbatman) -- [NathanS21](http://nathansalapat.com/) | [GitHub](https://github.com/NathanSalapat) -- [ChaosWormz](https://github.com/ChaosWormz) -- [Panquesito7](https://github.com/Panquesito7) -- [coil0](https://github.com/coil0) -- [Zeno-](https://github.com/Zeno-) -- [indriApollo](https://github.com/indriApollo) -- [Billy-S](https://github.com/Billy-S) -- Traxie21, the original creator of this mod (however, he/she does not have a GitHub account anymore). - -## Configuring the mod -Open your `minetest.conf` located in your Minetest directory. -Set the values of the settings you'd like to. - -Available options are: -``` -tp.timeout_delay = 60 -tp.enable_immediate_teleport = true -tp_enable_tpp_command = false -``` -Those values are the default values of the mod. -You can also go to your Minetest, Settings tab, All settings, Mods, and you'll find `tpr` there. -Or another way to do it, is changing the values in `settingtypes.txt`. - -## Installation -- Unzip the archive, rename the folder to `tpr` and -place it in .. minetest/mods/ - -- GNU/Linux: If you use a system-wide installation place - it in ~/.minetest/mods/. - -- If you only want this to be used in a single world, place - the folder in .. worldmods/ in your world directory. - -For further information or help, see: -https://wiki.minetest.net/Installing_Mods - -## TODO -- Make it so if a player attempts to teleport to coordinates within a protected area owned by another player, and that player is online, the owner receives a request to allow or deny the user from teleporting to their area. -- Add limitations to /tpc which only allow a user to teleport X number of blocks. Prevents users from teleporting to the edge of the world. -- Assess value in changing all tpr-based chat commands to one global command such as /tp to reduce the chance of confusion between tps_admin and the original mod (and also make it so people don't have to remember so many commands). -- Create a better sound effect for teleport and apply it to all teleport methods (not just /tpc) -- Rewrite to place all chat commands into one single command much like how /teleport works. -- Make evade respect land: no teleporting inside land, but instead make sure player is standing on surface or in water. - -If you think something else should be added to this list, [submit an issue](https://github.com/ChaosWormz/teleport-request/issues/new). \ No newline at end of file diff --git a/teleport_request/commands.lua b/teleport_request/commands.lua deleted file mode 100644 index e222442a..00000000 --- a/teleport_request/commands.lua +++ /dev/null @@ -1,68 +0,0 @@ ---[[ -Commands -Copyright (C) 2014-2020 ChaosWormz and contributors - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 -USA ---]] - --- Support for intllib -local S = tp.intllib - -minetest.register_chatcommand("tpr", { - description = S("Request teleport to another player"), - params = S(" | leave playername empty to see help message"), - privs = {interact = true, tp = true}, - func = tp.tpr_send -}) - -minetest.register_chatcommand("tphr", { - description = S("Request player to teleport to you"), - params = S(" | leave playername empty to see help message"), - privs = {interact = true, tp = true}, - func = tp.tphr_send -}) - -minetest.register_chatcommand("tpc", { - description = S("Teleport to coordinates"), - params = S(" | leave coordinates empty to see help message"), - privs = {interact = true, tp_tpc = true, tp = true}, - func = tp.tpc_send -}) - -minetest.register_chatcommand("tpj", { - description = S("Teleport to relative position"), - params = S(" | leave empty to see help message"), - privs = {interact = true, tp_tpc = true, tp = true}, - func = tp.tpj -}) - -minetest.register_chatcommand("tpe", { - description = S("Evade Enemy"), - privs = {interact = true, tp_tpc = true, tp = true}, - func = tp.tpe -}) - -minetest.register_chatcommand("tpy", { - description = S("Accept teleport requests from another player"), - privs = {interact = true, tp = true}, - func = tp.tpr_accept -}) - -minetest.register_chatcommand("tpn", { - description = S("Deny teleport requests from another player"), - privs = {interact = true, tp = true}, - func = tp.tpr_deny -}) diff --git a/teleport_request/config.lua b/teleport_request/config.lua deleted file mode 100644 index d81463ce..00000000 --- a/teleport_request/config.lua +++ /dev/null @@ -1,36 +0,0 @@ ---[[ -Configuration -Copyright (C) 2014-2020 ChaosWormz and contributors - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 -USA ---]] - --- Timeout delay and mod version. -tp.timeout_delay = tonumber(minetest.settings:get("tp.timeout_delay")) or 60 -tp.version = "1.5" - --- Enable teleporting immediately to the specified player for those with "tp_admin" privilege. -tp.enable_immediate_teleport = minetest.settings:get_bool("tp.enable_immediate_teleport") - --- Set the values of the positions of your places, players will be able to teleport to them (no matter if it is protected, or not). --- You must activate "enable_tpp_command" in order to make this to work. -tp.available_places = { - spawn = {x = 0, y = 0, z = 0}, -- Set coordinates of spawn here. - shop = {x = 0, y = 0, z = 0}, -- Set coordinates of the shop here. -} - --- Enable tpp command -tp.enable_tpp_command = minetest.settings:get_bool("tp.enable_tpp_command") diff --git a/teleport_request/functions.lua b/teleport_request/functions.lua deleted file mode 100644 index 738d1551..00000000 --- a/teleport_request/functions.lua +++ /dev/null @@ -1,608 +0,0 @@ ---[[ -Functions -Copyright (C) 2014-2020 ChaosWormz and contributors - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 -USA ---]] - --- Support for intllib -local S = tp.intllib - --- Placeholders -local chatmsg, source, target, name2, target_coords - -local map_size = 30912 -function tp.can_teleport(to) - return to.x < map_size and to.x > -map_size and to.y < map_size and to.y > -map_size and to.z < map_size and to.z > -map_size -end - --- Teleport player to a player (used in "/tpr" and in "/tphr" command). -function tp.tpr_teleport_player() - target_coords = source:get_pos() - local target_sound = target:get_pos() - target:set_pos(tp.find_free_position_near(target_coords)) - minetest.sound_play("tpr_warp", {pos = target_coords, gain = 0.5, max_hear_distance = 10}) - minetest.sound_play("tpr_warp", {pos = target_sound, gain = 0.5, max_hear_distance = 10}) - --tp.parti2(target_coords) -end - --- TPC & TPJ -function tp.tpc_teleport_player(player) - local pname = minetest.get_player_by_name(player) - minetest.sound_play("tpr_warp", {pos = pname:get_pos(), gain = 0.5, max_hear_distance = 10}) - pname:set_pos(tp.find_free_position_near(target_coords)) - minetest.sound_play("tpr_warp", {pos = target_coords, gain = 0.5, max_hear_distance = 10}) - --tp.parti2(target_coords) -end - --- TPP -function tp.tpp_teleport_player(player, pos) - local pname = minetest.get_player_by_name(player) - minetest.sound_play("tpr_warp", {pos = pname:get_pos(), gain = 0.5, max_hear_distance = 10}) - pname:set_pos(tp.find_free_position_near(pos)) - minetest.sound_play("tpr_warp", {pos = pos, gain = 0.5, max_hear_distance = 10}) - --tp.parti2(target_coords) -end - -function tp.find_free_position_near(pos) - local tries = { - {x=1,y=0,z=0}, - {x=-1,y=0,z=0}, - {x=0,y=0,z=1}, - {x=0,y=0,z=-1}, - } - for _,d in pairs(tries) do - local p = vector.add(pos, d) - local def = minetest.registered_nodes[minetest.get_node(p).name] - if def and not def.walkable then - return p, true - end - end - return pos, false -end - -function tp.parti(pos) - minetest.add_particlespawner(50, 0.4, - {x=pos.x + 0.5, y=pos.y, z=pos.z + 0.5}, {x=pos.x - 0.5, y=pos.y, z=pos.z - 0.5}, - {x=0, y=5, z=0}, {x=0, y=0, z=0}, - {x=0, y=5, z=0}, {x=0, y=0, z=0}, - 3, 5, - 3, 5, - false, - "tps_portal_parti.png") -end - -function tp.parti2(pos) - minetest.add_particlespawner(50, 0.4, - {x=pos.x + 0.5, y=pos.y + 10, z=pos.z + 0.5}, {x=pos.x - 0.5, y=pos.y, z=pos.z - 0.5}, - {x=0, y=-5, z=0}, {x=0, y=0, z=0}, - {x=0, y=-5, z=0}, {x=0, y=0, z=0}, - 3, 5, - 3, 5, - false, - "tps_portal_parti.png") -end - --- Teleport Request System -function tp.tpr_send(sender, receiver) - -- Compatibility with beerchat - if minetest.get_modpath("beerchat") and not minetest.check_player_privs(sender, {tp_admin = true}) then - if receiver == "" then - minetest.chat_send_player(sender, S("Usage: /tpr ")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("Usage: /tpr "), 0xFFFFFF) - end - return - end - - if not minetest.get_player_by_name(receiver) then - minetest.chat_send_player(sender, S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online"), 0xFFFFFF) - end - return - end - - local player_receiver = minetest.get_player_by_name(receiver) - if player_receiver:get_meta():get_string("beerchat:muted:" .. sender) == "true" then - minetest.chat_send_player(sender, S("You are not allowed to send requests because you're muted.")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("You are not allowed to send requests because you're muted."), 0xFFFFFF) - end - return - end - end - - if minetest.check_player_privs(sender, {tp_admin = true}) and tp.enable_immediate_teleport then - if receiver == "" then - minetest.chat_send_player(sender, S("Usage: /tpr ")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("Usage: /tpr "), 0xFFFFFF) - end - return - end - - if not minetest.get_player_by_name(receiver) then - minetest.chat_send_player(sender, S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online"), 0xFFFFFF) - end - return - end - - tp.tpr_list[receiver] = sender - tp.tpr_accept(receiver) - minetest.chat_send_player(sender, S("You are teleporting to @1.", receiver)) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("You are teleporting to @1.", receiver), 0xFFFFFF) - end - return - end - - if receiver == "" then - minetest.chat_send_player(sender, S("Usage: /tpr ")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("Usage: /tpr "), 0xFFFFFF) - end - return - end - - if not minetest.get_player_by_name(receiver) then - minetest.chat_send_player(sender, S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online"), 0xFFFFFF) - end - return - end - - if minetest.get_modpath("gamehub") then -- Compatibility with gamehub (UNTESTED) - if gamehub.players[receiver] then - minetest.chat_send_player(sender, S("Teleport request denied, player is in the gamehub!")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("Teleport request denied, player is in the gamehub!"), 0xFFFFFF) - end - return - end - end - - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(receiver), S("@1 is requesting to teleport to you. /tpy to accept", sender), 0xFFFFFF) - chat2.send_message(minetest.get_player_by_name(sender), S("Teleport request sent! It will timeout in @1 seconds", tp.timeout_delay), 0xFFFFFF) - end - - minetest.chat_send_player(receiver, S("@1 is requesting to teleport to you. /tpy to accept", sender)) - minetest.chat_send_player(sender, S("Teleport request sent! It will timeout in @1 seconds", tp.timeout_delay)) - - -- Write name values to list and clear old values. - tp.tpr_list[receiver] = sender - - -- Teleport timeout delay - minetest.after(tp.timeout_delay, function(name) - if tp.tpr_list[name] then - tp.tpr_list[name] = nil - minetest.chat_send_player(sender, S("Request timed-out.")) - minetest.chat_send_player(receiver, S("Request timed-out.")) - - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("Request timed-out."), 0xFFFFFF) - chat2.send_message(minetest.get_player_by_name(receiver), S("Request timed-out."), 0xFFFFFF) - end - return - end - end, receiver) -end - -function tp.tphr_send(sender, receiver) - -- Compatibility with beerchat - if minetest.get_modpath("beerchat") and not minetest.check_player_privs(sender, {tp_admin = true}) then - if not minetest.get_player_by_name(receiver) then - minetest.chat_send_player(sender, S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online"), 0xFFFFFF) - end - return - end - - local player_receiver = minetest.get_player_by_name(receiver) - if player_receiver:get_meta():get_string("beerchat:muted:" .. sender) == "true" then - minetest.chat_send_player(sender, S("You are not allowed to send requests because you're muted.")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("You are not allowed to send requests because you're muted."), 0xFFFFFF) - end - return - end - end - - if minetest.check_player_privs(sender, {tp_admin = true}) and tp.enable_immediate_teleport then - if receiver == "" then - minetest.chat_send_player(sender, S("Usage: /tphr ")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("Usage. /tphr "), 0xFFFFFF) - end - return - end - - if not minetest.get_player_by_name(receiver) then - minetest.chat_send_player(sender, S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online"), 0xFFFFFF) - end - return - end - - tp.tphr_list[receiver] = sender - tp.tpr_accept(receiver) - minetest.chat_send_player(sender, S("@1 is teleporting to you.", receiver)) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("@1 is teleporting to you.", receiver), 0xFFFFFF) - end - return - end - - if receiver == "" then - minetest.chat_send_player(sender, S("Usage: /tphr ")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("Usage. /tphr "), 0xFFFFFF) - end - return - end - - if not minetest.get_player_by_name(receiver) then - minetest.chat_send_player(sender, S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("There is no player by that name. Keep in mind this is case-sensitive, and the player must be online"), 0xFFFFFF) - end - return - end - - if minetest.get_modpath("gamehub") then -- Compatibility with gamehub (UNTESTED) - if gamehub.players[receiver] then - minetest.chat_send_player(sender, S("Teleport request denied, player is in the gamehub!")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("Teleport request denied, player is in the gamehub!"), 0xFFFFFF) - end - return - end - end - - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(receiver), S("@1 is requesting that you teleport to them. /tpy to accept; /tpn to deny", sender), 0xFFFFFF) - chat2.send_message(minetest.get_player_by_name(sender), S("Teleport request sent! It will timeout in @1 seconds", tp.timeout_delay), 0xFFFFFF) - end - - minetest.chat_send_player(receiver, S("@1 is requesting that you teleport to them. /tpy to accept; /tpn to deny", sender)) - minetest.chat_send_player(sender, S("Teleport request sent! It will timeout in @1 seconds", tp.timeout_delay)) - - -- Write name values to list and clear old values. - tp.tphr_list[receiver] = sender - - -- Teleport timeout delay - minetest.after(tp.timeout_delay, function(name) - if tp.tphr_list[name] then - tp.tphr_list[name] = nil - minetest.chat_send_player(sender, S("Request timed-out.")) - minetest.chat_send_player(receiver, S("Request timed-out.")) - - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(sender), S("Request timed-out"), 0xFFFFFF) - chat2.send_message(minetest.get_player_by_name(receiver), S("Request timed-out"), 0xFFFFFF) - end - return - end - end, receiver) -end - -function tp.tpc_send(player, coordinates) - - local posx,posy,posz = string.match(coordinates, "^(-?%d+), (-?%d+), (-?%d+)$") - local pname = minetest.get_player_by_name(player) - - if posx ~= nil or posy ~= nil or posz ~= nil then - posx = tonumber(posx) + 0.0 - posy = tonumber(posy) + 0.0 - posz = tonumber(posz) + 0.0 - end - - if posx==nil or posy==nil or posz==nil or string.len(posx) > 6 or string.len(posy) > 6 or string.len(posz) > 6 then - minetest.chat_send_player(player, S("Usage: /tpc ")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(player), S("Usage: /tpc "), 0xFFFFFF) - end - return nil - end - - target_coords = {x=posx, y=posy, z=posz} - - if tp.can_teleport(target_coords) == false then - minetest.chat_send_player(player, S("You cannot teleport to a location outside the map!")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(player), S("You cannot teleport to a location outside the map!"), 0xFFFFFF) - end - return nil - end - - -- If the area is protected, reject the user's request to teleport to these coordinates - -- In future release we'll actually query the player who owns the area, if they're online, and ask for their permission. - -- Admin user (priv "tp_admin") overrides all protection - if minetest.check_player_privs(pname, {tp_admin = true}) then - tp.tpc_teleport_player(player) - minetest.chat_send_player(player, S("Teleporting to: @1, @2, @3", posx, posy, posz)) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(player), S("Teleporting to: @1, @2, @3", posx, posy, posz), 0xFFFFFF) - end - else - if minetest.check_player_privs(pname, {tp_tpc = true}) then - local protected = minetest.is_protected(target_coords, player) - if protected then - minetest.record_protection_violation(target_coords, player) - return - end - - if minetest.get_modpath("areas") then - if not areas:canInteract(target_coords, player) then - local owners = areas:getNodeOwners(target_coords) - minetest.chat_send_player(player, S("Error: @1 is protected by @2.", minetest.pos_to_string(target_coords), table.concat(owners, ", "))) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(player), S("Error: @1 is protected by @2.", minetest.pos_to_string(target_coords), table.concat(owners, ", ")), 0xFFFFFF) - end - return - end - end - - tp.tpc_teleport_player(player) - minetest.chat_send_player(player, S("Teleporting to: @1, @2, @3", posx, posy, posz)) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(player), S("Teleporting to: @1, @2, @3", posx, posy, posz), 0xFFFFFF) - end - else - minetest.chat_send_player(player, S("Error: You do not have permission to teleport to those coordinates.")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(player), S("Error: You do not have permission to teleport to those coordinates."), 0xFFFFFF) - end - return - end - end -end - -function tp.tpr_deny(name) - if tp.tpr_list[name] then - name2 = tp.tpr_list[name] - minetest.chat_send_player(name2, S("Teleport request denied.")) - minetest.chat_send_player(name, S("You denied the request @1 sent you.", name2)) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(name2), S("Teleport request denied."), 0xFFFFFF) - chat2.send_message(minetest.get_player_by_name(name), S("You denied the request @1 sent you.", name2), 0xFFFFFF) - end - tp.tpr_list[name] = nil - - elseif tp.tphr_list[name] then - name2 = tp.tphr_list[name] - minetest.chat_send_player(name2, S("Teleport request denied.")) - minetest.chat_send_player(name, S("You denied the request @1 sent you.", name2)) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(name2), S("Teleport request denied."), 0xFFFFFF) - chat2.send_message(minetest.get_player_by_name(name), S("You denied the request @1 sent you.", name2), 0xFFFFFF) - end - tp.tphr_list[name] = nil - - else - minetest.chat_send_player(name, S("Usage: /tpn allows you to deny teleport requests sent to you by other players.")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(name), S("Usage: /tpn allows you to deny teleport requests sent to you by other players."), 0xFFFFFF) - end - return - end -end - --- Teleport Accept Systems -function tp.tpr_accept(name) - - -- Check to prevent constant teleporting. - if not tp.tpr_list[name] and not tp.tphr_list[name] then - minetest.chat_send_player(name, S("Usage: /tpy allows you to accept teleport requests sent to you by other players")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(name), S("Usage: /tpy allows you to accept teleport requests sent to you by other players"), 0xFFFFFF) - end - return - end - - if tp.tpr_list[name] then - name2 = tp.tpr_list[name] - source = minetest.get_player_by_name(name) - target = minetest.get_player_by_name(name2) - chatmsg = S("@1 is teleporting to you.", name2) - tp.tpr_list[name] = nil - - elseif tp.tphr_list[name] then - name2 = tp.tphr_list[name] - source = minetest.get_player_by_name(name2) - target = minetest.get_player_by_name(name) - chatmsg = S("You are teleporting to @1.", name2) - tp.tphr_list[name] = nil - else - return - end - - -- Could happen if either player disconnects (or timeout); if so just abort - if not source - or not target then - minetest.chat_send_player(name, S("@1 doesn't exist, or just disconnected/left (by timeout).", name2)) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(name), S("@1 doesn't exist, or just disconnected/left (by timeout).", name2), 0xFFFFFF) - end - return - end - - tp.tpr_teleport_player() - - minetest.chat_send_player(name, chatmsg) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(name), chatmsg, 0xFFFFFF) - end - - if minetest.check_player_privs(name2, {tp_admin = true}) == false then - minetest.chat_send_player(name2, S("Request Accepted!")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(name2), S("Request Accepted!"), 0xFFFFFF) - end - - else - if tp.enable_immediate_teleport then return end - - minetest.chat_send_player(name2, S("Request Accepted!")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(name2), S("Request Accepted!"), 0xFFFFFF) - end - return - end -end - --- Teleport Jump - Relative Position Teleportation by number of nodes -function tp.tpj(player, param) - - if param == "" then - minetest.chat_send_player(player, S("Usage: ")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(player), S("Usage: "), 0xFFFFFF) - end - return false - end - - local args = param:split(" ") -- look into this. Can it crash if the player does not have two parameters? - if #args < 2 then - minetest.chat_send_player(player, S("Usage: ")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(player), S("Usage: "), 0xFFFFFF) - end - return false - end - - if not tonumber(args[2]) then - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(player), S("Not a number!"), 0xFFFFFF) - end - return false, S("Not a number!") - end - - -- Initially generate the target coords from the player's current position (since it's relative) and then perform the math. - target_coords = minetest.get_player_by_name(player):get_pos() - if args[1] == "x" then - target_coords["x"] = target_coords["x"] + tonumber(args[2]) - elseif args[1] == "y" then - target_coords["y"] = target_coords["y"] + tonumber(args[2]) - elseif args[1] == "z" then - target_coords["z"] = target_coords["z"] + tonumber(args[2]) - else - minetest.chat_send_player(player, S("Not a valid axis. Valid options are X, Y or Z")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(player), S("Not a valid axis. Valid options are X, Y or Z"), 0xFFFFFF) - end - return - end - - if tp.can_teleport(target_coords) == false then - minetest.chat_send_player(player, S("You cannot teleport to a location outside the map!")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(player), S("You cannot teleport to a location outside the map!"), 0xFFFFFF) - end - return - end - tp.tpc_teleport_player(player) -end - --- Evade -function tp.tpe(player) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(player), S("EVADE!"), 0xFFFFFF) - end - minetest.chat_send_player(player, S("EVADE!")) - local mindistance = 15 - local maxdistance = 50 - local times = math.random(6,20) -- how many times to jump - minimum,maximum - local negatives = { '-','' } -- either it's this way or that way: the difference between -10 and 10 - local options = { 'x', 'y', 'z' } - local isnegative = '' - local distance = 0 - local axis = '' - local iteration = 0 - for i = 1,times do - -- do this every 1 second - minetest.after(iteration, - function() - isnegative = negatives[math.random(2)] -- choose randomly whether this is this way or that - distance = isnegative .. math.random(mindistance,maxdistance) -- the distance to jump - axis = options[math.random(3)] - local command = axis .. " " .. distance - tp.tpj(player, command) - end - ) - iteration = iteration + 0.5 - end -end - --- Teleport To Place (TPP) system. -if tp.enable_tpp_command then - - function tp.tpp(player, param) - - -- Show the available places to the player (taken from shivajiva101's POI mod, thanks!). - if param == "" then - local places = {} - if not tp.available_places then tp.available_places = {} end - for key, value in pairs(tp.available_places) do - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(player), key, 0xFFFFFF) - end - table.insert(places, key) - end - if #places == 0 then - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(player), S("There are no places yet."), 0xFFFFFF) - end - return true, S("There are no places yet.") - end - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(player), S("Usage: /tpp "), 0xFFFFFF) - end - table.insert(places, S("Usage: /tpp ")) - return true, table.concat(places, "\n") - - -- Teleport player to the specified place (taken from shivajiva101's POI mod, thanks!). - elseif tp.available_places[param] then - local pos = {x = tp.available_places[param].x, y = tp.available_places[param].y, z = tp.available_places[param].z} - tp.tpp_teleport_player(player, pos) - minetest.chat_send_player(player, S("Teleporting to @1.", param)) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(player), S("Teleporting to @1.", param), 0xFFFFFF) - end - - -- Check if the place exists. - elseif not tp.available_places[param] then - minetest.chat_send_player(player, S("There is no place by that name. Keep in mind this is case-sensitive.")) - if minetest.get_modpath("chat2") then - chat2.send_message(minetest.get_player_by_name(player), S("There is no place by that name. Keep in mind this is case-sensitive."), 0xFFFFFF) - end - return - end - end - - minetest.register_chatcommand("tpp", { - description = S("Teleport to a place (i.e., spawn, shop)."), - params = S(" | leave empty to see available places"), - privs = {}, - func = tp.tpp - }) -end diff --git a/teleport_request/init.lua b/teleport_request/init.lua deleted file mode 100644 index ffdbfee7..00000000 --- a/teleport_request/init.lua +++ /dev/null @@ -1,60 +0,0 @@ ---[[ -Allows players to request from another player to be teleported to them, and do much more. -Copyright (C) 2014-2020 ChaosWormz and contributors - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 -USA - ----------------------------------------------------------------------------- - -Originally made by Traxie21 and released with the WTFPL license. -Forum link: https://forum.minetest.net/viewtopic.php?id=4457 - -Updates by Zeno, Panquesito7 and ChaosWormz. -License: LGPLv2.1+ for code, CC BY-SA 4.0 for sounds. ---]] - --- Load support for intllib. -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S = dofile(MP.."/intllib.lua") - -tp = { - intllib = S, - tpr_list = {}, - tphr_list = {} -} - --- Clear requests when the player leaves -minetest.register_on_leaveplayer(function(name) - if tp.tpr_list[name] then - tp.tpr_list[name] = nil - return - end - - if tp.tphr_list[name] then - tp.tphr_list[name] = nil - return - end -end) - -dofile(MP.."/privileges.lua") -dofile(MP.."/config.lua") -dofile(MP.."/functions.lua") -dofile(MP.."/commands.lua") - --- Log -if minetest.settings:get_bool("log_mods") then - minetest.log("action", S("[Teleport Request] TPS Teleport v@1 Loaded!", tp.version)) -end diff --git a/teleport_request/intllib.lua b/teleport_request/intllib.lua deleted file mode 100644 index 6669d720..00000000 --- a/teleport_request/intllib.lua +++ /dev/null @@ -1,45 +0,0 @@ - --- Fallback functions for when `intllib` is not installed. --- Code released under Unlicense . - --- Get the latest version of this file at: --- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua - -local function format(str, ...) - local args = { ... } - local function repl(escape, open, num, close) - if escape == "" then - local replacement = tostring(args[tonumber(num)]) - if open == "" then - replacement = replacement..close - end - return replacement - else - return "@"..open..num..close - end - end - return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) -end - -local gettext, ngettext -if minetest.get_modpath("intllib") then - if intllib.make_gettext_pair then - -- New method using gettext. - gettext, ngettext = intllib.make_gettext_pair() - else - -- Old method using text files. - gettext = intllib.Getter() - end -end - --- Fill in missing functions. - -gettext = gettext or function(msgid, ...) - return format(msgid, ...) -end - -ngettext = ngettext or function(msgid, msgid_plural, n, ...) - return format(n==1 and msgid or msgid_plural, ...) -end - -return gettext, ngettext diff --git a/teleport_request/locale/es.po b/teleport_request/locale/es.po deleted file mode 100644 index cd452a70..00000000 --- a/teleport_request/locale/es.po +++ /dev/null @@ -1,201 +0,0 @@ -# Spanish translation for Teleport Request. -# Copyright (C) 2014-2020 ChaosWormz and contributors. -# This file is distributed under under the same license as the Teleport Request package. -# David Leal , 2019. - -msgid "" -msgstr "" -"Project-Id-Version: Teleport Request\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-07-12 5:07+0200\n" -"PO-Revision-Date: \n" -"Last-Translator: David Leal \n" -"Language-Team: \n" -"Language: es\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: config.lua -msgid "Let players teleport to other players (request will be sent)" -msgstr "Permite que los jugadores se teletransporten a otros jugadores (se enviará una solicitud)" - -#: config.lua -msgid "Gives full admin-access to a player." -msgstr "Da acceso total de administrador a un jugador." - -#: config.lua -msgid "Allow player to teleport to coordinates (if allowed by area protection)" -msgstr "Permite a los jugadores teletransportarse a las coordenadas especificadas (si esta permitido por la protección de la área)" - -#: init.lua -msgid "You are not allowed to send requests because you're muted." -msgstr "No tienes permiso para mandar solicitudes de teletransporte porque estás silenciado." - -#: init.lua -msgid "Usage: /tpr " -msgstr "Uso: /tpr " - -#: init.lua -msgid "There is no player by that name. Keep in mind this is case-sensitive, and the player must be online" -msgstr "No hay jugador con ese nombre. Tenga en cuenta que esto es caso-sensitivo, y el jugador debe de estar én linea." - -#: init.lua -msgid "Teleport request denied, player is in the gamehub!" -msgstr "Solicitud denegada, ¡el jugador esta en el centro de juegos!" - -#: init.lua -msgid "You are teleporting to @1." -msgstr "Te estas teletransportando a @1." - -#: init.lua -msgid "@1 is requesting to teleport to you. /tpy to accept" -msgstr "@1 esta pidiendo teletransportarse a ti. /tpy para aceptar" - -#: init.lua -msgid "Teleport request sent! It will timeout in @1 seconds" -msgstr "¡Solicitud enviada! Se agotara en @1 segundos" - -#: init.lua -msgid "Request timed-out." -msgstr "La solicitud enviada expiró." - -#: init.lua -msgid "@1 is teleporting to you." -msgstr "@1 se esta teletransportando a ti." - -#: init.lua -msgid "Usage: /tphr " -msgstr "Uso: /tphr " - -#: init.lua -msgid "@1 is requesting that you teleport to them. /tpy to accept; /tpn to deny" -msgstr "@1 esta pidiendo que tu te teletransportes a el/ella. /tpy para aceptar, /tpn para denegar" - -#: init.lua -msgid "Usage: /tpc " -msgstr "Uso: /tpc " - -#: init.lua -msgid "You cannot teleport to a location outside the map!" -msgstr "¡No puedes teletransportarte afuera del mundo!" - -#: init.lua -msgid "Teleporting to: @1, @2, @3" -msgstr "Teletransportandose a: @1, @2, @3" - -#: init.lua -msgid "Error: @1 is protected by @2." -msgstr "Error: @1 esta protegido por @2." - -#: init.lua -msgid "Error: You do not have permission to teleport to those coordinates." -msgstr "Error: No tienes permiso para teletransportarte a esas coordenadas." - -#: init.lua -msgid "Teleport request denied." -msgstr "Solicitud denegada." - -#: init.lua -msgid "You denied the request @1 sent you." -msgstr "Tú denegaste la solicitud de teletransporte que @1 te mando." - -#: init.lua -msgid "Usage: /tpn allows you to deny teleport requests sent to you by other players." -msgstr "Uso: /tpn te permite denegar solicitudes enviadas para ti de otros jugadores." - -#: init.lua -msgid "Usage: /tpy allows you to accept teleport requests sent to you by other players" -msgstr "Uso: /tpy te permite aceptar solicitudes enviadas para ti de otros jugadores" - -#: init.lua -msgid "@1 doesn't exist, or just disconnected/left (by timeout)." -msgstr "@1 no existe, o se desconecto/fue." - -#: init.lua -msgid "Request Accepted!" -msgstr "¡Solicitud aceptada!" - -#: init.lua -msgid "Usage: " -msgstr "Uso: " - -#: init.lua -msgid "Not a number!" -msgstr "¡No un número!" - -#: init.lua -msgid "Not a valid axis. Valid options are X, Y or Z" -msgstr "Eje invalido. Opciones validas son x, y, o z" - -#: init.lua -msgid "EVADE!" -msgstr "¡EVADIR!" - -#: init.lua -msgid "Request teleport to another player." -msgstr "Enviar solicitud para teletransportarte a otro jugador." - -#: init.lua -msgid " | leave playername empty to see help message" -msgstr " | Deje el nombre del jugador vacío para ver el mensaje de ayuda" - -#: init.lua -msgid "Request player to teleport to you" -msgstr "Solicita al jugador que se teletransporte a ti." - -#: init.lua -msgid "Teleport to coordinates" -msgstr "Teletransportarse a las coordenadas especificadas." - -#: init.lua -msgid " | leave coordinates empty to see help message" -msgstr " | Deje las coordenadas vacías para ver el mensaje de ayuda" - -#: init.lua -msgid "Teleport to relative position" -msgstr "Teletransportarse a la posición relativa." - -#: init.lua -msgid " | leave empty to see help message" -msgstr " | Deje vacío para ver el mensaje de ayuda" - -#: init.lua -msgid "Evade Enemy" -msgstr "Evadir enemigo." - -#: init.lua -msgid "Teleport to a place (i.e., spawn, shop)." -msgstr "Teletransportarse a un lugar (p.ej., la tienda, la ciudad)." - -#: init.lua -msgid " | leave empty to see available places" -msgstr " | Deje vacío para ver los lugares disponibles" - -#: init.lua -msgid "There are no places yet." -msgstr "Todavia no hay lugares." - -#: init.lua -msgid "Usage: /tpp " -msgstr "Uso: /tpp " - -#: init.lua -msgid "Teleporting to @1." -msgstr "Teletransportandose a @1." - -#: init.lua -msgid "There is no place by that name. Keep in mind this is case-sensitive." -msgstr "No hay lugar con ese nombre. Tenga en cuenta que esto es caso-sensitivo." - -#: init.lua -msgid "Accept teleport requests from another player" -msgstr "Aceptar solicitudes de otro jugador." - -#: init.lua -msgid "Deny teleport requests from another player" -msgstr "Denegar solicitudos de otro jugador." - -#: init.lua -msgid "[Teleport Request] TPS Teleport v@1 Loaded!" -msgstr "[TPS] Solicitud de teletransporte v@1 Cargado!" diff --git a/teleport_request/locale/template.pot b/teleport_request/locale/template.pot deleted file mode 100644 index eba900d5..00000000 --- a/teleport_request/locale/template.pot +++ /dev/null @@ -1,201 +0,0 @@ -# Template translation for Teleport Request. -# Copyright (C) 2014-2020 ChaosWormz and contributors. -# This file is distributed under under the same license as the Teleport Request package. -# David Leal , 2019. - -msgid "" -msgstr "" -"Project-Id-Version: Teleport Request\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-07-12 5:07+0200\n" -"PO-Revision-Date: \n" -"Last-Translator: David Leal \n" -"Language-Team: \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: config.lua -msgid "Let players teleport to other players (request will be sent)" -msgstr "" - -#: config.lua -msgid "Gives full admin-access to a player." -msgstr "" - -#: config.lua -msgid "Allow player to teleport to coordinates (if allowed by area protection)" -msgstr "" - -#: init.lua -msgid "You are not allowed to send requests because you're muted." -msgstr "" - -#: init.lua -msgid "Usage: /tpr " -msgstr "" - -#: init.lua -msgid "There is no player by that name. Keep in mind this is case sensitive, and the player must be online" -msgstr "" - -#: init.lua -msgid "Teleport request denied, player is in the gamehub!" -msgstr "" - -#: init.lua -msgid "You are teleporting to @1." -msgstr "" - -#: init.lua -msgid "@1 is requesting to teleport to you. /tpy to accept" -msgstr "" - -#: init.lua -msgid "Teleport request sent! It will timeout in @1 seconds" -msgstr "" - -#: init.lua -msgid "Request timed-out." -msgstr "" - -#: init.lua -msgid "@1 is teleporting to you." -msgstr "" - -#: init.lua -msgid "Usage: /tphr " -msgstr "" - -#: init.lua -msgid "@1 is requesting that you teleport to them. /tpy to accept; /tpn to deny" -msgstr "" - -#: init.lua -msgid "Usage: /tpc " -msgstr "" - -#: init.lua -msgid "You cannot teleport to a location outside the map!" -msgstr "" - -#: init.lua -msgid "Teleporting to: @1, @2, @3" -msgstr "" - -#: init.lua -msgid "Error: @1 is protected by @2." -msgstr "" - -#: init.lua -msgid "Error: You do not have permission to teleport to those coordinates." -msgstr "" - -#: init.lua -msgid "Teleport request denied." -msgstr "" - -#: init.lua -msgid "You denied the request @1 sent you." -msgstr "" - -#: init.lua -msgid "Usage: /tpn allows you to deny teleport requests sent to you by other players." -msgstr "" - -#: init.lua -msgid "Usage: /tpy allows you to accept teleport requests sent to you by other players" -msgstr "" - -#: init.lua -msgid "@1 doesn't exist, or just disconnected/left (by timeout)." -msgstr "" - -#: init.lua -msgid "Request Accepted!" -msgstr "" - -#: init.lua -msgid "Usage: " -msgstr "" - -#: init.lua -msgid "Not a number!" -msgstr "" - -#: init.lua -msgid "Not a valid axis. Valid options are X, Y or Z" -msgstr "" - -#: init.lua -msgid "EVADE!" -msgstr "" - -#: init.lua -msgid "Teleport to a place (i.e., spawn, shop)." -msgstr "" - -#: init.lua -msgid " | leave empty to see available places" -msgstr "" - -#: init.lua -msgid "There are no places yet." -msgstr "" - -#: init.lua -msgid "Usage: /tpp " -msgstr "" - -#: init.lua -msgid "Teleporting to @1." -msgstr "" - -#: init.lua -msgid "There is no place by that name. Keep in mind this is case-sensitive." -msgstr "" - -#: init.lua -msgid "Request teleport to another player." -msgstr "" - -#: init.lua -msgid " | leave playername empty to see help message" -msgstr "" - -#: init.lua -msgid "Request player to teleport to you" -msgstr "" - -#: init.lua -msgid "Teleport to coordinates" -msgstr "" - -#: init.lua -msgid " | leave coordinates empty to see help message" -msgstr "" - -#: init.lua -msgid "Teleport to relative position" -msgstr "" - -#: init.lua -msgid " | leave empty to see help message" -msgstr "" - -#: init.lua -msgid "Evade Enemy" -msgstr "" - -#: init.lua -msgid "Accept teleport requests from another player" -msgstr "" - -#: init.lua -msgid "Deny teleport requests from another player" -msgstr "" - -#: init.lua -msgid "[Teleport Request] TPS Teleport v@1 Loaded!" -msgstr "" diff --git a/teleport_request/mod.conf b/teleport_request/mod.conf deleted file mode 100644 index b03155bc..00000000 --- a/teleport_request/mod.conf +++ /dev/null @@ -1,3 +0,0 @@ -name = tpr -optional_depends = areas, intllib, beerchat, chat2, gamehub -description = Allows players to send a request to other players to teleport to them, and do much more. diff --git a/teleport_request/privileges.lua b/teleport_request/privileges.lua deleted file mode 100644 index b01f32c3..00000000 --- a/teleport_request/privileges.lua +++ /dev/null @@ -1,40 +0,0 @@ ---[[ -Configuration -Copyright (C) 2014-2020 ChaosWormz and contributors - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 -USA ---]] - --- Support for intllib -local S = tp.intllib - -minetest.register_privilege("tp", { - description = S("Let players teleport to other players (request will be sent)"), - give_to_singleplayer = false, - give_to_admin = true, -}) - -minetest.register_privilege("tp_admin", { - description = S("Gives full admin-access to a player."), - give_to_singleplayer = false, - give_to_admin = true, -}) - -minetest.register_privilege("tp_tpc", { - description = S("Allow player to teleport to coordinates (if allowed by area protection)"), - give_to_singleplayer = false, - give_to_admin = true, -}) diff --git a/teleport_request/settingtypes.txt b/teleport_request/settingtypes.txt deleted file mode 100644 index 7a40d9dc..00000000 --- a/teleport_request/settingtypes.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Timeout delay (default is 60) -tp.timeout_delay (Timeout delay after a request is sent) int 60 - -# Enables immediate teleport to players for those who have tp_admin privilege (enabled by default) -tp.enable_immediate_teleport (Immediate teleport for those with tp_admin privilege) bool true - -# Enables Teleport To Place command (disabled by default) -tp.enable_tpp_command (Enable Teleport To Place command) bool false diff --git a/teleport_request/sounds/LICENSE.txt b/teleport_request/sounds/LICENSE.txt deleted file mode 100644 index 8d9eaaa6..00000000 --- a/teleport_request/sounds/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) -Copyright (C) 2020 David Leal (halfpacho@gmail.com) & ChaosWormz - -You are free to: -Share — copy and redistribute the material in any medium or format -Adapt — remix, transform, and build upon the material for any purpose, even commercially. - -Under the following terms: - -Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. - -ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. - -Notices: - -You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation. -No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material. - -For more details: -https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/teleport_request/sounds/tpr_warp.ogg b/teleport_request/sounds/tpr_warp.ogg deleted file mode 100644 index 6199bd83..00000000 Binary files a/teleport_request/sounds/tpr_warp.ogg and /dev/null differ diff --git a/teleport_request/textures/tps_portal_parti.png b/teleport_request/textures/tps_portal_parti.png deleted file mode 100644 index 9998d754..00000000 Binary files a/teleport_request/textures/tps_portal_parti.png and /dev/null differ diff --git a/teleport_request/.luacheckrc b/unified_inventory/.luacheckrc similarity index 50% rename from teleport_request/.luacheckrc rename to unified_inventory/.luacheckrc index 390d987a..709c485e 100644 --- a/teleport_request/.luacheckrc +++ b/unified_inventory/.luacheckrc @@ -3,18 +3,16 @@ allow_defined_top = true max_line_length = 999 globals = { - "tp" + "unified_inventory", } read_globals = { string = {fields = {"split", "trim"}}, table = {fields = {"copy", "getn"}}, - "minetest", "core", - "vector", "ItemStack", - "dump", "dump2", + "minetest", "vector", + "ItemStack", "datastorage", +} - "chat2", "gamehub", - "intllib", "areas", - -} \ No newline at end of file +files["callbacks.lua"].ignore = { "player", "draw_lite_mode" } +files["bags.lua"].ignore = { "player" } diff --git a/unified_inventory/README.md b/unified_inventory/README.md index 15802c6e..8c917ec4 100644 --- a/unified_inventory/README.md +++ b/unified_inventory/README.md @@ -1,5 +1,9 @@ # Unified Inventory +[![](https://github.com/minetest-mods/unified_inventory/workflows/Check%20&%20Release/badge.svg)](https://github.com/minetest-mods/unified_inventory/actions) + +![Screenshot](screenshot.png) + Unified Inventory replaces the default survival and creative inventory. @@ -13,15 +17,14 @@ Unified Inventory replaces the default survival and creative inventory. * Home function to teleport * Trash slot * Lite mode: reduces the item browser width + * `minetest.conf` setting `unified_inventory_lite = true` * Mod API for modders: see [mod_api.txt](doc/mod_api.txt) * Setting-determinated features: see [settingtypes.txt](settingtypes.txt) ## Requirements - * Minetest 5.0.0+ since commit 4403b69 - * Minetest 0.4.16+ prior commit 4403b69 - + * Minetest 5.0.0+ # Licenses diff --git a/unified_inventory/api.lua b/unified_inventory/api.lua index 071900da..d24135b2 100644 --- a/unified_inventory/api.lua +++ b/unified_inventory/api.lua @@ -16,8 +16,8 @@ minetest.after(0.01, function() table.insert(unified_inventory.items_list, name) local all_names = rev_aliases[name] or {} table.insert(all_names, name) - for _, name in ipairs(all_names) do - local recipes = minetest.get_all_craft_recipes(name) + for _, player_name in ipairs(all_names) do + local recipes = minetest.get_all_craft_recipes(player_name) if recipes then for _, recipe in ipairs(recipes) do diff --git a/unified_inventory/bags.lua b/unified_inventory/bags.lua index 1ebbdd3f..c61c9829 100644 --- a/unified_inventory/bags.lua +++ b/unified_inventory/bags.lua @@ -1,4 +1,4 @@ ---[[ +--[[ Bags for Minetest Copyright (c) 2012 cornernote, Brett O'Donnell @@ -166,7 +166,6 @@ local function load_bags_metadata(player, bags_inv) end minetest.register_on_joinplayer(function(player) - local player_inv = player:get_inventory() local player_name = player:get_player_name() local bags_inv = minetest.create_detached_inventory(player_name .. "_bags",{ on_put = function(inv, listname, index, stack, player) @@ -250,7 +249,7 @@ if minetest.get_modpath("farming") ~= nil then minetest.register_craft({ output = "unified_inventory:bag_small", recipe = { - {"", "farming:cotton", ""}, + {"", "farming:string", ""}, {"group:wool", "group:wool", "group:wool"}, {"group:wool", "group:wool", "group:wool"}, }, @@ -260,8 +259,8 @@ if minetest.get_modpath("farming") ~= nil then output = "unified_inventory:bag_medium", recipe = { {"", "", ""}, - {"farming:cotton", "unified_inventory:bag_small", "farming:cotton"}, - {"farming:cotton", "unified_inventory:bag_small", "farming:cotton"}, + {"farming:string", "unified_inventory:bag_small", "farming:string"}, + {"farming:string", "unified_inventory:bag_small", "farming:string"}, }, }) @@ -269,8 +268,8 @@ if minetest.get_modpath("farming") ~= nil then output = "unified_inventory:bag_large", recipe = { {"", "", ""}, - {"farming:cotton", "unified_inventory:bag_medium", "farming:cotton"}, - {"farming:cotton", "unified_inventory:bag_medium", "farming:cotton"}, + {"farming:string", "unified_inventory:bag_medium", "farming:string"}, + {"farming:string", "unified_inventory:bag_medium", "farming:string"}, }, }) end diff --git a/unified_inventory/callbacks.lua b/unified_inventory/callbacks.lua index 8bfe6b60..bc902375 100644 --- a/unified_inventory/callbacks.lua +++ b/unified_inventory/callbacks.lua @@ -28,7 +28,6 @@ minetest.register_on_joinplayer(function(player) -- Refill slot local refill = minetest.create_detached_inventory(player_name.."refill", { allow_put = function(inv, listname, index, stack, player) - local player_name = player:get_player_name() if unified_inventory.is_creative(player_name) then return stack:get_count() else @@ -36,7 +35,6 @@ minetest.register_on_joinplayer(function(player) end end, on_put = function(inv, listname, index, stack, player) - local player_name = player:get_player_name() local handle_refill = (minetest.registered_items[stack:get_name()] or {}).on_refill or default_refill stack = handle_refill(stack) inv:set_stack(listname, index, stack) diff --git a/unified_inventory/internal.lua b/unified_inventory/internal.lua index 05dc5f59..ee8b4a91 100644 --- a/unified_inventory/internal.lua +++ b/unified_inventory/internal.lua @@ -215,11 +215,10 @@ function unified_inventory.get_formspec(player, page) else local dir = unified_inventory.active_search_direction[player_name] local list_index = unified_inventory.current_index[player_name] - local page = math.floor(list_index / (ui_peruser.items_per_page) + 1) + local page2 = math.floor(list_index / (ui_peruser.items_per_page) + 1) local pagemax = math.floor( (#unified_inventory.filtered_items_list[player_name] - 1) / (ui_peruser.items_per_page) + 1) - local item = {} for y = 0, ui_peruser.pagerows - 1 do for x = 0, ui_peruser.pagecols - 1 do local name = unified_inventory.filtered_items_list[player_name][list_index] @@ -254,7 +253,7 @@ function unified_inventory.get_formspec(player, page) end end formspec[n] = "label[8.2,"..ui_peruser.form_header_y..";"..F(S("Page")) .. ": " - .. S("@1 of @2",page,pagemax).."]" + .. S("@1 of @2",page2,pagemax).."]" end n= n+1 diff --git a/unified_inventory/item_names.lua b/unified_inventory/item_names.lua index d374b140..111c9ee6 100644 --- a/unified_inventory/item_names.lua +++ b/unified_inventory/item_names.lua @@ -1,6 +1,6 @@ -- Based on 4itemnames mod by 4aiman -local item_names = {} -- [player_name] = { hud, dtime, itemname } +local item_names = {} -- [player_name] = { hud, dtime, itemname } local dlimit = 3 -- HUD element will be hidden after this many seconds local air_hud_mod = minetest.get_modpath("4air") local hud_mod = minetest.get_modpath("hud") diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index 0ca4cfa0..91c16443 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -122,8 +122,9 @@ local function check_region(name) return worldedit.volume(worldedit.pos1[name], worldedit.pos2[name]) end +-- Strips any kind of escape codes (translation, colors) from a string -- https://github.com/minetest/minetest/blob/53dd7819277c53954d1298dfffa5287c306db8d0/src/util/string.cpp#L777 -local function strip_translation_escapes(input) +local function strip_escapes(input) local s = function(idx) return input:sub(idx, idx) end local out = "" local i = 1 @@ -169,7 +170,7 @@ worldedit.normalize_nodename = function(nodename) end end for key, value in pairs(minetest.registered_nodes) do - local desc = strip_translation_escapes(value.description):lower() + local desc = strip_escapes(value.description):gsub("\n.*", "", 1):lower() if desc == nodename then -- matches description return key end diff --git a/worldedit_commands/mark.lua b/worldedit_commands/mark.lua index 9f7b020f..cb45075c 100644 --- a/worldedit_commands/mark.lua +++ b/worldedit_commands/mark.lua @@ -130,6 +130,9 @@ minetest.register_entity(":worldedit:pos1", { self.object:remove() worldedit.marker1[self.player_name] = nil end, + on_blast = function(self, damage) + return false, false, {} -- don't damage or knockback + end, }) minetest.register_entity(":worldedit:pos2", { @@ -151,6 +154,9 @@ minetest.register_entity(":worldedit:pos2", { self.object:remove() worldedit.marker2[self.player_name] = nil end, + on_blast = function(self, damage) + return false, false, {} -- don't damage or knockback + end, }) minetest.register_entity(":worldedit:region_cube", { @@ -176,5 +182,8 @@ minetest.register_entity(":worldedit:region_cube", { end worldedit.marker_region[self.player_name] = nil end, + on_blast = function(self, damage) + return false, false, {} -- don't damage or knockback + end, }) diff --git a/worldedit_gui/functionality.lua b/worldedit_gui/functionality.lua index 1efed10e..9dda5f54 100644 --- a/worldedit_gui/functionality.lua +++ b/worldedit_gui/functionality.lua @@ -132,11 +132,21 @@ local function handle_changes(name, identifier, fields, def) return true end +-- This has the same behaviour as the player invoking the chat command +local function execute_worldedit_command(command_name, player_name, params) + local chatcmd = minetest.registered_chatcommands["/" .. command_name] + assert(chatcmd, "unknown command: " .. command_name) + local _, msg = chatcmd.func(player_name, params) + if msg then + worldedit.player_notify(player_name, msg) + end +end + worldedit.register_gui_function("worldedit_gui_about", { name = "About", privs = {interact=true}, on_select = function(name) - minetest.chatcommands["/about"].func(name, "") + execute_worldedit_command("about", name, "") end, }) @@ -144,7 +154,8 @@ worldedit.register_gui_function("worldedit_gui_inspect", { name = "Toggle Inspect", privs = we_privs("inspect"), on_select = function(name) - minetest.chatcommands["/inspect"].func(name, worldedit.inspect[name] and "disable" or "enable") + execute_worldedit_command("inspect", name, + worldedit.inspect[name] and "disable" or "enable") end, }) @@ -178,47 +189,47 @@ worldedit.register_gui_function("worldedit_gui_region", { worldedit.register_gui_handler("worldedit_gui_region", function(name, fields) if fields.worldedit_gui_p_get then - minetest.chatcommands["/p"].func(name, "get") + execute_worldedit_command("p", name, "get") return true elseif fields.worldedit_gui_p_set1 then - minetest.chatcommands["/p"].func(name, "set1") + execute_worldedit_command("p", name, "set1") return true elseif fields.worldedit_gui_p_set2 then - minetest.chatcommands["/p"].func(name, "set2") + execute_worldedit_command("p", name, "set2") return true elseif fields.worldedit_gui_pos1 then - minetest.chatcommands["/pos1"].func(name, "") + execute_worldedit_command("pos1", name, "") worldedit.show_page(name, "worldedit_gui_region") return true elseif fields.worldedit_gui_pos2 then - minetest.chatcommands["/pos2"].func(name, "") + execute_worldedit_command("pos2", name, "") worldedit.show_page(name, "worldedit_gui_region") return true elseif fields.worldedit_gui_reset then - minetest.chatcommands["/reset"].func(name, "") + execute_worldedit_command("reset", name, "") worldedit.show_page(name, "worldedit_gui_region") return true elseif fields.worldedit_gui_mark then - minetest.chatcommands["/mark"].func(name, "") + execute_worldedit_command("mark", name, "") worldedit.show_page(name, "worldedit_gui_region") return true elseif fields.worldedit_gui_unmark then - minetest.chatcommands["/unmark"].func(name, "") + execute_worldedit_command("unmark", name, "") worldedit.show_page(name, "worldedit_gui_region") return true elseif fields.worldedit_gui_volume then - minetest.chatcommands["/volume"].func(name, "") + execute_worldedit_command("volume", name, "") worldedit.show_page(name, "worldedit_gui_region") return true elseif fields.worldedit_gui_fixedpos_pos1_submit then - minetest.chatcommands["/fixedpos"].func(name, string.format("set1 %s %s %s", + execute_worldedit_command("fixedpos", name, ("set1 %s %s %s"):format( tostring(fields.worldedit_gui_fixedpos_pos1x), tostring(fields.worldedit_gui_fixedpos_pos1y), tostring(fields.worldedit_gui_fixedpos_pos1z))) worldedit.show_page(name, "worldedit_gui_region") return true elseif fields.worldedit_gui_fixedpos_pos2_submit then - minetest.chatcommands["/fixedpos"].func(name, string.format("set2 %s %s %s", + execute_worldedit_command("fixedpos", name, ("set2 %s %s %s"):format( tostring(fields.worldedit_gui_fixedpos_pos2x), tostring(fields.worldedit_gui_fixedpos_pos2y), tostring(fields.worldedit_gui_fixedpos_pos2z))) @@ -255,7 +266,7 @@ worldedit.register_gui_handler("worldedit_gui_set", function(name, fields) local n = worldedit.normalize_nodename(gui_nodename1[name]) if n then - minetest.chatcommands["/set"].func(name, n) + execute_worldedit_command("set", name, n) end return true end @@ -301,7 +312,7 @@ worldedit.register_gui_handler("worldedit_gui_replace", function(name, fields) local n1 = worldedit.normalize_nodename(gui_nodename1[name]) local n2 = worldedit.normalize_nodename(gui_nodename2[name]) if n1 and n2 then - minetest.chatcommands["/"..submit].func(name, string.format("%s %s", n1, n2)) + execute_worldedit_command(submit, name, n1 .. " " .. n2) end return true end @@ -350,7 +361,8 @@ worldedit.register_gui_handler("worldedit_gui_sphere_dome", function(name, field end local n = worldedit.normalize_nodename(gui_nodename1[name]) if n then - minetest.chatcommands["/"..submit].func(name, string.format("%s %s", gui_distance2[name], n)) + execute_worldedit_command(submit, name, + gui_distance2[name] .. " " .. n) end return true end @@ -404,7 +416,7 @@ worldedit.register_gui_handler("worldedit_gui_cylinder", function(name, fields) local n = worldedit.normalize_nodename(gui_nodename1[name]) if n then local args = string.format("%s %s %s %s %s", axis_values[gui_axis1[name]], gui_distance1[name], gui_distance2[name], gui_distance3[name], n) - minetest.chatcommands["/"..submit].func(name, args) + execute_worldedit_command(submit, name, args) end return true end @@ -448,7 +460,9 @@ worldedit.register_gui_handler("worldedit_gui_pyramid", function(name, fields) end local n = worldedit.normalize_nodename(gui_nodename1[name]) if n then - minetest.chatcommands["/"..submit].func(name, string.format("%s %s %s", axis_values[gui_axis1[name]], gui_distance1[name], n)) + execute_worldedit_command(submit, name, + axis_values[gui_axis1[name]] .. " " .. gui_distance1[name] .. + " " .. n) end return true end @@ -491,7 +505,9 @@ worldedit.register_gui_handler("worldedit_gui_spiral", function(name, fields) local n = worldedit.normalize_nodename(gui_nodename1[name]) if n then - minetest.chatcommands["/spiral"].func(name, string.format("%s %s %s %s", gui_distance1[name], gui_distance2[name], gui_distance3[name], n)) + execute_worldedit_command("spiral", name, + string.format("%s %s %s %s", gui_distance1[name], + gui_distance2[name], gui_distance3[name], n)) end return true end @@ -527,7 +543,8 @@ worldedit.register_gui_handler("worldedit_gui_copy_move", function(name, fields) if fields.worldedit_gui_copy_move_move then submit = "move" end - minetest.chatcommands["/"..submit].func(name, string.format("%s %s", axis_values[gui_axis1[name]], gui_distance1[name])) + execute_worldedit_command(submit, name, + axis_values[gui_axis1[name]] .. " " .. gui_distance1[name]) return true end return ret @@ -556,7 +573,8 @@ worldedit.register_gui_handler("worldedit_gui_stack", function(name, fields) copy_changes(name, fields, cg) worldedit.show_page(name, "worldedit_gui_stack") - minetest.chatcommands["/stack"].func(name, string.format("%s %s", axis_values[gui_axis1[name]], gui_count1[name])) + execute_worldedit_command("stack", name, + axis_values[gui_axis1[name]] .. " " .. gui_count1[name]) return true end return ret @@ -589,7 +607,8 @@ worldedit.register_gui_handler("worldedit_gui_stretch", function(name, fields) copy_changes(name, fields, cg) worldedit.show_page(name, "worldedit_gui_stretch") - minetest.chatcommands["/stretch"].func(name, string.format("%s %s %s", gui_count1[name], gui_count2[name], gui_count3[name])) + execute_worldedit_command("stretch", name, string.format("%s %s %s", + gui_count1[name], gui_count2[name], gui_count3[name])) return true end return ret @@ -616,7 +635,8 @@ worldedit.register_gui_handler("worldedit_gui_transpose", function(name, fields) if fields.worldedit_gui_transpose_submit then copy_changes(name, fields, cg) - minetest.chatcommands["/transpose"].func(name, string.format("%s %s", axis_values[gui_axis1[name]], axis_values[gui_axis2[name]])) + execute_worldedit_command("transpose", name, + axis_values[gui_axis1[name]] .. " " .. axis_values[gui_axis2[name]]) return true end return ret @@ -642,7 +662,7 @@ worldedit.register_gui_handler("worldedit_gui_flip", function(name, fields) copy_changes(name, fields, cg) worldedit.show_page(name, "worldedit_gui_flip") - minetest.chatcommands["/flip"].func(name, axis_values[gui_axis1[name]]) + execute_worldedit_command("flip", name, axis_values[gui_axis1[name]]) return true end return ret @@ -670,7 +690,8 @@ worldedit.register_gui_handler("worldedit_gui_rotate", function(name, fields) copy_changes(name, fields, cg) worldedit.show_page(name, "worldedit_gui_rotate") - minetest.chatcommands["/rotate"].func(name, string.format("%s %s", axis_values[gui_axis1[name]], angle_values[gui_angle[name]])) + execute_worldedit_command("rotate", name, + axis_values[gui_axis1[name]] .. angle_values[gui_angle[name]]) return true end return ret @@ -696,7 +717,8 @@ worldedit.register_gui_handler("worldedit_gui_orient", function(name, fields) copy_changes(name, fields, cg) worldedit.show_page(name, "worldedit_gui_orient") - minetest.chatcommands["/orient"].func(name, tostring(angle_values[gui_angle[name]])) + execute_worldedit_command("orient", name, + tostring(angle_values[gui_angle[name]])) return true end return ret @@ -706,7 +728,7 @@ worldedit.register_gui_function("worldedit_gui_fixlight", { name = "Fix Lighting", privs = we_privs("fixlight"), on_select = function(name) - minetest.chatcommands["/fixlight"].func(name, "") + execute_worldedit_command("fixlight", name, "") end, }) @@ -714,7 +736,7 @@ worldedit.register_gui_function("worldedit_gui_hide", { name = "Hide Region", privs = we_privs("hide"), on_select = function(name) - minetest.chatcommands["/hide"].func(name, "") + execute_worldedit_command("hide", name, "") end, }) @@ -745,7 +767,7 @@ worldedit.register_gui_handler("worldedit_gui_suppress", function(name, fields) local n = worldedit.normalize_nodename(gui_nodename1[name]) if n then - minetest.chatcommands["/suppress"].func(name, n) + execute_worldedit_command("suppress", name, n) end return true end @@ -779,7 +801,7 @@ worldedit.register_gui_handler("worldedit_gui_highlight", function(name, fields) local n = worldedit.normalize_nodename(gui_nodename1[name]) if n then - minetest.chatcommands["/highlight"].func(name, n) + execute_worldedit_command("highlight", name, n) end return true end @@ -790,7 +812,7 @@ worldedit.register_gui_function("worldedit_gui_restore", { name = "Restore Region", privs = we_privs("restore"), on_select = function(name) - minetest.chatcommands["/restore"].func(name, "") + execute_worldedit_command("restore", name, "") end, }) @@ -814,11 +836,11 @@ worldedit.register_gui_handler("worldedit_gui_save_load", function(name, fields) worldedit.show_page(name, "worldedit_gui_save_load") if fields.worldedit_gui_save_load_submit_save then - minetest.chatcommands["/save"].func(name, gui_filename[name]) + execute_worldedit_command("save", name, gui_filename[name]) elseif fields.worldedit_gui_save_load_submit_allocate then - minetest.chatcommands["/allocate"].func(name, gui_filename[name]) + execute_worldedit_command("allocate", name, gui_filename[name]) else --fields.worldedit_gui_save_load_submit_load - minetest.chatcommands["/load"].func(name, gui_filename[name]) + execute_worldedit_command("load", name, gui_filename[name]) end return true end @@ -868,7 +890,7 @@ worldedit.register_gui_handler("worldedit_gui_cube", function(name, fields) local n = worldedit.normalize_nodename(gui_nodename1[name]) if n then local args = string.format("%s %s %s %s", gui_distance1[name], gui_distance2[name], gui_distance3[name], n) - minetest.chatcommands["/"..submit].func(name, args) + execute_worldedit_command(submit, name, args) end return true end @@ -879,6 +901,6 @@ worldedit.register_gui_function("worldedit_gui_clearobjects", { name = "Clear Objects", privs = we_privs("clearobjects"), on_select = function(name) - minetest.chatcommands["/clearobjects"].func(name, "") + execute_worldedit_command("clearobjects", name, "") end, })