Added intllib support
Now you can add translations to this mod in the locale directory.master
parent
62c9b35e54
commit
96394f8dfb
22
cgpsmap.lua
22
cgpsmap.lua
|
@ -1,6 +1,16 @@
|
||||||
--original code for storing bookmarks outside of the compass by TeTpaAka
|
--original code for storing bookmarks outside of the compass by TeTpaAka
|
||||||
--modifications by Kilarin and Miner59
|
--modifications by Kilarin and Miner59
|
||||||
|
|
||||||
|
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||||
|
local S
|
||||||
|
if (minetest.get_modpath("intllib")) then
|
||||||
|
dofile(minetest.get_modpath("intllib").."/intllib.lua")
|
||||||
|
S = intllib.Getter(minetest.get_current_modname())
|
||||||
|
else
|
||||||
|
S = function ( s ) return s end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
local selected_cgpsmap = {}
|
local selected_cgpsmap = {}
|
||||||
local textlist_bookmark = {}
|
local textlist_bookmark = {}
|
||||||
local selected_bookmark = {}
|
local selected_bookmark = {}
|
||||||
|
@ -14,7 +24,7 @@ function write_to_cgpsmap(itemstack, user)
|
||||||
end
|
end
|
||||||
textlist_bookmark[user:get_player_name()] = list
|
textlist_bookmark[user:get_player_name()] = list
|
||||||
local formspec = "size[9,10;]"..
|
local formspec = "size[9,10;]"..
|
||||||
"button_exit[2,2;5,0.5;write;Write to cgpsmap]"..
|
"button_exit[2,2;5,0.5;write;"..S("Write to cgpsmap").."]"..
|
||||||
"textlist[0,3.0;9,6;bookmark_list;"..list..";"..bkmrkidx.."]"
|
"textlist[0,3.0;9,6;bookmark_list;"..list..";"..bkmrkidx.."]"
|
||||||
minetest.show_formspec(user:get_player_name(), "compassgps:write", formspec)
|
minetest.show_formspec(user:get_player_name(), "compassgps:write", formspec)
|
||||||
--print("write_to_cgpsmap end")
|
--print("write_to_cgpsmap end")
|
||||||
|
@ -30,9 +40,9 @@ function read_from_cgpsmap(itemstack, user, meta)
|
||||||
end
|
end
|
||||||
|
|
||||||
local formspec = "size[9,5]"..
|
local formspec = "size[9,5]"..
|
||||||
"label[2,0.5;bookmark pos: ("..meta["x"]..","..meta["y"]..","..meta["z"]..")]"..
|
"label[2,0.5;"..S("bookmark pos:").." ("..meta["x"]..","..meta["y"]..","..meta["z"]..")]"..
|
||||||
"field[2,2;5,0.5;name;bookmark name:;"..meta["bkmrkname"].."]"..
|
"field[2,2;5,0.5;name;"..S("bookmark name:")..";"..meta["bkmrkname"].."]"..
|
||||||
"button_exit[2,3;5,0.5;read;copy bookmark to your compassgps]"
|
"button_exit[2,3;5,0.5;read;"..S("copy bookmark to your compassgps").."]"
|
||||||
|
|
||||||
minetest.show_formspec(user:get_player_name(), "compassgps:read", formspec)
|
minetest.show_formspec(user:get_player_name(), "compassgps:read", formspec)
|
||||||
--print("read_from_cgpsmap end")
|
--print("read_from_cgpsmap end")
|
||||||
|
@ -57,7 +67,7 @@ minetest.register_craft({
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("compassgps:cgpsmap", {
|
minetest.register_craftitem("compassgps:cgpsmap", {
|
||||||
description = "CompassGPS Map (blank)",
|
description = S("CompassGPS Map (blank)"),
|
||||||
inventory_image = "cgpsmap-blank.png",
|
inventory_image = "cgpsmap-blank.png",
|
||||||
--group = {book = 1},
|
--group = {book = 1},
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
|
@ -68,7 +78,7 @@ minetest.register_craftitem("compassgps:cgpsmap", {
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("compassgps:cgpsmap_marked", {
|
minetest.register_craftitem("compassgps:cgpsmap_marked", {
|
||||||
description = "CompassGPS Map (marked)",
|
description = S("CompassGPS Map (marked)"),
|
||||||
inventory_image = "cgpsmap-marked.png",
|
inventory_image = "cgpsmap-marked.png",
|
||||||
groups = {not_in_creative_inventory=1},
|
groups = {not_in_creative_inventory=1},
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
default
|
default
|
||||||
|
intllib?
|
||||||
|
|
135
init.lua
135
init.lua
|
@ -14,6 +14,13 @@
|
||||||
--added pos and distance to display list
|
--added pos and distance to display list
|
||||||
--added hud showing current pos -> target pos : distance
|
--added hud showing current pos -> target pos : distance
|
||||||
|
|
||||||
|
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||||
|
local S
|
||||||
|
if (minetest.get_modpath("intllib")) then
|
||||||
|
S = intllib.Getter()
|
||||||
|
else
|
||||||
|
S = function ( s ) return s end
|
||||||
|
end
|
||||||
|
|
||||||
local hud_default_x=0.4
|
local hud_default_x=0.4
|
||||||
local hud_default_y=0.01
|
local hud_default_y=0.01
|
||||||
|
@ -27,9 +34,9 @@ local show_shared_on_singleplayer=false --show shared and admin checkboxes on si
|
||||||
--make no sense in a single player game.
|
--make no sense in a single player game.
|
||||||
|
|
||||||
minetest.register_privilege("shared_bookmarks",
|
minetest.register_privilege("shared_bookmarks",
|
||||||
"Can create shared bookmarks for use by anyone with a compasgps")
|
S("Can create shared bookmarks for use by anyone with a compassgps"))
|
||||||
--minetest.register_privilege("shared_bookmarks", {
|
--minetest.register_privilege("shared_bookmarks", {
|
||||||
-- description = "Can create shared bookmarks for use by anyone with a compasgps",
|
-- description = "Can create shared bookmarks for use by anyone with a compassgps",
|
||||||
-- give_to_singleplayer = false,})
|
-- give_to_singleplayer = false,})
|
||||||
|
|
||||||
compassgps = { }
|
compassgps = { }
|
||||||
|
@ -54,7 +61,7 @@ local default_bookmark = {}
|
||||||
local backwardscompatsave = "NO"
|
local backwardscompatsave = "NO"
|
||||||
|
|
||||||
|
|
||||||
print("compasgps reading bookmarks")
|
print(S("compassgps reading bookmarks"))
|
||||||
local file = io.open(minetest.get_worldpath().."/bookmarks", "r")
|
local file = io.open(minetest.get_worldpath().."/bookmarks", "r")
|
||||||
if file then
|
if file then
|
||||||
bookmarks = minetest.deserialize(file:read("*all"))
|
bookmarks = minetest.deserialize(file:read("*all"))
|
||||||
|
@ -120,7 +127,7 @@ end --distance3d
|
||||||
|
|
||||||
|
|
||||||
-- **********************************************************
|
-- **********************************************************
|
||||||
print("compasgps reading settings")
|
print(S("compassgps reading settings"))
|
||||||
if minetest.is_singleplayer() and show_shared_on_singleplayer==false then
|
if minetest.is_singleplayer() and show_shared_on_singleplayer==false then
|
||||||
singleplayer=true
|
singleplayer=true
|
||||||
else
|
else
|
||||||
|
@ -257,9 +264,9 @@ function compassgps.bookmark_loop(mode,playername,findidx)
|
||||||
textlist_bkmrks[playername]={}
|
textlist_bkmrks[playername]={}
|
||||||
if mode=="M" then
|
if mode=="M" then
|
||||||
local cpos=compassgps.round_pos(playerpos)
|
local cpos=compassgps.round_pos(playerpos)
|
||||||
list = "current position : "..compassgps.pos_to_string({x=cpos.x,y=cpos.y,z=cpos.z,player=playername,type="P",bkmrkname=playername.."'s map"})..","..
|
list = S("current position : ")..compassgps.pos_to_string({x=cpos.x,y=cpos.y,z=cpos.z,player=playername,type="P",bkmrkname=playername.."'s map"})..","..
|
||||||
compassgps.bookmark_name_pos_dist(spawnbkmrk,playername,playerpos)
|
compassgps.bookmark_name_pos_dist(spawnbkmrk,playername,playerpos)
|
||||||
textlist_bkmrks[playername][1]={x=cpos.x,y=cpos.y,z=cpos.z,player=playername,type="P",bkmrkname=playername.."'s map"}
|
textlist_bkmrks[playername][1]={x=cpos.x,y=cpos.y,z=cpos.z,player=playername,type="P",bkmrkname=S("%s's map"):format(playername)}
|
||||||
textlist_bkmrks[playername][2]=spawnbkmrk
|
textlist_bkmrks[playername][2]=spawnbkmrk
|
||||||
i=2
|
i=2
|
||||||
mode="L"
|
mode="L"
|
||||||
|
@ -369,9 +376,9 @@ function compassgps.get_confirm_formspec(playername,bkmrkidx)
|
||||||
local bkmrk=textlist_bkmrks[playername][bkmrkidx]
|
local bkmrk=textlist_bkmrks[playername][bkmrkidx]
|
||||||
|
|
||||||
return "compassgps:confirm_remove", "size[8,2;]"..
|
return "compassgps:confirm_remove", "size[8,2;]"..
|
||||||
"label[0,0.2;Remove bookmark: "..compassgps.bookmark_name_string(bkmrk).." ?]"..
|
"label[0,0.2;"..S("Remove bookmark: ")..compassgps.bookmark_name_string(bkmrk).." ?]"..
|
||||||
"button[0,0.7;4,1;confirm_remove_yes;Yes]"..
|
"button[0,0.7;4,1;confirm_remove_yes;"..S("Yes").."]"..
|
||||||
"button[4,0.7;4,1;confirm_remove_no;No]"
|
"button[4,0.7;4,1;confirm_remove_no;"..S("No").."]"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -438,7 +445,7 @@ minetest.register_on_player_receive_fields(function(player,formname,fields)
|
||||||
local player_privs
|
local player_privs
|
||||||
player_privs = minetest.get_player_privs(playername)
|
player_privs = minetest.get_player_privs(playername)
|
||||||
if not player_privs["privs"] then
|
if not player_privs["privs"] then
|
||||||
minetest.chat_send_player(playername,"you can not remove someone elses bookmark:"..
|
minetest.chat_send_player(playername,S("you can not remove someone elses bookmark:")..
|
||||||
compassgps.bookmark_name_string(textlist_bkmrks[playername][bkmrkidx]))
|
compassgps.bookmark_name_string(textlist_bkmrks[playername][bkmrkidx]))
|
||||||
return
|
return
|
||||||
end --if not player_privs
|
end --if not player_privs
|
||||||
|
@ -497,16 +504,16 @@ minetest.register_on_player_receive_fields(function(player,formname,fields)
|
||||||
hud_pos[playername].y=fields["hudy"]
|
hud_pos[playername].y=fields["hudy"]
|
||||||
if tonumber(hud_pos[playername].x)<0 or tonumber(hud_pos[playername].x)>1
|
if tonumber(hud_pos[playername].x)<0 or tonumber(hud_pos[playername].x)>1
|
||||||
or tonumber(hud_pos[playername].y)<0 or tonumber(hud_pos[playername].y)>1 then
|
or tonumber(hud_pos[playername].y)<0 or tonumber(hud_pos[playername].y)>1 then
|
||||||
minetest.chat_send_player(playername,"compassgps: hud coords out of range, hud will not be displayed. Change to between 0 and 1 to restore")
|
minetest.chat_send_player(playername,S("compassgps: hud coords out of range, hud will not be displayed. Change to between 0 and 1 to restore"))
|
||||||
--compassgps.write_settings() --no need to save until you quit
|
--compassgps.write_settings() --no need to save until you quit
|
||||||
end
|
end
|
||||||
else --not numbers
|
else --not numbers
|
||||||
minetest.chat_send_player(playername,"compassgps: hud coords are not numeric. Change to between 0 and 1")
|
minetest.chat_send_player(playername,S("compassgps: hud coords are not numeric. Change to between 0 and 1"))
|
||||||
end --if x,y valid
|
end --if x,y valid
|
||||||
if tonumber(fields["hudcolor"],16) then
|
if tonumber(fields["hudcolor"],16) then
|
||||||
hud_color[playername]=fields["hudcolor"]
|
hud_color[playername]=fields["hudcolor"]
|
||||||
else
|
else
|
||||||
mintest.chat_send_player(playername,"compassgps: hud color not valid hex number")
|
mintest.chat_send_player(playername,S("compassgps: hud color not valid hex number"))
|
||||||
end --if color valid
|
end --if color valid
|
||||||
elseif fields["compass_type_a"] then
|
elseif fields["compass_type_a"] then
|
||||||
compass_type[playername]="a"
|
compass_type[playername]="a"
|
||||||
|
@ -540,7 +547,7 @@ end --write_bookmarks
|
||||||
function compassgps.write_settings()
|
function compassgps.write_settings()
|
||||||
--loop through players and set settings
|
--loop through players and set settings
|
||||||
--(less error prone than trying to keep settings in sync all the time
|
--(less error prone than trying to keep settings in sync all the time
|
||||||
print("compassgps writing settings")
|
print(S("compassgps writing settings"))
|
||||||
local players = minetest.get_connected_players()
|
local players = minetest.get_connected_players()
|
||||||
for i,player in ipairs(players) do
|
for i,player in ipairs(players) do
|
||||||
local name = player:get_player_name();
|
local name = player:get_player_name();
|
||||||
|
@ -609,24 +616,24 @@ function compassgps.set_bookmark(playername, bkmrkname, type, predefinedpos)
|
||||||
bkmrkname=compassgps.clean_string(bkmrkname)
|
bkmrkname=compassgps.clean_string(bkmrkname)
|
||||||
|
|
||||||
if bkmrkname == "" then
|
if bkmrkname == "" then
|
||||||
minetest.chat_send_player(playername, "Give the bookmark a name.")
|
minetest.chat_send_player(playername, S("Give the bookmark a name."))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if bkmrkname == "default" or bkmrkname == "bed" or bkmrkname == "sethome"
|
if bkmrkname == "default" or bkmrkname == "bed" or bkmrkname == "sethome"
|
||||||
or string.sub(bkmrkname,1,8) == "*shared*"
|
or string.sub(bkmrkname,1,8) == "*shared*"
|
||||||
or string.sub(bkmrkname,1,7)=="*admin*" then
|
or string.sub(bkmrkname,1,7)=="*admin*" then
|
||||||
minetest.chat_send_player(playername, "A bookmark with the name '"..bkmrkname.."' can't be created.")
|
minetest.chat_send_player(playername, S("A bookmark with the name '%s' can't be created."):format(bkmrkname))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if bookmarks[playername..bkmrkname] then
|
if bookmarks[playername..bkmrkname] then
|
||||||
minetest.chat_send_player(playername, "You already have a bookmark with that name.")
|
minetest.chat_send_player(playername, S("You already have a bookmark with that name."))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
pos.type=type or "P" --Private Shared Admin
|
pos.type=type or "P" --Private Shared Admin
|
||||||
|
|
||||||
if pos.type=="S" and compassgps.count_shared(playername) >= max_shared then
|
if pos.type=="S" and compassgps.count_shared(playername) >= max_shared then
|
||||||
minetest.chat_send_player(playername, "The maximum number of shared bookmarks any user can create is "..max_shared)
|
minetest.chat_send_player(playername, S("The maximum number of shared bookmarks any user can create is %d."):format(max_shared))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -636,13 +643,13 @@ function compassgps.set_bookmark(playername, bkmrkname, type, predefinedpos)
|
||||||
bookmarks[playername..bkmrkname] = pos
|
bookmarks[playername..bkmrkname] = pos
|
||||||
|
|
||||||
compassgps.write_bookmarks()
|
compassgps.write_bookmarks()
|
||||||
minetest.chat_send_player(playername, "Bookmark "..bkmrkname.." added at "..compassgps.pos_to_string(pos).." type="..pos.type)
|
minetest.chat_send_player(playername, S("Bookmark '%s' added at %s type=%s"):format(bkmrkname, compassgps.pos_to_string(pos), pos.type))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
minetest.register_chatcommand("set_bookmark", {
|
minetest.register_chatcommand("set_bookmark", {
|
||||||
params = "<bookmark_name>",
|
params = "<bookmark_name>",
|
||||||
description = "set_bookmark: Sets a location bookmark for the player",
|
description = S("set_bookmark: Sets a location bookmark for the player"),
|
||||||
func = function (playername, bkmrkname)
|
func = function (playername, bkmrkname)
|
||||||
compassgps.set_bookmark(playername, bkmrkname, "P")
|
compassgps.set_bookmark(playername, bkmrkname, "P")
|
||||||
end,
|
end,
|
||||||
|
@ -688,7 +695,7 @@ end --pos_to_string
|
||||||
|
|
||||||
minetest.register_chatcommand("list_bookmarks", {
|
minetest.register_chatcommand("list_bookmarks", {
|
||||||
params = "",
|
params = "",
|
||||||
description = "list_bookmarks: Lists all bookmarks of a player",
|
description = S("list_bookmarks: Lists all bookmarks of a player"),
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
compassgps.bookmark_loop("C",name)
|
compassgps.bookmark_loop("C",name)
|
||||||
end,
|
end,
|
||||||
|
@ -698,22 +705,22 @@ minetest.register_chatcommand("list_bookmarks", {
|
||||||
function compassgps.verify_bookmark_parms(from_function,player,playername,bkmrkidx)
|
function compassgps.verify_bookmark_parms(from_function,player,playername,bkmrkidx)
|
||||||
--just being paranoid, probably none of these checks are necessary
|
--just being paranoid, probably none of these checks are necessary
|
||||||
if not player then
|
if not player then
|
||||||
print("compassgps."..from_function.." player not found")
|
print(S("compassgps.%s player not found"):format(from_function))
|
||||||
if not playername then print(" playername=nil")
|
if not playername then print(S(" playername=nil"))
|
||||||
else print(" playername="..playername)
|
else print(S(" playername=%s"):format(playername))
|
||||||
end --if not playername
|
end --if not playername
|
||||||
return false
|
return false
|
||||||
end --if not player
|
end --if not player
|
||||||
if not tonumber(bkmrkidx) then
|
if not tonumber(bkmrkidx) then
|
||||||
print("compassgps."..from_function.." invalid bkrmkidx")
|
print(S("compassgps.%s invalid bkrmkidx"):format(from_funtion))
|
||||||
if not bkmrkidx then print(" bkmrkidx=nil")
|
if not bkmrkidx then print(S(" bkmrkidx=nil"))
|
||||||
else print(" bkmrkidx="..bkmrkidx)
|
else print(" bkmrkidx="..bkmrkidx)
|
||||||
end --if not bkmrkidx
|
end --if not bkmrkidx
|
||||||
return false
|
return false
|
||||||
end --if not tonumber(bkmrkidx)
|
end --if not tonumber(bkmrkidx)
|
||||||
if not textlist_bkmrks[playername][bkmrkidx] then
|
if not textlist_bkmrks[playername][bkmrkidx] then
|
||||||
print("compassgps."..from_function.." invalid bookmark playername="..playername.." bkmrkid="..bkmrkidx)
|
print(S("compassgps.%s invalid bookmark playername=%s bkmrkid=%s"):format(from_function, playername, bkmrkidx))
|
||||||
minetest.chat_send_player(playername,"compassgps:"..from_function.." invalid bookmark")
|
minetest.chat_send_player(playername,S("compassgps:%s invalid bookmark"):format(from_function))
|
||||||
return false
|
return false
|
||||||
end --if not textlist_bkmrks
|
end --if not textlist_bkmrks
|
||||||
return true --if you got here it is all good
|
return true --if you got here it is all good
|
||||||
|
@ -728,9 +735,9 @@ function compassgps.remove_bookmark(playername, bkmrkidx)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print("remove bookmark playername="..playername.." bkmrkidx="..bkmrkidx)
|
print(S("remove bookmark playername=%s bkmrkidx=%s"):format(playername, bkmrkidx))
|
||||||
minetest.chat_send_player(playername, "removed "..
|
minetest.chat_send_player(playername, S("removed %s"):format(
|
||||||
compassgps.bookmark_name_string(textlist_bkmrks[playername][bkmrkidx]))
|
compassgps.bookmark_name_string(textlist_bkmrks[playername][bkmrkidx])))
|
||||||
bookmarks[textlist_bkmrks[playername][bkmrkidx].player..
|
bookmarks[textlist_bkmrks[playername][bkmrkidx].player..
|
||||||
textlist_bkmrks[playername][bkmrkidx].bkmrkname] = nil
|
textlist_bkmrks[playername][bkmrkidx].bkmrkname] = nil
|
||||||
compassgps.write_bookmarks()
|
compassgps.write_bookmarks()
|
||||||
|
@ -744,23 +751,23 @@ function compassgps.remove_bookmark_byname(playername, bkmrkname)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if bkmrkname == "" then
|
if bkmrkname == "" then
|
||||||
minetest.chat_send_player(name, "No bookmark was specified.")
|
minetest.chat_send_player(name, S("No bookmark was specified."))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not bookmarks[playername..bkmrkname] then
|
if not bookmarks[playername..bkmrkname] then
|
||||||
minetest.chat_send_player(playername, "You have no bookmark with this name.")
|
minetest.chat_send_player(playername, S("You have no bookmark with this name."))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
bookmarks[playername..bkmrkname] = nil
|
bookmarks[playername..bkmrkname] = nil
|
||||||
compassgps.write_bookmarks()
|
compassgps.write_bookmarks()
|
||||||
minetest.chat_send_player(playername, "The bookmark "..bkmrkname.." has been successfully removed.")
|
minetest.chat_send_player(playername, S("The bookmark "..bkmrkname.." has been successfully removed."))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_chatcommand("remove_bookmark", {
|
minetest.register_chatcommand("remove_bookmark", {
|
||||||
params = "<bookmark_name>",
|
params = "<bookmark_name>",
|
||||||
description = "Removes the bookmark specified by <bookmark_name>",
|
description = S("Removes the bookmark specified by <bookmark_name>"),
|
||||||
func = function(name, bkmrkname)
|
func = function(name, bkmrkname)
|
||||||
compassgps.remove_bookmark_byname(name,bkmrkname)
|
compassgps.remove_bookmark_byname(name,bkmrkname)
|
||||||
end,
|
end,
|
||||||
|
@ -771,10 +778,10 @@ function compassgps.teleport_bookmark(playername, bkmrkidx)
|
||||||
local player = minetest.get_player_by_name(playername)
|
local player = minetest.get_player_by_name(playername)
|
||||||
if not compassgps.verify_bookmark_parms("teleport_bookmark",player,playername,bkmrkidx)
|
if not compassgps.verify_bookmark_parms("teleport_bookmark",player,playername,bkmrkidx)
|
||||||
then return end
|
then return end
|
||||||
print("compassgps teleporting player "..playername.." to "..
|
print(S("compassgps teleporting player %s to %s"):format(playername,
|
||||||
compassgps.bookmark_name_string(textlist_bkmrks[playername][bkmrkidx]))
|
compassgps.bookmark_name_string(textlist_bkmrks[playername][bkmrkidx])))
|
||||||
minetest.chat_send_player(playername, "Teleporting to "..
|
minetest.chat_send_player(playername, S("Teleporting to %s"):format(
|
||||||
compassgps.bookmark_name_string(textlist_bkmrks[playername][bkmrkidx]))
|
compassgps.bookmark_name_string(textlist_bkmrks[playername][bkmrkidx])))
|
||||||
player:setpos(textlist_bkmrks[playername][bkmrkidx])
|
player:setpos(textlist_bkmrks[playername][bkmrkidx])
|
||||||
end --teleport_bookmark
|
end --teleport_bookmark
|
||||||
|
|
||||||
|
@ -786,20 +793,20 @@ function compassgps.find_bookmark_byname(playername, bkmrkname)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not bkmrkname or bkmrkname == "" then
|
if not bkmrkname or bkmrkname == "" then
|
||||||
minetest.chat_send_player(name, "No bookmark was specified.")
|
minetest.chat_send_player(name, S("No bookmark was specified."))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if bkmrkname == "default" then
|
if bkmrkname == "default" then
|
||||||
minetest.chat_send_player(name, "Pointing at default location.")
|
minetest.chat_send_player(name, S("Pointing at default location."))
|
||||||
point_to[playername] = compassgps.get_default_bookmark(playername)
|
point_to[playername] = compassgps.get_default_bookmark(playername)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not bookmarks[playername..bkmrkname] then
|
if not bookmarks[playername..bkmrkname] then
|
||||||
minetest.chat_send_player(name, "You have no bookmark with this name.")
|
minetest.chat_send_player(name, S("You have no bookmark with this name."))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
point_to[playername] = bookmarks[playername..bkmrkname]
|
point_to[playername] = bookmarks[playername..bkmrkname]
|
||||||
minetest.chat_send_player(playername, "Pointing at "..bkmrkname..".")
|
minetest.chat_send_player(playername, S("Pointing at %s."):format(bkmrkname))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -809,13 +816,13 @@ function compassgps.find_bookmark(playername, bkmrkidx)
|
||||||
if not compassgps.verify_bookmark_parms("find_bookmark",player,playername,bkmrkidx)
|
if not compassgps.verify_bookmark_parms("find_bookmark",player,playername,bkmrkidx)
|
||||||
then return end
|
then return end
|
||||||
point_to[playername] = textlist_bkmrks[playername][bkmrkidx]
|
point_to[playername] = textlist_bkmrks[playername][bkmrkidx]
|
||||||
minetest.chat_send_player(playername, "Pointing at "..point_to[playername].bkmrkname)
|
minetest.chat_send_player(playername, S("Pointing at %s."):format(point_to[playername].bkmrkname))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
minetest.register_chatcommand("find_bookmark", {
|
minetest.register_chatcommand("find_bookmark", {
|
||||||
params = "<bookmark_name>",
|
params = "<bookmark_name>",
|
||||||
description = "Lets the compassgps point to the bookmark",
|
description = S("Lets the compassgps point to the bookmark"),
|
||||||
func = function(playername, bkmrkname)
|
func = function(playername, bkmrkname)
|
||||||
compassgps.find_bookmark_byname(playername,bkmrkname)
|
compassgps.find_bookmark_byname(playername,bkmrkname)
|
||||||
end,
|
end,
|
||||||
|
@ -1148,39 +1155,39 @@ function compassgps.get_compassgps_formspec(name)
|
||||||
end
|
end
|
||||||
local telebutton=""
|
local telebutton=""
|
||||||
if player_privs["teleport"] then
|
if player_privs["teleport"] then
|
||||||
telebutton="button[4,9.3;3,1;teleport;teleport to bookmark]"
|
telebutton="button[4,9.3;3,1;teleport;"..S("teleport to bookmark").."]"
|
||||||
end
|
end
|
||||||
local sharedbutton=""
|
local sharedbutton=""
|
||||||
if player_privs["shared_bookmarks"] and not singleplayer then
|
if player_privs["shared_bookmarks"] and not singleplayer then
|
||||||
sharedbutton="button[2.3,0.7;2.3,1;new_shared_bookmark;create shared]"
|
sharedbutton="button[2.3,0.7;2.3,1;new_shared_bookmark;"..S("create shared").."]"
|
||||||
end
|
end
|
||||||
local adminbutton=""
|
local adminbutton=""
|
||||||
if player_privs["privs"] and not singleplayer then
|
if player_privs["privs"] and not singleplayer then
|
||||||
adminbutton="button[4.6,0.7;2.3,1;new_admin_bookmark;create admin]"
|
adminbutton="button[4.6,0.7;2.3,1;new_admin_bookmark;"..S("create admin").."]"
|
||||||
end
|
end
|
||||||
|
|
||||||
local checkboxes=""
|
local checkboxes=""
|
||||||
if not singleplayer then
|
if not singleplayer then
|
||||||
checkboxes="label[3.65,1.75;Show:]"..
|
checkboxes="label[3.65,1.75;"..S("Show:").."]"..
|
||||||
"checkbox[4.35,1.4;show_private;Private;"..view_type_P[name].."]"..
|
"checkbox[4.35,1.4;show_private;"..S("Private")..";"..view_type_P[name].."]"..
|
||||||
"checkbox[4.35,1.7;show_shared;Shared;"..view_type_S[name].."]"..
|
"checkbox[4.35,1.7;show_shared;"..S("Shared")..";"..view_type_S[name].."]"..
|
||||||
"checkbox[4.35,2.0;show_admin;Admin;"..view_type_A[name].."]"
|
"checkbox[4.35,2.0;show_admin;"..S("Admin")..";"..view_type_A[name].."]"
|
||||||
end
|
end
|
||||||
|
|
||||||
return "compassgps:bookmarks", "size[9,10;]"..
|
return "compassgps:bookmarks", "size[9,10;]"..
|
||||||
"field[0,0.2;5,1;bookmark;bookmark:;]"..
|
"field[0,0.2;5,1;bookmark;"..S("bookmark")..":;]"..
|
||||||
"button[5.5,0;2.25,0.8;settings;Settings]"..
|
"button[5.5,0;2.25,0.8;settings;"..S("Settings").."]"..
|
||||||
"button[0,0.7;2.3,1;new_bookmark;create bookmark]"..
|
"button[0,0.7;2.3,1;new_bookmark;"..S("create bookmark").."]"..
|
||||||
sharedbutton..
|
sharedbutton..
|
||||||
adminbutton..
|
adminbutton..
|
||||||
"button[6.9,0.7;2.4,1;remove_bookmark;remove bookmark]"..
|
"button[6.9,0.7;2.4,1;remove_bookmark;"..S("remove bookmark").."]"..
|
||||||
"label[0,1.75;Sort by:]"..
|
"label[0,1.75;"..S("Sort by:").."]"..
|
||||||
"textlist[1,1.75;1.2,1;sort_type;name,distance;"..sortdropdown.."]"..
|
"textlist[1,1.75;1.2,1;sort_type;"..S("name")..","..S("distance")..";"..sortdropdown.."]"..
|
||||||
"label[2.4,1.75;Dist:]"..
|
"label[2.4,1.75;"..S("Dist:").."]"..
|
||||||
"textlist[3,1.75;.5,1;distance_type;3d,2d;"..distdropdown.."]"..
|
"textlist[3,1.75;.5,1;distance_type;3d,2d;"..distdropdown.."]"..
|
||||||
checkboxes..
|
checkboxes..
|
||||||
"textlist[0,3.0;9,6;bookmark_list;"..list..";"..bkmrkidx.."]"..
|
"textlist[0,3.0;9,6;bookmark_list;"..list..";"..bkmrkidx.."]"..
|
||||||
"button[0,9.3;3,1;find_bookmark;find selected bookmark]"..
|
"button[0,9.3;3,1;find_bookmark;"..S("find selected bookmark").."]"..
|
||||||
telebutton
|
telebutton
|
||||||
|
|
||||||
end --get_compassgps_formspec
|
end --get_compassgps_formspec
|
||||||
|
@ -1191,11 +1198,11 @@ function compassgps.get_settings_formspec(name)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
|
|
||||||
return "compassgps:settings", "size[8,4;]"..
|
return "compassgps:settings", "size[8,4;]"..
|
||||||
"button[1,0.2;2.25,1;hud_pos;Change hud:]"..
|
"button[1,0.2;2.25,1;hud_pos;"..S("Change hud:").."]"..
|
||||||
"field[3.6,0.5;1.2,1;hudx;X:("..hud_default_x..");"..hud_pos[name].x.."]"..
|
"field[3.6,0.5;1.2,1;hudx;X:("..hud_default_x..");"..hud_pos[name].x.."]"..
|
||||||
"field[4.8,0.5;1.2,1;hudy;Y:("..hud_default_y..");"..hud_pos[name].y.."]"..
|
"field[4.8,0.5;1.2,1;hudy;Y:("..hud_default_y..");"..hud_pos[name].y.."]"..
|
||||||
"field[6.0,0.5;2,1;hudcolor;Color:("..hud_default_color..");"..hud_color[name].."]"..
|
"field[6.0,0.5;2,1;hudcolor;"..S("Color:").."("..hud_default_color..");"..hud_color[name].."]"..
|
||||||
"label[1,1.5;Compass Type:]"..
|
"label[1,1.5;"..S("Compass Type:").."]"..
|
||||||
"image_button[3,1.5;1,1;compass_0.png;compass_type_a;]"..
|
"image_button[3,1.5;1,1;compass_0.png;compass_type_a;]"..
|
||||||
"image_button[4,1.5;1,1;compass_b0.png;compass_type_b;]"..
|
"image_button[4,1.5;1,1;compass_b0.png;compass_type_b;]"..
|
||||||
"image_button[5,1.5;1,1;compass_c0.png;compass_type_c;]"
|
"image_button[5,1.5;1,1;compass_c0.png;compass_type_c;]"
|
||||||
|
@ -1219,7 +1226,7 @@ for i=1,12 do
|
||||||
img="compass_"..ctypename..".png"
|
img="compass_"..ctypename..".png"
|
||||||
--print("registering compassgps:"..ctypename.." img="..img)
|
--print("registering compassgps:"..ctypename.." img="..img)
|
||||||
minetest.register_tool("compassgps:"..ctypename, {
|
minetest.register_tool("compassgps:"..ctypename, {
|
||||||
description = "compassgps",
|
description = S("compassgps"),
|
||||||
inventory_image = img,
|
inventory_image = img,
|
||||||
wield_image = img, --.."^[transformR90" didn't work
|
wield_image = img, --.."^[transformR90" didn't work
|
||||||
on_use = function (itemstack, user, pointed_thing)
|
on_use = function (itemstack, user, pointed_thing)
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
bkmrkidx\=nil = bkmrkidx\=nil
|
||||||
|
playername\=%s = playername\=%s
|
||||||
|
playername\=nil = playername\=nil
|
||||||
|
%s's map = Karte von %s
|
||||||
|
A bookmark with the name '%s' can't be created. = Ein weiterer Wegpunkt mit dem Namen '%s' kann nicht erstellt werden.
|
||||||
|
Admin = Administrator
|
||||||
|
Bookmark '%s' added at %s type\=%s = Wegpunkt '%s' wurde bei %s vom Typ %s erstellt.
|
||||||
|
Change hud: = Ändere HUD:
|
||||||
|
Color: = Farbe:
|
||||||
|
Dist: = Entfernung:
|
||||||
|
Compass Type: = Kompasstyp:
|
||||||
|
Give the bookmark a name. = Geben Sie dem Wegpunkt einen Namen
|
||||||
|
Lets the compassgps point to the bookmark = Lässt den Kompass auf den Wegpunkt zeigen.
|
||||||
|
No = Nein
|
||||||
|
No bookmark was specified. = Kein Wegpunkt wurde angegegeben.
|
||||||
|
Pointing at %s. = Zeige auf %s.
|
||||||
|
Pointing at default location. = Zeige auf die Standardposition.
|
||||||
|
Private = Privat
|
||||||
|
Remove bookmark: = Entferne Wegpunkt:
|
||||||
|
Removes the bookmark specified by <bookmark_name> = Entfernt den Wegpunkt der mit <bookmark_name> angegeben ist.
|
||||||
|
Settings = Einstellungen
|
||||||
|
Shared = Geteilt
|
||||||
|
Show: = Zeige:
|
||||||
|
Sort by: = Sortiere nach:
|
||||||
|
Teleporting to %s = Teleportiere zu %s
|
||||||
|
The bookmark = Der Wegpunkt
|
||||||
|
The maximum number of shared bookmarks any user can create is %d. = Jeder Nutzer kann nur %d geteilte Wegpunkte erstellen.
|
||||||
|
Yes = Ja
|
||||||
|
You already have a bookmark with that name. = Sie haben bereits einen Wegpunkt mit diesem Namen.
|
||||||
|
You have no bookmark with this name. = Sie haben keinen Wegpunkt mit diesem Namen.
|
||||||
|
bookmark = Wegpunkt
|
||||||
|
compassgps reading bookmarks = compassgps liest die Wegpunkte.
|
||||||
|
compassgps reading settings = compassgps liest die Einstellungen.
|
||||||
|
compassgps = Kompass
|
||||||
|
compassgps teleporting player %s to %s = compassgps teleportiert Spieler %s nach %s.
|
||||||
|
compassgps writing settings = compassgps schreibt die Einstellungen.
|
||||||
|
compassgps.%s invalid bkrmkidx = compassgps.%s ungültige bkmrkidx.
|
||||||
|
compassgps.%s invalid bookmark playername\=%s bkmrkid\=%s = compassgps.%s ungültiger Wegpunkt Spielername\=%s bkmrkidx\=%s.
|
||||||
|
compassgps.%s player not found = compassgps.%s Spieler nicht gefunden.
|
||||||
|
compassgps: hud color not valid hex number = compassgps: HUD Farbe ist keine zulässige Hexadezimalzahl.
|
||||||
|
compassgps: hud coords are not numeric. Change to between 0 and 1 = compassgps: HUD Koordinaten sind keine Zahlen. Ändern sie diese zu Werten zwischen 0 und 1.
|
||||||
|
compassgps: hud coords out of range, hud will not be displayed. Change to between 0 and 1 to restore = compassgps: HUD Koordinaten sind außerhalb des zulässigen Bereichs. Ändern sie diese zu Werten zwischen 0 und 1 um das HUD wiederherzustellen.
|
||||||
|
compassgps:%s invalid bookmark = compassgps.%s ungültiger Wegpunkt
|
||||||
|
create admin = Erstelle Administratorwegpunkt
|
||||||
|
create bookmark = Erstelle Wegpunkt
|
||||||
|
create shared = Erstelle geteilten Wegpunkt
|
||||||
|
current position : = Momentane Position :
|
||||||
|
distance = Entfernung
|
||||||
|
find selected bookmark = Finde den ausgewählten Wegpunkt
|
||||||
|
list_bookmarks: Lists all bookmarks of a player = list_bookmarks: Zeigt alle Wegpunkte eines Spielers.
|
||||||
|
name = Name
|
||||||
|
remove bookmark = Entferne den Wegpunkt
|
||||||
|
remove bookmark playername\=%s bkmrkidx\=%s = Entferne den Wegpunkt Spielername\=%s bkmrkidx\=%s
|
||||||
|
removed %s = %s entfernt.
|
||||||
|
set_bookmark: Sets a location bookmark for the player = set_bookmark: Setzt einen Wegpunkt für den Spieler.
|
||||||
|
teleport to bookmark = Teleportiere zu dem Wegpunkt.
|
||||||
|
you can not remove someone elses bookmark: = Sie können den Wegpunkt eines anderen Spielers nicht entfernen:
|
||||||
|
CompassGPS Map (blank) = CompassGPS Karte (leer)
|
||||||
|
CompassGPS Map (marked) = CompassGPS Karte (markiert)
|
||||||
|
Write to cgpsmap = Schreibe auf die Karte
|
||||||
|
copy bookmark to your compassgps = Kopiere den Wegpunkt in ihren Kompass.
|
||||||
|
bookmark name: = Name des Wegpunkts:
|
||||||
|
bookmark pos: = Position des Wegpunkts:
|
|
@ -0,0 +1,63 @@
|
||||||
|
bkmrkidx\=nil =
|
||||||
|
playername\=%s =
|
||||||
|
playername\=nil =
|
||||||
|
%s's map =
|
||||||
|
A bookmark with the name '%s' can't be created. =
|
||||||
|
Admin =
|
||||||
|
Bookmark '%s' added at %s type\=%s =
|
||||||
|
Change hud: =
|
||||||
|
Color: =
|
||||||
|
Dist: =
|
||||||
|
Compass Type: =
|
||||||
|
Give the bookmark a name. =
|
||||||
|
Lets the compassgps point to the bookmark =
|
||||||
|
No =
|
||||||
|
No bookmark was specified. =
|
||||||
|
Pointing at %s. =
|
||||||
|
Pointing at default location. =
|
||||||
|
Private =
|
||||||
|
Remove bookmark: =
|
||||||
|
Removes the bookmark specified by <bookmark_name> =
|
||||||
|
Settings =
|
||||||
|
Shared =
|
||||||
|
Show: =
|
||||||
|
Sort by: =
|
||||||
|
Teleporting to %s =
|
||||||
|
The bookmark =
|
||||||
|
The maximum number of shared bookmarks any user can create is %d. =
|
||||||
|
Yes =
|
||||||
|
You already have a bookmark with that name. =
|
||||||
|
You have no bookmark with this name. =
|
||||||
|
bookmark =
|
||||||
|
compassgps reading bookmarks =
|
||||||
|
compassgps reading settings =
|
||||||
|
compassgps =
|
||||||
|
compassgps teleporting player %s to %s =
|
||||||
|
compassgps writing settings =
|
||||||
|
compassgps.%s invalid bkrmkidx =
|
||||||
|
compassgps.%s invalid bookmark playername\=%s bkmrkid\=%s =
|
||||||
|
compassgps.%s player not found =
|
||||||
|
compassgps: hud color not valid hex number =
|
||||||
|
compassgps: hud coords are not numeric. Change to between 0 and 1 =
|
||||||
|
compassgps: hud coords out of range, hud will not be displayed. Change to between 0 and 1 to restore =
|
||||||
|
compassgps:%s invalid bookmark =
|
||||||
|
create admin =
|
||||||
|
create bookmark =
|
||||||
|
create shared =
|
||||||
|
current position : =
|
||||||
|
distance =
|
||||||
|
find selected bookmark =
|
||||||
|
list_bookmarks: Lists all bookmarks of a player =
|
||||||
|
name =
|
||||||
|
remove bookmark =
|
||||||
|
remove bookmark playername\=%s bkmrkidx\=%s =
|
||||||
|
removed %s =
|
||||||
|
set_bookmark: Sets a location bookmark for the player =
|
||||||
|
teleport to bookmark =
|
||||||
|
you can not remove someone elses bookmark: =
|
||||||
|
CompassGPS Map (blank) =
|
||||||
|
CompassGPS Map (marked) =
|
||||||
|
Write to cgpsmap =
|
||||||
|
copy bookmark to your compassgps =
|
||||||
|
bookmark name: =
|
||||||
|
bookmark pos: =
|
Loading…
Reference in New Issue