Revert "Merge branch 'master' of https://github.com/minetest/minetest"

This reverts commit 6388be3057, reversing
changes made to 036095e237.
This commit is contained in:
Brandon 2013-07-12 21:39:49 -05:00
parent 6388be3057
commit cbdcc3de38
119 changed files with 6209 additions and 11906 deletions

View File

@ -16,7 +16,7 @@ See the README.txt in it.
Further documentation Further documentation
---------------------- ----------------------
- Website: http://minetest.net/ - Website: http://minetest.net/
- Wiki: http://wiki.minetest.net/ - Wiki: http://wiki.minetest.com/
- Developer wiki: http://dev.minetest.net/ - Developer wiki: http://dev.minetest.net/
- Forum: http://forum.minetest.net/ - Forum: http://forum.minetest.net/
- Github: https://github.com/minetest/minetest/ - Github: https://github.com/minetest/minetest/

View File

@ -11,20 +11,18 @@ math.randomseed(os.time())
os.setlocale("C", "numeric") os.setlocale("C", "numeric")
-- Load other files -- Load other files
local modpath = minetest.get_modpath("__builtin") dofile(minetest.get_modpath("__builtin").."/serialize.lua")
dofile(modpath.."/serialize.lua") dofile(minetest.get_modpath("__builtin").."/misc_helpers.lua")
dofile(modpath.."/misc_helpers.lua") dofile(minetest.get_modpath("__builtin").."/item.lua")
dofile(modpath.."/item.lua") dofile(minetest.get_modpath("__builtin").."/misc_register.lua")
dofile(modpath.."/misc_register.lua") dofile(minetest.get_modpath("__builtin").."/item_entity.lua")
dofile(modpath.."/item_entity.lua") dofile(minetest.get_modpath("__builtin").."/deprecated.lua")
dofile(modpath.."/deprecated.lua") dofile(minetest.get_modpath("__builtin").."/misc.lua")
dofile(modpath.."/misc.lua") dofile(minetest.get_modpath("__builtin").."/privileges.lua")
dofile(modpath.."/privileges.lua") dofile(minetest.get_modpath("__builtin").."/auth.lua")
dofile(modpath.."/auth.lua") dofile(minetest.get_modpath("__builtin").."/chatcommands.lua")
dofile(modpath.."/chatcommands.lua") dofile(minetest.get_modpath("__builtin").."/static_spawn.lua")
dofile(modpath.."/static_spawn.lua") dofile(minetest.get_modpath("__builtin").."/detached_inventory.lua")
dofile(modpath.."/detached_inventory.lua") dofile(minetest.get_modpath("__builtin").."/falling.lua")
dofile(modpath.."/falling.lua") dofile(minetest.get_modpath("__builtin").."/features.lua")
dofile(modpath.."/features.lua") dofile(minetest.get_modpath("__builtin").."/voxelarea.lua")
dofile(modpath.."/voxelarea.lua")
dofile(modpath.."/vector.lua")

View File

@ -272,9 +272,6 @@ minetest.register_chatcommand("teleport", {
local teleportee = nil local teleportee = nil
local p = {} local p = {}
p.x, p.y, p.z = string.match(param, "^([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$") p.x, p.y, p.z = string.match(param, "^([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$")
p.x = tonumber(p.x)
p.y = tonumber(p.y)
p.z = tonumber(p.z)
teleportee = minetest.get_player_by_name(name) teleportee = minetest.get_player_by_name(name)
if teleportee and p.x and p.y and p.z then if teleportee and p.x and p.y and p.z then
minetest.chat_send_player(name, "Teleporting to ("..p.x..", "..p.y..", "..p.z..")") minetest.chat_send_player(name, "Teleporting to ("..p.x..", "..p.y..", "..p.z..")")
@ -305,9 +302,6 @@ minetest.register_chatcommand("teleport", {
local p = {} local p = {}
local teleportee_name = nil local teleportee_name = nil
teleportee_name, p.x, p.y, p.z = string.match(param, "^([^ ]+) +([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$") teleportee_name, p.x, p.y, p.z = string.match(param, "^([^ ]+) +([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$")
p.x = tonumber(p.x)
p.y = tonumber(p.y)
p.z = tonumber(p.z)
if teleportee_name then if teleportee_name then
teleportee = minetest.get_player_by_name(teleportee_name) teleportee = minetest.get_player_by_name(teleportee_name)
end end

View File

@ -1,309 +0,0 @@
--Minetest
--Copyright (C) 2013 sapier
--
--This program 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 program 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 program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
gamemgr = {}
--------------------------------------------------------------------------------
function gamemgr.dialog_new_game()
local retval =
"label[2,2;Game Name]"..
"field[4.5,2.4;6,0.5;te_game_name;;]" ..
"button[5,4.2;2.6,0.5;new_game_confirm;Create]" ..
"button[7.5,4.2;2.8,0.5;new_game_cancel;Cancel]"
return retval
end
--------------------------------------------------------------------------------
function gamemgr.handle_games_buttons(fields)
if fields["gamelist"] ~= nil then
local event = explode_textlist_event(fields["gamelist"])
gamemgr.selected_game = event.index
end
if fields["btn_game_mgr_edit_game"] ~= nil then
return {
is_dialog = true,
show_buttons = false,
current_tab = "dialog_edit_game"
}
end
if fields["btn_game_mgr_new_game"] ~= nil then
return {
is_dialog = true,
show_buttons = false,
current_tab = "dialog_new_game"
}
end
return nil
end
--------------------------------------------------------------------------------
function gamemgr.handle_new_game_buttons(fields)
if fields["new_game_confirm"] and
fields["te_game_name"] ~= nil and
fields["te_game_name"] ~= "" then
local gamepath = engine.get_gamepath()
if gamepath ~= nil and
gamepath ~= "" then
local gamefolder = cleanup_path(fields["te_game_name"])
--TODO check for already existing first
engine.create_dir(gamepath .. DIR_DELIM .. gamefolder)
engine.create_dir(gamepath .. DIR_DELIM .. gamefolder .. DIR_DELIM .. "mods")
engine.create_dir(gamepath .. DIR_DELIM .. gamefolder .. DIR_DELIM .. "menu")
local gameconf =
io.open(gamepath .. DIR_DELIM .. gamefolder .. DIR_DELIM .. "game.conf","w")
if gameconf then
gameconf:write("name = " .. fields["te_game_name"])
gameconf:close()
end
end
end
return {
is_dialog = false,
show_buttons = true,
current_tab = engine.setting_get("main_menu_tab")
}
end
--------------------------------------------------------------------------------
function gamemgr.handle_edit_game_buttons(fields)
local current_game = gamemgr.get_game(gamemgr.selected_game)
if fields["btn_close_edit_game"] ~= nil or
current_game == nil then
return {
is_dialog = false,
show_buttons = true,
current_tab = engine.setting_get("main_menu_tab")
}
end
if fields["btn_remove_mod_from_game"] ~= nil then
gamemgr.delete_mod(current_game,engine.get_textlist_index("mods_current"))
end
if fields["btn_add_mod_to_game"] ~= nil then
local modindex = engine.get_textlist_index("mods_available")
if modindex > 0 and
modindex <= #modmgr.global_mods then
local sourcepath =
engine.get_modpath() .. DIR_DELIM .. modmgr.global_mods[modindex]
gamemgr.add_mod(current_game,sourcepath)
end
end
return nil
end
--------------------------------------------------------------------------------
function gamemgr.add_mod(gamespec,sourcepath)
if gamespec.gamemods_path ~= nil and
gamespec.gamemods_path ~= "" then
local modname = get_last_folder(sourcepath)
engine.copy_dir(sourcepath,gamespec.gamemods_path .. DIR_DELIM .. modname);
end
end
--------------------------------------------------------------------------------
function gamemgr.delete_mod(gamespec,modindex)
if gamespec.gamemods_path ~= nil and
gamespec.gamemods_path ~= "" then
local game_mods = {}
get_mods(gamespec.gamemods_path,game_mods)
if modindex > 0 and
#game_mods >= modindex then
local modname = game_mods[modindex]
if modname:find("<MODPACK>") ~= nil then
modname = modname:sub(0,modname:find("<") -2)
end
local modpath = gamespec.gamemods_path .. DIR_DELIM .. modname
if modpath:sub(0,gamespec.gamemods_path:len()) == gamespec.gamemods_path then
engine.delete_dir(modpath)
end
end
end
end
--------------------------------------------------------------------------------
function gamemgr.get_game_mods(gamespec)
local retval = ""
if gamespec.gamemods_path ~= nil and
gamespec.gamemods_path ~= "" then
local game_mods = {}
get_mods(gamespec.gamemods_path,game_mods)
for i=1,#game_mods,1 do
if retval ~= "" then
retval = retval..","
end
retval = retval .. game_mods[i]
end
end
return retval
end
--------------------------------------------------------------------------------
function gamemgr.gettab(name)
local retval = ""
if name == "dialog_edit_game" then
retval = retval .. gamemgr.dialog_edit_game()
end
if name == "dialog_new_game" then
retval = retval .. gamemgr.dialog_new_game()
end
if name == "game_mgr" then
retval = retval .. gamemgr.tab()
end
return retval
end
--------------------------------------------------------------------------------
function gamemgr.tab()
if gamemgr.selected_game == nil then
gamemgr.selected_game = 1
end
local retval =
"vertlabel[0,-0.25;GAMES]" ..
"label[1,-0.25;Games:]" ..
"textlist[1,0.25;4.5,4.4;gamelist;" ..
gamemgr.gamelist() ..
";" .. gamemgr.selected_game .. "]"
local current_game = gamemgr.get_game(gamemgr.selected_game)
if current_game ~= nil then
if current_game.menuicon_path ~= nil and
current_game.menuicon_path ~= "" then
retval = retval ..
"image[5.8,-0.25;2,2;" .. current_game.menuicon_path .. "]"
end
retval = retval ..
"field[8,-0.25;6,2;;" .. current_game.name .. ";]"..
"label[6,1.4;Mods:]" ..
"button[9.7,1.5;2,0.2;btn_game_mgr_edit_game;edit game]" ..
"textlist[6,2;5.5,3.3;game_mgr_modlist;"
.. gamemgr.get_game_mods(current_game) ..";0]" ..
"button[1,4.75;3.2,0.5;btn_game_mgr_new_game;new game]"
end
return retval
end
--------------------------------------------------------------------------------
function gamemgr.dialog_edit_game()
local current_game = gamemgr.get_game(gamemgr.selected_game)
if current_game ~= nil then
local retval =
"vertlabel[0,-0.25;EDIT GAME]" ..
"label[0,-0.25;" .. current_game.name .. "]" ..
"button[11.55,-0.2;0.75,0.5;btn_close_edit_game;x]"
if current_game.menuicon_path ~= nil and
current_game.menuicon_path ~= "" then
retval = retval ..
"image[5.25,0;2,2;" .. current_game.menuicon_path .. "]"
end
retval = retval ..
"textlist[0.5,0.5;4.5,4.3;mods_current;"
.. gamemgr.get_game_mods(current_game) ..";0]"
retval = retval ..
"textlist[7,0.5;4.5,4.3;mods_available;"
.. modmgr.get_mods_list() .. ";0]"
retval = retval ..
"button[0.55,4.95;4.7,0.5;btn_remove_mod_from_game;Remove selected mod]"
retval = retval ..
"button[7.05,4.95;4.7,0.5;btn_add_mod_to_game;<<-- Add mod]"
return retval
end
end
--------------------------------------------------------------------------------
function gamemgr.handle_buttons(tab,fields)
local retval = nil
if tab == "dialog_edit_game" then
retval = gamemgr.handle_edit_game_buttons(fields)
end
if tab == "dialog_new_game" then
retval = gamemgr.handle_new_game_buttons(fields)
end
if tab == "game_mgr" then
retval = gamemgr.handle_games_buttons(fields)
end
return retval
end
--------------------------------------------------------------------------------
function gamemgr.get_game(index)
if index > 0 and index <= #gamemgr.games then
return gamemgr.games[index]
end
return nil
end
--------------------------------------------------------------------------------
function gamemgr.update_gamelist()
gamemgr.games = engine.get_games()
end
--------------------------------------------------------------------------------
function gamemgr.gamelist()
local retval = ""
if #gamemgr.games > 0 then
retval = retval .. gamemgr.games[1].id
for i=2,#gamemgr.games,1 do
retval = retval .. "," .. gamemgr.games[i].name
end
end
return retval
end

View File

@ -311,9 +311,12 @@ function minetest.handle_node_drops(pos, drops, digger)
end end
function minetest.node_dig(pos, node, digger) function minetest.node_dig(pos, node, digger)
minetest.debug("node_dig")
local def = ItemStack({name=node.name}):get_definition() local def = ItemStack({name=node.name}):get_definition()
-- Check if def ~= 0 because we always want to be able to remove unknown nodes -- Check if def ~= 0 because we always want to be able to remove unknown nodes
if #def ~= 0 and not def.diggable or (def.can_dig and not def.can_dig(pos,digger)) then if #def ~= 0 and not def.diggable or (def.can_dig and not def.can_dig(pos,digger)) then
minetest.debug("not diggable")
minetest.log("info", digger:get_player_name() .. " tried to dig " minetest.log("info", digger:get_player_name() .. " tried to dig "
.. node.name .. " which is not diggable " .. node.name .. " which is not diggable "
.. minetest.pos_to_string(pos)) .. minetest.pos_to_string(pos))
@ -327,12 +330,10 @@ function minetest.node_dig(pos, node, digger)
local drops = minetest.get_node_drops(node.name, wielded:get_name()) local drops = minetest.get_node_drops(node.name, wielded:get_name())
-- Wear out tool -- Wear out tool
if not minetest.setting_getbool("creative_mode") then
local tp = wielded:get_tool_capabilities() local tp = wielded:get_tool_capabilities()
local dp = minetest.get_dig_params(def.groups, tp) local dp = minetest.get_dig_params(def.groups, tp)
wielded:add_wear(dp.wear) wielded:add_wear(dp.wear)
digger:set_wielded_item(wielded) digger:set_wielded_item(wielded)
end
-- Handle drops -- Handle drops
minetest.handle_node_drops(pos, drops, digger) minetest.handle_node_drops(pos, drops, digger)

File diff suppressed because it is too large Load Diff

View File

@ -1,107 +0,0 @@
--------------------------------------------------------------------------------
function dump(o, dumped)
dumped = dumped or {}
if type(o) == "number" then
return tostring(o)
elseif type(o) == "string" then
return string.format("%q", o)
elseif type(o) == "table" then
if dumped[o] then
return "<circular reference>"
end
dumped[o] = true
local t = {}
for k,v in pairs(o) do
t[#t+1] = "" .. k .. " = " .. dump(v, dumped)
end
return "{" .. table.concat(t, ", ") .. "}"
elseif type(o) == "boolean" then
return tostring(o)
elseif type(o) == "function" then
return "<function>"
elseif type(o) == "userdata" then
return "<userdata>"
elseif type(o) == "nil" then
return "nil"
else
error("cannot dump a " .. type(o))
return nil
end
end
--------------------------------------------------------------------------------
function string:split(sep)
local sep, fields = sep or ",", {}
local pattern = string.format("([^%s]+)", sep)
self:gsub(pattern, function(c) fields[#fields+1] = c end)
return fields
end
--------------------------------------------------------------------------------
function string:trim()
return (self:gsub("^%s*(.-)%s*$", "%1"))
end
--------------------------------------------------------------------------------
engine.get_game = function(index)
local games = game.get_games()
if index > 0 and index <= #games then
return games[index]
end
return nil
end
--------------------------------------------------------------------------------
function fs_escape_string(text)
if text ~= nil then
while (text:find("\r\n") ~= nil) do
local newtext = text:sub(1,text:find("\r\n")-1)
newtext = newtext .. " " .. text:sub(text:find("\r\n")+3)
text = newtext
end
while (text:find("\n") ~= nil) do
local newtext = text:sub(1,text:find("\n")-1)
newtext = newtext .. " " .. text:sub(text:find("\n")+1)
text = newtext
end
while (text:find("\r") ~= nil) do
local newtext = text:sub(1,text:find("\r")-1)
newtext = newtext .. " " .. text:sub(text:find("\r")+1)
text = newtext
end
text = string.gsub(text,"\\","\\\\")
text = string.gsub(text,"%]","\\]")
text = string.gsub(text,"%[","\\[")
text = string.gsub(text,";","\\;")
text = string.gsub(text,",","\\,")
end
return text
end
--------------------------------------------------------------------------------
function explode_textlist_event(text)
local retval = {}
retval.typ = "INV"
local parts = text:split(":")
if #parts == 2 then
retval.typ = parts[1]:trim()
retval.index= tonumber(parts[2]:trim())
if type(retval.index) ~= "number" then
retval.typ = "INV"
end
end
return retval
end

View File

@ -1,211 +0,0 @@
worldlist = {}
--------------------------------------------------------------------------------
function worldlist.refresh()
worldlist.m_raw_worldlist = engine.get_worlds()
worldlist.process()
end
--------------------------------------------------------------------------------
function worldlist.init()
worldlist.m_gamefilter = nil
worldlist.m_sortmode = "alphabetic"
worldlist.m_processed_worldlist = nil
worldlist.m_raw_worldlist = engine.get_worlds()
worldlist.process()
end
--------------------------------------------------------------------------------
function worldlist.set_gamefilter(gameid)
if gameid == worldlist.m_gamefilter then
return
end
worldlist.m_gamefilter = gameid
worldlist.process()
end
--------------------------------------------------------------------------------
function worldlist.get_gamefilter()
return worldlist.m_gamefilter
end
--------------------------------------------------------------------------------
--supported sort mode "alphabetic|none"
function worldlist.set_sortmode(mode)
if (mode == worldlist.m_sortmode) then
return
end
worldlist.m_sortmode = mode
worldlist.process()
end
--------------------------------------------------------------------------------
function worldlist.get_list()
return worldlist.m_processed_worldlist
end
--------------------------------------------------------------------------------
function worldlist.get_raw_list()
return worldlist.m_raw_worldlist
end
--------------------------------------------------------------------------------
function worldlist.get_raw_world(idx)
if type(idx) ~= "number" then
idx = tonumber(idx)
end
if idx ~= nil and idx > 0 and idx < #worldlist.m_raw_worldlist then
return worldlist.m_raw_worldlist[idx]
end
return nil
end
--------------------------------------------------------------------------------
function worldlist.get_engine_index(worldlistindex)
assert(worldlist.m_processed_worldlist ~= nil)
if worldlistindex ~= nil and worldlistindex > 0 and
worldlistindex <= #worldlist.m_processed_worldlist then
local entry = worldlist.m_processed_worldlist[worldlistindex]
for i,v in ipairs(worldlist.m_raw_worldlist) do
if worldlist.compare(v,entry) then
return i
end
end
end
return 0
end
--------------------------------------------------------------------------------
function worldlist.get_current_index(worldlistindex)
assert(worldlist.m_processed_worldlist ~= nil)
if worldlistindex ~= nil and worldlistindex > 0 and
worldlistindex <= #worldlist.m_raw_worldlist then
local entry = worldlist.m_raw_worldlist[worldlistindex]
for i,v in ipairs(worldlist.m_processed_worldlist) do
if worldlist.compare(v,entry) then
return i
end
end
end
return 0
end
--------------------------------------------------------------------------------
function worldlist.process()
assert(worldlist.m_raw_worldlist ~= nil)
if worldlist.m_sortmode == "none" and
worldlist.m_gamefilter == nil then
worldlist.m_processed_worldlist = worldlist.m_raw_worldlist
return
end
worldlist.m_processed_worldlist = {}
for i,v in ipairs(worldlist.m_raw_worldlist) do
if worldlist.m_gamefilter == nil or
v.gameid == worldlist.m_gamefilter then
table.insert(worldlist.m_processed_worldlist,v)
end
end
if worldlist.m_sortmode == "none" then
return
end
if worldlist.m_sortmode == "alphabetic" then
worldlist.sort_alphabetic()
end
end
--------------------------------------------------------------------------------
function worldlist.compare(world1,world2)
if world1.path ~= world2.path then
return false
end
if world1.name ~= world2.name then
return false
end
if world1.gameid ~= world2.gameid then
return false
end
return true
end
--------------------------------------------------------------------------------
function worldlist.size()
if worldlist.m_processed_worldlist == nil then
return 0
end
return #worldlist.m_processed_worldlist
end
--------------------------------------------------------------------------------
function worldlist.exists(worldname)
for i,v in ipairs(worldlist.m_raw_worldlist) do
if v.name == worldname then
return true
end
end
return false
end
--------------------------------------------------------------------------------
function worldlist.engine_index_by_name(worldname)
local worldcount = 0
local worldidx = 0
for i,v in ipairs(worldlist.m_raw_worldlist) do
if v.name == worldname then
worldcount = worldcount +1
worldidx = i
end
end
-- If there are more worlds than one with same name we can't decide which
-- one is meant. This shouldn't be possible but just for sure.
if worldcount > 1 then
worldidx=0
end
return worldidx
end
--------------------------------------------------------------------------------
function worldlist.sort_alphabetic()
table.sort(worldlist.m_processed_worldlist, function(a, b)
local n1 = a.name
local n2 = b.name
local count = math.min(#n1, #n2)
for i=1,count do
if n1:sub(i, i):lower() < n2:sub(i, i):lower() then
return true
elseif n1:sub(i, i):lower() > n2:sub(i, i):lower() then
return false
end
end
return (#n1 <= #n2)
end)
end

View File

@ -91,14 +91,4 @@ function minetest.pos_to_string(pos)
return "(" .. pos.x .. "," .. pos.y .. "," .. pos.z .. ")" return "(" .. pos.x .. "," .. pos.y .. "," .. pos.z .. ")"
end end
function math.hypot(x, y)
local t
x = math.abs(x)
y = math.abs(y)
t = math.min(x, y)
x = math.max(x, y)
if x == 0 then return 0 end
t = t / x
return x * math.sqrt(1 + t * t)
end

View File

@ -1,883 +0,0 @@
--Minetest
--Copyright (C) 2013 sapier
--
--This program 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 program 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 program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--------------------------------------------------------------------------------
function get_mods(path,retval,basefolder)
local mods = engine.get_dirlist(path,true)
for i=1,#mods,1 do
local filename = path .. DIR_DELIM .. mods[i] .. DIR_DELIM .. "modpack.txt"
local modpackfile,error = io.open(filename,"r")
local name = mods[i]
if basefolder ~= nil and
basefolder ~= "" then
name = basefolder .. DIR_DELIM .. mods[i]
end
if modpackfile ~= nil then
modpackfile:close()
table.insert(retval,name .. " <MODPACK>")
get_mods(path .. DIR_DELIM .. name,retval,name)
else
table.insert(retval,name)
end
end
end
--modmanager implementation
modmgr = {}
--------------------------------------------------------------------------------
function modmgr.extract(modfile)
if modfile.type == "zip" then
local tempfolder = os.tempfolder()
if tempfolder ~= nil and
tempfodler ~= "" then
engine.create_dir(tempfolder)
engine.extract_zip(modfile.name,tempfolder)
return tempfolder
end
end
end
-------------------------------------------------------------------------------
function modmgr.getbasefolder(temppath)
if temppath == nil then
return {
type = "invalid",
path = ""
}
end
local testfile = io.open(temppath .. DIR_DELIM .. "init.lua","r")
if testfile ~= nil then
testfile:close()
return {
type="mod",
path=temppath
}
end
testfile = io.open(temppath .. DIR_DELIM .. "modpack.txt","r")
if testfile ~= nil then
testfile:close()
return {
type="modpack",
path=temppath
}
end
local subdirs = engine.get_dirlist(temppath,true)
--only single mod or modpack allowed
if #subdirs ~= 1 then
return {
type = "invalid",
path = ""
}
end
testfile =
io.open(temppath .. DIR_DELIM .. subdirs[1] ..DIR_DELIM .."init.lua","r")
if testfile ~= nil then
testfile:close()
return {
type="mod",
path= temppath .. DIR_DELIM .. subdirs[1]
}
end
testfile =
io.open(temppath .. DIR_DELIM .. subdirs[1] ..DIR_DELIM .."modpack.txt","r")
if testfile ~= nil then
testfile:close()
return {
type="modpack",
path=temppath .. DIR_DELIM .. subdirs[1]
}
end
return {
type = "invalid",
path = ""
}
end
--------------------------------------------------------------------------------
function modmgr.isValidModname(modpath)
if modpath:find("-") ~= nil then
return false
end
return true
end
--------------------------------------------------------------------------------
function modmgr.parse_register_line(line)
local pos1 = line:find("\"")
local pos2 = nil
if pos1 ~= nil then
pos2 = line:find("\"",pos1+1)
end
if pos1 ~= nil and pos2 ~= nil then
local item = line:sub(pos1+1,pos2-1)
if item ~= nil and
item ~= "" then
local pos3 = item:find(":")
if pos3 ~= nil then
return item:sub(1,pos3-1)
end
end
end
return nil
end
--------------------------------------------------------------------------------
function modmgr.parse_dofile_line(modpath,line)
local pos1 = line:find("\"")
local pos2 = nil
if pos1 ~= nil then
pos2 = line:find("\"",pos1+1)
end
if pos1 ~= nil and pos2 ~= nil then
local filename = line:sub(pos1+1,pos2-1)
if filename ~= nil and
filename ~= "" and
filename:find(".lua") then
return modmgr.identify_modname(modpath,filename)
end
end
return nil
end
--------------------------------------------------------------------------------
function modmgr.update_global_mods()
local modpath = engine.get_modpath()
modmgr.global_mods = {}
if modpath ~= nil and
modpath ~= "" then
get_mods(modpath,modmgr.global_mods)
end
end
--------------------------------------------------------------------------------
function modmgr.get_mods_list()
local toadd = ""
modmgr.update_global_mods()
if modmgr.global_mods ~= nil then
for i=1,#modmgr.global_mods,1 do
if toadd ~= "" then
toadd = toadd..","
end
toadd = toadd .. modmgr.global_mods[i]
end
end
return toadd
end
--------------------------------------------------------------------------------
function modmgr.mod_exists(basename)
modmgr.update_global_mods()
if modmgr.global_mods ~= nil then
for i=1,#modmgr.global_mods,1 do
if modmgr.global_mods[i] == basename then
return true
end
end
end
return false
end
--------------------------------------------------------------------------------
function modmgr.identify_modname(modpath,filename)
local testfile = io.open(modpath .. DIR_DELIM .. filename,"r")
if testfile ~= nil then
local line = testfile:read()
while line~= nil do
local modname = nil
if line:find("minetest.register_tool") then
modname = modmgr.parse_register_line(line)
end
if line:find("minetest.register_craftitem") then
modname = modmgr.parse_register_line(line)
end
if line:find("minetest.register_node") then
modname = modmgr.parse_register_line(line)
end
if line:find("dofile") then
modname = modmgr.parse_dofile_line(modpath,line)
end
if modname ~= nil then
testfile:close()
return modname
end
line = testfile:read()
end
testfile:close()
end
return nil
end
--------------------------------------------------------------------------------
function modmgr.tab()
if modmgr.selected_mod == nil then
modmgr.selected_mod = 1
end
local retval =
"vertlabel[0,-0.25;MODS]" ..
"label[0.8,-0.25;Installed Mods:]" ..
"textlist[0.75,0.25;4.5,4.3;modlist;" ..
modmgr.get_mods_list() ..
";" .. modmgr.selected_mod .. "]"
retval = retval ..
"button[1,4.85;2,0.5;btn_mod_mgr_install_local;Install]" ..
"button[3,4.85;2,0.5;btn_mod_mgr_download;Download]"
if #modmgr.global_mods >= modmgr.selected_mod and
modmgr.global_mods[modmgr.selected_mod]:find("<MODPACK>") then
retval = retval .. "button[10,4.85;2,0.5;btn_mod_mgr_rename_modpack;Rename]"
end
if #modmgr.global_mods >= modmgr.selected_mod then
local modpath = engine.get_modpath()
--show dependencys
if modmgr.global_mods[modmgr.selected_mod]:find("<MODPACK>") == nil then
retval = retval ..
"label[6,1.9;Depends:]" ..
"textlist[6,2.4;5.7,2;deplist;"
toadd = modmgr.get_dependencys(modpath .. DIR_DELIM ..
modmgr.global_mods[modmgr.selected_mod])
retval = retval .. toadd .. ";0;true,false]"
--TODO read modinfo
end
--show delete button
retval = retval .. "button[8,4.85;2,0.5;btn_mod_mgr_delete_mod;Delete]"
end
return retval
end
--------------------------------------------------------------------------------
function modmgr.dialog_rename_modpack()
local modname = modmgr.global_mods[modmgr.selected_mod]
modname = modname:sub(0,modname:find("<") -2)
local retval =
"label[1.75,1;Rename Modpack:]"..
"field[4.5,1.4;6,0.5;te_modpack_name;;" ..
modname ..
"]" ..
"button[5,4.2;2.6,0.5;dlg_rename_modpack_confirm;Accept]" ..
"button[7.5,4.2;2.8,0.5;dlg_rename_modpack_cancel;Cancel]"
return retval
end
--------------------------------------------------------------------------------
function modmgr.precheck()
if modmgr.global_mods == nil then
modmgr.update_global_mods()
end
if modmgr.world_config_selected_world == nil then
modmgr.world_config_selected_world = 1
end
if modmgr.world_config_selected_mod == nil then
modmgr.world_config_selected_mod = 1
end
if modmgr.hide_gamemods == nil then
modmgr.hide_gamemods = true
end
end
--------------------------------------------------------------------------------
function modmgr.get_worldmod_idx()
if not modmgr.hide_gamemods then
return modmgr.world_config_selected_mod - #modmgr.worldconfig.game_mods
else
return modmgr.world_config_selected_mod
end
end
--------------------------------------------------------------------------------
function modmgr.is_gamemod()
if not modmgr.hide_gamemods then
if modmgr.world_config_selected_mod <= #modmgr.worldconfig.game_mods then
return true
else
return false
end
else
return false
end
end
--------------------------------------------------------------------------------
function modmgr.render_worldmodlist()
local retval = ""
for i=1,#modmgr.global_mods,1 do
local parts = modmgr.global_mods[i]:split(DIR_DELIM)
local shortname = parts[#parts]
if modmgr.worldconfig.global_mods[shortname] then
retval = retval .. "#22F922" .. modmgr.global_mods[i] .. ","
else
retval = retval .. modmgr.global_mods[i] .. ","
end
end
return retval
end
--------------------------------------------------------------------------------
function modmgr.render_gamemodlist()
local retval = ""
for i=1,#modmgr.worldconfig.game_mods,1 do
retval = retval ..
"#0000FF" .. modmgr.worldconfig.game_mods[i] .. ","
end
return retval
end
--------------------------------------------------------------------------------
function modmgr.dialog_configure_world()
modmgr.precheck()
local modpack_selected = false
local gamemod_selected = modmgr.is_gamemod()
local modname = ""
local modfolder = ""
local shortname = ""
if not gamemod_selected then
local worldmodidx = modmgr.get_worldmod_idx()
modname = modmgr.global_mods[worldmodidx]
if modname ~= nil then
if modname:find("<MODPACK>") ~= nil then
modname = modname:sub(0,modname:find("<") -2)
modpack_selected = true
end
local parts = modmgr.global_mods[worldmodidx]:split(DIR_DELIM)
shortname = parts[#parts]
modfolder = engine.get_modpath() .. DIR_DELIM .. modname
else
modname = ""
end
end
local worldspec = engine.get_worlds()[modmgr.world_config_selected_world]
local retval =
"size[11,6.5]" ..
"label[1.5,-0.25;World: " .. worldspec.name .. "]"
if modmgr.hide_gamemods then
retval = retval .. "checkbox[5.5,6.15;cb_hide_gamemods;Hide Game;true]"
else
retval = retval .. "checkbox[5.5,6.15;cb_hide_gamemods;Hide Game;false]"
end
retval = retval ..
"button[9.25,6.35;2,0.5;btn_config_world_save;Save]" ..
"button[7.4,6.35;2,0.5;btn_config_world_cancel;Cancel]" ..
"textlist[5.5,-0.25;5.5,6.5;world_config_modlist;"
if not modmgr.hide_gamemods then
retval = retval .. modmgr.render_gamemodlist()
end
retval = retval .. modmgr.render_worldmodlist()
retval = retval .. ";" .. modmgr.world_config_selected_mod .."]"
if not gamemod_selected then
retval = retval ..
"label[0,0.45;Mod:]" ..
"label[0.75,0.45;" .. modname .. "]" ..
"label[0,1.5;depends on:]" ..
"textlist[0,2;5,2;world_config_depends;" ..
modmgr.get_dependencys(modfolder) .. ";0]" ..
"label[0,4;depends on:]" ..
"textlist[0,4.5;5,2;world_config_is_required;;0]"
if modpack_selected then
retval = retval ..
"button[-0.05,1.05;2,0.5;btn_cfgw_enable_all;Enable All]" ..
"button[3.25,1.05;2,0.5;btn_cfgw_disable_all;Disable All]"
else
retval = retval ..
"checkbox[0,0.8;cb_mod_enabled;enabled;"
if modmgr.worldconfig.global_mods[shortname] then
retval = retval .. "true"
else
retval = retval .. "false"
end
retval = retval .. "]"
end
end
return retval
end
--------------------------------------------------------------------------------
function modmgr.handle_buttons(tab,fields)
local retval = nil
if tab == "mod_mgr" then
retval = modmgr.handle_modmgr_buttons(fields)
end
if tab == "dialog_rename_modpack" then
retval = modmgr.handle_rename_modpack_buttons(fields)
end
if tab == "dialog_delete_mod" then
retval = modmgr.handle_delete_mod_buttons(fields)
end
if tab == "dialog_configure_world" then
retval = modmgr.handle_configure_world_buttons(fields)
end
return retval
end
--------------------------------------------------------------------------------
function modmgr.get_dependencys(modfolder)
local filename = modfolder ..
DIR_DELIM .. "depends.txt"
local dependencyfile = io.open(filename,"r")
local toadd = ""
if dependencyfile then
local dependency = dependencyfile:read("*l")
while dependency do
if toadd ~= "" then
toadd = toadd .. ","
end
toadd = toadd .. dependency
dependency = dependencyfile:read()
end
dependencyfile:close()
else
print("Modmgr:" .. filename .. " not found")
end
return toadd
end
--------------------------------------------------------------------------------
function modmgr.get_worldconfig(worldpath)
local filename = worldpath ..
DIR_DELIM .. "world.mt"
local worldfile = io.open(filename,"r")
local worldconfig = {}
worldconfig.global_mods = {}
worldconfig.game_mods = {}
if worldfile then
local dependency = worldfile:read("*l")
while dependency do
local parts = dependency:split("=")
local key = parts[1]:trim()
if key == "gameid" then
worldconfig.id = parts[2]:trim()
else
local key = parts[1]:trim():sub(10)
if parts[2]:trim() == "true" then
worldconfig.global_mods[key] = true
else
worldconfig.global_mods[key] = false
end
end
dependency = worldfile:read("*l")
end
worldfile:close()
else
print("Modmgr: " .. filename .. " not found")
end
--read gamemods
local gamemodpath = engine.get_gamepath() .. DIR_DELIM .. worldconfig.id .. DIR_DELIM .. "mods"
get_mods(gamemodpath,worldconfig.game_mods)
return worldconfig
end
--------------------------------------------------------------------------------
function modmgr.handle_modmgr_buttons(fields)
local retval = {
tab = nil,
is_dialog = nil,
show_buttons = nil,
}
if fields["modlist"] ~= nil then
local event = explode_textlist_event(fields["modlist"])
modmgr.selected_mod = event.index
end
if fields["btn_mod_mgr_install_local"] ~= nil then
engine.show_file_open_dialog("mod_mgt_open_dlg","Select Mod File:")
end
if fields["btn_mod_mgr_download"] ~= nil then
retval.current_tab = "dialog_modstore_unsorted"
retval.is_dialog = true
retval.show_buttons = false
return retval
end
if fields["btn_mod_mgr_rename_modpack"] ~= nil then
retval.current_tab = "dialog_rename_modpack"
retval.is_dialog = true
retval.show_buttons = false
return retval
end
if fields["btn_mod_mgr_delete_mod"] ~= nil then
retval.current_tab = "dialog_delete_mod"
retval.is_dialog = true
retval.show_buttons = false
return retval
end
if fields["mod_mgt_open_dlg_accepted"] ~= nil and
fields["mod_mgt_open_dlg_accepted"] ~= "" then
modmgr.installmod(fields["mod_mgt_open_dlg_accepted"],nil)
end
return nil;
end
--------------------------------------------------------------------------------
function modmgr.installmod(modfilename,basename)
local modfile = identify_filetype(modfilename)
local modpath = modmgr.extract(modfile)
if modpath == nil then
gamedata.errormessage = "Install Mod: file: " .. modfile.name ..
"\nInstall Mod: unsupported filetype \"" .. modfile.type .. "\""
return
end
local basefolder = modmgr.getbasefolder(modpath)
if basefolder.type == "modpack" then
local clean_path = nil
if basename ~= nil then
clean_path = "mp_" .. basename
end
if clean_path == nil then
clean_path = get_last_folder(cleanup_path(basefolder.path))
end
if clean_path ~= nil then
local targetpath = engine.get_modpath() .. DIR_DELIM .. clean_path
if not engine.copy_dir(basefolder.path,targetpath) then
gamedata.errormessage = "Failed to install " .. basename .. " to " .. targetpath
end
else
gamedata.errormessage = "Install Mod: unable to find suitable foldername for modpack "
.. modfilename
end
end
if basefolder.type == "mod" then
local targetfolder = basename
if targetfolder == nil then
targetfolder = modmgr.identify_modname(basefolder.path,"init.lua")
end
--if heuristic failed try to use current foldername
if targetfolder == nil then
targetfolder = get_last_folder(basefolder.path)
end
if targetfolder ~= nil and modmgr.isValidModname(targetfolder) then
local targetpath = engine.get_modpath() .. DIR_DELIM .. targetfolder
engine.copy_dir(basefolder.path,targetpath)
else
gamedata.errormessage = "Install Mod: unable to find real modname for: "
.. modfilename
end
end
engine.delete_dir(modpath)
end
--------------------------------------------------------------------------------
function modmgr.handle_rename_modpack_buttons(fields)
local oldname = modmgr.global_mods[modmgr.selected_mod]
oldname = oldname:sub(0,oldname:find("<") -2)
if fields["dlg_rename_modpack_confirm"] ~= nil then
local oldpath = engine.get_modpath() .. DIR_DELIM .. oldname
local targetpath = engine.get_modpath() .. DIR_DELIM .. fields["te_modpack_name"]
engine.copy_dir(oldpath,targetpath,false)
end
return {
is_dialog = false,
show_buttons = true,
current_tab = engine.setting_get("main_menu_tab")
}
end
--------------------------------------------------------------------------------
function modmgr.handle_configure_world_buttons(fields)
if fields["world_config_modlist"] ~= nil then
local event = explode_textlist_event(fields["world_config_modlist"])
modmgr.world_config_selected_mod = event.index
end
if fields["cb_mod_enabled"] ~= nil then
local index = modmgr.get_worldmod_idx()
local modname = modmgr.global_mods[index]
local parts = modmgr.global_mods[index]:split(DIR_DELIM)
local shortname = parts[#parts]
if fields["cb_mod_enabled"] == "true" then
modmgr.worldconfig.global_mods[shortname] = true
else
modmgr.worldconfig.global_mods[shortname] = false
end
end
if fields["cb_hide_gamemods"] ~= nil then
if fields["cb_hide_gamemods"] == "true" then
modmgr.hide_gamemods = true
else
modmgr.hide_gamemods = false
end
end
if fields["btn_config_world_save"] then
local worldspec = engine.get_worlds()[modmgr.world_config_selected_world]
local filename = worldspec.path ..
DIR_DELIM .. "world.mt"
local worldfile = io.open(filename,"w")
if worldfile then
worldfile:write("gameid = " .. modmgr.worldconfig.id .. "\n")
for key,value in pairs(modmgr.worldconfig.global_mods) do
if value then
worldfile:write("load_mod_" .. key .. " = true" .. "\n")
else
worldfile:write("load_mod_" .. key .. " = false" .. "\n")
end
end
worldfile:close()
end
modmgr.worldconfig = nil
return {
is_dialog = false,
show_buttons = true,
current_tab = engine.setting_get("main_menu_tab")
}
end
if fields["btn_config_world_cancel"] then
modmgr.worldconfig = nil
return {
is_dialog = false,
show_buttons = true,
current_tab = engine.setting_get("main_menu_tab")
}
end
if fields["btn_cfgw_enable_all"] then
local worldmodidx = modmgr.get_worldmod_idx()
modname = modmgr.global_mods[worldmodidx]
modname = modname:sub(0,modname:find("<") -2)
for i=1,#modmgr.global_mods,1 do
if modmgr.global_mods[i]:find("<MODPACK>") == nil then
local modpackpart = modmgr.global_mods[i]:sub(0,modname:len())
if modpackpart == modname then
local parts = modmgr.global_mods[i]:split(DIR_DELIM)
local shortname = parts[#parts]
modmgr.worldconfig.global_mods[shortname] = true
end
end
end
end
if fields["btn_cfgw_disable_all"] then
local worldmodidx = modmgr.get_worldmod_idx()
modname = modmgr.global_mods[worldmodidx]
modname = modname:sub(0,modname:find("<") -2)
for i=1,#modmgr.global_mods,1 do
local modpackpart = modmgr.global_mods[i]:sub(0,modname:len())
if modpackpart == modname then
local parts = modmgr.global_mods[i]:split(DIR_DELIM)
local shortname = parts[#parts]
modmgr.worldconfig.global_mods[shortname] = nil
end
end
end
return nil
end
--------------------------------------------------------------------------------
function modmgr.handle_delete_mod_buttons(fields)
local modname = modmgr.global_mods[modmgr.selected_mod]
if modname:find("<MODPACK>") ~= nil then
modname = modname:sub(0,modname:find("<") -2)
end
if fields["dlg_delete_mod_confirm"] ~= nil then
local oldpath = engine.get_modpath() .. DIR_DELIM .. modname
if oldpath ~= nil and
oldpath ~= "" and
oldpath ~= engine.get_modpath() then
engine.delete_dir(oldpath)
end
end
return {
is_dialog = false,
show_buttons = true,
current_tab = engine.setting_get("main_menu_tab")
}
end
--------------------------------------------------------------------------------
function modmgr.dialog_delete_mod()
local modname = modmgr.global_mods[modmgr.selected_mod]
if modname:find("<MODPACK>") ~= nil then
modname = modname:sub(0,modname:find("<") -2)
end
local retval =
"field[1.75,1;10,3;;Are you sure you want to delete ".. modname .. "?;]"..
"button[4,4.2;1,0.5;dlg_delete_mod_confirm;Yes]" ..
"button[6.5,4.2;3,0.5;dlg_delete_mod_cancel;No of course not!]"
return retval
end
--------------------------------------------------------------------------------
function modmgr.init_worldconfig()
local worldspec = engine.get_worlds()[modmgr.world_config_selected_world]
if worldspec ~= nil then
--read worldconfig
modmgr.worldconfig = modmgr.get_worldconfig(worldspec.path)
if modmgr.worldconfig.id == nil or
modmgr.worldconfig.id == "" then
modmgr.worldconfig = nil
return false
end
return true
end
return false
end
--------------------------------------------------------------------------------
function modmgr.gettab(name)
local retval = ""
if name == "mod_mgr" then
retval = retval .. modmgr.tab()
end
if name == "dialog_rename_modpack" then
retval = retval .. modmgr.dialog_rename_modpack()
end
if name == "dialog_delete_mod" then
retval = retval .. modmgr.dialog_delete_mod()
end
if name == "dialog_configure_world" then
retval = retval .. modmgr.dialog_configure_world()
end
return retval
end

View File

@ -1,276 +0,0 @@
--Minetest
--Copyright (C) 2013 sapier
--
--This program 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 program 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 program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--------------------------------------------------------------------------------
--modstore implementation
modstore = {}
--------------------------------------------------------------------------------
function modstore.init()
modstore.tabnames = {}
table.insert(modstore.tabnames,"dialog_modstore_unsorted")
table.insert(modstore.tabnames,"dialog_modstore_search")
modstore.modsperpage = 5
modstore.basetexturedir = engine.get_gamepath() .. DIR_DELIM .. ".." ..
DIR_DELIM .. "textures" .. DIR_DELIM .. "base" ..
DIR_DELIM .. "pack" .. DIR_DELIM
modstore.update_modlist()
modstore.current_list = nil
modstore.details_cache = {}
end
--------------------------------------------------------------------------------
function modstore.nametoindex(name)
for i=1,#modstore.tabnames,1 do
if modstore.tabnames[i] == name then
return i
end
end
return 1
end
--------------------------------------------------------------------------------
function modstore.gettab(tabname)
local retval = ""
local is_modstore_tab = false
if tabname == "dialog_modstore_unsorted" then
retval = modstore.getmodlist(modstore.modlist_unsorted)
is_modstore_tab = true
end
if tabname == "dialog_modstore_search" then
is_modstore_tab = true
end
if is_modstore_tab then
return modstore.tabheader(tabname) .. retval
end
if tabname == "modstore_mod_installed" then
return "size[6,2]label[0.25,0.25;Mod: " .. modstore.lastmodtitle ..
" installed successfully]" ..
"button[2.5,1.5;1,0.5;btn_confirm_mod_successfull;ok]"
end
return ""
end
--------------------------------------------------------------------------------
function modstore.tabheader(tabname)
local retval = "size[12,9.25]"
retval = retval .. "tabheader[-0.3,-0.99;modstore_tab;" ..
"Unsorted,Search;" ..
modstore.nametoindex(tabname) .. ";true;false]"
return retval
end
--------------------------------------------------------------------------------
function modstore.handle_buttons(current_tab,fields)
modstore.lastmodtitle = ""
if fields["modstore_tab"] then
local index = tonumber(fields["modstore_tab"])
if index > 0 and
index <= #modstore.tabnames then
return {
current_tab = modstore.tabnames[index],
is_dialog = true,
show_buttons = false
}
end
modstore.modlist_page = 0
end
if fields["btn_modstore_page_up"] then
if modstore.current_list ~= nil and modstore.current_list.page > 0 then
modstore.current_list.page = modstore.current_list.page - 1
end
end
if fields["btn_modstore_page_down"] then
if modstore.current_list ~= nil and
modstore.current_list.page <modstore.current_list.pagecount then
modstore.current_list.page = modstore.current_list.page +1
end
end
if fields["btn_confirm_mod_successfull"] then
return {
current_tab = modstore.tabnames[1],
is_dialog = true,
show_buttons = false
}
end
for i=1, modstore.modsperpage, 1 do
local installbtn = "btn_install_mod_" .. i
if fields[installbtn] then
local modlistentry =
modstore.current_list.page * modstore.modsperpage + i
local moddetails = modstore.get_details(modstore.current_list.data[modlistentry].id)
local fullurl = engine.setting_get("modstore_download_url") ..
moddetails.download_url
local modfilename = os.tempfolder() .. ".zip"
print("Downloading mod from: " .. fullurl .. " to ".. modfilename)
if engine.download_file(fullurl,modfilename) then
modmgr.installmod(modfilename,moddetails.basename)
os.remove(modfilename)
modstore.lastmodtitle = modstore.current_list.data[modlistentry].title
return {
current_tab = "modstore_mod_installed",
is_dialog = true,
show_buttons = false
}
else
gamedata.errormessage = "Unable to download " ..
moddetails.download_url .. " (internet connection?)"
end
end
end
end
--------------------------------------------------------------------------------
function modstore.update_modlist()
modstore.modlist_unsorted = {}
modstore.modlist_unsorted.data = engine.get_modstore_list()
if modstore.modlist_unsorted.data ~= nil then
modstore.modlist_unsorted.pagecount =
math.floor((#modstore.modlist_unsorted.data / modstore.modsperpage))
else
modstore.modlist_unsorted.data = {}
modstore.modlist_unsorted.pagecount = 0
end
modstore.modlist_unsorted.page = 0
end
--------------------------------------------------------------------------------
function modstore.getmodlist(list)
local retval = ""
retval = retval .. "label[10,-0.4;Page " .. (list.page +1) ..
" of " .. (list.pagecount +1) .. "]"
retval = retval .. "button[11.6,-0.1;0.5,0.5;btn_modstore_page_up;^]"
retval = retval .. "box[11.6,0.35;0.28,8.6;000000]"
local scrollbarpos = 0.35 + (8.1/list.pagecount) * list.page
retval = retval .. "box[11.6," ..scrollbarpos .. ";0.28,0.5;32CD32]"
retval = retval .. "button[11.6,9.0;0.5,0.5;btn_modstore_page_down;v]"
if #list.data < (list.page * modstore.modsperpage) then
return retval
end
local endmod = (list.page * modstore.modsperpage) + modstore.modsperpage
if (endmod > #list.data) then
endmod = #list.data
end
for i=(list.page * modstore.modsperpage) +1, endmod, 1 do
--getmoddetails
local details = modstore.get_details(list.data[i].id)
if details ~= nil then
local screenshot_ypos = (i-1 - (list.page * modstore.modsperpage))*1.9 +0.2
retval = retval .. "box[0," .. screenshot_ypos .. ";11.4,1.75;FFFFFF]"
--screenshot
if details.screenshot_url ~= nil and
details.screenshot_url ~= "" then
if list.data[i].texturename == nil then
print("downloading screenshot: " .. details.screenshot_url)
local filename = os.tempfolder()
if engine.download_file(details.screenshot_url,filename) then
list.data[i].texturename = filename
end
end
end
if list.data[i].texturename == nil then
list.data[i].texturename = modstore.basetexturedir .. "no_screenshot.png"
end
retval = retval .. "image[0,".. screenshot_ypos .. ";3,2;" ..
list.data[i].texturename .. "]"
--title + author
retval = retval .."label[2.75," .. screenshot_ypos .. ";" ..
fs_escape_string(details.title) .. " (" .. details.author .. ")]"
--description
local descriptiony = screenshot_ypos + 0.5
retval = retval .. "textarea[3," .. descriptiony .. ";6.5,1.6;;" ..
fs_escape_string(details.description) .. ";]"
--rating
local ratingy = screenshot_ypos + 0.6
retval = retval .."label[10.1," .. ratingy .. ";Rating: " .. details.rating .."]"
--install button
local buttony = screenshot_ypos + 1.2
local buttonnumber = (i - (list.page * modstore.modsperpage))
retval = retval .."button[9.6," .. buttony .. ";2,0.5;btn_install_mod_" .. buttonnumber .. ";"
if modmgr.mod_exists(details.basename) then
retval = retval .. "re-Install]"
else
retval = retval .. "Install]"
end
end
end
modstore.current_list = list
return retval
end
--------------------------------------------------------------------------------
function modstore.get_details(modid)
if modstore.details_cache[modid] ~= nil then
return modstore.details_cache[modid]
end
local retval = engine.get_modstore_details(tostring(modid))
modstore.details_cache[modid] = retval
return retval
end

View File

@ -1,141 +0,0 @@
vector = {}
function vector.new(a, b, c)
v = {x=0, y=0, z=0}
if type(a) == "table" then
v = {x=a.x, y=a.y, z=a.z}
elseif a and b and c then
v = {x=a, y=b, z=c}
end
setmetatable(v, {
__add = vector.add,
__sub = vector.subtract,
__mul = vector.multiply,
__div = vector.divide,
__umn = function(v) return vector.multiply(v, -1) end,
__len = vector.length,
__eq = vector.equals,
})
return v
end
function vector.equals(a, b)
return a.x == b.x and
a.y == b.y and
a.z == b.z
end
function vector.length(v)
return math.hypot(v.x, math.hypot(v.y, v.z))
end
function vector.normalize(v)
local len = vector.length(v)
if len == 0 then
return vector.new()
else
return vector.divide(v, len)
end
end
function vector.round(v)
return {
x = math.floor(v.x + 0.5),
y = math.floor(v.y + 0.5),
z = math.floor(v.z + 0.5)
}
end
function vector.distance(a, b)
local x = a.x - b.x
local y = a.y - b.y
local z = a.z - b.z
return math.hypot(x, math.hypot(y, z))
end
function vector.direction(pos1, pos2)
local x_raw = pos2.x - pos1.x
local y_raw = pos2.y - pos1.y
local z_raw = pos2.z - pos1.z
local x_abs = math.abs(x_raw)
local y_abs = math.abs(y_raw)
local z_abs = math.abs(z_raw)
if x_abs >= y_abs and
x_abs >= z_abs then
y_raw = y_raw * (1 / x_abs)
z_raw = z_raw * (1 / x_abs)
x_raw = x_raw / x_abs
end
if y_abs >= x_abs and
y_abs >= z_abs then
x_raw = x_raw * (1 / y_abs)
z_raw = z_raw * (1 / y_abs)
y_raw = y_raw / y_abs
end
if z_abs >= y_abs and
z_abs >= x_abs then
x_raw = x_raw * (1 / z_abs)
y_raw = y_raw * (1 / z_abs)
z_raw = z_raw / z_abs
end
return {x=x_raw, y=y_raw, z=z_raw}
end
function vector.add(a, b)
if type(b) == "table" then
return vector.new(
a.x + b.x,
a.y + b.y,
a.z + b.z)
else
return vector.new(
a.x + b,
a.y + b,
a.z + b)
end
end
function vector.subtract(a, b)
if type(b) == "table" then
return vector.new(
a.x - b.x,
a.y - b.y,
a.z - b.z)
else
return vector.new(
a.x - b,
a.y - b,
a.z - b)
end
end
function vector.multiply(a, b)
if type(b) == "table" then
return vector.new(
a.x * b.x,
a.y * b.y,
a.z * b.z)
else
return vector.new(
a.x * b,
a.y * b,
a.z * b)
end
end
function vector.divide(a, b)
if type(b) == "table" then
return vector.new(
a.x / b.x,
a.y / b.y,
a.z / b.z)
else
return vector.new(
a.x / b,
a.y / b,
a.z / b)
end
end

View File

@ -44,22 +44,6 @@ function VoxelArea:indexp(p)
return math.floor(i) return math.floor(i)
end end
function VoxelArea:position(i)
local p = {}
i = i - 1
p.z = math.floor(i / self.zstride) + self.MinEdge.z
i = i % self.zstride
p.y = math.floor(i / self.ystride) + self.MinEdge.y
i = i % self.ystride
p.x = math.floor(i) + self.MinEdge.x
return p
end
function VoxelArea:contains(x, y, z) function VoxelArea:contains(x, y, z)
return (x >= self.MinEdge.x) and (x <= self.MaxEdge.x) and return (x >= self.MinEdge.x) and (x <= self.MaxEdge.x) and
(y >= self.MinEdge.y) and (y <= self.MaxEdge.y) and (y >= self.MinEdge.y) and (y <= self.MaxEdge.y) and
@ -76,28 +60,3 @@ function VoxelArea:containsi(i)
return (i >= 1) and (i <= self:getVolume()) return (i >= 1) and (i <= self:getVolume())
end end
function VoxelArea:iter(minx, miny, minz, maxx, maxy, maxz)
local i = self:index(minx, miny, minz) - 1
local last = self:index(maxx, maxy, maxz)
local ystride = self.ystride
local zstride = self.zstride
local yoff = (last+1) % ystride
local zoff = (last+1) % zstride
local ystridediff = (i - last) % ystride
local zstridediff = (i - last) % zstride
return function()
i = i + 1
if i % zstride == zoff then
i = i + zstridediff
elseif i % ystride == yoff then
i = i + ystridediff
end
if i <= last then
return i
end
end
end
function VoxelArea:iterp(minp, maxp)
return self:iter(minp.x, minp.y, minp.z, maxp.x, maxp.y, maxp.z)
end

View File

@ -1 +0,0 @@
trans_alphach

View File

@ -1,47 +0,0 @@
uniform sampler2D myTexture;
uniform sampler2D normalTexture;
uniform vec4 skyBgColor;
uniform float fogDistance;
varying vec3 vPosition;
varying vec3 viewVec;
void main (void)
{
vec4 col = texture2D(myTexture, vec2(gl_TexCoord[0]));
float alpha = col.a;
vec2 uv = gl_TexCoord[0].st;
vec4 base = texture2D(myTexture, uv);
vec4 final_color = vec4(0.2, 0.2, 0.2, 1.0) * base;
vec3 vVec = normalize(viewVec);
vec3 bump = normalize(texture2D(normalTexture, uv).xyz * 2.0 - 1.0);
vec3 R = reflect(-vVec, bump);
vec3 lVec = normalize(vec3(0.0, -0.4, 0.5));
float diffuse = max(dot(lVec, bump), 0.0);
vec3 color = diffuse * texture2D(myTexture, gl_TexCoord[0].st).rgb;
float specular = pow(clamp(dot(R, lVec), 0.0, 1.0),1.0);
vec4 vSpecular = 0.2*specular * diffuse;
color += vSpecular;
col = vec4(color.r, color.g, color.b, alpha);
col *= gl_Color;
col = col * col; // SRGB -> Linear
col *= 1.8;
col.r = 1.0 - exp(1.0 - col.r) / exp(1.0);
col.g = 1.0 - exp(1.0 - col.g) / exp(1.0);
col.b = 1.0 - exp(1.0 - col.b) / exp(1.0);
col = sqrt(col); // Linear -> SRGB
if(fogDistance != 0.0){
float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0));
alpha = mix(alpha, 0.0, d);
}
gl_FragColor = vec4(col.r, col.g, col.b, alpha);
}

View File

@ -1,98 +0,0 @@
uniform mat4 mWorldViewProj;
uniform mat4 mInvWorld;
uniform mat4 mTransWorld;
uniform float dayNightRatio;
varying vec3 vPosition;
varying vec3 viewVec;
void main(void)
{
gl_Position = mWorldViewProj * gl_Vertex;
vPosition = (mWorldViewProj * gl_Vertex).xyz;
vec3 tangent;
vec3 binormal;
vec3 c1 = cross( gl_Normal, vec3(0.0, 0.0, 1.0) );
vec3 c2 = cross( gl_Normal, vec3(0.0, 1.0, 0.0) );
if( length(c1)>length(c2) )
{
tangent = c1;
}
else
{
tangent = c2;
}
tangent = normalize(tangent);
//binormal = cross(gl_Normal, tangent);
//binormal = normalize(binormal);
vec4 color;
//color = vec4(1.0, 1.0, 1.0, 1.0);
float day = gl_Color.r;
float night = gl_Color.g;
float light_source = gl_Color.b;
/*color.r = mix(night, day, dayNightRatio);
color.g = color.r;
color.b = color.r;*/
float rg = mix(night, day, dayNightRatio);
rg += light_source * 1.5; // Make light sources brighter
float b = rg;
// Moonlight is blue
b += (day - night) / 13.0;
rg -= (day - night) / 13.0;
// Emphase blue a bit in darker places
// See C++ implementation in mapblock_mesh.cpp finalColorBlend()
b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025);
// Artificial light is yellow-ish
// See C++ implementation in mapblock_mesh.cpp finalColorBlend()
rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065);
color.r = rg;
color.g = rg;
color.b = b;
// Make sides and bottom darker than the top
color = color * color; // SRGB -> Linear
if(gl_Normal.y <= 0.5)
color *= 0.6;
//color *= 0.7;
color = sqrt(color); // Linear -> SRGB
color.a = gl_Color.a;
gl_FrontColor = gl_BackColor = color;
gl_TexCoord[0] = gl_MultiTexCoord0;
vec3 n1 = normalize(gl_NormalMatrix * gl_Normal);
vec4 tangent1 = vec4(tangent.x, tangent.y, tangent.z, 0);
//vec3 t1 = normalize(gl_NormalMatrix * tangent1);
//vec3 b1 = cross(n1, t1);
vec3 v;
vec3 vVertex = vec3(gl_ModelViewMatrix * gl_Vertex);
vec3 vVec = -vVertex;
//v.x = dot(vVec, t1);
//v.y = dot(vVec, b1);
//v.z = dot(vVec, n1);
//viewVec = vVec;
viewVec = normalize(vec3(0.0, -0.4, 0.5));
//Vector representing the 0th texture coordinate passed to fragment shader
//gl_TexCoord[0] = vec2(gl_MultiTexCoord0);
// Transform the current vertex
//gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}

View File

@ -1 +0,0 @@
trans_alphach_ref

View File

@ -1,46 +0,0 @@
uniform sampler2D myTexture;
uniform sampler2D normalTexture;
uniform vec4 skyBgColor;
uniform float fogDistance;
varying vec3 vPosition;
varying vec3 viewVec;
void main (void)
{
vec4 col = texture2D(myTexture, vec2(gl_TexCoord[0]));
float alpha = col.a;
vec2 uv = gl_TexCoord[0].st;
vec4 base = texture2D(myTexture, uv);
vec4 final_color = vec4(0.2, 0.2, 0.2, 1.0) * base;
vec3 vVec = normalize(viewVec);
vec3 bump = normalize(texture2D(normalTexture, uv).xyz * 2.0 - 1.0);
vec3 R = reflect(-vVec, bump);
vec3 lVec = normalize(vec3(0.0, -0.4, 0.5));
float diffuse = max(dot(lVec, bump), 0.0);
vec3 color = diffuse * texture2D(myTexture, gl_TexCoord[0].st).rgb;
float specular = pow(clamp(dot(R, lVec), 0.0, 1.0),1.0);
vec4 vSpecular = 0.2*specular * diffuse;
color += vSpecular;
col = vec4(color.r, color.g, color.b, alpha);
col *= gl_Color;
col = col * col; // SRGB -> Linear
col *= 1.8;
col.r = 1.0 - exp(1.0 - col.r) / exp(1.0);
col.g = 1.0 - exp(1.0 - col.g) / exp(1.0);
col.b = 1.0 - exp(1.0 - col.b) / exp(1.0);
col = sqrt(col); // Linear -> SRGB
if(fogDistance != 0.0){
float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0));
col = mix(col, skyBgColor, d);
}
gl_FragColor = vec4(col.r, col.g, col.b, alpha);
}

View File

@ -1,98 +0,0 @@
uniform mat4 mWorldViewProj;
uniform mat4 mInvWorld;
uniform mat4 mTransWorld;
uniform float dayNightRatio;
varying vec3 vPosition;
varying vec3 viewVec;
void main(void)
{
gl_Position = mWorldViewProj * gl_Vertex;
vPosition = (mWorldViewProj * gl_Vertex).xyz;
vec3 tangent;
vec3 binormal;
vec3 c1 = cross( gl_Normal, vec3(0.0, 0.0, 1.0) );
vec3 c2 = cross( gl_Normal, vec3(0.0, 1.0, 0.0) );
if( length(c1)>length(c2) )
{
tangent = c1;
}
else
{
tangent = c2;
}
tangent = normalize(tangent);
//binormal = cross(gl_Normal, tangent);
//binormal = normalize(binormal);
vec4 color;
//color = vec4(1.0, 1.0, 1.0, 1.0);
float day = gl_Color.r;
float night = gl_Color.g;
float light_source = gl_Color.b;
/*color.r = mix(night, day, dayNightRatio);
color.g = color.r;
color.b = color.r;*/
float rg = mix(night, day, dayNightRatio);
rg += light_source * 1.5; // Make light sources brighter
float b = rg;
// Moonlight is blue
b += (day - night) / 13.0;
rg -= (day - night) / 13.0;
// Emphase blue a bit in darker places
// See C++ implementation in mapblock_mesh.cpp finalColorBlend()
b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025);
// Artificial light is yellow-ish
// See C++ implementation in mapblock_mesh.cpp finalColorBlend()
rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065);
color.r = rg;
color.g = rg;
color.b = b;
// Make sides and bottom darker than the top
color = color * color; // SRGB -> Linear
if(gl_Normal.y <= 0.5)
color *= 0.6;
//color *= 0.7;
color = sqrt(color); // Linear -> SRGB
color.a = gl_Color.a;
gl_FrontColor = gl_BackColor = color;
gl_TexCoord[0] = gl_MultiTexCoord0;
vec3 n1 = normalize(gl_NormalMatrix * gl_Normal);
vec4 tangent1 = vec4(tangent.x, tangent.y, tangent.z, 0);
//vec3 t1 = normalize(gl_NormalMatrix * tangent1);
//vec3 b1 = cross(n1, t1);
vec3 v;
vec3 vVertex = vec3(gl_ModelViewMatrix * gl_Vertex);
vec3 vVec = -vVertex;
//v.x = dot(vVec, t1);
//v.y = dot(vVec, b1);
//v.z = dot(vVec, n1);
//viewVec = vVec;
viewVec = normalize(vec3(0.0, -0.4, 0.5));
//Vector representing the 0th texture coordinate passed to fragment shader
//gl_TexCoord[0] = vec2(gl_MultiTexCoord0);
// Transform the current vertex
//gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}

View File

@ -507,7 +507,8 @@ Representations of simple things
-------------------------------- --------------------------------
Position/vector: Position/vector:
{x=num, y=num, z=num} {x=num, y=num, z=num}
For helper functions see "Vector helpers". Currently the API does not provide any helper functions for addition,
subtraction and whatever; you can define those that you need yourself.
pointed_thing: pointed_thing:
{type="nothing"} {type="nothing"}
@ -882,15 +883,6 @@ background[<X>,<Y>;<W>,<H>;<texture name>]
^ Position and size units are inventory slots ^ Position and size units are inventory slots
^ Example for formspec 8x4 in 16x resolution: image shall be sized 8*16px x 4*16px ^ Example for formspec 8x4 in 16x resolution: image shall be sized 8*16px x 4*16px
pwdfield[<X>,<Y>;<W>,<H>;<name>;<label>]
^ Textual password style field; will be sent to server when a button is clicked
^ x and y position the field relative to the top left of the menu
^ w and h are the size of the field
^ fields are a set height, but will be vertically centred on h
^ Position and size units are inventory slots
^ name is the name of the field as returned in fields to on_receive_fields
^ label, if not blank, will be text printed on the top left above the field
field[<X>,<Y>;<W>,<H>;<name>;<label>;<default>] field[<X>,<Y>;<W>,<H>;<name>;<label>;<default>]
^ Textual field; will be sent to server when a button is clicked ^ Textual field; will be sent to server when a button is clicked
^ x and y position the field relative to the top left of the menu ^ x and y position the field relative to the top left of the menu
@ -918,12 +910,6 @@ label[<X>,<Y>;<label>]
^ label is the text on the label ^ label is the text on the label
^ Position and size units are inventory slots ^ Position and size units are inventory slots
vertlabel[<X>,<Y>;<label>]
^ Textual label drawn verticaly
^ x and y work as per field
^ label is the text on the label
^ Position and size units are inventory slots
button[<X>,<Y>;<W>,<H>;<name>;<label>] button[<X>,<Y>;<W>,<H>;<name>;<label>]
^ Clickable button. When clicked, fields will be sent. ^ Clickable button. When clicked, fields will be sent.
^ x, y and name work as per field ^ x, y and name work as per field
@ -936,13 +922,6 @@ image_button[<X>,<Y>;<W>,<H>;<texture name>;<name>;<label>]
^ image is the filename of an image ^ image is the filename of an image
^ Position and size units are inventory slots ^ Position and size units are inventory slots
image_button[<X>,<Y>;<W>,<H>;<texture name>;<name>;<label>;<noclip>;<drawborder>]
^ x, y, w, h, and name work as per button
^ image is the filename of an image
^ Position and size units are inventory slots
^ noclip true meand imagebutton doesn't need to be within specified formsize
^ drawborder draw button bodrer or not
item_image_button[<X>,<Y>;<W>,<H>;<item name>;<name>;<label>] item_image_button[<X>,<Y>;<W>,<H>;<item name>;<name>;<label>]
^ x, y, w, h, name and label work as per button ^ x, y, w, h, name and label work as per button
^ item name is the registered name of an item/node, ^ item name is the registered name of an item/node,
@ -955,51 +934,6 @@ button_exit[<X>,<Y>;<W>,<H>;<name>;<label>]
image_button_exit[<X>,<Y>;<W>,<H>;<texture name>;<name>;<label>] image_button_exit[<X>,<Y>;<W>,<H>;<texture name>;<name>;<label>]
^ When clicked, fields will be sent and the form will quit. ^ When clicked, fields will be sent and the form will quit.
textlist[<X>,<Y>;<W>,<H>;<name>;<listelem 1>,<listelem 2>,...,<listelem n>]
^Scrollabel itemlist showing arbitrary text elements
^ x and y position the itemlist relative to the top left of the menu
^ w and h are the size of the itemlist
^ name fieldname sent to server on doubleclick value is current selected element
^ listelements can be prepended by #colorkey (see colorkeys),
^ if you want a listelement to start with # write ##
textlist[<X>,<Y>;<W>,<H>;<name>;<listelem 1>,<listelem 2>,...,<listelem n>;<selected idx>;<transparent>]
^Scrollabel itemlist showing arbitrary text elements
^ x and y position the itemlist relative to the top left of the menu
^ w and h are the size of the itemlist
^ name fieldname sent to server on doubleclick value is current selected element
^ listelements can be prepended by #RRGGBB in hexadecimal format
^ if you want a listelement to start with # write ##
^ index to be selected within textlist
^ true/false draw transparent background
tabheader[<X>,<Y>;<name>;<caption 1>,<caption 2>,...,<caption n>;<current_tab>;<transparent>;<draw_border>]
^ show a tabHEADER at specific position (ignores formsize)
^ x and y position the itemlist relative to the top left of the menu
^ name fieldname data is transfered to lua
^ caption 1... name shown on top of tab
^ current_tab index of selected tab 1...
^ transparent (optional) show transparent
^ draw_border (optional) draw border
box[<X>,<Y>;<W>,<H>;<color>]
^ simple colored semitransparent box
^ x and y position the box relative to the top left of the menu
^ w and h are the size of box
^ colorkey (see colorkeys)
dropdown[<X>,<Y>;<W>;<name>;<item 1>,<item 2>, ...,<item n>;<selected idx>]
^ show a dropdown field
^ x and y position of dropdown
^ width of dropdown
^ fieldname data is transfered to lua
^ items to be shown in dropdown
^ index of currently selected dropdown item
^ color in hexadecimal format RRGGBB
Note: do NOT use a element name starting with "key_" those names are reserved to
pass key press events to formspec!
Inventory location: Inventory location:
- "context": Selected node metadata (deprecated: "current_name") - "context": Selected node metadata (deprecated: "current_name")
@ -1008,41 +942,12 @@ Inventory location:
- "nodemeta:<X>,<Y>,<Z>": Any node metadata - "nodemeta:<X>,<Y>,<Z>": Any node metadata
- "detached:<name>": A detached inventory - "detached:<name>": A detached inventory
Vector helpers
---------------
vector.new([x[, y, z]]) -> vector
^ x is a table or the x position.
vector.direction(p1, p2) -> vector
vector.distance(p1, p2) -> number
vector.length(v) -> number
vector.normalize(v) -> vector
vector.round(v) -> vector
vector.equal(v1, v2) -> bool
vector.add(v, x) -> vector
^ x can be annother vector or a number
vector.subtract(v, x) -> vector
vector.multiply(v, x) -> vector
vector.divide(v, x) -> vector
You can also use Lua operators on vectors.
For example:
v1 = vector.new()
v1 = v1 + 5
v2 = vector.new(v1)
v1 = v1 * v2
if v1 == v2 then
error("Math broke")
end
Helper functions Helper functions
----------------- -----------------
dump2(obj, name="_", dumped={}) dump2(obj, name="_", dumped={})
^ Return object serialized as a string, handles reference loops ^ Return object serialized as a string, handles reference loops
dump(obj, dumped={}) dump(obj, dumped={})
^ Return object serialized as a string ^ Return object serialized as a string
math.hypot(x, y)
^ Get the hypotenuse of a triangle with legs x and y.
Usefull for distance calculation.
string:split(separator) string:split(separator)
^ eg. string:split("a,b", ",") == {"a","b"} ^ eg. string:split("a,b", ",") == {"a","b"}
string:trim() string:trim()
@ -1404,10 +1309,8 @@ minetest.create_schematic(p1, p2, probability_list, filename)
^ If probability_list is nil, no probabilities are applied. ^ If probability_list is nil, no probabilities are applied.
^ Saves schematic in the Minetest Schematic format to filename. ^ Saves schematic in the Minetest Schematic format to filename.
minetest.place_schematic(pos, schematic, rotation) minetest.place_schematic(pos, schematic)
^ Place the schematic specified by schematic (see: Schematic specifier) at pos. ^ Place the schematic specified by schematic (see: Schematic specifier) at pos.
^ Rotation can be "0", "90", "180", "270", or "random".
^ If the rotation parameter is omitted, the schematic is not rotated.
Random: Random:
minetest.get_connected_players() -> list of ObjectRefs minetest.get_connected_players() -> list of ObjectRefs
@ -1660,11 +1563,13 @@ methods:
- update_map(): Update map after writing chunk back to map. - update_map(): Update map after writing chunk back to map.
^ To be used only by VoxelManip objects created by the mod itself; not a VoxelManip that was ^ To be used only by VoxelManip objects created by the mod itself; not a VoxelManip that was
^ retrieved from minetest.get_mapgen_object ^ retrieved from minetest.get_mapgen_object
- set_lighting(light): Set the lighting within the VoxelManip - set_lighting(p1, p2, light): Set the lighting in the region formed by p1 and p2 to light
^ light is a table, {day=<0...15>, night=<0...15>} ^ light is a table containing two integer fields ranging from 0 to 15, day and night
^ To be used only by a VoxelManip object from minetest.get_mapgen_object ^ To be used only by a VoxelManip object from minetest.get_mapgen_object; otherwise, set lighting will
- calc_lighting(): Calculate lighting within the VoxelManip ^ be ignored
^ To be used only by a VoxelManip object from minetest.get_mapgen_object - calc_lighting(p1, p2): Calculate lighting in the region formed by p1 and p2
^ To be used only by a VoxelManip object from minetest.get_mapgen_object; otherwise, calculated lighting
^ will be ignored
- update_liquids(): Update liquid flow - update_liquids(): Update liquid flow
VoxelArea: A helper class for voxel areas VoxelArea: A helper class for voxel areas
@ -1676,13 +1581,6 @@ methods:
- index(x, y, z): returns the index of an absolute position in a flat array starting at 1 - index(x, y, z): returns the index of an absolute position in a flat array starting at 1
^ useful for things like VoxelManip, raw Schematic specifiers, PerlinNoiseMap:get2d/3dMap, and so on ^ useful for things like VoxelManip, raw Schematic specifiers, PerlinNoiseMap:get2d/3dMap, and so on
- indexp(p): same as above, except takes a vector - indexp(p): same as above, except takes a vector
- position(i): returns the absolute position vector corresponding to index i
- contains(x, y, z): check if (x,y,z) is inside area formed by MinEdge and MaxEdge
- containsp(p): same as above, except takes a vector
- containsi(i): same as above, except takes an index
- iter(minx, miny, minz, maxx, maxy, maxz): returns an iterator that returns indices
^ from (minx,miny,minz) to (maxx,maxy,maxz) in the order of [z [y [x]]]
- iterp(minp, maxp): same as above, except takes a vector
Mapgen objects Mapgen objects
--------------- ---------------
@ -1694,8 +1592,8 @@ get_mapgen_object() was called outside of an on_generate() callback, nil is retu
The following Mapgen objects are currently available: The following Mapgen objects are currently available:
- voxelmanip - voxelmanip
This returns three values; the VoxelManip object to be used, minimum and maximum emerged position, in that This returns four values; the VoxelManip object to be used, the voxel data, minimum emerge position,
order. All mapgens support this object. and maximum emerged position. All mapgens support this object.
- heightmap - heightmap
Returns an array containing the y coordinates of the ground levels of nodes in the most recently Returns an array containing the y coordinates of the ground levels of nodes in the most recently
@ -2152,8 +2050,6 @@ Decoration definition (register_decoration)
^ See 'Schematic specifier' for details. ^ See 'Schematic specifier' for details.
flags = "place_center_x, place_center_z", flags = "place_center_x, place_center_z",
^ Flags for schematic decorations. See 'Schematic attributes'. ^ Flags for schematic decorations. See 'Schematic attributes'.
rotation = "90" --rotate schematic 90 degrees on placement
^ Rotation can be "0", "90", "180", "270", or "random".
} }
Chatcommand definition (register_chatcommand) Chatcommand definition (register_chatcommand)

View File

@ -1,163 +0,0 @@
Minetest Lua Mainmenu API Reference 0.4.6
========================================
Introduction
-------------
The main menu is defined as a formspec by Lua in builtin/mainmenu.lua
Description of formspec language to show your menu is in lua_api.txt
Callbacks
---------
engine.buttonhandler(fields): called when a button is pressed.
^ fields = {name1 = value1, name2 = value2, ...}
engine.event_handler(event)
^ event: "MenuQuit", "KeyEnter", "ExitButton" or "EditBoxEnter"
Gamedata
--------
The "gamedata" table is read when calling engine.start(). It should contain:
{
playername = <name>,
password = <password>,
address = <IP/adress>,
port = <port>,
selected_world = <index>, -- 0 for client mode
singleplayer = <true/false>,
}
Functions
---------
engine.start()
engine.close()
Filesystem:
engine.get_scriptdir()
^ returns directory of script
engine.get_modpath()
^ returns path to global modpath
engine.get_modstore_details(modid)
^ modid numeric id of mod in modstore
^ returns {
id = <numeric id of mod in modstore>,
title = <human readable title>,
basename = <basename for mod>,
description = <description of mod>,
author = <author of mod>,
download_url= <best match download url>,
license = <short description of license>,
rating = <float value of current rating>
}
engine.get_modstore_list()
^ returns {
[1] = {
id = <numeric id of mod in modstore>,
title = <human readable title>,
basename = <basename for mod>
}
}
engine.get_gamepath()
^ returns path to global gamepath
engine.get_dirlist(path,onlydirs)
^ path to get subdirs from
^ onlydirs should result contain only dirs?
^ returns list of folders within path
engine.create_dir(absolute_path)
^ absolute_path to directory to create (needs to be absolute)
^ returns true/false
engine.delete_dir(absolute_path)
^ absolute_path to directory to delete (needs to be absolute)
^ returns true/false
engine.copy_dir(source,destination,keep_soure)
^ source folder
^ destination folder
^ keep_source DEFAULT true --> if set to false source is deleted after copying
^ returns true/false
engine.extract_zip(zipfile,destination) [unzip within path required]
^ zipfile to extract
^ destination folder to extract to
^ returns true/false
engine.download_file(url,target)
^ url to download
^ target to store to
^ returns true/false
engine.get_version()
^ returns current minetest version
GUI:
engine.update_formspec(formspec)
- engine.set_background(type, texturepath)
^ type: "background", "overlay", "header" or "footer"
engine.set_clouds(<true/false>)
engine.set_topleft_text(text)
Games:
engine.get_game(index)
^ returns {
id = <id>,
path = <full path to game>,
gamemods_path = <path>,
name = <name of game>,
menuicon_path = <full path to menuicon>,
DEPRECATED:
addon_mods_paths = {[1] = <path>,},
}
engine.get_games() -> table of all games in upper format
Favorites:
engine.get_favorites(location) -> list of favorites
^ location: "local" or "online"
^ returns {
[1] = {
clients = <number of clients/nil>,
clients_max = <maximum number of clients/nil>,
version = <server version/nil>,
password = <true/nil>,
creative = <true/nil>,
damage = <true/nil>,
pvp = <true/nil>,
description = <server description/nil>,
name = <server name/nil>,
address = <address of server/nil>,
port = <port>
},
}
engine.delete_favorite(id, location) -> success
Settings:
engine.setting_set(name, value)
engine.setting_get(name) -> string or nil
engine.setting_setbool(name, value)
engine.setting_getbool(name) -> bool or nil
Worlds:
engine.get_worlds() -> list of worlds
^ returns {
[1] = {
path = <full path to world>,
name = <name of world>,
gameid = <gameid of world>,
},
}
engine.create_world(worldname, gameid)
engine.delete_world(index)
UI:
engine.get_textlist_index(textlistname) -> index
engine.show_keys_menu()
engine.file_open_dialog(formname,caption)
^ shows a file open dialog
^ formname is base name of dialog response returned in fields
^ -if dialog was accepted "_accepted"
^^ will be added to fieldname containing the path
^ -if dialog was canceled "_cancelled"
^ will be added to fieldname value is set to formname itself
^ returns nil or selected file/folder
Helpers:
dump(obj, dumped={})
^ Return object serialized as a string
string:split(separator)
^ eg. string:split("a,b", ",") == {"a","b"}
string:trim()
^ eg. string.trim("\n \t\tfoo bar\t ") == "foo bar"

View File

@ -8,7 +8,7 @@
# Uncomment settings by removing the preceding #. # Uncomment settings by removing the preceding #.
# #
# Further documentation: # Further documentation:
# http://wiki.minetest.net/ # http://wiki.minetest.com/
# #
# NOTE: This file might not be up-to-date, refer to the # NOTE: This file might not be up-to-date, refer to the
# defaultsettings.cpp file for an up-to-date list: # defaultsettings.cpp file for an up-to-date list:
@ -112,6 +112,9 @@
# Enable smooth lighting with simple ambient occlusion; # Enable smooth lighting with simple ambient occlusion;
# disable for speed or for different looks. # disable for speed or for different looks.
#smooth_lighting = true #smooth_lighting = true
# Enable combining mainly used textures to a bigger one for improved speed
# disable if it causes graphics glitches.
#enable_texture_atlas = false
# Path to texture directory. All textures are first searched from here. # Path to texture directory. All textures are first searched from here.
#texture_path = #texture_path =
# Video back-end. # Video back-end.
@ -172,8 +175,6 @@
# (1: low level shaders; not implemented) # (1: low level shaders; not implemented)
# 2: enable high level shaders # 2: enable high level shaders
#enable_shaders = 2 #enable_shaders = 2
# Set to true to enable textures bumpmapping. Requires shaders enabled.
#enable_bumpmapping = false
# The time in seconds it takes between repeated # The time in seconds it takes between repeated
# right clicks when holding the right mouse button # right clicks when holding the right mouse button
#repeat_rightclick_time = 0.25 #repeat_rightclick_time = 0.25
@ -206,8 +207,6 @@
#server_url = http://minetest.net #server_url = http://minetest.net
# Automaticaly report to masterserver # Automaticaly report to masterserver
#server_announce = 0 #server_announce = 0
# Announce to this masterserver. if you want to announce your ipv6 address - use serverlist_url = v6.servers.minetest.net
#serverlist_url = servers.minetest.net
# Default game (default when creating a new world) # Default game (default when creating a new world)
#default_game = minetest #default_game = minetest
# World directory (everything in the world is stored here) # World directory (everything in the world is stored here)
@ -377,9 +376,3 @@
# Enable/disable running an IPv6 server. An IPv6 server may be restricted # Enable/disable running an IPv6 server. An IPv6 server may be restricted
# to IPv6 clients, depending on system configuration. # to IPv6 clients, depending on system configuration.
#ipv6_server = false #ipv6_server = false
#main_menu_game_mgr = 0
#main_menu_mod_mgr = 0
#modstore_download_url = http://forum.minetest.net/media/
#modstore_listmods_url = http://forum.minetest.net/mmdb/mods/
#modstore_details_url = http://forum.minetest.net/mmdb/mod/*/

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 0.0.0\n" "Project-Id-Version: 0.0.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: 2013-02-17 00:41+0200\n" "PO-Revision-Date: 2013-02-17 00:41+0200\n"
"Last-Translator: Rune Biskopstö Christensen <lakersforce@gmail.com>\n" "Last-Translator: Rune Biskopstö Christensen <lakersforce@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
@ -18,47 +18,35 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Weblate 1.4-dev\n" "X-Generator: Weblate 1.4-dev\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "" msgstr ""
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "" msgstr ""
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "" msgstr ""
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "" msgstr ""
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "" msgstr ""
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "" msgstr ""
#: src/game.cpp:1223 #: src/game.cpp:3348
msgid "Item definitions..."
msgstr ""
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "" msgstr ""
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
@ -66,40 +54,56 @@ msgstr ""
"\n" "\n"
"Tjek debug.txt for detaljer." "Tjek debug.txt for detaljer."
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
"Advarsel: nogle modifikationer er endnu ikke konfigureret.\n"
"De vil blive aktiveret som standard når du gemmer konfigurationen. "
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
"Advarsel: nogle konfigurerede modifikationer mangler.\n"
"Deres indstillinger vil blive fjernet når du gemmer konfigurationen. "
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "aktiveret" msgstr "aktiveret"
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "Aktivér alle" msgstr "Aktivér alle"
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "Deaktivér alle" msgstr "Deaktivér alle"
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "afhænger af:" msgstr "afhænger af:"
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "er påkrævet af:" msgstr "er påkrævet af:"
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "Anuller" msgstr "Anuller"
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "Gem" msgstr "Gem"
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "Konfiguration gemt. " msgstr "Konfiguration gemt. "
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "Advarsel: konfigurationen er ikke sammenhængende. " msgstr "Advarsel: konfigurationen er ikke sammenhængende. "
@ -111,15 +115,15 @@ msgstr "Ja"
msgid "No" msgid "No"
msgstr "Nej" msgstr "Nej"
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "Verdens navn" msgstr "Verdens navn"
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "Spil" msgstr "Spil"
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "Skab" msgstr "Skab"
@ -131,12 +135,12 @@ msgstr "Du døde."
msgid "Respawn" msgid "Respawn"
msgstr "Genopstå" msgstr "Genopstå"
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "Venstre klik: flyt alle enheder. Højre klik: flyt en enkelt enhed" msgstr "Venstre klik: flyt alle enheder. Højre klik: flyt en enkelt enhed"
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "Fortsæt" msgstr "Fortsæt"
@ -414,23 +418,23 @@ msgstr "Kan ikke konfigurere verden: ingenting valgt"
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "Mislykkedes i at slette alle verdenens filer" msgstr "Mislykkedes i at slette alle verdenens filer"
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "Gammelt kodeord" msgstr "Gammelt kodeord"
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "Nyt kodeord" msgstr "Nyt kodeord"
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "Bekræft kodeord" msgstr "Bekræft kodeord"
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "Skift" msgstr "Skift"
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "Kodeordene er ikke ens!" msgstr "Kodeordene er ikke ens!"
@ -469,11 +473,11 @@ msgid ""
"- T: chat\n" "- T: chat\n"
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "" msgstr ""
@ -776,26 +780,29 @@ msgstr "Zoom"
msgid "Main Menu" msgid "Main Menu"
msgstr "Hovedmenu" msgstr "Hovedmenu"
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "Mislykkedes i at initialisere verden" msgstr "Mislykkedes i at initialisere verden"
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "Ingen verden valgt og ingen adresse angivet. Ingen opgave at lave." msgstr "Ingen verden valgt og ingen adresse angivet. Ingen opgave at lave."
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "Kunne ikke finde eller indlæse spil \"" msgstr "Kunne ikke finde eller indlæse spil \""
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "Ugyldig spilspecifikationer." msgstr "Ugyldig spilspecifikationer."
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "Forbindelses fejl (udløbelse af tidsfrist?)" msgstr "Forbindelses fejl (udløbelse af tidsfrist?)"
#~ msgid "Delete map"
#~ msgstr "Slet mappen"
#~ msgid "" #~ msgid ""
#~ "Default Controls:\n" #~ "Default Controls:\n"
#~ "- WASD: Walk\n" #~ "- WASD: Walk\n"
@ -820,20 +827,3 @@ msgstr "Forbindelses fejl (udløbelse af tidsfrist?)"
#~ "- I: beholdning\n" #~ "- I: beholdning\n"
#~ "- ESC: denne menu\n" #~ "- ESC: denne menu\n"
#~ "- T: snak\n" #~ "- T: snak\n"
#~ msgid "Delete map"
#~ msgstr "Slet mappen"
#~ msgid ""
#~ "Warning: Some configured mods are missing.\n"
#~ "Their setting will be removed when you save the configuration. "
#~ msgstr ""
#~ "Advarsel: nogle konfigurerede modifikationer mangler.\n"
#~ "Deres indstillinger vil blive fjernet når du gemmer konfigurationen. "
#~ msgid ""
#~ "Warning: Some mods are not configured yet.\n"
#~ "They will be enabled by default when you save the configuration. "
#~ msgstr ""
#~ "Advarsel: nogle modifikationer er endnu ikke konfigureret.\n"
#~ "De vil blive aktiveret som standard når du gemmer konfigurationen. "

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 0.0.0\n" "Project-Id-Version: 0.0.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: 2013-05-14 12:51+0200\n" "PO-Revision-Date: 2013-05-14 12:51+0200\n"
"Last-Translator: Pilz Adam <PilzAdam@gmx.de>\n" "Last-Translator: Pilz Adam <PilzAdam@gmx.de>\n"
"Language-Team: Deutsch <>\n" "Language-Team: Deutsch <>\n"
@ -18,48 +18,35 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Weblate 1.4-dev\n" "X-Generator: Weblate 1.4-dev\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "Inventarbilder..." msgstr "Inventarbilder..."
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "Lädt..." msgstr "Lädt..."
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "Erstelle Server..." msgstr "Erstelle Server..."
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "Erstelle Client..." msgstr "Erstelle Client..."
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "Löse Adresse auf..." msgstr "Löse Adresse auf..."
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "Verbinde zum Server..." msgstr "Verbinde zum Server..."
#: src/game.cpp:1223 #: src/game.cpp:3348
#, fuzzy
msgid "Item definitions..."
msgstr "Inventarbilder..."
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "Herunterfahren..." msgstr "Herunterfahren..."
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
@ -67,40 +54,56 @@ msgstr ""
"\n" "\n"
"Siehe debug.txt für Details." "Siehe debug.txt für Details."
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
"Warnung: Einige Mods sind noch nicht konfiguriert.\n"
"Sie werden aktiviert wenn die Konfiguration gespeichert wird. "
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
"Warnung: Einige konfigurierte Mods fehlen.\n"
"Mod Einstellungen werden gelöscht wenn die Konfiguration gespeichert wird. "
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "Aktiviert" msgstr "Aktiviert"
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "Alle an" msgstr "Alle an"
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "Alle aus" msgstr "Alle aus"
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "abhängig von:" msgstr "abhängig von:"
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "wird benötigt von:" msgstr "wird benötigt von:"
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "Abbrechen" msgstr "Abbrechen"
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "Speichern" msgstr "Speichern"
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "Konfiguration gespeichert. " msgstr "Konfiguration gespeichert. "
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "Warnung: Konfiguration nicht konsistent. " msgstr "Warnung: Konfiguration nicht konsistent. "
@ -112,15 +115,15 @@ msgstr "Ja"
msgid "No" msgid "No"
msgstr "Nein" msgstr "Nein"
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "Weltname" msgstr "Weltname"
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "Spiel" msgstr "Spiel"
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "Erstellen" msgstr "Erstellen"
@ -132,12 +135,12 @@ msgstr "Sie sind gestorben."
msgid "Respawn" msgid "Respawn"
msgstr "Wiederbeleben" msgstr "Wiederbeleben"
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "Linksklick: Alle Items bewegen, Rechtsklick: Einzelnes Item bewegen" msgstr "Linksklick: Alle Items bewegen, Rechtsklick: Einzelnes Item bewegen"
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "Fortsetzen" msgstr "Fortsetzen"
@ -410,23 +413,23 @@ msgstr "Kann Welt nicht konfigurieren: Nichts ausgewählt"
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "Es konnten nicht alle Welt Dateien gelöscht werden" msgstr "Es konnten nicht alle Welt Dateien gelöscht werden"
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "Altes Passwort" msgstr "Altes Passwort"
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "Neues Passwort" msgstr "Neues Passwort"
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "Passwort wiederholen" msgstr "Passwort wiederholen"
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "Ändern" msgstr "Ändern"
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "Passwörter passen nicht zusammen!" msgstr "Passwörter passen nicht zusammen!"
@ -476,11 +479,11 @@ msgstr ""
"- Mausrad: Item auswählen\n" "- Mausrad: Item auswählen\n"
"- T: Chat\n" "- T: Chat\n"
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "Sound Lautstärke: " msgstr "Sound Lautstärke: "
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "Zurück" msgstr "Zurück"
@ -780,26 +783,32 @@ msgstr "Zoom"
msgid "Main Menu" msgid "Main Menu"
msgstr "Hauptmenü" msgstr "Hauptmenü"
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "Kann Welt nicht initialisieren" msgstr "Kann Welt nicht initialisieren"
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "Keine Welt ausgewählt und keine Adresse angegeben. Nichts zu tun." msgstr "Keine Welt ausgewählt und keine Adresse angegeben. Nichts zu tun."
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "Kann Spiel nicht finden/laden \"" msgstr "Kann Spiel nicht finden/laden \""
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "Invalide Spielspezif." msgstr "Invalide Spielspezif."
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "Verbindungsfehler (Zeitüberschreitung?)" msgstr "Verbindungsfehler (Zeitüberschreitung?)"
#~ msgid "KEYBINDINGS"
#~ msgstr "TASTEN EINST."
#~ msgid "Delete map"
#~ msgstr "Karte löschen"
#~ msgid "" #~ msgid ""
#~ "Default Controls:\n" #~ "Default Controls:\n"
#~ "- WASD: Walk\n" #~ "- WASD: Walk\n"
@ -823,24 +832,3 @@ msgstr "Verbindungsfehler (Zeitüberschreitung?)"
#~ "- R: alle geladenen Blöcke anzeigen (wechseln)\n" #~ "- R: alle geladenen Blöcke anzeigen (wechseln)\n"
#~ "- I: Inventar\n" #~ "- I: Inventar\n"
#~ "- T: Chat\n" #~ "- T: Chat\n"
#~ msgid "Delete map"
#~ msgstr "Karte löschen"
#~ msgid "KEYBINDINGS"
#~ msgstr "TASTEN EINST."
#~ msgid ""
#~ "Warning: Some configured mods are missing.\n"
#~ "Their setting will be removed when you save the configuration. "
#~ msgstr ""
#~ "Warnung: Einige konfigurierte Mods fehlen.\n"
#~ "Mod Einstellungen werden gelöscht wenn die Konfiguration gespeichert "
#~ "wird. "
#~ msgid ""
#~ "Warning: Some mods are not configured yet.\n"
#~ "They will be enabled by default when you save the configuration. "
#~ msgstr ""
#~ "Warnung: Einige Mods sind noch nicht konfiguriert.\n"
#~ "Sie werden aktiviert wenn die Konfiguration gespeichert wird. "

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: minetest\n" "Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: 2013-04-18 15:28+0100\n" "PO-Revision-Date: 2013-04-18 15:28+0100\n"
"Last-Translator: LS-Steeef \n" "Last-Translator: LS-Steeef \n"
"Language-Team: \n" "Language-Team: \n"
@ -17,47 +17,35 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.5.5\n" "X-Generator: Poedit 1.5.5\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "" msgstr ""
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "" msgstr ""
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "" msgstr ""
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "" msgstr ""
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "" msgstr ""
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "" msgstr ""
#: src/game.cpp:1223 #: src/game.cpp:3348
msgid "Item definitions..."
msgstr ""
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "" msgstr ""
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
@ -65,40 +53,57 @@ msgstr ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
"Let op: Nog niet alle mods zijn geconfigueerd. \n"
"De mods zullen automatisch worden ingeschakeld als je de configuratie "
"bewaard."
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
"LEt op: Sommige ingestelde mods zijn vermist.\n"
"Hun instellingen worden verwijderd als je de configuratie opslaat."
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "ingeschakeld" msgstr "ingeschakeld"
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "Allen inschakelen" msgstr "Allen inschakelen"
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "Allen uitschakelen" msgstr "Allen uitschakelen"
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "heeft nodig:" msgstr "heeft nodig:"
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "is benodigd voor:" msgstr "is benodigd voor:"
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "Annuleer" msgstr "Annuleer"
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "Bewaar" msgstr "Bewaar"
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "Instellingen bewaard." msgstr "Instellingen bewaard."
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "Waarschuwing: Instellingen niet consistent." msgstr "Waarschuwing: Instellingen niet consistent."
@ -110,15 +115,15 @@ msgstr "Ja"
msgid "No" msgid "No"
msgstr "Nee" msgstr "Nee"
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "Naam wereld" msgstr "Naam wereld"
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "Spel" msgstr "Spel"
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "Maak aan" msgstr "Maak aan"
@ -130,13 +135,13 @@ msgstr "Je bent gestorven."
msgid "Respawn" msgid "Respawn"
msgstr "Respawn" msgstr "Respawn"
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "" msgstr ""
"Linkermuisknop: Verplaats alle items. Rechtermuisknop: Verplaats één item." "Linkermuisknop: Verplaats alle items. Rechtermuisknop: Verplaats één item."
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "Volgende" msgstr "Volgende"
@ -408,23 +413,23 @@ msgstr "Kan instellingen niet aanpassen: Niets geselecteerd"
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "Niet alle bestanden zijn verwijderd" msgstr "Niet alle bestanden zijn verwijderd"
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "Huidig wachtwoord" msgstr "Huidig wachtwoord"
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "Nieuw wachtwoord" msgstr "Nieuw wachtwoord"
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "Herhaal wachtwoord" msgstr "Herhaal wachtwoord"
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "Veranderen" msgstr "Veranderen"
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "Wachtwoorden zijn niet gelijk!" msgstr "Wachtwoorden zijn niet gelijk!"
@ -463,11 +468,11 @@ msgid ""
"- T: chat\n" "- T: chat\n"
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "Volume:" msgstr "Volume:"
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "Exit" msgstr "Exit"
@ -767,23 +772,23 @@ msgstr "Zoom"
msgid "Main Menu" msgid "Main Menu"
msgstr "Hoofdmenu" msgstr "Hoofdmenu"
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "Laden van wereld is mislukt" msgstr "Laden van wereld is mislukt"
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "Geen wereld en adres geselecteerd. Niks te doen." msgstr "Geen wereld en adres geselecteerd. Niks te doen."
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "Kan niet de game laden of vinden." msgstr "Kan niet de game laden of vinden."
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "Onjuiste gamespec." msgstr "Onjuiste gamespec."
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "Connection error (timed out?)" msgstr "Connection error (timed out?)"
@ -811,18 +816,3 @@ msgstr "Connection error (timed out?)"
#~ "- I: Rugzak\n" #~ "- I: Rugzak\n"
#~ "- ESC: Menu\n" #~ "- ESC: Menu\n"
#~ "- T: Chat\n" #~ "- T: Chat\n"
#~ msgid ""
#~ "Warning: Some configured mods are missing.\n"
#~ "Their setting will be removed when you save the configuration. "
#~ msgstr ""
#~ "LEt op: Sommige ingestelde mods zijn vermist.\n"
#~ "Hun instellingen worden verwijderd als je de configuratie opslaat."
#~ msgid ""
#~ "Warning: Some mods are not configured yet.\n"
#~ "They will be enabled by default when you save the configuration. "
#~ msgstr ""
#~ "Let op: Nog niet alle mods zijn geconfigueerd. \n"
#~ "De mods zullen automatisch worden ingeschakeld als je de configuratie "
#~ "bewaard."

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: minetest\n" "Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: 2013-05-16 14:51+0200\n" "PO-Revision-Date: 2013-05-16 14:51+0200\n"
"Last-Translator: Diego Martínez <lkaezadl3@gmail.com>\n" "Last-Translator: Diego Martínez <lkaezadl3@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,48 +18,35 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Weblate 1.4-dev\n" "X-Generator: Weblate 1.4-dev\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "Texturas de objetos..." msgstr "Texturas de objetos..."
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "Cargando..." msgstr "Cargando..."
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "Creando servidor..." msgstr "Creando servidor..."
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "Creando cliente..." msgstr "Creando cliente..."
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "Resolviendo dirección..." msgstr "Resolviendo dirección..."
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "Conectando al servidor..." msgstr "Conectando al servidor..."
#: src/game.cpp:1223 #: src/game.cpp:3348
#, fuzzy
msgid "Item definitions..."
msgstr "Texturas de objetos..."
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "Apagando cosas..." msgstr "Apagando cosas..."
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
@ -67,40 +54,56 @@ msgstr ""
"\n" "\n"
"Consulta debug.txt para obtener más detalles." "Consulta debug.txt para obtener más detalles."
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
"ADVERTENCIA: Algunos mods no están aún configurados.\n"
"Se habilitarán de forma predeterminada al guardar la configuración. "
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
"ADVERTENCIA: Algunos mods configurados faltan.\n"
"Su ajuste se quitará al guardar la configuración. "
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "Activado" msgstr "Activado"
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "Activar todos" msgstr "Activar todos"
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "Desactivar todos" msgstr "Desactivar todos"
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "Dependencias:" msgstr "Dependencias:"
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "es requerido por:" msgstr "es requerido por:"
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "Cancelar" msgstr "Cancelar"
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "Guardar" msgstr "Guardar"
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "Configuración guardada. " msgstr "Configuración guardada. "
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "ADVERTENCIA: La configuración no corresponde. " msgstr "ADVERTENCIA: La configuración no corresponde. "
@ -112,15 +115,15 @@ msgstr "Sí"
msgid "No" msgid "No"
msgstr "No" msgstr "No"
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "Nombre del mundo" msgstr "Nombre del mundo"
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "Juego" msgstr "Juego"
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "Crear" msgstr "Crear"
@ -132,13 +135,13 @@ msgstr "Has muerto."
msgid "Respawn" msgid "Respawn"
msgstr "Revivir" msgstr "Revivir"
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "" msgstr ""
"Click izquierdo: Mover todos los objetos. Click derecho: Mover un objeto." "Click izquierdo: Mover todos los objetos. Click derecho: Mover un objeto."
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "Continuar" msgstr "Continuar"
@ -412,23 +415,23 @@ msgstr "No se puede configurar el mundo: Ninguno seleccionado"
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "No se pudo eliminar todos los archivos del mundo" msgstr "No se pudo eliminar todos los archivos del mundo"
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "Contraseña anterior" msgstr "Contraseña anterior"
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "Nueva contraseña" msgstr "Nueva contraseña"
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "Confirmar contraseña" msgstr "Confirmar contraseña"
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "Cambiar" msgstr "Cambiar"
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "¡Las contraseñas no coinciden!" msgstr "¡Las contraseñas no coinciden!"
@ -478,11 +481,11 @@ msgstr ""
"- Rueda ratón: elegir objeto\n" "- Rueda ratón: elegir objeto\n"
"- T: conversar\n" "- T: conversar\n"
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "Volúmen del Sonido: " msgstr "Volúmen del Sonido: "
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "Salir" msgstr "Salir"
@ -782,24 +785,24 @@ msgstr "Zoom"
msgid "Main Menu" msgid "Main Menu"
msgstr "Menú Principal" msgstr "Menú Principal"
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "Fallo al iniciar el mundo" msgstr "Fallo al iniciar el mundo"
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "" msgstr ""
"No se seleccionó mundo y no se ha especificado una dirección. Nada que hacer." "No se seleccionó mundo y no se ha especificado una dirección. Nada que hacer."
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "No se puede encontrar o cargar el juego \"" msgstr "No se puede encontrar o cargar el juego \""
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "Juego especificado no válido." msgstr "Juego especificado no válido."
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "Error de conexión (¿tiempo agotado?)" msgstr "Error de conexión (¿tiempo agotado?)"
@ -827,17 +830,3 @@ msgstr "Error de conexión (¿tiempo agotado?)"
#~ "- I: Inventario \n" #~ "- I: Inventario \n"
#~ "- ESC: Este Menu\n" #~ "- ESC: Este Menu\n"
#~ "- T: Conversar\n" #~ "- T: Conversar\n"
#~ msgid ""
#~ "Warning: Some configured mods are missing.\n"
#~ "Their setting will be removed when you save the configuration. "
#~ msgstr ""
#~ "ADVERTENCIA: Algunos mods configurados faltan.\n"
#~ "Su ajuste se quitará al guardar la configuración. "
#~ msgid ""
#~ "Warning: Some mods are not configured yet.\n"
#~ "They will be enabled by default when you save the configuration. "
#~ msgstr ""
#~ "ADVERTENCIA: Algunos mods no están aún configurados.\n"
#~ "Se habilitarán de forma predeterminada al guardar la configuración. "

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: minetest\n" "Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: 2013-04-03 17:02+0200\n" "PO-Revision-Date: 2013-04-03 17:02+0200\n"
"Last-Translator: Pilz Adam <PilzAdam@gmx.de>\n" "Last-Translator: Pilz Adam <PilzAdam@gmx.de>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,47 +18,35 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Weblate 1.4-dev\n" "X-Generator: Weblate 1.4-dev\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "" msgstr ""
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "" msgstr ""
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "" msgstr ""
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "" msgstr ""
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "" msgstr ""
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "" msgstr ""
#: src/game.cpp:1223 #: src/game.cpp:3348
msgid "Item definitions..."
msgstr ""
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "" msgstr ""
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
@ -66,40 +54,56 @@ msgstr ""
"\n" "\n"
"Vaata debug.txt info jaoks." "Vaata debug.txt info jaoks."
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
"Hoiatus: Mõned modifikatsioonid pole sätitud veel.\n"
"Need lülitatakse sisse kohe pärast sätete salvestamist."
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
"Hoiatus: Mõned konfigureeritud modifikatsioonid on kaotsi läinud.\n"
"Nende sätted kustutatakse kui salvestada konfiguratsioon."
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "Sisse lülitatud" msgstr "Sisse lülitatud"
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "Lülita kõik sisse" msgstr "Lülita kõik sisse"
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "Lülita kõik välja" msgstr "Lülita kõik välja"
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "Vajab:" msgstr "Vajab:"
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "Seda vajavad:" msgstr "Seda vajavad:"
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "Tühista" msgstr "Tühista"
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "Salvesta" msgstr "Salvesta"
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "Konfiguratsioon salvestatud. " msgstr "Konfiguratsioon salvestatud. "
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "Hoiatus: Konfiguratsioon pole kindel." msgstr "Hoiatus: Konfiguratsioon pole kindel."
@ -111,15 +115,15 @@ msgstr "Jah"
msgid "No" msgid "No"
msgstr "Ei" msgstr "Ei"
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "Maailma nimi" msgstr "Maailma nimi"
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "Mäng" msgstr "Mäng"
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "Loo" msgstr "Loo"
@ -131,13 +135,13 @@ msgstr "Sa surid."
msgid "Respawn" msgid "Respawn"
msgstr "Ärka ellu" msgstr "Ärka ellu"
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "" msgstr ""
"Vasak hiireklõps: Liiguta kõiki asju, Parem hiireklõps: Liiguta üksikut asja" "Vasak hiireklõps: Liiguta kõiki asju, Parem hiireklõps: Liiguta üksikut asja"
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "Jätka" msgstr "Jätka"
@ -411,23 +415,23 @@ msgstr "Maailma konfigureerimine ebaõnnestus: Pole midagi valitud"
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "Kõigi maailma failide kustutamine ebaõnnestus" msgstr "Kõigi maailma failide kustutamine ebaõnnestus"
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "Vana parool" msgstr "Vana parool"
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "Uus parool" msgstr "Uus parool"
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "Kinnita parooli" msgstr "Kinnita parooli"
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "Muuda" msgstr "Muuda"
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "Paroolid ei ole samad!" msgstr "Paroolid ei ole samad!"
@ -466,11 +470,11 @@ msgid ""
"- T: chat\n" "- T: chat\n"
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "Hääle Volüüm: " msgstr "Hääle Volüüm: "
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "Välju" msgstr "Välju"
@ -770,23 +774,23 @@ msgstr "Suumi"
msgid "Main Menu" msgid "Main Menu"
msgstr "Menüü" msgstr "Menüü"
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "Maailma initsialiseerimine ebaõnnestus" msgstr "Maailma initsialiseerimine ebaõnnestus"
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "Pole valitud ei maailma ega IP aadressi. Pole midagi teha." msgstr "Pole valitud ei maailma ega IP aadressi. Pole midagi teha."
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "Ei leia ega suuda jätkata mängu." msgstr "Ei leia ega suuda jätkata mängu."
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "Vale mängu ID." msgstr "Vale mängu ID."
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "Ühenduse viga (Aeg otsas?)" msgstr "Ühenduse viga (Aeg otsas?)"
@ -814,17 +818,3 @@ msgstr "Ühenduse viga (Aeg otsas?)"
#~ "- I: Seljakott\n" #~ "- I: Seljakott\n"
#~ "- ESC: Menüü\n" #~ "- ESC: Menüü\n"
#~ "- T: Jututupa\n" #~ "- T: Jututupa\n"
#~ msgid ""
#~ "Warning: Some configured mods are missing.\n"
#~ "Their setting will be removed when you save the configuration. "
#~ msgstr ""
#~ "Hoiatus: Mõned konfigureeritud modifikatsioonid on kaotsi läinud.\n"
#~ "Nende sätted kustutatakse kui salvestada konfiguratsioon."
#~ msgid ""
#~ "Warning: Some mods are not configured yet.\n"
#~ "They will be enabled by default when you save the configuration. "
#~ msgstr ""
#~ "Hoiatus: Mõned modifikatsioonid pole sätitud veel.\n"
#~ "Need lülitatakse sisse kohe pärast sätete salvestamist."

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 0.0.0\n" "Project-Id-Version: 0.0.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: 2013-06-01 13:22+0200\n" "PO-Revision-Date: 2013-06-01 13:22+0200\n"
"Last-Translator: Ilya Zhuravlev <zhuravlevilya@ya.ru>\n" "Last-Translator: Ilya Zhuravlev <zhuravlevilya@ya.ru>\n"
"Language-Team: Français <>\n" "Language-Team: Français <>\n"
@ -18,48 +18,35 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Weblate 1.4-dev\n" "X-Generator: Weblate 1.4-dev\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "Textures d'objets..." msgstr "Textures d'objets..."
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "Chargement..." msgstr "Chargement..."
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "Création du serveur..." msgstr "Création du serveur..."
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "Création du client..." msgstr "Création du client..."
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "Résolution de l'adresse..." msgstr "Résolution de l'adresse..."
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "Connexion au serveur..." msgstr "Connexion au serveur..."
#: src/game.cpp:1223 #: src/game.cpp:3348
#, fuzzy
msgid "Item definitions..."
msgstr "Textures d'objets..."
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "Quitter le jeu..." msgstr "Quitter le jeu..."
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
@ -67,40 +54,56 @@ msgstr ""
"\n" "\n"
"Voir debug.txt pour plus d'information." "Voir debug.txt pour plus d'information."
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
"Attention : certains mods ne sont pas encore configurés.\n"
"Ils seront activés par défaut quand vous enregistrerez la configuration. "
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
"Attention : certains mods configurés sont introuvables.\n"
"Leurs réglages seront effacés quand vous enregistrerez la configuration. "
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "activé" msgstr "activé"
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "Tout activer" msgstr "Tout activer"
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "Tout désactiver" msgstr "Tout désactiver"
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "dépend de :" msgstr "dépend de :"
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "est requis par :" msgstr "est requis par :"
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "Annuler" msgstr "Annuler"
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "Enregistrer" msgstr "Enregistrer"
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "Configuration enregistrée. " msgstr "Configuration enregistrée. "
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "Attention : configuration incorrecte. " msgstr "Attention : configuration incorrecte. "
@ -112,15 +115,15 @@ msgstr "Oui"
msgid "No" msgid "No"
msgstr "Non" msgstr "Non"
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "Nom du monde" msgstr "Nom du monde"
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "Jeu" msgstr "Jeu"
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "Créer" msgstr "Créer"
@ -132,13 +135,13 @@ msgstr "Vous êtes mort."
msgid "Respawn" msgid "Respawn"
msgstr "Réapparaître" msgstr "Réapparaître"
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "" msgstr ""
"Clic gauche : déplacer tous les objets -- Clic droit : déplacer un objet" "Clic gauche : déplacer tous les objets -- Clic droit : déplacer un objet"
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "OK" msgstr "OK"
@ -232,8 +235,7 @@ msgstr "Imprimer stacks"
#: src/guiMainMenu.cpp:92 #: src/guiMainMenu.cpp:92
msgid "Cannot create world: Name contains invalid characters" msgid "Cannot create world: Name contains invalid characters"
msgstr "" msgstr "Impossible de créer le monde : le nom contient des caractères invalides"
"Impossible de créer le monde : le nom contient des caractères invalides"
#: src/guiMainMenu.cpp:103 #: src/guiMainMenu.cpp:103
msgid "Cannot create world: A world by this name already exists" msgid "Cannot create world: A world by this name already exists"
@ -411,23 +413,23 @@ msgstr "Impossible de configurer ce monde : aucune sélection active"
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "Tous les fichiers du monde n'ont pu être effacés" msgstr "Tous les fichiers du monde n'ont pu être effacés"
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "Ancien mot de passe" msgstr "Ancien mot de passe"
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "Nouveau mot de passe" msgstr "Nouveau mot de passe"
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "Confirmer mot de passe" msgstr "Confirmer mot de passe"
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "Changer" msgstr "Changer"
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "Les mots de passe ne correspondent pas !" msgstr "Les mots de passe ne correspondent pas !"
@ -477,11 +479,11 @@ msgstr ""
"- Molette souris : sélectionner objet\n" "- Molette souris : sélectionner objet\n"
"- T : discuter\n" "- T : discuter\n"
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "Volume sonore :" msgstr "Volume sonore :"
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "OK" msgstr "OK"
@ -781,26 +783,29 @@ msgstr "Zoomer"
msgid "Main Menu" msgid "Main Menu"
msgstr "Menu principal" msgstr "Menu principal"
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "Le monde n'a pas pu être initialisé" msgstr "Le monde n'a pas pu être initialisé"
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "Pas de monde sélectionné et pas d'adresse fournie. Rien à faire." msgstr "Pas de monde sélectionné et pas d'adresse fournie. Rien à faire."
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "N'a pas pu trouver ou charger le jeu \"" msgstr "N'a pas pu trouver ou charger le jeu \""
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "gamespec invalide." msgstr "gamespec invalide."
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "Erreur de connexion (perte de connexion ?)" msgstr "Erreur de connexion (perte de connexion ?)"
#~ msgid "Delete map"
#~ msgstr "Supprimer carte"
#~ msgid "" #~ msgid ""
#~ "Default Controls:\n" #~ "Default Controls:\n"
#~ "- WASD: Walk\n" #~ "- WASD: Walk\n"
@ -825,20 +830,3 @@ msgstr "Erreur de connexion (perte de connexion ?)"
#~ "- I : inventaire\n" #~ "- I : inventaire\n"
#~ "- Échap : ce menu\n" #~ "- Échap : ce menu\n"
#~ "- T : discuter\n" #~ "- T : discuter\n"
#~ msgid "Delete map"
#~ msgstr "Supprimer carte"
#~ msgid ""
#~ "Warning: Some configured mods are missing.\n"
#~ "Their setting will be removed when you save the configuration. "
#~ msgstr ""
#~ "Attention : certains mods configurés sont introuvables.\n"
#~ "Leurs réglages seront effacés quand vous enregistrerez la configuration. "
#~ msgid ""
#~ "Warning: Some mods are not configured yet.\n"
#~ "They will be enabled by default when you save the configuration. "
#~ msgstr ""
#~ "Attention : certains mods ne sont pas encore configurés.\n"
#~ "Ils seront activés par défaut quand vous enregistrerez la configuration. "

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: minetest\n" "Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,86 +17,86 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "" msgstr ""
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "" msgstr ""
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "" msgstr ""
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "" msgstr ""
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "" msgstr ""
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "" msgstr ""
#: src/game.cpp:1223 #: src/game.cpp:3348
msgid "Item definitions..."
msgstr ""
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "" msgstr ""
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "" msgstr ""
@ -108,15 +108,15 @@ msgstr ""
msgid "No" msgid "No"
msgstr "" msgstr ""
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "" msgstr ""
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "" msgstr ""
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "" msgstr ""
@ -128,12 +128,12 @@ msgstr ""
msgid "Respawn" msgid "Respawn"
msgstr "" msgstr ""
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "" msgstr ""
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "" msgstr ""
@ -405,23 +405,23 @@ msgstr ""
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "" msgstr ""
@ -460,11 +460,11 @@ msgid ""
"- T: chat\n" "- T: chat\n"
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "" msgstr ""
@ -764,22 +764,22 @@ msgstr ""
msgid "Main Menu" msgid "Main Menu"
msgstr "" msgstr ""
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "" msgstr ""
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "" msgstr ""
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "" msgstr ""
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "" msgstr ""
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "" msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: minetest\n" "Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: 2013-03-30 20:50+0200\n" "PO-Revision-Date: 2013-03-30 20:50+0200\n"
"Last-Translator: Fabio Luongo <e249260@rmqkr.net>\n" "Last-Translator: Fabio Luongo <e249260@rmqkr.net>\n"
"Language-Team: Italian\n" "Language-Team: Italian\n"
@ -18,47 +18,35 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Weblate 1.4-dev\n" "X-Generator: Weblate 1.4-dev\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "" msgstr ""
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "" msgstr ""
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "" msgstr ""
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "" msgstr ""
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "" msgstr ""
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "" msgstr ""
#: src/game.cpp:1223 #: src/game.cpp:3348
msgid "Item definitions..."
msgstr ""
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "" msgstr ""
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
@ -66,40 +54,56 @@ msgstr ""
"\n" "\n"
"Controlla debug.txt per i dettagli." "Controlla debug.txt per i dettagli."
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
"Attenzione: alcune mod non sono ancora configurate.\n"
"Saranno abilitate di default quando salverai la configurazione. "
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
"Attenzione: mancano alcune mod configurate.\n"
"Le loro impostazioni saranno rimosse al salvataggio della configurazione. "
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "attivato" msgstr "attivato"
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "Attiva tutto" msgstr "Attiva tutto"
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "Disabilita tutto" msgstr "Disabilita tutto"
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "dipende da:" msgstr "dipende da:"
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "è richiesto da:" msgstr "è richiesto da:"
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "Annulla" msgstr "Annulla"
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "Salva" msgstr "Salva"
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "Configurazione salvata. " msgstr "Configurazione salvata. "
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "Attenzione: configurazione non corretta. " msgstr "Attenzione: configurazione non corretta. "
@ -111,15 +115,15 @@ msgstr "Sì"
msgid "No" msgid "No"
msgstr "No" msgstr "No"
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "Nome mondo" msgstr "Nome mondo"
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "Gioco" msgstr "Gioco"
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "Crea" msgstr "Crea"
@ -131,13 +135,13 @@ msgstr "Sei morto."
msgid "Respawn" msgid "Respawn"
msgstr "Ricomincia" msgstr "Ricomincia"
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "" msgstr ""
"Click sinistro: muovi tutti gli oggetti; click destro: muovi un solo oggetto" "Click sinistro: muovi tutti gli oggetti; click destro: muovi un solo oggetto"
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "Procedi" msgstr "Procedi"
@ -413,23 +417,23 @@ msgstr "Impossibile configurare il mondo: nessun mondo selezionato"
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "Eliminazione di tutti i file del mondo fallita" msgstr "Eliminazione di tutti i file del mondo fallita"
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "Vecchia password" msgstr "Vecchia password"
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "Nuova password" msgstr "Nuova password"
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "Conferma password" msgstr "Conferma password"
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "Modifica" msgstr "Modifica"
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "Le password non corrispondono!" msgstr "Le password non corrispondono!"
@ -468,11 +472,11 @@ msgid ""
"- T: chat\n" "- T: chat\n"
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "" msgstr ""
@ -772,26 +776,29 @@ msgstr ""
msgid "Main Menu" msgid "Main Menu"
msgstr "Menu principale" msgstr "Menu principale"
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "Fallimento nell'inizializzare il mondo" msgstr "Fallimento nell'inizializzare il mondo"
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "Nessun mondo selezionato e nessun indirizzo fornito. Niente da fare." msgstr "Nessun mondo selezionato e nessun indirizzo fornito. Niente da fare."
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "Impossibile trovare o caricare il gioco \"" msgstr "Impossibile trovare o caricare il gioco \""
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "Specifiche di gioco non valide." msgstr "Specifiche di gioco non valide."
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "Errore connessione (tempo scaduto?)" msgstr "Errore connessione (tempo scaduto?)"
#~ msgid "Delete map"
#~ msgstr "Cancella mappa"
#~ msgid "" #~ msgid ""
#~ "Default Controls:\n" #~ "Default Controls:\n"
#~ "- WASD: Walk\n" #~ "- WASD: Walk\n"
@ -816,21 +823,3 @@ msgstr "Errore connessione (tempo scaduto?)"
#~ "- I: inventario\n" #~ "- I: inventario\n"
#~ "- ESC: questo menu\n" #~ "- ESC: questo menu\n"
#~ "- T: chat\n" #~ "- T: chat\n"
#~ msgid "Delete map"
#~ msgstr "Cancella mappa"
#~ msgid ""
#~ "Warning: Some configured mods are missing.\n"
#~ "Their setting will be removed when you save the configuration. "
#~ msgstr ""
#~ "Attenzione: mancano alcune mod configurate.\n"
#~ "Le loro impostazioni saranno rimosse al salvataggio della "
#~ "configurazione. "
#~ msgid ""
#~ "Warning: Some mods are not configured yet.\n"
#~ "They will be enabled by default when you save the configuration. "
#~ msgstr ""
#~ "Attenzione: alcune mod non sono ancora configurate.\n"
#~ "Saranno abilitate di default quando salverai la configurazione. "

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: minetest\n" "Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: 2013-03-07 23:06+0200\n" "PO-Revision-Date: 2013-03-07 23:06+0200\n"
"Last-Translator: Mitori Itoshiki <mito551@gmail.com>\n" "Last-Translator: Mitori Itoshiki <mito551@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,86 +18,90 @@ msgstr ""
"Plural-Forms: nplurals=1; plural=0;\n" "Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 1.4-dev\n" "X-Generator: Weblate 1.4-dev\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "" msgstr ""
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "" msgstr ""
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "" msgstr ""
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "" msgstr ""
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "" msgstr ""
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "" msgstr ""
#: src/game.cpp:1223 #: src/game.cpp:3348
msgid "Item definitions..."
msgstr ""
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "" msgstr ""
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
"警告: マインテストの改造がいくつか設定されていません。\n"
"これらを設定を保存すると自動で有効化されます。 "
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
"警告: いくつかの設定みの改造ファイルが見つかりません.\n"
"これらの情報は設定を保存すると削除されます. "
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "有効にしました" msgstr "有効にしました"
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "全部を有効にしました" msgstr "全部を有効にしました"
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "全部を無効にしました" msgstr "全部を無効にしました"
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "この改造ファイルが必要です:" msgstr "この改造ファイルが必要です:"
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "この改造に必要されます:" msgstr "この改造に必要されます:"
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "キャンセル" msgstr "キャンセル"
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "保存" msgstr "保存"
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "設定を保存しました. " msgstr "設定を保存しました. "
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "注意:設定が一定でわありません。" msgstr "注意:設定が一定でわありません。"
@ -109,15 +113,15 @@ msgstr "はい"
msgid "No" msgid "No"
msgstr "いいえ" msgstr "いいえ"
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "ワールド名" msgstr "ワールド名"
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "ゲーム" msgstr "ゲーム"
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "作成" msgstr "作成"
@ -129,12 +133,12 @@ msgstr "死亡しました。"
msgid "Respawn" msgid "Respawn"
msgstr "リスポーン" msgstr "リスポーン"
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "左クリックは全部のアイテムを動かす,右クリックは一つのアイテムを動かす" msgstr "左クリックは全部のアイテムを動かす,右クリックは一つのアイテムを動かす"
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "続く" msgstr "続く"
@ -409,23 +413,23 @@ msgstr "ワールドの設定ができません: 何も選択されていませ
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "ワールドファイルの全ての削除に失敗" msgstr "ワールドファイルの全ての削除に失敗"
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "古いパスワード" msgstr "古いパスワード"
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "新しいパスワード" msgstr "新しいパスワード"
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "パスワードの確認" msgstr "パスワードの確認"
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "変更" msgstr "変更"
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "新しいパスワードが一致しません!" msgstr "新しいパスワードが一致しません!"
@ -464,11 +468,11 @@ msgid ""
"- T: chat\n" "- T: chat\n"
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "" msgstr ""
@ -804,36 +808,22 @@ msgstr "ズーム"
msgid "Main Menu" msgid "Main Menu"
msgstr "メインメニュー" msgstr "メインメニュー"
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "ワールドの初期化に失敗" msgstr "ワールドの初期化に失敗"
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "" msgstr ""
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "ゲームをロードか見つかるのに失敗" msgstr "ゲームをロードか見つかるのに失敗"
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "" msgstr ""
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "接続エラー (タイムアウトか?)" msgstr "接続エラー (タイムアウトか?)"
#~ msgid ""
#~ "Warning: Some configured mods are missing.\n"
#~ "Their setting will be removed when you save the configuration. "
#~ msgstr ""
#~ "警告: いくつかの設定みの改造ファイルが見つかりません.\n"
#~ "これらの情報は設定を保存すると削除されます. "
#~ msgid ""
#~ "Warning: Some mods are not configured yet.\n"
#~ "They will be enabled by default when you save the configuration. "
#~ msgstr ""
#~ "警告: マインテストの改造がいくつか設定されていません。\n"
#~ "これらを設定を保存すると自動で有効化されます。 "

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: minetest\n" "Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,86 +17,86 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "" msgstr ""
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "" msgstr ""
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "" msgstr ""
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "" msgstr ""
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "" msgstr ""
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "" msgstr ""
#: src/game.cpp:1223 #: src/game.cpp:3348
msgid "Item definitions..."
msgstr ""
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "" msgstr ""
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "" msgstr ""
@ -108,15 +108,15 @@ msgstr ""
msgid "No" msgid "No"
msgstr "" msgstr ""
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "" msgstr ""
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "" msgstr ""
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "" msgstr ""
@ -128,12 +128,12 @@ msgstr ""
msgid "Respawn" msgid "Respawn"
msgstr "" msgstr ""
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "" msgstr ""
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "" msgstr ""
@ -405,23 +405,23 @@ msgstr ""
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "" msgstr ""
@ -460,11 +460,11 @@ msgid ""
"- T: chat\n" "- T: chat\n"
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "" msgstr ""
@ -764,22 +764,22 @@ msgstr ""
msgid "Main Menu" msgid "Main Menu"
msgstr "" msgstr ""
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "" msgstr ""
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "" msgstr ""
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "" msgstr ""
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "" msgstr ""
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "" msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: minetest\n" "Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: 2013-06-01 18:09+0200\n" "PO-Revision-Date: 2013-06-01 18:09+0200\n"
"Last-Translator: Chynggyz Jumaliev <translatorky@lavabit.com>\n" "Last-Translator: Chynggyz Jumaliev <translatorky@lavabit.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,48 +18,35 @@ msgstr ""
"Plural-Forms: nplurals=1; plural=0;\n" "Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 1.4-dev\n" "X-Generator: Weblate 1.4-dev\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "Буюм текстуралары..." msgstr "Буюм текстуралары..."
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "Жүктөлүүдө..." msgstr "Жүктөлүүдө..."
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "Сервер жаратылууда...." msgstr "Сервер жаратылууда...."
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "Клиент жаратылууда..." msgstr "Клиент жаратылууда..."
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "Дареги чечилүүдө..." msgstr "Дареги чечилүүдө..."
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "Серверге туташтырылууда..." msgstr "Серверге туташтырылууда..."
#: src/game.cpp:1223 #: src/game.cpp:3348
#, fuzzy
msgid "Item definitions..."
msgstr "Буюм текстуралары..."
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "Оюн өчүрүлүүдө..." msgstr "Оюн өчүрүлүүдө..."
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
@ -67,40 +54,52 @@ msgstr ""
"\n" "\n"
"Толугураак маалымат үчүн, debug.txt'ти текшериңиз." "Толугураак маалымат үчүн, debug.txt'ти текшериңиз."
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "күйгүзүлгөн" msgstr "күйгүзүлгөн"
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "Баарын күйгүзүү" msgstr "Баарын күйгүзүү"
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "Баарын өчүрүү" msgstr "Баарын өчүрүү"
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "көз карандылыктары:" msgstr "көз карандылыктары:"
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "талап кылынганы:" msgstr "талап кылынганы:"
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "Жокко чыгаруу" msgstr "Жокко чыгаруу"
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "Сактоо" msgstr "Сактоо"
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "Конфигурация сакталды. " msgstr "Конфигурация сакталды. "
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "Эскертүү: Туура эмес конфигурация. " msgstr "Эскертүү: Туура эмес конфигурация. "
@ -112,15 +111,15 @@ msgstr "Ооба"
msgid "No" msgid "No"
msgstr "Жок" msgstr "Жок"
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "Дүйнө аты" msgstr "Дүйнө аты"
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "Оюн" msgstr "Оюн"
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "Жаратуу" msgstr "Жаратуу"
@ -132,12 +131,12 @@ msgstr "Сиз өлдүңүз."
msgid "Respawn" msgid "Respawn"
msgstr "Кайтадан жаралуу" msgstr "Кайтадан жаралуу"
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "Сол баскычы: Бардык буюмдарды ташуу, Оң баскычы: Бир буюмду ташуу" msgstr "Сол баскычы: Бардык буюмдарды ташуу, Оң баскычы: Бир буюмду ташуу"
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "Улантуу" msgstr "Улантуу"
@ -409,23 +408,23 @@ msgstr "Дүйнөнү ырастоо мүмкүн эмес: Эч нерсе т
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "Бардык дүйнө файлдарын өчүрүү оңунан чыккан жок" msgstr "Бардык дүйнө файлдарын өчүрүү оңунан чыккан жок"
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "Эски сырсөз" msgstr "Эски сырсөз"
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "Жаңы сырсөз" msgstr "Жаңы сырсөз"
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "Сырсөздү аныктоо" msgstr "Сырсөздү аныктоо"
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "Өзгөртүү" msgstr "Өзгөртүү"
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "Сырсөздөр дал келген жок!" msgstr "Сырсөздөр дал келген жок!"
@ -475,11 +474,11 @@ msgstr ""
"- Чычкан дөңгөлөгү: буюмду тандоо\n" "- Чычкан дөңгөлөгү: буюмду тандоо\n"
"- T: маек\n" "- T: маек\n"
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "Үн көлөмү: " msgstr "Үн көлөмү: "
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "Чыгуу" msgstr "Чыгуу"
@ -779,23 +778,23 @@ msgstr "Масштаб"
msgid "Main Menu" msgid "Main Menu"
msgstr "Башкы меню" msgstr "Башкы меню"
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "Дүйнөнү инициалдаштыруу катасы" msgstr "Дүйнөнү инициалдаштыруу катасы"
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "Дүйнө тандалган жок жана дареги киргизилген жок. Кылууга эч нерсе жок." msgstr "Дүйнө тандалган жок жана дареги киргизилген жок. Кылууга эч нерсе жок."
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "Оюнду табуу же жүктөө мүмкүн эмес \"" msgstr "Оюнду табуу же жүктөө мүмкүн эмес \""
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "" msgstr ""
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "Туташтыруу катасы (убактыңыз өтүп кеттиби?)" msgstr "Туташтыруу катасы (убактыңыз өтүп кеттиби?)"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: minetest\n" "Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,86 +17,86 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "" msgstr ""
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "" msgstr ""
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "" msgstr ""
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "" msgstr ""
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "" msgstr ""
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "" msgstr ""
#: src/game.cpp:1223 #: src/game.cpp:3348
msgid "Item definitions..."
msgstr ""
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "" msgstr ""
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "" msgstr ""
@ -108,15 +108,15 @@ msgstr ""
msgid "No" msgid "No"
msgstr "" msgstr ""
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "" msgstr ""
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "" msgstr ""
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "" msgstr ""
@ -128,12 +128,12 @@ msgstr ""
msgid "Respawn" msgid "Respawn"
msgstr "" msgstr ""
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "" msgstr ""
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "" msgstr ""
@ -405,23 +405,23 @@ msgstr ""
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "" msgstr ""
@ -460,11 +460,11 @@ msgid ""
"- T: chat\n" "- T: chat\n"
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "" msgstr ""
@ -764,22 +764,22 @@ msgstr ""
msgid "Main Menu" msgid "Main Menu"
msgstr "" msgstr ""
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "" msgstr ""
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "" msgstr ""
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "" msgstr ""
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "" msgstr ""
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "" msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: minetest\n" "Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: 2013-05-02 08:17+0200\n" "PO-Revision-Date: 2013-05-02 08:17+0200\n"
"Last-Translator: Sindre Tellevik <graknol@gmail.com>\n" "Last-Translator: Sindre Tellevik <graknol@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,86 +18,90 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Weblate 1.4-dev\n" "X-Generator: Weblate 1.4-dev\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "" msgstr ""
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "" msgstr ""
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "" msgstr ""
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "" msgstr ""
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "" msgstr ""
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "" msgstr ""
#: src/game.cpp:1223 #: src/game.cpp:3348
msgid "Item definitions..."
msgstr ""
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "" msgstr ""
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
"Advarsel: Noen modifikasjoner er ikke konfigurert enda. \n"
"De vil bli aktivert som standard når du lagrer konfigurasjonen."
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
"Advarsel: Noen konfigurerte modifikasjoner mangler. \n"
"Instillingene deres vil bli fjernet når du lagrer konfigurasjonen."
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "aktivert" msgstr "aktivert"
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "Aktiver Alle" msgstr "Aktiver Alle"
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "Deaktiver Alle" msgstr "Deaktiver Alle"
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "Avhenger av:" msgstr "Avhenger av:"
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "trengs av:" msgstr "trengs av:"
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "Avbryt" msgstr "Avbryt"
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "Lagre" msgstr "Lagre"
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "Konfigurasjon lagret.…" msgstr "Konfigurasjon lagret.…"
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "" msgstr ""
@ -109,15 +113,15 @@ msgstr "Ja"
msgid "No" msgid "No"
msgstr "Nei" msgstr "Nei"
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "Navnet på verdenen" msgstr "Navnet på verdenen"
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "Spill" msgstr "Spill"
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "Opprett" msgstr "Opprett"
@ -129,12 +133,12 @@ msgstr "Du døde."
msgid "Respawn" msgid "Respawn"
msgstr "" msgstr ""
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "" msgstr ""
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "" msgstr ""
@ -406,23 +410,23 @@ msgstr ""
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "" msgstr ""
@ -461,11 +465,11 @@ msgid ""
"- T: chat\n" "- T: chat\n"
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "" msgstr ""
@ -765,36 +769,22 @@ msgstr ""
msgid "Main Menu" msgid "Main Menu"
msgstr "" msgstr ""
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "" msgstr ""
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "" msgstr ""
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "" msgstr ""
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "" msgstr ""
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "" msgstr ""
#~ msgid ""
#~ "Warning: Some configured mods are missing.\n"
#~ "Their setting will be removed when you save the configuration. "
#~ msgstr ""
#~ "Advarsel: Noen konfigurerte modifikasjoner mangler. \n"
#~ "Instillingene deres vil bli fjernet når du lagrer konfigurasjonen."
#~ msgid ""
#~ "Warning: Some mods are not configured yet.\n"
#~ "They will be enabled by default when you save the configuration. "
#~ msgstr ""
#~ "Advarsel: Noen modifikasjoner er ikke konfigurert enda. \n"
#~ "De vil bli aktivert som standard når du lagrer konfigurasjonen."

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: minetest\n" "Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: 2013-05-01 22:18+0200\n" "PO-Revision-Date: 2013-05-01 22:18+0200\n"
"Last-Translator: Sfan5 . <sfan5@live.de>\n" "Last-Translator: Sfan5 . <sfan5@live.de>\n"
"Language-Team: \n" "Language-Team: \n"
@ -18,47 +18,35 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Weblate 1.4-dev\n" "X-Generator: Weblate 1.4-dev\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "" msgstr ""
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "" msgstr ""
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "" msgstr ""
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "" msgstr ""
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "" msgstr ""
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "" msgstr ""
#: src/game.cpp:1223 #: src/game.cpp:3348
msgid "Item definitions..."
msgstr ""
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "" msgstr ""
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
@ -66,40 +54,57 @@ msgstr ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
"Let op: Nog niet alle mods zijn geconfigueerd. \n"
"De mods zullen automatisch worden ingeschakeld als je de configuratie "
"bewaard. "
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
"LEt op: Sommige ingestelde mods zijn vermist.\n"
"Hun instellingen worden verwijderd als je de configuratie opslaat. "
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "ingeschakeld" msgstr "ingeschakeld"
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "Allen inschakelen" msgstr "Allen inschakelen"
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "Allen uitschakelen" msgstr "Allen uitschakelen"
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "heeft nodig:" msgstr "heeft nodig:"
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "is benodigd voor:" msgstr "is benodigd voor:"
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "Annuleer" msgstr "Annuleer"
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "Bewaar" msgstr "Bewaar"
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "Instellingen bewaard. " msgstr "Instellingen bewaard. "
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "Waarschuwing: Instellingen niet consistent. " msgstr "Waarschuwing: Instellingen niet consistent. "
@ -111,15 +116,15 @@ msgstr "Ja"
msgid "No" msgid "No"
msgstr "Nee" msgstr "Nee"
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "Naam wereld" msgstr "Naam wereld"
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "Spel" msgstr "Spel"
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "Maak aan" msgstr "Maak aan"
@ -131,13 +136,13 @@ msgstr "Je bent gestorven."
msgid "Respawn" msgid "Respawn"
msgstr "Respawn" msgstr "Respawn"
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "" msgstr ""
"Linkermuisknop: Verplaats alle items. Rechtermuisknop: Verplaats één item" "Linkermuisknop: Verplaats alle items. Rechtermuisknop: Verplaats één item"
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "Volgende" msgstr "Volgende"
@ -409,23 +414,23 @@ msgstr "Kan instellingen niet aanpassen: Niets geselecteerd"
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "Niet alle bestanden zijn verwijderd" msgstr "Niet alle bestanden zijn verwijderd"
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "Huidig wachtwoord" msgstr "Huidig wachtwoord"
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "Nieuw wachtwoord" msgstr "Nieuw wachtwoord"
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "Herhaal wachtwoord" msgstr "Herhaal wachtwoord"
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "Veranderen" msgstr "Veranderen"
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "Wachtwoorden zijn niet gelijk!" msgstr "Wachtwoorden zijn niet gelijk!"
@ -464,11 +469,11 @@ msgid ""
"- T: chat\n" "- T: chat\n"
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "Volume: " msgstr "Volume: "
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "Exit" msgstr "Exit"
@ -768,23 +773,23 @@ msgstr "Zoom"
msgid "Main Menu" msgid "Main Menu"
msgstr "Hoofdmenu" msgstr "Hoofdmenu"
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "Laden van wereld is mislukt" msgstr "Laden van wereld is mislukt"
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "Geen wereld en adres geselecteerd. Niks te doen." msgstr "Geen wereld en adres geselecteerd. Niks te doen."
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "Kan niet de game laden of vinden \"" msgstr "Kan niet de game laden of vinden \""
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "Onjuiste gamespec." msgstr "Onjuiste gamespec."
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "Connection error (timed out?)" msgstr "Connection error (timed out?)"
@ -812,18 +817,3 @@ msgstr "Connection error (timed out?)"
#~ "- I: Rugzak\n" #~ "- I: Rugzak\n"
#~ "- ESC: Menu\n" #~ "- ESC: Menu\n"
#~ "- T: Chat\n" #~ "- T: Chat\n"
#~ msgid ""
#~ "Warning: Some configured mods are missing.\n"
#~ "Their setting will be removed when you save the configuration. "
#~ msgstr ""
#~ "LEt op: Sommige ingestelde mods zijn vermist.\n"
#~ "Hun instellingen worden verwijderd als je de configuratie opslaat. "
#~ msgid ""
#~ "Warning: Some mods are not configured yet.\n"
#~ "They will be enabled by default when you save the configuration. "
#~ msgstr ""
#~ "Let op: Nog niet alle mods zijn geconfigueerd. \n"
#~ "De mods zullen automatisch worden ingeschakeld als je de configuratie "
#~ "bewaard. "

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: minetest\n" "Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: 2013-04-21 23:38+0200\n" "PO-Revision-Date: 2013-04-21 23:38+0200\n"
"Last-Translator: Daniel \"Tracerneo\" Ziółkowski <ziolkoneo@gmail.com>\n" "Last-Translator: Daniel \"Tracerneo\" Ziółkowski <ziolkoneo@gmail.com>\n"
"Language-Team: Polish <>\n" "Language-Team: Polish <>\n"
@ -19,47 +19,35 @@ msgstr ""
"|| n%100>=20) ? 1 : 2);\n" "|| n%100>=20) ? 1 : 2);\n"
"X-Generator: Weblate 1.4-dev\n" "X-Generator: Weblate 1.4-dev\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "" msgstr ""
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "" msgstr ""
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "" msgstr ""
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "" msgstr ""
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "" msgstr ""
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "" msgstr ""
#: src/game.cpp:1223 #: src/game.cpp:3348
msgid "Item definitions..."
msgstr ""
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "" msgstr ""
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
@ -67,40 +55,56 @@ msgstr ""
"\n" "\n"
"Sprawdź plik debug.txt by uzyskać więcej informacji." "Sprawdź plik debug.txt by uzyskać więcej informacji."
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
"Uwaga: Niektóre z modyfikacji nie zostały jeszcze skonfigurowane.\n"
"Zostaną domyślnie włączone gdy zapiszesz konfigurację. "
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
"Ostrzeżenie: Niektóre z modyfikacji nie zostały znalezione.\n"
"Ich ustawienia zostaną usunięte gdy zapiszesz konfigurację. "
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "włączone" msgstr "włączone"
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "Włącz wszystkie" msgstr "Włącz wszystkie"
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "Wyłącz wszystkie" msgstr "Wyłącz wszystkie"
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "zależne od:" msgstr "zależne od:"
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "wymagane przez:" msgstr "wymagane przez:"
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "Anuluj" msgstr "Anuluj"
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "Zapisz" msgstr "Zapisz"
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "Konfiguracja zapisana. " msgstr "Konfiguracja zapisana. "
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "Ostrzeżenie: Plik konfiguracyjny niespójny. " msgstr "Ostrzeżenie: Plik konfiguracyjny niespójny. "
@ -112,15 +116,15 @@ msgstr "Tak"
msgid "No" msgid "No"
msgstr "Nie" msgstr "Nie"
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "Nazwa świata" msgstr "Nazwa świata"
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "Gra" msgstr "Gra"
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "Utwórz" msgstr "Utwórz"
@ -132,14 +136,14 @@ msgstr "Zginąłeś."
msgid "Respawn" msgid "Respawn"
msgstr "Wróć do gry" msgstr "Wróć do gry"
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "" msgstr ""
"Lewy przycisk myszy: przenieś wszystkie przedmioty, Prawy przycisk myszy: " "Lewy przycisk myszy: przenieś wszystkie przedmioty, Prawy przycisk myszy: "
"przenieś pojedynczy przedmiot" "przenieś pojedynczy przedmiot"
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "Kontynuuj" msgstr "Kontynuuj"
@ -413,23 +417,23 @@ msgstr "Nie można skonfigurować świata: Nic nie zaznaczono"
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "Nie udało się skasować wszystkich plików świata" msgstr "Nie udało się skasować wszystkich plików świata"
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "Stare hasło" msgstr "Stare hasło"
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "Nowe hasło" msgstr "Nowe hasło"
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "Potwierdź hasło" msgstr "Potwierdź hasło"
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "Zmień" msgstr "Zmień"
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "Hasła nie są jednakowe!" msgstr "Hasła nie są jednakowe!"
@ -468,11 +472,11 @@ msgid ""
"- T: chat\n" "- T: chat\n"
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "Głośność: " msgstr "Głośność: "
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "Wyjście" msgstr "Wyjście"
@ -772,23 +776,23 @@ msgstr "Zoom"
msgid "Main Menu" msgid "Main Menu"
msgstr "Menu główne" msgstr "Menu główne"
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "Inicjalizacja świata nie powiodła się" msgstr "Inicjalizacja świata nie powiodła się"
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "Nie wybrano świata ani adresu." msgstr "Nie wybrano świata ani adresu."
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "Nie można znaleźć lub wczytać trybu gry \"" msgstr "Nie można znaleźć lub wczytać trybu gry \""
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "Nieprawidłowa specyfikacja trybu gry." msgstr "Nieprawidłowa specyfikacja trybu gry."
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "Błąd połączenia (brak odpowiedzi?)" msgstr "Błąd połączenia (brak odpowiedzi?)"
@ -816,17 +820,3 @@ msgstr "Błąd połączenia (brak odpowiedzi?)"
#~ "- I: menu ekwipunku\n" #~ "- I: menu ekwipunku\n"
#~ "- ESC: to menu\n" #~ "- ESC: to menu\n"
#~ "- T: czat\n" #~ "- T: czat\n"
#~ msgid ""
#~ "Warning: Some configured mods are missing.\n"
#~ "Their setting will be removed when you save the configuration. "
#~ msgstr ""
#~ "Ostrzeżenie: Niektóre z modyfikacji nie zostały znalezione.\n"
#~ "Ich ustawienia zostaną usunięte gdy zapiszesz konfigurację. "
#~ msgid ""
#~ "Warning: Some mods are not configured yet.\n"
#~ "They will be enabled by default when you save the configuration. "
#~ msgstr ""
#~ "Uwaga: Niektóre z modyfikacji nie zostały jeszcze skonfigurowane.\n"
#~ "Zostaną domyślnie włączone gdy zapiszesz konfigurację. "

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: minetest\n" "Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: 2013-05-30 00:13+0200\n" "PO-Revision-Date: 2013-05-30 00:13+0200\n"
"Last-Translator: v c <vicente.camolas@gmail.com>\n" "Last-Translator: v c <vicente.camolas@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,48 +18,35 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Weblate 1.4-dev\n" "X-Generator: Weblate 1.4-dev\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "Texturas dos items..." msgstr "Texturas dos items..."
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "A carregar..." msgstr "A carregar..."
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "A criar servidor..." msgstr "A criar servidor..."
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "A criar cliente..." msgstr "A criar cliente..."
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "A resolver endereço..." msgstr "A resolver endereço..."
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "A conectar ao servidor..." msgstr "A conectar ao servidor..."
#: src/game.cpp:1223 #: src/game.cpp:3348
#, fuzzy
msgid "Item definitions..."
msgstr "Texturas dos items..."
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "A desligar..." msgstr "A desligar..."
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
@ -67,40 +54,56 @@ msgstr ""
"\n" "\n"
"Consulte debug.txt para mais detalhes." "Consulte debug.txt para mais detalhes."
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
"Atenção: Alguns mods ainda não estão configurados.\n"
"Eles vão ser ativados por predefinição quando guardar a configuração. "
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
"Atenção: Alguns mods configurados estão em falta.\n"
"As suas definições vão ser removidas quando gravar a configuração. "
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "ativo" msgstr "ativo"
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "Ativar Tudo" msgstr "Ativar Tudo"
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "Desativar Tudo" msgstr "Desativar Tudo"
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "depende de:" msgstr "depende de:"
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "é necessário pelo:" msgstr "é necessário pelo:"
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "Cancelar" msgstr "Cancelar"
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "Guardar" msgstr "Guardar"
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "Configuração gravada. " msgstr "Configuração gravada. "
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "Atenção: Configuração não compatível. " msgstr "Atenção: Configuração não compatível. "
@ -112,15 +115,15 @@ msgstr "Sim"
msgid "No" msgid "No"
msgstr "Não" msgstr "Não"
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "Nome do Mundo" msgstr "Nome do Mundo"
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "Jogo" msgstr "Jogo"
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "Criar" msgstr "Criar"
@ -132,12 +135,12 @@ msgstr "Morreste."
msgid "Respawn" msgid "Respawn"
msgstr "Reaparecer" msgstr "Reaparecer"
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "Botão esq: Mover todos os itens Botão dir: Mover um item" msgstr "Botão esq: Mover todos os itens Botão dir: Mover um item"
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "Continuar" msgstr "Continuar"
@ -409,23 +412,23 @@ msgstr "Não foi possível configurar mundo: Nada seleccionado"
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "Falhou a remoção de todos os ficheiros dos mundos" msgstr "Falhou a remoção de todos os ficheiros dos mundos"
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "Senha antiga" msgstr "Senha antiga"
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "Senha Nova" msgstr "Senha Nova"
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "Confirmar Senha" msgstr "Confirmar Senha"
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "Mudar" msgstr "Mudar"
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "Senhas não correspondem!" msgstr "Senhas não correspondem!"
@ -475,11 +478,11 @@ msgstr ""
"- Roda do rato: seleccionar item\n" "- Roda do rato: seleccionar item\n"
"- T: conversação\n" "- T: conversação\n"
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "Volume do som: " msgstr "Volume do som: "
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "Sair" msgstr "Sair"
@ -779,24 +782,24 @@ msgstr "Zoom"
msgid "Main Menu" msgid "Main Menu"
msgstr "Menu Principal" msgstr "Menu Principal"
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "Falha ao iniciar mundo" msgstr "Falha ao iniciar mundo"
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "" msgstr ""
"Nenhum mundo seleccionado e nenhum endereço providenciado. Nada para fazer." "Nenhum mundo seleccionado e nenhum endereço providenciado. Nada para fazer."
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "Não foi possível encontrar ou carregar jogo \"" msgstr "Não foi possível encontrar ou carregar jogo \""
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "gamespec inválido." msgstr "gamespec inválido."
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "Erro de conexão (excedeu tempo?)" msgstr "Erro de conexão (excedeu tempo?)"
@ -824,17 +827,3 @@ msgstr "Erro de conexão (excedeu tempo?)"
#~ "- I: Inventário\n" #~ "- I: Inventário\n"
#~ "- ESC: Este menu\n" #~ "- ESC: Este menu\n"
#~ "- T: Chat\n" #~ "- T: Chat\n"
#~ msgid ""
#~ "Warning: Some configured mods are missing.\n"
#~ "Their setting will be removed when you save the configuration. "
#~ msgstr ""
#~ "Atenção: Alguns mods configurados estão em falta.\n"
#~ "As suas definições vão ser removidas quando gravar a configuração. "
#~ msgid ""
#~ "Warning: Some mods are not configured yet.\n"
#~ "They will be enabled by default when you save the configuration. "
#~ msgstr ""
#~ "Atenção: Alguns mods ainda não estão configurados.\n"
#~ "Eles vão ser ativados por predefinição quando guardar a configuração. "

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: minetest\n" "Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: 2013-05-15 18:58+0200\n" "PO-Revision-Date: 2013-05-15 18:58+0200\n"
"Last-Translator: Frederico Guimarães <frederico@teia.bio.br>\n" "Last-Translator: Frederico Guimarães <frederico@teia.bio.br>\n"
"Language-Team: LANGUAGE <contato@ejweb.com.br>\n" "Language-Team: LANGUAGE <contato@ejweb.com.br>\n"
@ -18,48 +18,35 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Weblate 1.4-dev\n" "X-Generator: Weblate 1.4-dev\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "Texturas dos itens..." msgstr "Texturas dos itens..."
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "Carregando..." msgstr "Carregando..."
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "Criando o servidor..." msgstr "Criando o servidor..."
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "Criando o cliente..." msgstr "Criando o cliente..."
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "Resolvendo os endereços..." msgstr "Resolvendo os endereços..."
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "Conectando ao servidor..." msgstr "Conectando ao servidor..."
#: src/game.cpp:1223 #: src/game.cpp:3348
#, fuzzy
msgid "Item definitions..."
msgstr "Texturas dos itens..."
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "Desligando tudo..." msgstr "Desligando tudo..."
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
@ -67,40 +54,56 @@ msgstr ""
"\n" "\n"
"Verifique o debug.txt para mais detalhes." "Verifique o debug.txt para mais detalhes."
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
"Atenção: Alguns mods ainda não foram configurados.\n"
"E eles serão ativados por padrão, quando você salvar a configuração."
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
"Atenção: Alguns mods configurados não foram encontrados.\n"
"Suas definições serão removidas quando você salvar a configuração."
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "habilitado" msgstr "habilitado"
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "Habilitar tudo" msgstr "Habilitar tudo"
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "Desabilitar tudo" msgstr "Desabilitar tudo"
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "depende de:" msgstr "depende de:"
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "é necessário para:" msgstr "é necessário para:"
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "Cancelar" msgstr "Cancelar"
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "Salvar" msgstr "Salvar"
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "A configuração foi salva. " msgstr "A configuração foi salva. "
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "Atenção: A configuração não está consistente." msgstr "Atenção: A configuração não está consistente."
@ -112,15 +115,15 @@ msgstr "Sim"
msgid "No" msgid "No"
msgstr "Não" msgstr "Não"
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "Nome do mundo" msgstr "Nome do mundo"
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "Jogo" msgstr "Jogo"
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "Criar" msgstr "Criar"
@ -132,12 +135,12 @@ msgstr "Você morreu."
msgid "Respawn" msgid "Respawn"
msgstr "Reviver" msgstr "Reviver"
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "Botão esq.: Move todos os itens, Botão dir.: Move um item" msgstr "Botão esq.: Move todos os itens, Botão dir.: Move um item"
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "Continuar" msgstr "Continuar"
@ -410,23 +413,23 @@ msgstr "Não foi possível configurar o mundo: Nada foi selecionado"
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "Não foi possível excluir todos os arquivos do mundo" msgstr "Não foi possível excluir todos os arquivos do mundo"
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "Senha antiga" msgstr "Senha antiga"
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "Nova senha" msgstr "Nova senha"
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "Confirmar a senha" msgstr "Confirmar a senha"
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "Alterar" msgstr "Alterar"
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "As senhas não correspondem!" msgstr "As senhas não correspondem!"
@ -476,11 +479,11 @@ msgstr ""
"- Roda do mouse: selecionar item\n" "- Roda do mouse: selecionar item\n"
"- T: bate-papo\n" "- T: bate-papo\n"
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "Volume do som: " msgstr "Volume do som: "
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "Sair" msgstr "Sair"
@ -780,25 +783,25 @@ msgstr "Zoom"
msgid "Main Menu" msgid "Main Menu"
msgstr "Menu principal" msgstr "Menu principal"
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "Não foi possível iniciar o mundo" msgstr "Não foi possível iniciar o mundo"
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "" msgstr ""
"Nenhum mundo foi selecionado e nenhum endereço fornecido. Não existe nada a " "Nenhum mundo foi selecionado e nenhum endereço fornecido. Não existe nada a "
"ser feito." "ser feito."
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "Não foi possível localizar ou carregar jogo \"" msgstr "Não foi possível localizar ou carregar jogo \""
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "Especificação do jogo inválida." msgstr "Especificação do jogo inválida."
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "Erro de conexão (tempo excedido?)" msgstr "Erro de conexão (tempo excedido?)"
@ -826,17 +829,3 @@ msgstr "Erro de conexão (tempo excedido?)"
#~ "- I: inventário\n" #~ "- I: inventário\n"
#~ "- ESC: este menu\n" #~ "- ESC: este menu\n"
#~ "- T: bate-papo\n" #~ "- T: bate-papo\n"
#~ msgid ""
#~ "Warning: Some configured mods are missing.\n"
#~ "Their setting will be removed when you save the configuration. "
#~ msgstr ""
#~ "Atenção: Alguns mods configurados não foram encontrados.\n"
#~ "Suas definições serão removidas quando você salvar a configuração."
#~ msgid ""
#~ "Warning: Some mods are not configured yet.\n"
#~ "They will be enabled by default when you save the configuration. "
#~ msgstr ""
#~ "Atenção: Alguns mods ainda não foram configurados.\n"
#~ "E eles serão ativados por padrão, quando você salvar a configuração."

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: minetest\n" "Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,86 +17,86 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "" msgstr ""
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "" msgstr ""
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "" msgstr ""
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "" msgstr ""
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "" msgstr ""
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "" msgstr ""
#: src/game.cpp:1223 #: src/game.cpp:3348
msgid "Item definitions..."
msgstr ""
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "" msgstr ""
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "" msgstr ""
@ -108,15 +108,15 @@ msgstr ""
msgid "No" msgid "No"
msgstr "" msgstr ""
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "" msgstr ""
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "" msgstr ""
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "" msgstr ""
@ -128,12 +128,12 @@ msgstr ""
msgid "Respawn" msgid "Respawn"
msgstr "" msgstr ""
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "" msgstr ""
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "" msgstr ""
@ -405,23 +405,23 @@ msgstr ""
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "" msgstr ""
@ -460,11 +460,11 @@ msgid ""
"- T: chat\n" "- T: chat\n"
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "" msgstr ""
@ -764,22 +764,22 @@ msgstr ""
msgid "Main Menu" msgid "Main Menu"
msgstr "" msgstr ""
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "" msgstr ""
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "" msgstr ""
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "" msgstr ""
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "" msgstr ""
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "" msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: minetest\n" "Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: 2013-05-08 11:06+0200\n" "PO-Revision-Date: 2013-05-08 11:06+0200\n"
"Last-Translator: Anton Tsyganenko <anton-tsyganenko@yandex.ru>\n" "Last-Translator: Anton Tsyganenko <anton-tsyganenko@yandex.ru>\n"
"Language-Team: Russian\n" "Language-Team: Russian\n"
@ -19,47 +19,35 @@ msgstr ""
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Weblate 1.4-dev\n" "X-Generator: Weblate 1.4-dev\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "" msgstr ""
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "" msgstr ""
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "" msgstr ""
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "" msgstr ""
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "" msgstr ""
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "" msgstr ""
#: src/game.cpp:1223 #: src/game.cpp:3348
msgid "Item definitions..."
msgstr ""
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "" msgstr ""
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
@ -67,40 +55,57 @@ msgstr ""
"\n" "\n"
"Подробная информация в debug.txt." "Подробная информация в debug.txt."
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
"Предупреждение: Некоторые моды еще не настроены.\n"
"Их стандартные настройки будут установлены, когда вы сохраните "
"конфигурацию. "
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
"Предупреждение: Некоторые моды не найдены.\n"
"Их настройки будут удалены, когда вы сохраните конфигурацию. "
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "включено" msgstr "включено"
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "Включить Всё" msgstr "Включить Всё"
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "Отключить Всё" msgstr "Отключить Всё"
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "зависит от:" msgstr "зависит от:"
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "требуется для:" msgstr "требуется для:"
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "Отменить" msgstr "Отменить"
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "Сохранить" msgstr "Сохранить"
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "Настройки сохранены. " msgstr "Настройки сохранены. "
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "Предупреждение: Неверная конфигурация. " msgstr "Предупреждение: Неверная конфигурация. "
@ -112,15 +117,15 @@ msgstr "Да"
msgid "No" msgid "No"
msgstr "Нет" msgstr "Нет"
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "Название мира" msgstr "Название мира"
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "Игра" msgstr "Игра"
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "Создать" msgstr "Создать"
@ -132,12 +137,12 @@ msgstr "Вы умерли."
msgid "Respawn" msgid "Respawn"
msgstr "Возродиться" msgstr "Возродиться"
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "ЛКМ: Переместить все предметы, ПКМ: Переместить один предмет" msgstr "ЛКМ: Переместить все предметы, ПКМ: Переместить один предмет"
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "Продолжить" msgstr "Продолжить"
@ -412,23 +417,23 @@ msgstr "Невозможно настроить мир: ничего не выб
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "Ошибка при удалении файлов мира" msgstr "Ошибка при удалении файлов мира"
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "Старый Пароль" msgstr "Старый Пароль"
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "Новый Пароль" msgstr "Новый Пароль"
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "Подтверждение Пароля" msgstr "Подтверждение Пароля"
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "Изменить" msgstr "Изменить"
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "Пароли не совпадают!" msgstr "Пароли не совпадают!"
@ -467,11 +472,11 @@ msgid ""
"- T: chat\n" "- T: chat\n"
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "Громкость Звука: " msgstr "Громкость Звука: "
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "Выход" msgstr "Выход"
@ -778,24 +783,24 @@ msgstr "Масштаб"
msgid "Main Menu" msgid "Main Menu"
msgstr "Главное Меню" msgstr "Главное Меню"
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "Ошибка при инициализации мира" msgstr "Ошибка при инициализации мира"
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "Не выбран мир и не введен адрес." msgstr "Не выбран мир и не введен адрес."
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "Невозможно найти или загрузить игру \"" msgstr "Невозможно найти или загрузить игру \""
#: src/main.cpp:2075 #: src/main.cpp:2070
#, fuzzy #, fuzzy
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "Неправильная конфигурация игры." msgstr "Неправильная конфигурация игры."
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "Ошибка соединения (таймаут пинга?)" msgstr "Ошибка соединения (таймаут пинга?)"
@ -823,18 +828,3 @@ msgstr "Ошибка соединения (таймаут пинга?)"
#~ "- I: инвентарь\n" #~ "- I: инвентарь\n"
#~ "- ESC: это меню\n" #~ "- ESC: это меню\n"
#~ "- T: чат\n" #~ "- T: чат\n"
#~ msgid ""
#~ "Warning: Some configured mods are missing.\n"
#~ "Their setting will be removed when you save the configuration. "
#~ msgstr ""
#~ "Предупреждение: Некоторые моды не найдены.\n"
#~ "Их настройки будут удалены, когда вы сохраните конфигурацию. "
#~ msgid ""
#~ "Warning: Some mods are not configured yet.\n"
#~ "They will be enabled by default when you save the configuration. "
#~ msgstr ""
#~ "Предупреждение: Некоторые моды еще не настроены.\n"
#~ "Их стандартные настройки будут установлены, когда вы сохраните "
#~ "конфигурацию. "

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: minetest\n" "Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: 2013-04-23 17:00+0200\n" "PO-Revision-Date: 2013-04-23 17:00+0200\n"
"Last-Translator: ?????? ???????? <Martin_Devil@mail.ru>\n" "Last-Translator: ?????? ???????? <Martin_Devil@mail.ru>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -19,88 +19,86 @@ msgstr ""
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Weblate 1.4-dev\n" "X-Generator: Weblate 1.4-dev\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "" msgstr ""
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "" msgstr ""
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "" msgstr ""
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "" msgstr ""
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "" msgstr ""
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "" msgstr ""
#: src/game.cpp:1223 #: src/game.cpp:3348
msgid "Item definitions..."
msgstr ""
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "" msgstr ""
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
msgstr "" msgstr "\nДеталі у файлі debug.txt."
"\n"
"Деталі у файлі debug.txt."
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "Увімкнути Все" msgstr "Увімкнути Все"
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "Вимкнути Усе" msgstr "Вимкнути Усе"
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "залежить від:" msgstr "залежить від:"
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "Зберегти" msgstr "Зберегти"
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "Налаштування Збережено!" msgstr "Налаштування Збережено!"
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "Попередження: Помилкова конфігурація." msgstr "Попередження: Помилкова конфігурація."
@ -112,15 +110,15 @@ msgstr ""
msgid "No" msgid "No"
msgstr "" msgstr ""
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "" msgstr ""
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "" msgstr ""
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "" msgstr ""
@ -132,12 +130,12 @@ msgstr ""
msgid "Respawn" msgid "Respawn"
msgstr "" msgstr ""
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "" msgstr ""
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "" msgstr ""
@ -409,23 +407,23 @@ msgstr ""
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "" msgstr ""
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "" msgstr ""
@ -464,11 +462,11 @@ msgid ""
"- T: chat\n" "- T: chat\n"
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "" msgstr ""
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "" msgstr ""
@ -768,22 +766,22 @@ msgstr ""
msgid "Main Menu" msgid "Main Menu"
msgstr "" msgstr ""
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "" msgstr ""
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "" msgstr ""
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "" msgstr ""
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "" msgstr ""
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "" msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: minetest\n" "Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-24 00:07+0000\n" "POT-Creation-Date: 2013-05-13 18:26+0200\n"
"PO-Revision-Date: 2013-05-18 16:23+0200\n" "PO-Revision-Date: 2013-05-18 16:23+0200\n"
"Last-Translator: Shen Zheyu <arsdragonfly@gmail.com>\n" "Last-Translator: Shen Zheyu <arsdragonfly@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,48 +18,35 @@ msgstr ""
"Plural-Forms: nplurals=1; plural=0;\n" "Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 1.4-dev\n" "X-Generator: Weblate 1.4-dev\n"
#: src/client.cpp:2877 #: src/client.cpp:2846
msgid "Item textures..." msgid "Item textures..."
msgstr "物品材质..." msgstr "物品材质..."
#: src/game.cpp:959 #: src/game.cpp:912
msgid "Loading..." msgid "Loading..."
msgstr "载入中..." msgstr "载入中..."
#: src/game.cpp:1019 #: src/game.cpp:972
msgid "Creating server...." msgid "Creating server...."
msgstr "正在建立服务器...." msgstr "正在建立服务器...."
#: src/game.cpp:1035 #: src/game.cpp:988
msgid "Creating client..." msgid "Creating client..."
msgstr "正在建立客户端..." msgstr "正在建立客户端..."
#: src/game.cpp:1050 #: src/game.cpp:1003
msgid "Resolving address..." msgid "Resolving address..."
msgstr "正在解析地址..." msgstr "正在解析地址..."
#: src/game.cpp:1126 #: src/game.cpp:1079
msgid "Connecting to server..." msgid "Connecting to server..."
msgstr "正在连接服务器..." msgstr "正在连接服务器..."
#: src/game.cpp:1223 #: src/game.cpp:3348
#, fuzzy
msgid "Item definitions..."
msgstr "物品材质..."
#: src/game.cpp:1230
msgid "Node definitions..."
msgstr ""
#: src/game.cpp:1237
msgid "Media..."
msgstr ""
#: src/game.cpp:3418
msgid "Shutting down stuff..." msgid "Shutting down stuff..."
msgstr "关闭中......" msgstr "关闭中......"
#: src/game.cpp:3448 src/guiConfigureWorld.cpp:397 #: src/game.cpp:3378 src/guiConfigureWorld.cpp:426
msgid "" msgid ""
"\n" "\n"
"Check debug.txt for details." "Check debug.txt for details."
@ -67,40 +54,56 @@ msgstr ""
"\n" "\n"
"查看 debug.txt 以获得详细信息。" "查看 debug.txt 以获得详细信息。"
#: src/guiConfigureWorld.cpp:184 #: src/guiConfigureWorld.cpp:123
msgid ""
"Warning: Some mods are not configured yet.\n"
"They will be enabled by default when you save the configuration. "
msgstr ""
"警告一些MOD仍未设定。\n"
"它们会在你保存配置的时候自动启用。 "
#: src/guiConfigureWorld.cpp:143
msgid ""
"Warning: Some configured mods are missing.\n"
"Their setting will be removed when you save the configuration. "
msgstr ""
"警告缺少一些设定了的MOD。\n"
"它们的设置会在你保存配置的时候被移除。 "
#: src/guiConfigureWorld.cpp:208
msgid "enabled" msgid "enabled"
msgstr "启用" msgstr "启用"
#: src/guiConfigureWorld.cpp:194 #: src/guiConfigureWorld.cpp:218
msgid "Enable All" msgid "Enable All"
msgstr "全部启用" msgstr "全部启用"
#: src/guiConfigureWorld.cpp:203 #: src/guiConfigureWorld.cpp:227
msgid "Disable All" msgid "Disable All"
msgstr "全部禁用" msgstr "全部禁用"
#: src/guiConfigureWorld.cpp:211 #: src/guiConfigureWorld.cpp:235
msgid "depends on:" msgid "depends on:"
msgstr "依赖于:" msgstr "依赖于:"
#: src/guiConfigureWorld.cpp:224 #: src/guiConfigureWorld.cpp:248
msgid "is required by:" msgid "is required by:"
msgstr "被需要:" msgstr "被需要:"
#: src/guiConfigureWorld.cpp:246 src/guiCreateWorld.cpp:178 #: src/guiConfigureWorld.cpp:270 src/guiCreateWorld.cpp:177
#: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223 #: src/guiKeyChangeMenu.cpp:195 src/keycode.cpp:223
msgid "Cancel" msgid "Cancel"
msgstr "取消" msgstr "取消"
#: src/guiConfigureWorld.cpp:253 src/guiKeyChangeMenu.cpp:187 #: src/guiConfigureWorld.cpp:277 src/guiKeyChangeMenu.cpp:187
msgid "Save" msgid "Save"
msgstr "保存" msgstr "保存"
#: src/guiConfigureWorld.cpp:374 #: src/guiConfigureWorld.cpp:403
msgid "Configuration saved. " msgid "Configuration saved. "
msgstr "配置已保存。 " msgstr "配置已保存。 "
#: src/guiConfigureWorld.cpp:386 #: src/guiConfigureWorld.cpp:415
msgid "Warning: Configuration not consistent. " msgid "Warning: Configuration not consistent. "
msgstr "警告:配置不一致。 " msgstr "警告:配置不一致。 "
@ -112,15 +115,15 @@ msgstr "是"
msgid "No" msgid "No"
msgstr "否" msgstr "否"
#: src/guiCreateWorld.cpp:123 #: src/guiCreateWorld.cpp:125
msgid "World name" msgid "World name"
msgstr "世界名称" msgstr "世界名称"
#: src/guiCreateWorld.cpp:146 #: src/guiCreateWorld.cpp:145
msgid "Game" msgid "Game"
msgstr "游戏" msgstr "游戏"
#: src/guiCreateWorld.cpp:170 #: src/guiCreateWorld.cpp:169
msgid "Create" msgid "Create"
msgstr "创建" msgstr "创建"
@ -132,12 +135,12 @@ msgstr "你死了。"
msgid "Respawn" msgid "Respawn"
msgstr "重生" msgstr "重生"
#: src/guiFormSpecMenu.cpp:585 #: src/guiFormSpecMenu.cpp:582
msgid "Left click: Move all items, Right click: Move single item" msgid "Left click: Move all items, Right click: Move single item"
msgstr "左键:移动所有物品,右键:移动单个物品" msgstr "左键:移动所有物品,右键:移动单个物品"
#: src/guiFormSpecMenu.cpp:611 src/guiMessageMenu.cpp:107 #: src/guiFormSpecMenu.cpp:608 src/guiMessageMenu.cpp:107
#: src/guiTextInputMenu.cpp:133 #: src/guiTextInputMenu.cpp:130
msgid "Proceed" msgid "Proceed"
msgstr "继续游戏" msgstr "继续游戏"
@ -409,23 +412,23 @@ msgstr "无法配置世界:没有选择世界"
msgid "Failed to delete all world files" msgid "Failed to delete all world files"
msgstr "无法删除所有该世界的文件" msgstr "无法删除所有该世界的文件"
#: src/guiPasswordChange.cpp:107 #: src/guiPasswordChange.cpp:108
msgid "Old Password" msgid "Old Password"
msgstr "旧密码" msgstr "旧密码"
#: src/guiPasswordChange.cpp:125 #: src/guiPasswordChange.cpp:126
msgid "New Password" msgid "New Password"
msgstr "新密码" msgstr "新密码"
#: src/guiPasswordChange.cpp:142 #: src/guiPasswordChange.cpp:143
msgid "Confirm Password" msgid "Confirm Password"
msgstr "确认密码" msgstr "确认密码"
#: src/guiPasswordChange.cpp:160 #: src/guiPasswordChange.cpp:161
msgid "Change" msgid "Change"
msgstr "更改" msgstr "更改"
#: src/guiPasswordChange.cpp:169 #: src/guiPasswordChange.cpp:170
msgid "Passwords do not match!" msgid "Passwords do not match!"
msgstr "密码不匹配!" msgstr "密码不匹配!"
@ -475,11 +478,11 @@ msgstr ""
"鼠标滚轮: 选择物品\n" "鼠标滚轮: 选择物品\n"
"T: 聊天\n" "T: 聊天\n"
#: src/guiVolumeChange.cpp:107 #: src/guiVolumeChange.cpp:108
msgid "Sound Volume: " msgid "Sound Volume: "
msgstr "音量: " msgstr "音量: "
#: src/guiVolumeChange.cpp:121 #: src/guiVolumeChange.cpp:122
msgid "Exit" msgid "Exit"
msgstr "退出" msgstr "退出"
@ -779,23 +782,23 @@ msgstr "缩放"
msgid "Main Menu" msgid "Main Menu"
msgstr "主菜单" msgstr "主菜单"
#: src/main.cpp:2040 #: src/main.cpp:2035
msgid "Failed to initialize world" msgid "Failed to initialize world"
msgstr "无法初始化世界" msgstr "无法初始化世界"
#: src/main.cpp:2053 #: src/main.cpp:2048
msgid "No world selected and no address provided. Nothing to do." msgid "No world selected and no address provided. Nothing to do."
msgstr "没有选择世界或提供地址。未执行操作。" msgstr "没有选择世界或提供地址。未执行操作。"
#: src/main.cpp:2061 #: src/main.cpp:2056
msgid "Could not find or load game \"" msgid "Could not find or load game \""
msgstr "无法找到或载入游戏模式“" msgstr "无法找到或载入游戏模式“"
#: src/main.cpp:2075 #: src/main.cpp:2070
msgid "Invalid gamespec." msgid "Invalid gamespec."
msgstr "非法游戏模式规格。" msgstr "非法游戏模式规格。"
#: src/main.cpp:2116 #: src/main.cpp:2111
msgid "Connection error (timed out?)" msgid "Connection error (timed out?)"
msgstr "连接出错(超时?)" msgstr "连接出错(超时?)"
@ -824,17 +827,3 @@ msgstr "连接出错(超时?)"
#~ "I物品栏\n" #~ "I物品栏\n"
#~ "ESC菜单\n" #~ "ESC菜单\n"
#~ "T聊天\n" #~ "T聊天\n"
#~ msgid ""
#~ "Warning: Some configured mods are missing.\n"
#~ "Their setting will be removed when you save the configuration. "
#~ msgstr ""
#~ "警告缺少一些设定了的MOD。\n"
#~ "它们的设置会在你保存配置的时候被移除。 "
#~ msgid ""
#~ "Warning: Some mods are not configured yet.\n"
#~ "They will be enabled by default when you save the configuration. "
#~ msgstr ""
#~ "警告一些MOD仍未设定。\n"
#~ "它们会在你保存配置的时候自动启用。 "

View File

@ -271,7 +271,6 @@ set(common_SRCS
staticobject.cpp staticobject.cpp
serverlist.cpp serverlist.cpp
pathfinder.cpp pathfinder.cpp
convert_json.cpp
${SCRIPT_SRCS} ${SCRIPT_SRCS}
${UTIL_SRCS} ${UTIL_SRCS}
) )
@ -314,6 +313,7 @@ set(minetest_SRCS
clientobject.cpp clientobject.cpp
chat.cpp chat.cpp
hud.cpp hud.cpp
guiMainMenu.cpp
guiKeyChangeMenu.cpp guiKeyChangeMenu.cpp
guiMessageMenu.cpp guiMessageMenu.cpp
guiTextInputMenu.cpp guiTextInputMenu.cpp
@ -323,16 +323,15 @@ set(minetest_SRCS
guiVolumeChange.cpp guiVolumeChange.cpp
guiDeathScreen.cpp guiDeathScreen.cpp
guiChatConsole.cpp guiChatConsole.cpp
guiCreateWorld.cpp
guiConfigureWorld.cpp
guiConfirmMenu.cpp
client.cpp client.cpp
filecache.cpp filecache.cpp
tile.cpp tile.cpp
shader.cpp shader.cpp
game.cpp game.cpp
main.cpp main.cpp
guiEngine.cpp
guiLuaApi.cpp
guiFileSelectMenu.cpp
convert_json.cpp
) )
if(USE_FREETYPE) if(USE_FREETYPE)

View File

@ -42,20 +42,10 @@ BiomeDefManager::BiomeDefManager() {
b->name = "Default"; b->name = "Default";
b->flags = 0; b->flags = 0;
b->depth_top = 0; b->c_top = CONTENT_AIR;
b->depth_filler = 0; b->top_depth = 0;
b->c_filler = b->c_top;
b->nname_top = "air"; b->filler_height = MAP_GENERATION_LIMIT;
b->nname_filler = "air";
b->nname_water = "mapgen_water_source";
b->nname_dust = "air";
b->nname_dust_water = "mapgen_water_source";
b->c_top = CONTENT_IGNORE;
b->c_filler = CONTENT_IGNORE;
b->c_water = CONTENT_IGNORE;
b->c_dust = CONTENT_IGNORE;
b->c_dust_water = CONTENT_IGNORE;
b->height_min = -MAP_GENERATION_LIMIT; b->height_min = -MAP_GENERATION_LIMIT;
b->height_max = MAP_GENERATION_LIMIT; b->height_max = MAP_GENERATION_LIMIT;
@ -111,42 +101,27 @@ void BiomeDefManager::resolveNodeNames(INodeDefManager *ndef) {
biome_registration_finished = true; biome_registration_finished = true;
for (size_t i = 0; i < biomes.size(); i++) { for (size_t i = 0; i != biomes.size(); i++) {
b = biomes[i]; b = biomes[i];
b->c_top = ndef->getId(b->nname_top); if (b->c_top == CONTENT_IGNORE) {
b->c_top = ndef->getId(b->top_nodename);
if (b->c_top == CONTENT_IGNORE) { if (b->c_top == CONTENT_IGNORE) {
errorstream << "BiomeDefManager::resolveNodeNames: node '" errorstream << "BiomeDefManager::resolveNodeNames: node '"
<< b->nname_top << "' not defined" << std::endl; << b->top_nodename << "' not defined" << std::endl;
b->c_top = CONTENT_AIR; b->c_top = CONTENT_AIR;
b->depth_top = 0; b->top_depth = 0;
}
} }
b->c_filler = ndef->getId(b->nname_filler); if (b->c_filler == CONTENT_IGNORE) {
b->c_filler = ndef->getId(b->filler_nodename);
if (b->c_filler == CONTENT_IGNORE) { if (b->c_filler == CONTENT_IGNORE) {
errorstream << "BiomeDefManager::resolveNodeNames: node '" errorstream << "BiomeDefManager::resolveNodeNames: node '"
<< b->nname_filler << "' not defined" << std::endl; << b->filler_nodename << "' not defined" << std::endl;
b->c_filler = CONTENT_AIR; b->c_filler = CONTENT_AIR;
b->depth_filler = 0; b->filler_height = MAP_GENERATION_LIMIT;
} }
b->c_water = ndef->getId(b->nname_water);
if (b->c_water == CONTENT_IGNORE) {
errorstream << "BiomeDefManager::resolveNodeNames: node '"
<< b->nname_water << "' not defined" << std::endl;
b->c_water = CONTENT_AIR;
}
b->c_dust = ndef->getId(b->nname_dust);
if (b->c_dust == CONTENT_IGNORE) {
errorstream << "BiomeDefManager::resolveNodeNames: node '"
<< b->nname_dust << "' not defined" << std::endl;
}
b->c_dust_water = ndef->getId(b->nname_dust_water);
if (b->c_dust_water == CONTENT_IGNORE) {
errorstream << "BiomeDefManager::resolveNodeNames: node '"
<< b->nname_dust_water << "' not defined" << std::endl;
} }
} }
} }

View File

@ -45,20 +45,14 @@ public:
std::string name; std::string name;
u32 flags; u32 flags;
std::string nname_top; std::string top_nodename;
std::string nname_filler; std::string filler_nodename;
std::string nname_water;
std::string nname_dust;
std::string nname_dust_water;
content_t c_top; content_t c_top;
content_t c_filler; s16 top_depth;
content_t c_water;
content_t c_dust;
content_t c_dust_water;
s16 depth_top; content_t c_filler;
s16 depth_filler; s16 filler_height;
s16 height_min; s16 height_min;
s16 height_max; s16 height_max;

View File

@ -24,12 +24,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "mapgen_v7.h" #include "mapgen_v7.h"
#include "cavegen.h" #include "cavegen.h"
NoiseParams nparams_caveliquids =
{0, 1, v3f(150.0, 150.0, 150.0), 776, 3, 0.6};
///////////////////////////////////////////////////////////////////////////////
CaveV6::CaveV6(MapgenV6 *mg, PseudoRandom *ps, PseudoRandom *ps2, bool is_large_cave) { CaveV6::CaveV6(MapgenV6 *mg, PseudoRandom *ps, PseudoRandom *ps2, bool is_large_cave) {
this->mg = mg; this->mg = mg;
@ -275,8 +269,6 @@ CaveV7::CaveV7(MapgenV7 *mg, PseudoRandom *ps, bool is_large_cave) {
this->ps = ps; this->ps = ps;
this->c_water_source = mg->c_water_source; this->c_water_source = mg->c_water_source;
this->c_lava_source = mg->c_lava_source; this->c_lava_source = mg->c_lava_source;
this->c_ice = mg->c_ice;
this->np_caveliquids = &nparams_caveliquids;
dswitchint = ps->range(1, 14); dswitchint = ps->range(1, 14);
flooded = ps->range(1, 2) == 2; flooded = ps->range(1, 2) == 2;
@ -311,7 +303,7 @@ void CaveV7::makeCave(v3s16 nmin, v3s16 nmax, int max_stone_height) {
// Allow a bit more // Allow a bit more
//(this should be more than the maximum radius of the tunnel) //(this should be more than the maximum radius of the tunnel)
s16 insure = 10; s16 insure = 10;
s16 more = MYMAX(MAP_BLOCKSIZE - max_tunnel_diameter / 2 - insure, 1); s16 more = MAP_BLOCKSIZE - max_tunnel_diameter / 2 - insure;
ar += v3s16(1,0,1) * more * 2; ar += v3s16(1,0,1) * more * 2;
of -= v3s16(1,0,1) * more; of -= v3s16(1,0,1) * more;
@ -455,9 +447,8 @@ void CaveV7::makeTunnel(bool dirswitch) {
bool randomize_xz = (ps->range(1, 2) == 1); bool randomize_xz = (ps->range(1, 2) == 1);
// Make a ravine every once in a while if it's long enough // Make a ravine every once in a while if it's long enough
//float xylen = vec.X * vec.X + vec.Z * vec.Z; float xylen = vec.X * vec.X + vec.Z * vec.Z;
//disable ravines for now bool is_ravine = (xylen > 500.0) && !large_cave && (ps->range(1, 8) == 1);
bool is_ravine = false; //(xylen > 500.0) && !large_cave && (ps->range(1, 8) == 1);
// Carve routes // Carve routes
for (float f = 0; f < 1.0; f += 1.0 / veclen) for (float f = 0; f < 1.0; f += 1.0 / veclen)
@ -471,14 +462,11 @@ void CaveV7::carveRoute(v3f vec, float f, bool randomize_xz, bool is_ravine) {
MapNode airnode(CONTENT_AIR); MapNode airnode(CONTENT_AIR);
MapNode waternode(c_water_source); MapNode waternode(c_water_source);
MapNode lavanode(c_lava_source); MapNode lavanode(c_lava_source);
MapNode liquidnode = ps->range(0, 4) ? lavanode : waternode;
v3s16 startp(orp.X, orp.Y, orp.Z); v3s16 startp(orp.X, orp.Y, orp.Z);
startp += of; startp += of;
float nval = NoisePerlin3D(np_caveliquids, startp.X,
startp.Y, startp.Z, mg->seed);
MapNode liquidnode = nval < 0.40 ? lavanode : waternode;
v3f fp = orp + vec * f; v3f fp = orp + vec * f;
fp.X += 0.1 * ps->range(-10, 10); fp.X += 0.1 * ps->range(-10, 10);
fp.Z += 0.1 * ps->range(-10, 10); fp.Z += 0.1 * ps->range(-10, 10);
@ -492,7 +480,6 @@ void CaveV7::carveRoute(v3f vec, float f, bool randomize_xz, bool is_ravine) {
} }
bool flat_cave_floor = !large_cave && ps->range(0, 2) == 2; bool flat_cave_floor = !large_cave && ps->range(0, 2) == 2;
bool should_make_cave_hole = ps->range(1, 10) == 1;
for (s16 z0 = d0; z0 <= d1; z0++) { for (s16 z0 = d0; z0 <= d1; z0++) {
s16 si = rs / 2 - MYMAX(0, abs(z0) - rs / 7 - 1); s16 si = rs / 2 - MYMAX(0, abs(z0) - rs / 7 - 1);
@ -516,22 +503,14 @@ void CaveV7::carveRoute(v3f vec, float f, bool randomize_xz, bool is_ravine) {
v3s16 p(cp.X + x0, cp.Y + y0, cp.Z + z0); v3s16 p(cp.X + x0, cp.Y + y0, cp.Z + z0);
p += of; p += of;
if (!is_ravine && mg->heightmap && should_make_cave_hole) {
int maplen = node_max.X - node_min.X + 1;
int idx = (p.Z - node_min.Z) * maplen + (p.X - node_min.X);
if (p.Y >= mg->heightmap[idx] - 2)
continue;
}
if (vm->m_area.contains(p) == false) if (vm->m_area.contains(p) == false)
continue; continue;
u32 i = vm->m_area.index(p); u32 i = vm->m_area.index(p);
// Don't replace air, water, lava, or ice // Don't replace air or water or lava
content_t c = vm->m_data[i].getContent(); content_t c = vm->m_data[i].getContent();
if (c == CONTENT_AIR || c == c_water_source || if (c == CONTENT_AIR || c == c_water_source || c == c_lava_source)
c == c_lava_source || c == c_ice)
continue; continue;
if (large_cave) { if (large_cave) {
@ -545,9 +524,6 @@ void CaveV7::carveRoute(v3f vec, float f, bool randomize_xz, bool is_ravine) {
else else
vm->m_data[i] = airnode; vm->m_data[i] = airnode;
} else { } else {
if (c == CONTENT_IGNORE)
continue;
vm->m_data[i] = airnode; vm->m_data[i] = airnode;
vm->m_flags[i] |= VMANIP_FLAG_CAVE; vm->m_flags[i] |= VMANIP_FLAG_CAVE;
} }

View File

@ -75,8 +75,6 @@ public:
ManualMapVoxelManipulator *vm; ManualMapVoxelManipulator *vm;
INodeDefManager *ndef; INodeDefManager *ndef;
NoiseParams *np_caveliquids;
s16 min_tunnel_diameter; s16 min_tunnel_diameter;
s16 max_tunnel_diameter; s16 max_tunnel_diameter;
u16 tunnel_routepoints; u16 tunnel_routepoints;
@ -104,7 +102,6 @@ public:
content_t c_water_source; content_t c_water_source;
content_t c_lava_source; content_t c_lava_source;
content_t c_ice;
int water_level; int water_level;

View File

@ -250,7 +250,7 @@ void * MediaFetchThread::Thread()
m_file_data.push_back(make_pair(i->name, data)); m_file_data.push_back(make_pair(i->name, data));
} else { } else {
m_failed.push_back(*i); m_failed.push_back(*i);
infostream << "cURL request failed for " << i->name << " (" << curl_easy_strerror(res) << ")"<< std::endl; infostream << "cURL request failed for " << i->name << std::endl;
} }
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
} }
@ -320,6 +320,12 @@ Client::Client(
m_playerpos_send_timer = 0.0; m_playerpos_send_timer = 0.0;
m_ignore_damage_timer = 0.0; m_ignore_damage_timer = 0.0;
// Build main texture atlas, now that the GameDef exists (that is, us)
if(g_settings->getBool("enable_texture_atlas"))
m_tsrc->buildMainAtlas(this);
else
infostream<<"Not building texture atlas."<<std::endl;
/* /*
Add local player Add local player
*/ */
@ -797,8 +803,7 @@ void Client::step(float dtime)
all_stopped &= !(*thread)->IsRunning(); all_stopped &= !(*thread)->IsRunning();
while (!(*thread)->m_file_data.empty()) { while (!(*thread)->m_file_data.empty()) {
std::pair <std::string, std::string> out = (*thread)->m_file_data.pop_front(); std::pair <std::string, std::string> out = (*thread)->m_file_data.pop_front();
if(m_media_received_count < m_media_count) ++m_media_received_count;
m_media_received_count++;
bool success = loadMedia(out.second, out.first); bool success = loadMedia(out.second, out.first);
if(success){ if(success){
@ -1732,9 +1737,15 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id)
} }
else if(command == TOCLIENT_MEDIA) else if(command == TOCLIENT_MEDIA)
{ {
if (m_media_count == 0)
return;
std::string datastring((char*)&data[2], datasize-2); std::string datastring((char*)&data[2], datasize-2);
std::istringstream is(datastring, std::ios_base::binary); std::istringstream is(datastring, std::ios_base::binary);
// Mesh update thread must be stopped while
// updating content definitions
assert(!m_mesh_update_thread.IsRunning());
/* /*
u16 command u16 command
u16 total number of file bunches u16 total number of file bunches
@ -1749,31 +1760,11 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id)
*/ */
int num_bunches = readU16(is); int num_bunches = readU16(is);
int bunch_i = readU16(is); int bunch_i = readU16(is);
u32 num_files = readU32(is); int num_files = readU32(is);
infostream<<"Client: Received files: bunch "<<bunch_i<<"/" infostream<<"Client: Received files: bunch "<<bunch_i<<"/"
<<num_bunches<<" files="<<num_files <<num_bunches<<" files="<<num_files
<<" size="<<datasize<<std::endl; <<" size="<<datasize<<std::endl;
for(int i=0; i<num_files; i++){
// Check total and received media count
assert(m_media_received_count <= m_media_count);
if (num_files > m_media_count - m_media_received_count) {
errorstream<<"Client: Received more files than requested:"
<<" total count="<<m_media_count
<<" total received="<<m_media_received_count
<<" bunch "<<bunch_i<<"/"<<num_bunches
<<" files="<<num_files
<<" size="<<datasize<<std::endl;
num_files = m_media_count - m_media_received_count;
}
if (num_files == 0)
return;
// Mesh update thread must be stopped while
// updating content definitions
assert(!m_mesh_update_thread.IsRunning());
for(u32 i=0; i<num_files; i++){
assert(m_media_received_count < m_media_count);
m_media_received_count++; m_media_received_count++;
std::string name = deSerializeString(is); std::string name = deSerializeString(is);
std::string data = deSerializeLongString(is); std::string data = deSerializeLongString(is);
@ -2864,8 +2855,12 @@ void Client::afterContentReceived(IrrlichtDevice *device, gui::IGUIFont* font)
infostream<<"- Rebuilding images and textures"<<std::endl; infostream<<"- Rebuilding images and textures"<<std::endl;
m_tsrc->rebuildImagesAndTextures(); m_tsrc->rebuildImagesAndTextures();
// Update texture atlas
infostream<<"- Updating texture atlas"<<std::endl;
if(g_settings->getBool("enable_texture_atlas"))
m_tsrc->buildMainAtlas(this);
// Rebuild shaders // Rebuild shaders
infostream<<"- Rebuilding shaders"<<std::endl;
m_shsrc->rebuildShaders(); m_shsrc->rebuildShaders();
// Update node aliases // Update node aliases

View File

@ -31,10 +31,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "main.h" // g_profiler #include "main.h" // g_profiler
#include "profiler.h" #include "profiler.h"
// float error is 10 - 9.96875 = 0.03125
//#define COLL_ZERO 0.032 // broken unit tests
#define COLL_ZERO 0
// Helper function: // Helper function:
// Checks for collision of a moving aabbox with a static aabbox // Checks for collision of a moving aabbox with a static aabbox
// Returns -1 if no collision, 0 if X collision, 1 if Y collision, 2 if Z collision // Returns -1 if no collision, 0 if X collision, 1 if Y collision, 2 if Z collision
@ -45,9 +41,9 @@ int axisAlignedCollision(
{ {
//TimeTaker tt("axisAlignedCollision"); //TimeTaker tt("axisAlignedCollision");
f32 xsize = (staticbox.MaxEdge.X - staticbox.MinEdge.X) - COLL_ZERO; // reduce box size for solve collision stuck (flying sand) f32 xsize = (staticbox.MaxEdge.X - staticbox.MinEdge.X);
f32 ysize = (staticbox.MaxEdge.Y - staticbox.MinEdge.Y); // - COLL_ZERO; // Y - no sense for falling, but maybe try later f32 ysize = (staticbox.MaxEdge.Y - staticbox.MinEdge.Y);
f32 zsize = (staticbox.MaxEdge.Z - staticbox.MinEdge.Z) - COLL_ZERO; f32 zsize = (staticbox.MaxEdge.Z - staticbox.MinEdge.Z);
aabb3f relbox( aabb3f relbox(
movingbox.MinEdge.X - staticbox.MinEdge.X, movingbox.MinEdge.X - staticbox.MinEdge.X,
@ -64,9 +60,9 @@ int axisAlignedCollision(
{ {
dtime = - relbox.MaxEdge.X / speed.X; dtime = - relbox.MaxEdge.X / speed.X;
if((relbox.MinEdge.Y + speed.Y * dtime < ysize) && if((relbox.MinEdge.Y + speed.Y * dtime < ysize) &&
(relbox.MaxEdge.Y + speed.Y * dtime > COLL_ZERO) && (relbox.MaxEdge.Y + speed.Y * dtime > 0) &&
(relbox.MinEdge.Z + speed.Z * dtime < zsize) && (relbox.MinEdge.Z + speed.Z * dtime < zsize) &&
(relbox.MaxEdge.Z + speed.Z * dtime > COLL_ZERO)) (relbox.MaxEdge.Z + speed.Z * dtime > 0))
return 0; return 0;
} }
else if(relbox.MinEdge.X > xsize) else if(relbox.MinEdge.X > xsize)
@ -80,9 +76,9 @@ int axisAlignedCollision(
{ {
dtime = (xsize - relbox.MinEdge.X) / speed.X; dtime = (xsize - relbox.MinEdge.X) / speed.X;
if((relbox.MinEdge.Y + speed.Y * dtime < ysize) && if((relbox.MinEdge.Y + speed.Y * dtime < ysize) &&
(relbox.MaxEdge.Y + speed.Y * dtime > COLL_ZERO) && (relbox.MaxEdge.Y + speed.Y * dtime > 0) &&
(relbox.MinEdge.Z + speed.Z * dtime < zsize) && (relbox.MinEdge.Z + speed.Z * dtime < zsize) &&
(relbox.MaxEdge.Z + speed.Z * dtime > COLL_ZERO)) (relbox.MaxEdge.Z + speed.Z * dtime > 0))
return 0; return 0;
} }
else if(relbox.MaxEdge.X < 0) else if(relbox.MaxEdge.X < 0)
@ -99,9 +95,9 @@ int axisAlignedCollision(
{ {
dtime = - relbox.MaxEdge.Y / speed.Y; dtime = - relbox.MaxEdge.Y / speed.Y;
if((relbox.MinEdge.X + speed.X * dtime < xsize) && if((relbox.MinEdge.X + speed.X * dtime < xsize) &&
(relbox.MaxEdge.X + speed.X * dtime > COLL_ZERO) && (relbox.MaxEdge.X + speed.X * dtime > 0) &&
(relbox.MinEdge.Z + speed.Z * dtime < zsize) && (relbox.MinEdge.Z + speed.Z * dtime < zsize) &&
(relbox.MaxEdge.Z + speed.Z * dtime > COLL_ZERO)) (relbox.MaxEdge.Z + speed.Z * dtime > 0))
return 1; return 1;
} }
else if(relbox.MinEdge.Y > ysize) else if(relbox.MinEdge.Y > ysize)
@ -115,9 +111,9 @@ int axisAlignedCollision(
{ {
dtime = (ysize - relbox.MinEdge.Y) / speed.Y; dtime = (ysize - relbox.MinEdge.Y) / speed.Y;
if((relbox.MinEdge.X + speed.X * dtime < xsize) && if((relbox.MinEdge.X + speed.X * dtime < xsize) &&
(relbox.MaxEdge.X + speed.X * dtime > COLL_ZERO) && (relbox.MaxEdge.X + speed.X * dtime > 0) &&
(relbox.MinEdge.Z + speed.Z * dtime < zsize) && (relbox.MinEdge.Z + speed.Z * dtime < zsize) &&
(relbox.MaxEdge.Z + speed.Z * dtime > COLL_ZERO)) (relbox.MaxEdge.Z + speed.Z * dtime > 0))
return 1; return 1;
} }
else if(relbox.MaxEdge.Y < 0) else if(relbox.MaxEdge.Y < 0)
@ -134,9 +130,9 @@ int axisAlignedCollision(
{ {
dtime = - relbox.MaxEdge.Z / speed.Z; dtime = - relbox.MaxEdge.Z / speed.Z;
if((relbox.MinEdge.X + speed.X * dtime < xsize) && if((relbox.MinEdge.X + speed.X * dtime < xsize) &&
(relbox.MaxEdge.X + speed.X * dtime > COLL_ZERO) && (relbox.MaxEdge.X + speed.X * dtime > 0) &&
(relbox.MinEdge.Y + speed.Y * dtime < ysize) && (relbox.MinEdge.Y + speed.Y * dtime < ysize) &&
(relbox.MaxEdge.Y + speed.Y * dtime > COLL_ZERO)) (relbox.MaxEdge.Y + speed.Y * dtime > 0))
return 2; return 2;
} }
//else if(relbox.MinEdge.Z > zsize) //else if(relbox.MinEdge.Z > zsize)
@ -150,9 +146,9 @@ int axisAlignedCollision(
{ {
dtime = (zsize - relbox.MinEdge.Z) / speed.Z; dtime = (zsize - relbox.MinEdge.Z) / speed.Z;
if((relbox.MinEdge.X + speed.X * dtime < xsize) && if((relbox.MinEdge.X + speed.X * dtime < xsize) &&
(relbox.MaxEdge.X + speed.X * dtime > COLL_ZERO) && (relbox.MaxEdge.X + speed.X * dtime > 0) &&
(relbox.MinEdge.Y + speed.Y * dtime < ysize) && (relbox.MinEdge.Y + speed.Y * dtime < ysize) &&
(relbox.MaxEdge.Y + speed.Y * dtime > COLL_ZERO)) (relbox.MaxEdge.Y + speed.Y * dtime > 0))
return 2; return 2;
} }
//else if(relbox.MaxEdge.Z < 0) //else if(relbox.MaxEdge.Z < 0)

View File

@ -1436,8 +1436,7 @@ SharedBuffer<u8> Connection::processPacket(Channel *channel,
else if(type == TYPE_RELIABLE) else if(type == TYPE_RELIABLE)
{ {
// Recursive reliable packets not allowed // Recursive reliable packets not allowed
if(reliable) assert(reliable == false);
throw InvalidIncomingDataException("Found nested reliable packets");
if(packetdata.getSize() < RELIABLE_HEADER_SIZE) if(packetdata.getSize() < RELIABLE_HEADER_SIZE)
throw InvalidIncomingDataException throw InvalidIncomingDataException

View File

@ -228,12 +228,9 @@ public:
ServerMap *map = &env->getServerMap(); ServerMap *map = &env->getServerMap();
if (map->transforming_liquid_size() > 500) if (map->transforming_liquid_size() > 500)
return; return;
if ( map->getNodeNoEx(p - v3s16(0, 1, 0 )).getContent() != CONTENT_AIR // below //todo: look around except top
&& map->getNodeNoEx(p - v3s16(1, 0, 0 )).getContent() != CONTENT_AIR // right MapNode n_below = map->getNodeNoEx(p - v3s16(0, 1, 0));
&& map->getNodeNoEx(p - v3s16(-1, 0, 0 )).getContent() != CONTENT_AIR // left if (n_below.getContent() != CONTENT_AIR)
&& map->getNodeNoEx(p - v3s16(0, 0, 1 )).getContent() != CONTENT_AIR // back
&& map->getNodeNoEx(p - v3s16(0, 0, -1)).getContent() != CONTENT_AIR // front
)
return; return;
map->transforming_liquid_add(p); map->transforming_liquid_add(p);
} }

View File

@ -223,7 +223,7 @@ void TestCAO::addToScene(scene::ISceneManager *smgr, ITextureSource *tsrc,
// Set material // Set material
buf->getMaterial().setFlag(video::EMF_LIGHTING, false); buf->getMaterial().setFlag(video::EMF_LIGHTING, false);
buf->getMaterial().setFlag(video::EMF_BACK_FACE_CULLING, false); buf->getMaterial().setFlag(video::EMF_BACK_FACE_CULLING, false);
buf->getMaterial().setTexture(0, tsrc->getTexture("rat.png")); buf->getMaterial().setTexture(0, tsrc->getTextureRaw("rat.png"));
buf->getMaterial().setFlag(video::EMF_BILINEAR_FILTER, false); buf->getMaterial().setFlag(video::EMF_BILINEAR_FILTER, false);
buf->getMaterial().setFlag(video::EMF_FOG_ENABLE, true); buf->getMaterial().setFlag(video::EMF_FOG_ENABLE, true);
buf->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; buf->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
@ -393,7 +393,7 @@ void ItemCAO::addToScene(scene::ISceneManager *smgr, ITextureSource *tsrc,
buf->getMaterial().setFlag(video::EMF_LIGHTING, false); buf->getMaterial().setFlag(video::EMF_LIGHTING, false);
buf->getMaterial().setFlag(video::EMF_BACK_FACE_CULLING, false); buf->getMaterial().setFlag(video::EMF_BACK_FACE_CULLING, false);
// Initialize with a generated placeholder texture // Initialize with a generated placeholder texture
buf->getMaterial().setTexture(0, tsrc->getTexture("")); buf->getMaterial().setTexture(0, tsrc->getTextureRaw(""));
buf->getMaterial().setFlag(video::EMF_BILINEAR_FILTER, false); buf->getMaterial().setFlag(video::EMF_BILINEAR_FILTER, false);
buf->getMaterial().setFlag(video::EMF_FOG_ENABLE, true); buf->getMaterial().setFlag(video::EMF_FOG_ENABLE, true);
buf->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; buf->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
@ -864,7 +864,7 @@ public:
m_spritenode = smgr->addBillboardSceneNode( m_spritenode = smgr->addBillboardSceneNode(
NULL, v2f(1, 1), v3f(0,0,0), -1); NULL, v2f(1, 1), v3f(0,0,0), -1);
m_spritenode->setMaterialTexture(0, m_spritenode->setMaterialTexture(0,
tsrc->getTexture("unknown_node.png")); tsrc->getTextureRaw("unknown_node.png"));
m_spritenode->setMaterialFlag(video::EMF_LIGHTING, false); m_spritenode->setMaterialFlag(video::EMF_LIGHTING, false);
m_spritenode->setMaterialFlag(video::EMF_BILINEAR_FILTER, false); m_spritenode->setMaterialFlag(video::EMF_BILINEAR_FILTER, false);
m_spritenode->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF); m_spritenode->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF);
@ -1273,7 +1273,7 @@ public:
texturestring = m_prop.textures[0]; texturestring = m_prop.textures[0];
texturestring += mod; texturestring += mod;
m_spritenode->setMaterialTexture(0, m_spritenode->setMaterialTexture(0,
tsrc->getTexture(texturestring)); tsrc->getTextureRaw(texturestring));
// This allows setting per-material colors. However, until a real lighting // This allows setting per-material colors. However, until a real lighting
// system is added, the code below will have no effect. Once MineTest // system is added, the code below will have no effect. Once MineTest
@ -1300,7 +1300,7 @@ public:
if(texturestring == "") if(texturestring == "")
continue; // Empty texture string means don't modify that material continue; // Empty texture string means don't modify that material
texturestring += mod; texturestring += mod;
video::ITexture* texture = tsrc->getTexture(texturestring); video::ITexture* texture = tsrc->getTextureRaw(texturestring);
if(!texture) if(!texture)
{ {
errorstream<<"GenericCAO::updateTextures(): Could not load texture "<<texturestring<<std::endl; errorstream<<"GenericCAO::updateTextures(): Could not load texture "<<texturestring<<std::endl;
@ -1308,8 +1308,8 @@ public:
} }
// Set material flags and texture // Set material flags and texture
m_animated_meshnode->setMaterialTexture(i, texture);
video::SMaterial& material = m_animated_meshnode->getMaterial(i); video::SMaterial& material = m_animated_meshnode->getMaterial(i);
material.TextureLayer[0].Texture = texture;
material.setFlag(video::EMF_LIGHTING, false); material.setFlag(video::EMF_LIGHTING, false);
material.setFlag(video::EMF_BILINEAR_FILTER, false); material.setFlag(video::EMF_BILINEAR_FILTER, false);
@ -1338,15 +1338,20 @@ public:
if(m_prop.textures.size() > i) if(m_prop.textures.size() > i)
texturestring = m_prop.textures[i]; texturestring = m_prop.textures[i];
texturestring += mod; texturestring += mod;
AtlasPointer ap = tsrc->getTexture(texturestring);
// Get the tile texture and atlas transformation
video::ITexture* atlas = ap.atlas;
v2f pos = ap.pos;
v2f size = ap.size;
// Set material flags and texture // Set material flags and texture
video::SMaterial& material = m_meshnode->getMaterial(i); video::SMaterial& material = m_meshnode->getMaterial(i);
material.setFlag(video::EMF_LIGHTING, false); material.setFlag(video::EMF_LIGHTING, false);
material.setFlag(video::EMF_BILINEAR_FILTER, false); material.setFlag(video::EMF_BILINEAR_FILTER, false);
material.setTexture(0, material.setTexture(0, atlas);
tsrc->getTexture(texturestring)); material.getTextureMatrix(0).setTextureTranslate(pos.X, pos.Y);
material.getTextureMatrix(0).makeIdentity(); material.getTextureMatrix(0).setTextureScale(size.X, size.Y);
// This allows setting per-material colors. However, until a real lighting // This allows setting per-material colors. However, until a real lighting
// system is added, the code below will have no effect. Once MineTest // system is added, the code below will have no effect. Once MineTest
@ -1373,7 +1378,7 @@ public:
tname += mod; tname += mod;
scene::IMeshBuffer *buf = mesh->getMeshBuffer(0); scene::IMeshBuffer *buf = mesh->getMeshBuffer(0);
buf->getMaterial().setTexture(0, buf->getMaterial().setTexture(0,
tsrc->getTexture(tname)); tsrc->getTextureRaw(tname));
// This allows setting per-material colors. However, until a real lighting // This allows setting per-material colors. However, until a real lighting
// system is added, the code below will have no effect. Once MineTest // system is added, the code below will have no effect. Once MineTest
@ -1398,7 +1403,7 @@ public:
tname += mod; tname += mod;
scene::IMeshBuffer *buf = mesh->getMeshBuffer(1); scene::IMeshBuffer *buf = mesh->getMeshBuffer(1);
buf->getMaterial().setTexture(0, buf->getMaterial().setTexture(0,
tsrc->getTexture(tname)); tsrc->getTextureRaw(tname));
// This allows setting per-material colors. However, until a real lighting // This allows setting per-material colors. However, until a real lighting
// system is added, the code below will have no effect. Once MineTest // system is added, the code below will have no effect. Once MineTest

View File

@ -50,7 +50,7 @@ public:
m_spritenode = smgr->addBillboardSceneNode( m_spritenode = smgr->addBillboardSceneNode(
NULL, v2f(1,1), pos, -1); NULL, v2f(1,1), pos, -1);
m_spritenode->setMaterialTexture(0, m_spritenode->setMaterialTexture(0,
env->getGameDef()->tsrc()->getTexture("smoke_puff.png")); env->getGameDef()->tsrc()->getTextureRaw("smoke_puff.png"));
m_spritenode->setMaterialFlag(video::EMF_LIGHTING, false); m_spritenode->setMaterialFlag(video::EMF_LIGHTING, false);
m_spritenode->setMaterialFlag(video::EMF_BILINEAR_FILTER, false); m_spritenode->setMaterialFlag(video::EMF_BILINEAR_FILTER, false);
//m_spritenode->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF); //m_spritenode->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF);

View File

@ -99,6 +99,7 @@ void makeCuboid(MeshCollector *collector, const aabb3f &box,
video::S3DVertex(min.X,min.Y,min.Z, 0,0,-1, c, txc[20],txc[23]), video::S3DVertex(min.X,min.Y,min.Z, 0,0,-1, c, txc[20],txc[23]),
}; };
v2f t;
for(int i = 0; i < tilecount; i++) for(int i = 0; i < tilecount; i++)
{ {
switch (tiles[i].rotation) switch (tiles[i].rotation)
@ -118,43 +119,49 @@ void makeCuboid(MeshCollector *collector, const aabb3f &box,
vertices[i*4+x].TCoords.rotateBy(270,irr::core::vector2df(0, 0)); vertices[i*4+x].TCoords.rotateBy(270,irr::core::vector2df(0, 0));
break; break;
case 4: //FXR90 case 4: //FXR90
for (int x = 0; x < 4; x++){ for (int x = 0; x < 4; x++)
vertices[i*4+x].TCoords.X = 1.0 - vertices[i*4+x].TCoords.X;
vertices[i*4+x].TCoords.rotateBy(90,irr::core::vector2df(0, 0)); vertices[i*4+x].TCoords.rotateBy(90,irr::core::vector2df(0, 0));
}
tiles[i].texture.pos.Y += tiles[i].texture.size.Y;
tiles[i].texture.size.Y *= -1;
break; break;
case 5: //FXR270 case 5: //FXR270
for (int x = 0; x < 4; x++){ for (int x = 0; x < 4; x++)
vertices[i*4+x].TCoords.X = 1.0 - vertices[i*4+x].TCoords.X;
vertices[i*4+x].TCoords.rotateBy(270,irr::core::vector2df(0, 0)); vertices[i*4+x].TCoords.rotateBy(270,irr::core::vector2df(0, 0));
} t=vertices[i*4].TCoords;
tiles[i].texture.pos.Y += tiles[i].texture.size.Y;
tiles[i].texture.size.Y *= -1;
break; break;
case 6: //FYR90 case 6: //FYR90
for (int x = 0; x < 4; x++){ for (int x = 0; x < 4; x++)
vertices[i*4+x].TCoords.Y = 1.0 - vertices[i*4+x].TCoords.Y;
vertices[i*4+x].TCoords.rotateBy(90,irr::core::vector2df(0, 0)); vertices[i*4+x].TCoords.rotateBy(90,irr::core::vector2df(0, 0));
} tiles[i].texture.pos.X += tiles[i].texture.size.X;
tiles[i].texture.size.X *= -1;
break; break;
case 7: //FYR270 case 7: //FYR270
for (int x = 0; x < 4; x++){ for (int x = 0; x < 4; x++)
vertices[i*4+x].TCoords.Y = 1.0 - vertices[i*4+x].TCoords.Y;
vertices[i*4+x].TCoords.rotateBy(270,irr::core::vector2df(0, 0)); vertices[i*4+x].TCoords.rotateBy(270,irr::core::vector2df(0, 0));
} tiles[i].texture.pos.X += tiles[i].texture.size.X;
tiles[i].texture.size.X *= -1;
break; break;
case 8: //FX case 8: //FX
for (int x = 0; x < 4; x++){ tiles[i].texture.pos.Y += tiles[i].texture.size.Y;
vertices[i*4+x].TCoords.X = 1.0 - vertices[i*4+x].TCoords.X; tiles[i].texture.size.Y *= -1;
}
break; break;
case 9: //FY case 9: //FY
for (int x = 0; x < 4; x++){ tiles[i].texture.pos.X += tiles[i].texture.size.X;
vertices[i*4+x].TCoords.Y = 1.0 - vertices[i*4+x].TCoords.Y; tiles[i].texture.size.X *= -1;
}
break; break;
default: default:
break; break;
} }
} }
for(s32 j=0; j<24; j++)
{
int tileindex = MYMIN(j/4, tilecount-1);
vertices[j].TCoords *= tiles[tileindex].texture.size;
vertices[j].TCoords += tiles[tileindex].texture.pos;
}
u16 indices[] = {0,1,2,2,3,0}; u16 indices[] = {0,1,2,2,3,0};
// Add to mesh collector // Add to mesh collector
for(s32 j=0; j<24; j+=4) for(s32 j=0; j<24; j+=4)
@ -211,6 +218,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
*/ */
TileSpec tile_liquid = f.special_tiles[0]; TileSpec tile_liquid = f.special_tiles[0];
TileSpec tile_liquid_bfculled = getNodeTile(n, p, v3s16(0,0,0), data); TileSpec tile_liquid_bfculled = getNodeTile(n, p, v3s16(0,0,0), data);
AtlasPointer &pa_liquid = tile_liquid.texture;
bool top_is_same_liquid = false; bool top_is_same_liquid = false;
MapNode ntop = data->m_vmanip.getNodeNoEx(blockpos_nodes + v3s16(x,y+1,z)); MapNode ntop = data->m_vmanip.getNodeNoEx(blockpos_nodes + v3s16(x,y+1,z));
@ -272,10 +280,14 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
video::S3DVertex vertices[4] = video::S3DVertex vertices[4] =
{ {
video::S3DVertex(-BS/2,0,BS/2,0,0,0, c, 0,1), video::S3DVertex(-BS/2,0,BS/2,0,0,0, c,
video::S3DVertex(BS/2,0,BS/2,0,0,0, c, 1,1), pa_liquid.x0(), pa_liquid.y1()),
video::S3DVertex(BS/2,0,BS/2, 0,0,0, c, 1,0), video::S3DVertex(BS/2,0,BS/2,0,0,0, c,
video::S3DVertex(-BS/2,0,BS/2, 0,0,0, c, 0,0), pa_liquid.x1(), pa_liquid.y1()),
video::S3DVertex(BS/2,0,BS/2, 0,0,0, c,
pa_liquid.x1(), pa_liquid.y0()),
video::S3DVertex(-BS/2,0,BS/2, 0,0,0, c,
pa_liquid.x0(), pa_liquid.y0()),
}; };
/* /*
@ -347,10 +359,14 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
video::S3DVertex vertices[4] = video::S3DVertex vertices[4] =
{ {
video::S3DVertex(-BS/2,0,BS/2, 0,0,0, c, 0,1), video::S3DVertex(-BS/2,0,BS/2, 0,0,0, c,
video::S3DVertex(BS/2,0,BS/2, 0,0,0, c, 1,1), pa_liquid.x0(), pa_liquid.y1()),
video::S3DVertex(BS/2,0,-BS/2, 0,0,0, c, 1,0), video::S3DVertex(BS/2,0,BS/2, 0,0,0, c,
video::S3DVertex(-BS/2,0,-BS/2, 0,0,0, c, 0,0), pa_liquid.x1(), pa_liquid.y1()),
video::S3DVertex(BS/2,0,-BS/2, 0,0,0, c,
pa_liquid.x1(), pa_liquid.y0()),
video::S3DVertex(-BS/2,0,-BS/2, 0,0,0, c,
pa_liquid.x0(), pa_liquid.y0()),
}; };
v3f offset(p.X*BS, p.Y*BS + (-0.5+node_liquid_level)*BS, p.Z*BS); v3f offset(p.X*BS, p.Y*BS + (-0.5+node_liquid_level)*BS, p.Z*BS);
@ -370,6 +386,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
*/ */
TileSpec tile_liquid = f.special_tiles[0]; TileSpec tile_liquid = f.special_tiles[0];
TileSpec tile_liquid_bfculled = f.special_tiles[1]; TileSpec tile_liquid_bfculled = f.special_tiles[1];
AtlasPointer &pa_liquid = tile_liquid.texture;
bool top_is_same_liquid = false; bool top_is_same_liquid = false;
MapNode ntop = data->m_vmanip.getNodeNoEx(blockpos_nodes + v3s16(x,y+1,z)); MapNode ntop = data->m_vmanip.getNodeNoEx(blockpos_nodes + v3s16(x,y+1,z));
@ -549,10 +566,14 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
video::S3DVertex vertices[4] = video::S3DVertex vertices[4] =
{ {
video::S3DVertex(-BS/2,0,BS/2, 0,0,0, c, 0,1), video::S3DVertex(-BS/2,0,BS/2, 0,0,0, c,
video::S3DVertex(BS/2,0,BS/2, 0,0,0, c, 1,1), pa_liquid.x0(), pa_liquid.y1()),
video::S3DVertex(BS/2,0,BS/2, 0,0,0, c, 1,0), video::S3DVertex(BS/2,0,BS/2, 0,0,0, c,
video::S3DVertex(-BS/2,0,BS/2, 0,0,0, c, 0,0), pa_liquid.x1(), pa_liquid.y1()),
video::S3DVertex(BS/2,0,BS/2, 0,0,0, c,
pa_liquid.x1(), pa_liquid.y0()),
video::S3DVertex(-BS/2,0,BS/2, 0,0,0, c,
pa_liquid.x0(), pa_liquid.y0()),
}; };
/* /*
@ -626,10 +647,14 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
{ {
video::S3DVertex vertices[4] = video::S3DVertex vertices[4] =
{ {
video::S3DVertex(-BS/2,0,BS/2, 0,0,0, c, 0,1), video::S3DVertex(-BS/2,0,BS/2, 0,0,0, c,
video::S3DVertex(BS/2,0,BS/2, 0,0,0, c, 1,1), pa_liquid.x0(), pa_liquid.y1()),
video::S3DVertex(BS/2,0,-BS/2, 0,0,0, c, 1,0), video::S3DVertex(BS/2,0,BS/2, 0,0,0, c,
video::S3DVertex(-BS/2,0,-BS/2, 0,0,0, c, 0,0), pa_liquid.x1(), pa_liquid.y1()),
video::S3DVertex(BS/2,0,-BS/2, 0,0,0, c,
pa_liquid.x1(), pa_liquid.y0()),
video::S3DVertex(-BS/2,0,-BS/2, 0,0,0, c,
pa_liquid.x0(), pa_liquid.y0()),
}; };
// To get backface culling right, the vertices need to go // To get backface culling right, the vertices need to go
@ -700,6 +725,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
case NDT_GLASSLIKE: case NDT_GLASSLIKE:
{ {
TileSpec tile = getNodeTile(n, p, v3s16(0,0,0), data); TileSpec tile = getNodeTile(n, p, v3s16(0,0,0), data);
AtlasPointer ap = tile.texture;
u16 l = getInteriorLight(n, 1, data); u16 l = getInteriorLight(n, 1, data);
video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source)); video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
@ -715,10 +741,14 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
// The face at Z+ // The face at Z+
video::S3DVertex vertices[4] = { video::S3DVertex vertices[4] = {
video::S3DVertex(-BS/2,-BS/2,BS/2, 0,0,0, c, 0,1), video::S3DVertex(-BS/2,-BS/2,BS/2, 0,0,0, c,
video::S3DVertex(BS/2,-BS/2,BS/2, 0,0,0, c, 1,1), ap.x0(), ap.y1()),
video::S3DVertex(BS/2,BS/2,BS/2, 0,0,0, c, 1,0), video::S3DVertex(BS/2,-BS/2,BS/2, 0,0,0, c,
video::S3DVertex(-BS/2,BS/2,BS/2, 0,0,0, c, 0,0), ap.x1(), ap.y1()),
video::S3DVertex(BS/2,BS/2,BS/2, 0,0,0, c,
ap.x1(), ap.y0()),
video::S3DVertex(-BS/2,BS/2,BS/2, 0,0,0, c,
ap.x0(), ap.y0()),
}; };
// Rotations in the g_6dirs format // Rotations in the g_6dirs format
@ -880,6 +910,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
{ {
TileSpec tile_leaves = getNodeTile(n, p, TileSpec tile_leaves = getNodeTile(n, p,
v3s16(0,0,0), data); v3s16(0,0,0), data);
AtlasPointer pa_leaves = tile_leaves.texture;
u16 l = getInteriorLight(n, 1, data); u16 l = getInteriorLight(n, 1, data);
video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source)); video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
@ -914,16 +945,22 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
tile.material_flags &= ~MATERIAL_FLAG_BACKFACE_CULLING; tile.material_flags &= ~MATERIAL_FLAG_BACKFACE_CULLING;
tile.material_flags |= MATERIAL_FLAG_CRACK_OVERLAY; tile.material_flags |= MATERIAL_FLAG_CRACK_OVERLAY;
AtlasPointer ap = tile.texture;
u16 l = getInteriorLight(n, 1, data); u16 l = getInteriorLight(n, 1, data);
video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source)); video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
// Wall at X+ of node // Wall at X+ of node
video::S3DVertex vertices[4] = video::S3DVertex vertices[4] =
{ {
video::S3DVertex(-BS/2,-BS/2,0, 0,0,0, c, 0,1), video::S3DVertex(-BS/2,-BS/2,0, 0,0,0, c,
video::S3DVertex(BS/2,-BS/2,0, 0,0,0, c, 1,1), ap.x0(), ap.y1()),
video::S3DVertex(BS/2,BS/2,0, 0,0,0, c, 1,0), video::S3DVertex(BS/2,-BS/2,0, 0,0,0, c,
video::S3DVertex(-BS/2,BS/2,0, 0,0,0, c, 0,0), ap.x1(), ap.y1()),
video::S3DVertex(BS/2,BS/2,0, 0,0,0, c,
ap.x1(), ap.y0()),
video::S3DVertex(-BS/2,BS/2,0, 0,0,0, c,
ap.x0(), ap.y0()),
}; };
for(s32 i=0; i<4; i++) for(s32 i=0; i<4; i++)
@ -953,6 +990,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
TileSpec tile = getNodeTileN(n, p, 0, data); TileSpec tile = getNodeTileN(n, p, 0, data);
tile.material_flags &= ~MATERIAL_FLAG_BACKFACE_CULLING; tile.material_flags &= ~MATERIAL_FLAG_BACKFACE_CULLING;
tile.material_flags |= MATERIAL_FLAG_CRACK_OVERLAY; tile.material_flags |= MATERIAL_FLAG_CRACK_OVERLAY;
AtlasPointer ap = tile.texture;
u16 l = getInteriorLight(n, 0, data); u16 l = getInteriorLight(n, 0, data);
video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source)); video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
@ -961,10 +999,14 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
// Wall at X+ of node // Wall at X+ of node
video::S3DVertex vertices[4] = video::S3DVertex vertices[4] =
{ {
video::S3DVertex(BS/2-d,BS/2,BS/2, 0,0,0, c, 0,0), video::S3DVertex(BS/2-d,BS/2,BS/2, 0,0,0, c,
video::S3DVertex(BS/2-d,BS/2,-BS/2, 0,0,0, c, 1,0), ap.x0(), ap.y0()),
video::S3DVertex(BS/2-d,-BS/2,-BS/2, 0,0,0, c, 1,1), video::S3DVertex(BS/2-d,BS/2,-BS/2, 0,0,0, c,
video::S3DVertex(BS/2-d,-BS/2,BS/2, 0,0,0, c, 0,1), ap.x1(), ap.y0()),
video::S3DVertex(BS/2-d,-BS/2,-BS/2, 0,0,0, c,
ap.x1(), ap.y1()),
video::S3DVertex(BS/2-d,-BS/2,BS/2, 0,0,0, c,
ap.x0(), ap.y1()),
}; };
v3s16 dir = n.getWallMountedDir(nodedef); v3s16 dir = n.getWallMountedDir(nodedef);
@ -995,6 +1037,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
{ {
TileSpec tile = getNodeTileN(n, p, 0, data); TileSpec tile = getNodeTileN(n, p, 0, data);
tile.material_flags |= MATERIAL_FLAG_CRACK_OVERLAY; tile.material_flags |= MATERIAL_FLAG_CRACK_OVERLAY;
AtlasPointer ap = tile.texture;
u16 l = getInteriorLight(n, 1, data); u16 l = getInteriorLight(n, 1, data);
video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source)); video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
@ -1003,12 +1046,16 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
{ {
video::S3DVertex vertices[4] = video::S3DVertex vertices[4] =
{ {
video::S3DVertex(-BS/2*f.visual_scale,-BS/2,0, 0,0,0, c, 0,1), video::S3DVertex(-BS/2*f.visual_scale,-BS/2,0, 0,0,0, c,
video::S3DVertex( BS/2*f.visual_scale,-BS/2,0, 0,0,0, c, 1,1), ap.x0(), ap.y1()),
video::S3DVertex( BS/2*f.visual_scale,-BS/2,0, 0,0,0, c,
ap.x1(), ap.y1()),
video::S3DVertex( BS/2*f.visual_scale, video::S3DVertex( BS/2*f.visual_scale,
-BS/2 + f.visual_scale*BS,0, 0,0,0, c, 1,0), -BS/2 + f.visual_scale*BS,0, 0,0,0, c,
ap.x1(), ap.y0()),
video::S3DVertex(-BS/2*f.visual_scale, video::S3DVertex(-BS/2*f.visual_scale,
-BS/2 + f.visual_scale*BS,0, 0,0,0, c, 0,0), -BS/2 + f.visual_scale*BS,0, 0,0,0, c,
ap.x0(), ap.y0()),
}; };
if(j == 0) if(j == 0)
@ -1041,12 +1088,9 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
// A hack to put wood the right way around in the posts // A hack to put wood the right way around in the posts
ITextureSource *tsrc = data->m_gamedef->tsrc(); ITextureSource *tsrc = data->m_gamedef->tsrc();
std::string texturestring_rot = tsrc->getTextureName(
tile.texture_id) + "^[transformR90";
TileSpec tile_rot = tile; TileSpec tile_rot = tile;
tile_rot.texture = tsrc->getTexture( tile_rot.texture = tsrc->getTexture(tsrc->getTextureName(
texturestring_rot, tile.texture.id) + "^[transformR90");
&tile_rot.texture_id);
u16 l = getInteriorLight(n, 1, data); u16 l = getInteriorLight(n, 1, data);
video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source)); video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
@ -1297,6 +1341,8 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
tile.material_flags &= ~MATERIAL_FLAG_BACKFACE_CULLING; tile.material_flags &= ~MATERIAL_FLAG_BACKFACE_CULLING;
tile.material_flags |= MATERIAL_FLAG_CRACK_OVERLAY; tile.material_flags |= MATERIAL_FLAG_CRACK_OVERLAY;
AtlasPointer ap = tile.texture;
u16 l = getInteriorLight(n, 0, data); u16 l = getInteriorLight(n, 0, data);
video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source)); video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
@ -1308,10 +1354,14 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
video::S3DVertex vertices[4] = video::S3DVertex vertices[4] =
{ {
video::S3DVertex(-BS/2,-BS/2+d,-BS/2, 0,0,0, c, 0,1), video::S3DVertex(-BS/2,-BS/2+d,-BS/2, 0,0,0, c,
video::S3DVertex(BS/2,-BS/2+d,-BS/2, 0,0,0, c, 1,1), ap.x0(), ap.y1()),
video::S3DVertex(BS/2,g*BS/2+d,BS/2, 0,0,0, c, 1,0), video::S3DVertex(BS/2,-BS/2+d,-BS/2, 0,0,0, c,
video::S3DVertex(-BS/2,g*BS/2+d,BS/2, 0,0,0, c, 0,0), ap.x1(), ap.y1()),
video::S3DVertex(BS/2,g*BS/2+d,BS/2, 0,0,0, c,
ap.x1(), ap.y0()),
video::S3DVertex(-BS/2,g*BS/2+d,BS/2, 0,0,0, c,
ap.x0(), ap.y0()),
}; };
for(s32 i=0; i<4; i++) for(s32 i=0; i<4; i++)

View File

@ -1,367 +0,0 @@
/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program 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 program 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 program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <vector>
#include <iostream>
#include <sstream>
#include "convert_json.h"
#include "mods.h"
#include "config.h"
#include "log.h"
#if USE_CURL
#include <curl/curl.h>
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp)
{
((std::string*)userp)->append((char*)contents, size * nmemb);
return size * nmemb;
}
#endif
Json::Value fetchJsonValue(const std::string url,
struct curl_slist *chunk) {
#if USE_CURL
std::string liststring;
CURL *curl;
curl = curl_easy_init();
if (curl)
{
CURLcode res;
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &liststring);
if (chunk != 0)
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk);
res = curl_easy_perform(curl);
if (res != CURLE_OK)
errorstream<<"Jsonreader: "<< url <<" not found (" << curl_easy_strerror(res) << ")" <<std::endl;
curl_easy_cleanup(curl);
}
Json::Value root;
Json::Reader reader;
std::istringstream stream(liststring);
if (!liststring.size()) {
return Json::Value();
}
if (!reader.parse( stream, root ) )
{
errorstream << "URL: " << url << std::endl;
errorstream << "Failed to parse json data " << reader.getFormattedErrorMessages();
errorstream << "data: \"" << liststring << "\"" << std::endl;
return Json::Value();
}
if (root.isArray()) {
return root;
}
if ((root["list"].isArray())) {
return root["list"];
}
else {
return root;
}
#endif
return Json::Value();
}
std::vector<ModStoreMod> readModStoreList(Json::Value& modlist) {
std::vector<ModStoreMod> retval;
if (modlist.isArray()) {
for (unsigned int i = 0; i < modlist.size(); i++)
{
ModStoreMod toadd;
toadd.valid = true;
//id
if (modlist[i]["id"].asString().size()) {
const char* id_raw = modlist[i]["id"].asString().c_str();
char* endptr = 0;
int numbervalue = strtol(id_raw,&endptr,10);
if ((*id_raw != 0) && (*endptr == 0)) {
toadd.id = numbervalue;
}
}
else {
toadd.valid = false;
}
//title
if (modlist[i]["title"].asString().size()) {
toadd.title = modlist[i]["title"].asString();
}
else {
toadd.valid = false;
}
//basename
if (modlist[i]["basename"].asString().size()) {
toadd.basename = modlist[i]["basename"].asString();
}
else {
toadd.valid = false;
}
//author
//rating
//version
if (toadd.valid) {
retval.push_back(toadd);
}
}
}
return retval;
}
ModStoreModDetails readModStoreModDetails(Json::Value& details) {
ModStoreModDetails retval;
retval.valid = true;
//version set
if (details["version_set"].isArray()) {
for (unsigned int i = 0; i < details["version_set"].size(); i++)
{
ModStoreVersionEntry toadd;
if (details["version_set"][i]["id"].asString().size()) {
const char* id_raw = details["version_set"][i]["id"].asString().c_str();
char* endptr = 0;
int numbervalue = strtol(id_raw,&endptr,10);
if ((*id_raw != 0) && (*endptr == 0)) {
toadd.id = numbervalue;
}
}
else {
retval.valid = false;
}
//date
if (details["version_set"][i]["date"].asString().size()) {
toadd.date = details["version_set"][i]["date"].asString();
}
//file
if (details["version_set"][i]["file"].asString().size()) {
toadd.file = details["version_set"][i]["file"].asString();
}
else {
retval.valid = false;
}
//approved
//mtversion
if( retval.valid ) {
retval.versions.push_back(toadd);
}
else {
break;
}
}
}
if (retval.versions.size() < 1) {
retval.valid = false;
}
//categories
if (details["categories"].isObject()) {
for (unsigned int i = 0; i < details["categories"].size(); i++) {
ModStoreCategoryInfo toadd;
if (details["categories"][i]["id"].asString().size()) {
const char* id_raw = details["categories"][i]["id"].asString().c_str();
char* endptr = 0;
int numbervalue = strtol(id_raw,&endptr,10);
if ((*id_raw != 0) && (*endptr == 0)) {
toadd.id = numbervalue;
}
}
else {
retval.valid = false;
}
if (details["categories"][i]["title"].asString().size()) {
toadd.name = details["categories"][i]["title"].asString();
}
else {
retval.valid = false;
}
if( retval.valid ) {
retval.categories.push_back(toadd);
}
else {
break;
}
}
}
//author
if (details["author"].isObject()) {
if (details["author"]["id"].asString().size()) {
const char* id_raw = details["author"]["id"].asString().c_str();
char* endptr = 0;
int numbervalue = strtol(id_raw,&endptr,10);
if ((*id_raw != 0) && (*endptr == 0)) {
retval.author.id = numbervalue;
}
else {
retval.valid = false;
}
}
else {
retval.valid = false;
}
if (details["author"]["username"].asString().size()) {
retval.author.username = details["author"]["username"].asString();
}
else {
retval.valid = false;
}
}
else {
retval.valid = false;
}
//license
if (details["license"].isObject()) {
if (details["license"]["id"].asString().size()) {
const char* id_raw = details["license"]["id"].asString().c_str();
char* endptr = 0;
int numbervalue = strtol(id_raw,&endptr,10);
if ((*id_raw != 0) && (*endptr == 0)) {
retval.license.id = numbervalue;
}
}
else {
retval.valid = false;
}
if (details["license"]["short"].asString().size()) {
retval.license.shortinfo = details["license"]["short"].asString();
}
else {
retval.valid = false;
}
if (details["license"]["link"].asString().size()) {
retval.license.url = details["license"]["link"].asString();
}
}
//id
if (details["id"].asString().size()) {
const char* id_raw = details["id"].asString().c_str();
char* endptr = 0;
int numbervalue = strtol(id_raw,&endptr,10);
if ((*id_raw != 0) && (*endptr == 0)) {
retval.id = numbervalue;
}
}
else {
retval.valid = false;
}
//title
if (details["title"].asString().size()) {
retval.title = details["title"].asString();
}
else {
retval.valid = false;
}
//basename
if (details["basename"].asString().size()) {
retval.basename = details["basename"].asString();
}
else {
retval.valid = false;
}
//description
if (details["desc"].asString().size()) {
retval.description = details["desc"].asString();
}
//repository
if (details["replink"].asString().size()) {
retval.repository = details["replink"].asString();
}
//value
if (details["rating"].asString().size()) {
const char* id_raw = details["rating"].asString().c_str();
char* endptr = 0;
float numbervalue = strtof(id_raw,&endptr);
if ((*id_raw != 0) && (*endptr == 0)) {
retval.rating = numbervalue;
}
}
else {
retval.rating = 0.0;
}
//depends
if (details["depends"].isArray()) {
//TODO
}
//softdepends
if (details["softdep"].isArray()) {
//TODO
}
//screenshot url
if (details["screenshot_url"].asString().size()) {
retval.screenshot_url = details["screenshot_url"].asString();
}
return retval;
}

View File

@ -94,6 +94,7 @@ void set_default_settings(Settings *settings)
settings->setDefault("new_style_water", "false"); settings->setDefault("new_style_water", "false");
settings->setDefault("new_style_leaves", "true"); settings->setDefault("new_style_leaves", "true");
settings->setDefault("smooth_lighting", "true"); settings->setDefault("smooth_lighting", "true");
settings->setDefault("enable_texture_atlas", "false");
settings->setDefault("texture_path", ""); settings->setDefault("texture_path", "");
settings->setDefault("shader_path", ""); settings->setDefault("shader_path", "");
settings->setDefault("video_driver", "opengl"); settings->setDefault("video_driver", "opengl");
@ -126,8 +127,7 @@ void set_default_settings(Settings *settings)
settings->setDefault("bilinear_filter", "false"); settings->setDefault("bilinear_filter", "false");
settings->setDefault("trilinear_filter", "false"); settings->setDefault("trilinear_filter", "false");
settings->setDefault("preload_item_visuals", "true"); settings->setDefault("preload_item_visuals", "true");
settings->setDefault("enable_bumpmapping", "false"); settings->setDefault("enable_shaders", "2");
settings->setDefault("enable_shaders", "true");
settings->setDefault("repeat_rightclick_time", "0.25"); settings->setDefault("repeat_rightclick_time", "0.25");
settings->setDefault("enable_particles", "true"); settings->setDefault("enable_particles", "true");
@ -235,15 +235,12 @@ void set_default_settings(Settings *settings)
settings->setDefault("mgv6_np_trees", "0, 1, (125, 125, 125), 2, 4, 0.66"); settings->setDefault("mgv6_np_trees", "0, 1, (125, 125, 125), 2, 4, 0.66");
settings->setDefault("mgv6_np_apple_trees", "0, 1, (100, 100, 100), 342902, 3, 0.45"); settings->setDefault("mgv6_np_apple_trees", "0, 1, (100, 100, 100), 342902, 3, 0.45");
settings->setDefault("mgv7_np_terrain_base", "4, 70, (300, 300, 300), 82341, 6, 0.7"); settings->setDefault("mgv7_np_terrain_base", "0, 80, (250, 250, 250), 82341, 5, 0.6");
settings->setDefault("mgv7_np_terrain_alt", "4, 25, (600, 600, 600), 5934, 5, 0.6"); settings->setDefault("mgv7_np_terrain_alt", "0, 20, (250, 250, 250), 5934, 5, 0.6");
settings->setDefault("mgv7_np_terrain_persist", "0.6, 0.1, (500, 500, 500), 539, 3, 0.6"); settings->setDefault("mgv7_np_terrain_mod", "0, 1, (350, 350, 350), 85039, 5, 0.6");
settings->setDefault("mgv7_np_height_select", "-0.5, 1, (250, 250, 250), 4213, 5, 0.69"); settings->setDefault("mgv7_np_terrain_persist", "0, 1, (500, 500, 500), 539, 3, 0.6");
settings->setDefault("mgv7_np_filler_depth", "0, 1.2, (150, 150, 150), 261, 4, 0.7"); settings->setDefault("mgv7_np_height_select", "0.5, 0.5, (250, 250, 250), 4213, 5, 0.69");
settings->setDefault("mgv7_np_mount_height", "100, 30, (500, 500, 500), 72449, 4, 0.6"); settings->setDefault("mgv7_np_ridge", "0, 1, (100, 100, 100), 6467, 4, 0.75");
settings->setDefault("mgv7_np_ridge_uwater", "0, 1, (500, 500, 500), 85039, 4, 0.6");
settings->setDefault("mgv7_np_mountain", "0, 1, (250, 350, 250), 5333, 5, 0.68");
settings->setDefault("mgv7_np_ridge", "0, 1, (100, 120, 100), 6467, 4, 0.75");
settings->setDefault("mgindev_np_terrain_base", "-4, 20, (250, 250, 250), 82341, 5, 0.6, 10, 10"); settings->setDefault("mgindev_np_terrain_base", "-4, 20, (250, 250, 250), 82341, 5, 0.6, 10, 10");
settings->setDefault("mgindev_np_terrain_higher", "20, 16, (500, 500, 500), 85039, 5, 0.6, 10, 10"); settings->setDefault("mgindev_np_terrain_higher", "20, 16, (500, 500, 500), 85039, 5, 0.6, 10, 10");
@ -260,11 +257,6 @@ void set_default_settings(Settings *settings)
// IPv6 // IPv6
settings->setDefault("enable_ipv6", "true"); settings->setDefault("enable_ipv6", "true");
settings->setDefault("ipv6_server", "false"); settings->setDefault("ipv6_server", "false");
settings->setDefault("modstore_download_url", "http://forum.minetest.net/media/");
settings->setDefault("modstore_listmods_url", "http://forum.minetest.net/mmdb/mods/");
settings->setDefault("modstore_details_url", "http://forum.minetest.net/mmdb/mod/*/");
} }
void override_default_settings(Settings *settings, Settings *from) void override_default_settings(Settings *settings, Settings *from)

View File

@ -204,7 +204,7 @@ void Environment::printPlayers(std::ostream &o)
u32 Environment::getDayNightRatio() u32 Environment::getDayNightRatio()
{ {
bool smooth = g_settings->getBool("enable_shaders"); bool smooth = (g_settings->getS32("enable_shaders") != 0);
return time_to_daynight_ratio(m_time_of_day_f*24000, smooth); return time_to_daynight_ratio(m_time_of_day_f*24000, smooth);
} }

View File

@ -65,7 +65,7 @@ FarMesh::FarMesh(
m_materials[1].setFlag(video::EMF_BACK_FACE_CULLING, false); m_materials[1].setFlag(video::EMF_BACK_FACE_CULLING, false);
m_materials[1].setFlag(video::EMF_BILINEAR_FILTER, false); m_materials[1].setFlag(video::EMF_BILINEAR_FILTER, false);
m_materials[1].setFlag(video::EMF_FOG_ENABLE, false); m_materials[1].setFlag(video::EMF_FOG_ENABLE, false);
m_materials[1].setTexture(0, client->tsrc()->getTexture("treeprop.png")); m_materials[1].setTexture(0, client->tsrc()->getTextureRaw("treeprop.png"));
m_materials[1].MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; m_materials[1].MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF;
m_materials[1].setFlag(video::EMF_FOG_ENABLE, true); m_materials[1].setFlag(video::EMF_FOG_ENABLE, true);

View File

@ -20,9 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "filesys.h" #include "filesys.h"
#include "strfnd.h" #include "strfnd.h"
#include <iostream> #include <iostream>
#include <stdio.h>
#include <string.h> #include <string.h>
#include <errno.h>
#include "log.h" #include "log.h"
namespace fs namespace fs
@ -32,9 +30,11 @@ namespace fs
#define _WIN32_WINNT 0x0501 #define _WIN32_WINNT 0x0501
#include <windows.h> #include <windows.h>
#include <stdio.h>
#include <malloc.h> #include <malloc.h>
#include <tchar.h> #include <tchar.h>
#include <wchar.h> #include <wchar.h>
#include <stdio.h>
#define BUFSIZE MAX_PATH #define BUFSIZE MAX_PATH
@ -145,11 +145,6 @@ bool IsDir(std::string path)
(attr & FILE_ATTRIBUTE_DIRECTORY)); (attr & FILE_ATTRIBUTE_DIRECTORY));
} }
bool IsDirDelimiter(char c)
{
return c == '/' || c == '\\';
}
bool RecursiveDelete(std::string path) bool RecursiveDelete(std::string path)
{ {
infostream<<"Recursively deleting \""<<path<<"\""<<std::endl; infostream<<"Recursively deleting \""<<path<<"\""<<std::endl;
@ -212,26 +207,11 @@ bool DeleteSingleFileOrEmptyDirectory(std::string path)
} }
} }
std::string TempPath()
{
DWORD bufsize = GetTempPath(0, "");
if(bufsize == 0){
errorstream<<"GetTempPath failed, error = "<<GetLastError()<<std::endl;
return "";
}
std::vector<char> buf(bufsize);
DWORD len = GetTempPath(bufsize, &buf[0]);
if(len == 0 || len > bufsize){
errorstream<<"GetTempPath failed, error = "<<GetLastError()<<std::endl;
return "";
}
return std::string(buf.begin(), buf.begin() + len);
}
#else // POSIX #else // POSIX
#include <sys/types.h> #include <sys/types.h>
#include <dirent.h> #include <dirent.h>
#include <errno.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <unistd.h> #include <unistd.h>
@ -321,11 +301,6 @@ bool IsDir(std::string path)
return ((statbuf.st_mode & S_IFDIR) == S_IFDIR); return ((statbuf.st_mode & S_IFDIR) == S_IFDIR);
} }
bool IsDirDelimiter(char c)
{
return c == '/';
}
bool RecursiveDelete(std::string path) bool RecursiveDelete(std::string path)
{ {
/* /*
@ -389,20 +364,6 @@ bool DeleteSingleFileOrEmptyDirectory(std::string path)
} }
} }
std::string TempPath()
{
/*
Should the environment variables TMPDIR, TMP and TEMP
and the macro P_tmpdir (if defined by stdio.h) be checked
before falling back on /tmp?
Probably not, because this function is intended to be
compatible with lua's os.tmpname which under the default
configuration hardcodes mkstemp("/tmp/lua_XXXXXX").
*/
return std::string(DIR_DELIM) + "tmp";
}
#endif #endif
void GetRecursiveSubPaths(std::string path, std::vector<std::string> &dst) void GetRecursiveSubPaths(std::string path, std::vector<std::string> &dst)
@ -453,14 +414,16 @@ bool RecursiveDeleteContent(std::string path)
bool CreateAllDirs(std::string path) bool CreateAllDirs(std::string path)
{ {
size_t pos;
std::vector<std::string> tocreate; std::vector<std::string> tocreate;
std::string basepath = path; std::string basepath = path;
while(!PathExists(basepath)) while(!PathExists(basepath))
{ {
tocreate.push_back(basepath); tocreate.push_back(basepath);
basepath = RemoveLastPathComponent(basepath); pos = basepath.rfind(DIR_DELIM_C);
if(basepath.empty()) if(pos == std::string::npos)
break; break;
basepath = basepath.substr(0,pos);
} }
for(int i=tocreate.size()-1;i>=0;i--) for(int i=tocreate.size()-1;i>=0;i--)
if(!CreateDir(tocreate[i])) if(!CreateDir(tocreate[i]))
@ -468,221 +431,5 @@ bool CreateAllDirs(std::string path)
return true; return true;
} }
bool CopyFileContents(std::string source, std::string target)
{
FILE *sourcefile = fopen(source.c_str(), "rb");
if(sourcefile == NULL){
errorstream<<source<<": can't open for reading: "
<<strerror(errno)<<std::endl;
return false;
}
FILE *targetfile = fopen(target.c_str(), "wb");
if(targetfile == NULL){
errorstream<<target<<": can't open for writing: "
<<strerror(errno)<<std::endl;
fclose(sourcefile);
return false;
}
size_t total = 0;
bool retval = true;
bool done = false;
char readbuffer[BUFSIZ];
while(!done){
size_t readbytes = fread(readbuffer, 1,
sizeof(readbuffer), sourcefile);
total += readbytes;
if(ferror(sourcefile)){
errorstream<<source<<": IO error: "
<<strerror(errno)<<std::endl;
retval = false;
done = true;
}
if(readbytes > 0){
fwrite(readbuffer, 1, readbytes, targetfile);
}
if(feof(sourcefile) || ferror(sourcefile)){
// flush destination file to catch write errors
// (e.g. disk full)
fflush(targetfile);
done = true;
}
if(ferror(targetfile)){
errorstream<<target<<": IO error: "
<<strerror(errno)<<std::endl;
retval = false;
done = true;
}
}
infostream<<"copied "<<total<<" bytes from "
<<source<<" to "<<target<<std::endl;
fclose(sourcefile);
fclose(targetfile);
return retval;
}
bool CopyDir(std::string source, std::string target)
{
if(PathExists(source)){
if(!PathExists(target)){
fs::CreateAllDirs(target);
}
bool retval = true;
std::vector<DirListNode> content = fs::GetDirListing(source);
for(unsigned int i=0; i < content.size(); i++){
std::string sourcechild = source + DIR_DELIM + content[i].name;
std::string targetchild = target + DIR_DELIM + content[i].name;
if(content[i].dir){
if(!fs::CopyDir(sourcechild, targetchild)){
retval = false;
}
}
else {
if(!fs::CopyFileContents(sourcechild, targetchild)){
retval = false;
}
}
}
return retval;
}
else {
return false;
}
}
bool PathStartsWith(std::string path, std::string prefix)
{
size_t pathsize = path.size();
size_t pathpos = 0;
size_t prefixsize = prefix.size();
size_t prefixpos = 0;
for(;;){
bool delim1 = pathpos == pathsize
|| IsDirDelimiter(path[pathpos]);
bool delim2 = prefixpos == prefixsize
|| IsDirDelimiter(prefix[prefixpos]);
if(delim1 != delim2)
return false;
if(delim1){
while(pathpos < pathsize &&
IsDirDelimiter(path[pathpos]))
++pathpos;
while(prefixpos < prefixsize &&
IsDirDelimiter(prefix[prefixpos]))
++prefixpos;
if(prefixpos == prefixsize)
return true;
if(pathpos == pathsize)
return false;
}
else{
size_t len = 0;
do{
char pathchar = path[pathpos+len];
char prefixchar = prefix[prefixpos+len];
if(FILESYS_CASE_INSENSITIVE){
pathchar = tolower(pathchar);
prefixchar = tolower(prefixchar);
}
if(pathchar != prefixchar)
return false;
++len;
} while(pathpos+len < pathsize
&& !IsDirDelimiter(path[pathpos+len])
&& prefixpos+len < prefixsize
&& !IsDirDelimiter(
prefix[prefixsize+len]));
pathpos += len;
prefixpos += len;
}
}
}
std::string RemoveLastPathComponent(std::string path,
std::string *removed, int count)
{
if(removed)
*removed = "";
size_t remaining = path.size();
for(int i = 0; i < count; ++i){
// strip a dir delimiter
while(remaining != 0 && IsDirDelimiter(path[remaining-1]))
remaining--;
// strip a path component
size_t component_end = remaining;
while(remaining != 0 && !IsDirDelimiter(path[remaining-1]))
remaining--;
size_t component_start = remaining;
// strip a dir delimiter
while(remaining != 0 && IsDirDelimiter(path[remaining-1]))
remaining--;
if(removed){
std::string component = path.substr(component_start,
component_end - component_start);
if(i)
*removed = component + DIR_DELIM + *removed;
else
*removed = component;
}
}
return path.substr(0, remaining);
}
std::string RemoveRelativePathComponents(std::string path)
{
size_t pos = path.size();
size_t dotdot_count = 0;
while(pos != 0){
size_t component_with_delim_end = pos;
// skip a dir delimiter
while(pos != 0 && IsDirDelimiter(path[pos-1]))
pos--;
// strip a path component
size_t component_end = pos;
while(pos != 0 && !IsDirDelimiter(path[pos-1]))
pos--;
size_t component_start = pos;
std::string component = path.substr(component_start,
component_end - component_start);
bool remove_this_component = false;
if(component == "."){
remove_this_component = true;
}
else if(component == ".."){
remove_this_component = true;
dotdot_count += 1;
}
else if(dotdot_count != 0){
remove_this_component = true;
dotdot_count -= 1;
}
if(remove_this_component){
while(pos != 0 && IsDirDelimiter(path[pos-1]))
pos--;
path = path.substr(0, pos) + DIR_DELIM +
path.substr(component_with_delim_end,
std::string::npos);
pos++;
}
}
if(dotdot_count > 0)
return "";
// remove trailing dir delimiters
pos = path.size();
while(pos != 0 && IsDirDelimiter(path[pos-1]))
pos--;
return path.substr(0, pos);
}
} // namespace fs } // namespace fs

View File

@ -26,10 +26,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#ifdef _WIN32 // WINDOWS #ifdef _WIN32 // WINDOWS
#define DIR_DELIM "\\" #define DIR_DELIM "\\"
#define FILESYS_CASE_INSENSITIVE 1 #define DIR_DELIM_C '\\'
#else // POSIX #else // POSIX
#define DIR_DELIM "/" #define DIR_DELIM "/"
#define FILESYS_CASE_INSENSITIVE 0 #define DIR_DELIM_C '/'
#endif #endif
namespace fs namespace fs
@ -49,17 +49,12 @@ bool PathExists(std::string path);
bool IsDir(std::string path); bool IsDir(std::string path);
bool IsDirDelimiter(char c);
// Only pass full paths to this one. True on success. // Only pass full paths to this one. True on success.
// NOTE: The WIN32 version returns always true. // NOTE: The WIN32 version returns always true.
bool RecursiveDelete(std::string path); bool RecursiveDelete(std::string path);
bool DeleteSingleFileOrEmptyDirectory(std::string path); bool DeleteSingleFileOrEmptyDirectory(std::string path);
// Returns path to temp directory, can return "" on error
std::string TempPath();
/* Multiplatform */ /* Multiplatform */
// The path itself not included // The path itself not included
@ -74,30 +69,6 @@ bool RecursiveDeleteContent(std::string path);
// Create all directories on the given path that don't already exist. // Create all directories on the given path that don't already exist.
bool CreateAllDirs(std::string path); bool CreateAllDirs(std::string path);
// Copy a regular file
bool CopyFileContents(std::string source, std::string target);
// Copy directory and all subdirectories
// Omits files and subdirectories that start with a period
bool CopyDir(std::string source, std::string target);
// Check if one path is prefix of another
// For example, "/tmp" is a prefix of "/tmp" and "/tmp/file" but not "/tmp2"
// Ignores case differences and '/' vs. '\\' on Windows
bool PathStartsWith(std::string path, std::string prefix);
// Remove last path component and the dir delimiter before and/or after it,
// returns "" if there is only one path component.
// removed: If non-NULL, receives the removed component(s).
// count: Number of components to remove
std::string RemoveLastPathComponent(std::string path,
std::string *removed = NULL, int count = 1);
// Remove "." and ".." path components and for every ".." removed, remove
// the last normal path component before it. Unlike AbsolutePath,
// this does not resolve symlinks and check for existence of directories.
std::string RemoveRelativePathComponents(std::string path);
}//fs }//fs
#endif #endif

View File

@ -208,6 +208,33 @@ public:
Client *m_client; Client *m_client;
}; };
class FormspecFormSource: public IFormSource
{
public:
FormspecFormSource(std::string formspec,FormspecFormSource** game_formspec)
{
m_formspec = formspec;
m_game_formspec = game_formspec;
}
~FormspecFormSource()
{
*m_game_formspec = 0;
}
void setForm(std::string formspec) {
m_formspec = formspec;
}
std::string getForm()
{
return m_formspec;
}
std::string m_formspec;
FormspecFormSource** m_game_formspec;
};
/* /*
Check if a node is pointable Check if a node is pointable
*/ */
@ -804,10 +831,6 @@ public:
u32 daynight_ratio = m_client->getEnv().getDayNightRatio(); u32 daynight_ratio = m_client->getEnv().getDayNightRatio();
float daynight_ratio_f = (float)daynight_ratio / 1000.0; float daynight_ratio_f = (float)daynight_ratio / 1000.0;
services->setPixelShaderConstant("dayNightRatio", &daynight_ratio_f, 1); services->setPixelShaderConstant("dayNightRatio", &daynight_ratio_f, 1);
// Normal map texture layer
int layer = 1;
services->setPixelShaderConstant("normalTexture" , (irr::f32*)&layer, 1);
} }
}; };
@ -1209,28 +1232,26 @@ void the_game(
} }
// Display status // Display status
std::ostringstream ss;
int progress=0; int progress=0;
if (!client.itemdefReceived()) if (!client.itemdefReceived())
{ {
wchar_t* text = wgettext("Item definitions..."); ss << "Item definitions...";
progress = 0; progress = 0;
draw_load_screen(text, device, font, dtime, progress);
delete[] text;
} }
else if (!client.nodedefReceived()) else if (!client.nodedefReceived())
{ {
wchar_t* text = wgettext("Node definitions..."); ss << "Node definitions...";
progress = 25; progress = 25;
draw_load_screen(text, device, font, dtime, progress);
delete[] text;
} }
else else
{ {
wchar_t* text = wgettext("Media..."); ss << "Media...";
progress = 50+client.mediaReceiveProgress()*50+0.5; progress = 50+client.mediaReceiveProgress()*50+0.5;
}
wchar_t* text = wgettext(ss.str().c_str());
draw_load_screen(text, device, font, dtime, progress); draw_load_screen(text, device, font, dtime, progress);
delete[] text; delete[] text;
}
// On some computers framerate doesn't seem to be // On some computers framerate doesn't seem to be
// automatically limited // automatically limited
@ -1322,7 +1343,7 @@ void the_game(
*/ */
int crack_animation_length = 5; int crack_animation_length = 5;
{ {
video::ITexture *t = tsrc->getTexture("crack_anylength.png"); video::ITexture *t = tsrc->getTextureRaw("crack_anylength.png");
v2u32 size = t->getOriginalSize(); v2u32 size = t->getOriginalSize();
crack_animation_length = size.Y / size.X; crack_animation_length = size.Y / size.X;
} }
@ -2289,7 +2310,7 @@ void the_game(
else if(event.type == CE_SPAWN_PARTICLE) else if(event.type == CE_SPAWN_PARTICLE)
{ {
LocalPlayer* player = client.getEnv().getLocalPlayer(); LocalPlayer* player = client.getEnv().getLocalPlayer();
video::ITexture *texture = AtlasPointer ap =
gamedef->tsrc()->getTexture(*(event.spawn_particle.texture)); gamedef->tsrc()->getTexture(*(event.spawn_particle.texture));
new Particle(gamedef, smgr, player, client.getEnv(), new Particle(gamedef, smgr, player, client.getEnv(),
@ -2298,15 +2319,12 @@ void the_game(
*event.spawn_particle.acc, *event.spawn_particle.acc,
event.spawn_particle.expirationtime, event.spawn_particle.expirationtime,
event.spawn_particle.size, event.spawn_particle.size,
event.spawn_particle.collisiondetection, event.spawn_particle.collisiondetection, ap);
texture,
v2f(0.0, 0.0),
v2f(1.0, 1.0));
} }
else if(event.type == CE_ADD_PARTICLESPAWNER) else if(event.type == CE_ADD_PARTICLESPAWNER)
{ {
LocalPlayer* player = client.getEnv().getLocalPlayer(); LocalPlayer* player = client.getEnv().getLocalPlayer();
video::ITexture *texture = AtlasPointer ap =
gamedef->tsrc()->getTexture(*(event.add_particlespawner.texture)); gamedef->tsrc()->getTexture(*(event.add_particlespawner.texture));
new ParticleSpawner(gamedef, smgr, player, new ParticleSpawner(gamedef, smgr, player,
@ -2323,7 +2341,7 @@ void the_game(
event.add_particlespawner.minsize, event.add_particlespawner.minsize,
event.add_particlespawner.maxsize, event.add_particlespawner.maxsize,
event.add_particlespawner.collisiondetection, event.add_particlespawner.collisiondetection,
texture, ap,
event.add_particlespawner.id); event.add_particlespawner.id);
} }
else if(event.type == CE_DELETE_PARTICLESPAWNER) else if(event.type == CE_DELETE_PARTICLESPAWNER)
@ -2613,6 +2631,20 @@ void the_game(
params = getDigParams(nodedef->get(n).groups, tp); params = getDigParams(nodedef->get(n).groups, tp);
} }
SimpleSoundSpec sound_dig = nodedef->get(n).sound_dig;
if(sound_dig.exists()){
if(sound_dig.name == "__group"){
if(params.main_group != ""){
soundmaker.m_player_leftpunch_sound.gain = 0.5;
soundmaker.m_player_leftpunch_sound.name =
std::string("default_dig_") +
params.main_group;
}
} else{
soundmaker.m_player_leftpunch_sound = sound_dig;
}
}
float dig_time_complete = 0.0; float dig_time_complete = 0.0;
if(params.diggable == false) if(params.diggable == false)
@ -2644,20 +2676,6 @@ void the_game(
dig_index = crack_animation_length; dig_index = crack_animation_length;
} }
SimpleSoundSpec sound_dig = nodedef->get(n).sound_dig;
if(sound_dig.exists() && params.diggable){
if(sound_dig.name == "__group"){
if(params.main_group != ""){
soundmaker.m_player_leftpunch_sound.gain = 0.5;
soundmaker.m_player_leftpunch_sound.name =
std::string("default_dig_") +
params.main_group;
}
} else{
soundmaker.m_player_leftpunch_sound = sound_dig;
}
}
// Don't show cracks if not diggable // Don't show cracks if not diggable
if(dig_time_complete >= 100000.0) if(dig_time_complete >= 100000.0)
{ {

693
src/guiConfigureWorld.cpp Normal file
View File

@ -0,0 +1,693 @@
/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program 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 program 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 program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <iostream>
#include <string>
#include <map>
#include "guiConfigureWorld.h"
#include "guiMessageMenu.h"
#include <IGUIButton.h>
#include <IGUICheckBox.h>
#include <IGUIListBox.h>
#include <IGUIStaticText.h>
#include <IGUITreeView.h>
#include "gettext.h"
#include "util/string.h"
#include "settings.h"
#include "filesys.h"
enum
{
GUI_ID_MOD_TREEVIEW = 101,
GUI_ID_ENABLED_CHECKBOX,
GUI_ID_ENABLEALL,
GUI_ID_DISABLEALL,
GUI_ID_DEPENDS_LISTBOX,
GUI_ID_RDEPENDS_LISTBOX,
GUI_ID_CANCEL,
GUI_ID_SAVE
};
#define QUESTIONMARK_STR L"?"
#define CHECKMARK_STR L"\411"
#define CROSS_STR L"\403"
GUIConfigureWorld::GUIConfigureWorld(gui::IGUIEnvironment* env,
gui::IGUIElement* parent, s32 id,
IMenuManager *menumgr, WorldSpec wspec):
GUIModalMenu(env, parent, id, menumgr),
m_wspec(wspec),
m_gspec(findWorldSubgame(m_wspec.path)),
m_menumgr(menumgr)
{
//will be initialized in regenerateGUI()
m_treeview=NULL;
// game mods
m_gamemods = flattenModTree(getModsInPath(m_gspec.gamemods_path));
// world mods
std::string worldmods_path = wspec.path + DIR_DELIM + "worldmods";
m_worldmods = flattenModTree(getModsInPath(worldmods_path));
// fill m_addontree with add-on mods
std::set<std::string> paths = m_gspec.addon_mods_paths;
for(std::set<std::string>::iterator it=paths.begin();
it != paths.end(); ++it)
{
std::map<std::string,ModSpec> mods = getModsInPath(*it);
m_addontree.insert(mods.begin(), mods.end());
}
// expand modpacks
m_addonmods = flattenModTree(m_addontree);
// collect reverse dependencies
for(std::map<std::string, ModSpec>::iterator it = m_addonmods.begin();
it != m_addonmods.end(); ++it)
{
std::string modname = (*it).first;
ModSpec mod = (*it).second;
for(std::set<std::string>::iterator dep_it = mod.depends.begin();
dep_it != mod.depends.end(); ++dep_it)
{
m_reverse_depends.insert(std::make_pair((*dep_it),modname));
}
}
m_settings.readConfigFile((m_wspec.path + DIR_DELIM + "world.mt").c_str());
std::vector<std::string> names = m_settings.getNames();
// mod_names contains the names of mods mentioned in the world.mt file
std::set<std::string> mod_names;
for(std::vector<std::string>::iterator it = names.begin();
it != names.end(); ++it)
{
std::string name = *it;
if (name.compare(0,9,"load_mod_")==0)
mod_names.insert(name.substr(9));
}
// find new mods (installed but not mentioned in world.mt)
for(std::map<std::string, ModSpec>::iterator it = m_addonmods.begin();
it != m_addonmods.end(); ++it)
{
std::string modname = (*it).first;
ModSpec mod = (*it).second;
// a mod is new if it is not a modpack, and does not occur in
// mod_names
if(!mod.is_modpack &&
mod_names.count(modname) == 0)
m_settings.setBool("load_mod_"+modname, false);
}
// find missing mods (mentioned in world.mt, but not installed)
for(std::set<std::string>::iterator it = mod_names.begin();
it != mod_names.end(); ++it)
{
std::string modname = *it;
if(m_addonmods.count(modname) == 0)
m_settings.remove("load_mod_"+modname);
}
std::string worldmtfile = m_wspec.path+DIR_DELIM+"world.mt";
m_settings.updateConfigFile(worldmtfile.c_str());
}
void GUIConfigureWorld::drawMenu()
{
gui::IGUISkin* skin = Environment->getSkin();
if (!skin)
return;
video::IVideoDriver* driver = Environment->getVideoDriver();
video::SColor bgcolor(140,0,0,0);
driver->draw2DRectangle(bgcolor, AbsoluteRect, &AbsoluteClippingRect);
gui::IGUIElement::draw();
}
void GUIConfigureWorld::regenerateGui(v2u32 screensize)
{
/*
Remove stuff
*/
removeChildren();
/*
Calculate new sizes and positions
*/
core::rect<s32> rect(
screensize.X/2 - 580/2,
screensize.Y/2 - 300/2,
screensize.X/2 + 580/2,
screensize.Y/2 + 300/2
);
DesiredRect = rect;
recalculateAbsolutePosition(false);
v2s32 topleft = v2s32(10, 10);
/*
Add stuff
*/
changeCtype("");
{
core::rect<s32> rect(0, 0, 200, 20);
rect += topleft;
//proper text is set below, when a mod is selected
m_modname_text = Environment->addStaticText(L"Mod: N/A", rect, false,
false, this, -1);
}
{
core::rect<s32> rect(0, 0, 200, 20);
rect += v2s32(0, 25) + topleft;
wchar_t* text = wgettext("enabled");
m_enabled_checkbox =
Environment->addCheckBox(false, rect, this, GUI_ID_ENABLED_CHECKBOX,
text);
delete[] text;
m_enabled_checkbox->setVisible(false);
}
{
core::rect<s32> rect(0, 0, 85, 30);
rect = rect + v2s32(0, 25) + topleft;
wchar_t* text = wgettext("Enable All");
m_enableall = Environment->addButton(rect, this, GUI_ID_ENABLEALL,
text);
delete[] text;
m_enableall->setVisible(false);
}
{
core::rect<s32> rect(0, 0, 85, 30);
rect = rect + v2s32(115, 25) + topleft;
wchar_t* text = wgettext("Disable All");
m_disableall = Environment->addButton(rect, this, GUI_ID_DISABLEALL, text );
delete[] text;
m_disableall->setVisible(false);
}
{
core::rect<s32> rect(0, 0, 200, 20);
rect += v2s32(0, 60) + topleft;
wchar_t* text = wgettext("depends on:");
Environment->addStaticText(text, rect, false, false, this, -1);
delete[] text;
}
{
core::rect<s32> rect(0, 0, 200, 85);
rect += v2s32(0, 80) + topleft;
m_dependencies_listbox =
Environment->addListBox(rect, this, GUI_ID_DEPENDS_LISTBOX, true);
}
{
core::rect<s32> rect(0, 0, 200, 20);
rect += v2s32(0, 175) + topleft;
wchar_t* text = wgettext("is required by:");
Environment->addStaticText( text, rect, false, false, this, -1);
delete[] text;
}
{
core::rect<s32> rect(0, 0, 200, 85);
rect += v2s32(0, 195) + topleft;
m_rdependencies_listbox =
Environment->addListBox(rect,this, GUI_ID_RDEPENDS_LISTBOX,true);
}
{
core::rect<s32> rect(0, 0, 340, 250);
rect += v2s32(220, 0) + topleft;
m_treeview = Environment->addTreeView(rect, this,
GUI_ID_MOD_TREEVIEW,true);
gui::IGUITreeViewNode* node
= m_treeview->getRoot()->addChildBack(L"Add-Ons");
buildTreeView(m_addontree, node);
}
{
core::rect<s32> rect(0, 0, 120, 30);
rect = rect + v2s32(330, 270) - topleft;
wchar_t* text = wgettext("Cancel");
Environment->addButton(rect, this, GUI_ID_CANCEL, text);
delete[] text;
}
{
core::rect<s32> rect(0, 0, 120, 30);
rect = rect + v2s32(460, 270) - topleft;
wchar_t* text = wgettext("Save");
Environment->addButton(rect, this, GUI_ID_SAVE, text);
delete[] text;
}
changeCtype("C");
// at start, none of the treeview nodes is selected, so we select
// the first element in the treeview of mods manually here.
if(m_treeview->getRoot()->hasChilds())
{
m_treeview->getRoot()->getFirstChild()->setExpanded(true);
m_treeview->getRoot()->getFirstChild()->setSelected(true);
// Because a manual ->setSelected() doesn't cause an event, we
// have to do this here:
adjustSidebar();
}
}
bool GUIConfigureWorld::OnEvent(const SEvent& event)
{
gui::IGUITreeViewNode* selected_node = NULL;
if(m_treeview != NULL)
selected_node = m_treeview->getSelected();
if(event.EventType==EET_KEY_INPUT_EVENT && event.KeyInput.PressedDown)
{
switch (event.KeyInput.Key) {
case KEY_ESCAPE: {
quitMenu();
return true;
}
// irrlicht's built-in TreeView gui has no keyboard control,
// so we do it here: up/down to select prev/next node,
// left/right to collapse/expand nodes, space to toggle
// enabled/disabled.
case KEY_DOWN: {
if(selected_node != NULL)
{
gui::IGUITreeViewNode* node = selected_node->getNextVisible();
if(node != NULL)
{
node->setSelected(true);
adjustSidebar();
}
}
return true;
}
case KEY_UP: {
if(selected_node != NULL)
{
gui::IGUITreeViewNode* node = selected_node->getPrevSibling();
if(node!=NULL)
{
node->setSelected(true);
adjustSidebar();
}
else
{
gui::IGUITreeViewNode* parent = selected_node->getParent();
if(selected_node == parent->getFirstChild() &&
parent != m_treeview->getRoot())
{
parent->setSelected(true);
adjustSidebar();
}
}
}
return true;
}
case KEY_RIGHT: {
if(selected_node != NULL && selected_node->hasChilds())
selected_node->setExpanded(true);
return true;
}
case KEY_LEFT: {
if(selected_node != NULL && selected_node->hasChilds())
selected_node->setExpanded(false);
return true;
}
case KEY_SPACE: {
if(selected_node != NULL && !selected_node->hasChilds() &&
selected_node->getText() != NULL)
{
std::string modname = wide_to_narrow(selected_node->getText());
bool checked = m_enabled_checkbox->isChecked();
m_enabled_checkbox->setChecked(!checked);
setEnabled(modname,!checked);
}
return true;
}
default: {}
}
}
if(event.EventType==EET_GUI_EVENT)
{
if(event.GUIEvent.EventType==gui::EGET_ELEMENT_FOCUS_LOST
&& isVisible())
{
if(!canTakeFocus(event.GUIEvent.Element))
{
dstream<<"GUIConfigureWorld: Not allowing focus change."
<<std::endl;
// Returning true disables focus change
return true;
}
}
if(event.GUIEvent.EventType==gui::EGET_BUTTON_CLICKED){
switch(event.GUIEvent.Caller->getID()){
case GUI_ID_CANCEL: {
quitMenu();
return true;
}
case GUI_ID_SAVE: {
std::string worldmtfile = m_wspec.path+DIR_DELIM+"world.mt";
m_settings.updateConfigFile(worldmtfile.c_str());
// The trailing spaces are because there seems to be a
// bug in the text-size calculation. if the trailing
// spaces are removed from the message text, the
// message gets wrapped and parts of it are cut off:
wchar_t* text = wgettext("Configuration saved. ");
GUIMessageMenu *menu =
new GUIMessageMenu(Environment, Parent, -1, m_menumgr,
text );
delete[] text;
menu->drop();
try
{
ModConfiguration modconf(m_wspec.path);
if(!modconf.isConsistent())
{
wchar_t* text = wgettext("Warning: Configuration not consistent. ");
GUIMessageMenu *menu =
new GUIMessageMenu(Environment, Parent, -1, m_menumgr,
text );
delete[] text;
menu->drop();
}
}
catch(ModError &err)
{
errorstream<<err.what()<<std::endl;
std::wstring text = narrow_to_wide(err.what()) + wgettext("\nCheck debug.txt for details.");
GUIMessageMenu *menu =
new GUIMessageMenu(Environment, Parent, -1, m_menumgr,
text );
menu->drop();
}
quitMenu();
return true;
}
case GUI_ID_ENABLEALL: {
if(selected_node != NULL && selected_node->getParent() == m_treeview->getRoot())
{
enableAllMods(m_addonmods,true);
}
else if(selected_node != NULL && selected_node->getText() != NULL)
{
std::string modname = wide_to_narrow(selected_node->getText());
std::map<std::string, ModSpec>::iterator mod_it = m_addonmods.find(modname);
if(mod_it != m_addonmods.end())
enableAllMods(mod_it->second.modpack_content,true);
}
return true;
}
case GUI_ID_DISABLEALL: {
if(selected_node != NULL && selected_node->getParent() == m_treeview->getRoot())
{
enableAllMods(m_addonmods,false);
}
if(selected_node != NULL && selected_node->getText() != NULL)
{
std::string modname = wide_to_narrow(selected_node->getText());
std::map<std::string, ModSpec>::iterator mod_it = m_addonmods.find(modname);
if(mod_it != m_addonmods.end())
enableAllMods(mod_it->second.modpack_content,false);
}
return true;
}
}
}
if(event.GUIEvent.EventType==gui::EGET_CHECKBOX_CHANGED &&
event.GUIEvent.Caller->getID() == GUI_ID_ENABLED_CHECKBOX)
{
if(selected_node != NULL && !selected_node->hasChilds() &&
selected_node->getText() != NULL)
{
std::string modname = wide_to_narrow(selected_node->getText());
setEnabled(modname, m_enabled_checkbox->isChecked());
}
return true;
}
if(event.GUIEvent.EventType==gui::EGET_TREEVIEW_NODE_SELECT &&
event.GUIEvent.Caller->getID() == GUI_ID_MOD_TREEVIEW)
{
selecting_dep = -1;
selecting_rdep = -1;
adjustSidebar();
return true;
}
if(event.GUIEvent.EventType==gui::EGET_LISTBOX_CHANGED &&
event.GUIEvent.Caller->getID() == GUI_ID_DEPENDS_LISTBOX)
{
selecting_dep = m_dependencies_listbox->getSelected();
selecting_rdep = -1;
return true;
}
if(event.GUIEvent.EventType==gui::EGET_LISTBOX_CHANGED &&
event.GUIEvent.Caller->getID() == GUI_ID_RDEPENDS_LISTBOX)
{
selecting_dep = -1;
selecting_rdep = m_rdependencies_listbox->getSelected();
return true;
}
//double click in a dependency listbox: find corresponding
//treeviewnode and select it:
if(event.GUIEvent.EventType==gui::EGET_LISTBOX_SELECTED_AGAIN)
{
gui::IGUIListBox* box = NULL;
if(event.GUIEvent.Caller->getID() == GUI_ID_DEPENDS_LISTBOX)
{
box = m_dependencies_listbox;
if(box->getSelected() != selecting_dep)
return true;
}
if(event.GUIEvent.Caller->getID() == GUI_ID_RDEPENDS_LISTBOX)
{
box = m_rdependencies_listbox;
if(box->getSelected() != selecting_rdep)
return true;
}
if(box != NULL && box->getSelected() != -1 &&
box->getListItem(box->getSelected()) != NULL)
{
std::string modname =
wide_to_narrow(box->getListItem(box->getSelected()));
std::map<std::string, gui::IGUITreeViewNode*>::iterator it =
m_nodes.find(modname);
if(it != m_nodes.end())
{
// select node and make sure node is visible by
// expanding all parents
gui::IGUITreeViewNode* node = (*it).second;
node->setSelected(true);
while(!node->isVisible() &&
node->getParent() != m_treeview->getRoot())
{
node = node->getParent();
node->setExpanded(true);
}
adjustSidebar();
}
}
return true;
}
}
return Parent ? Parent->OnEvent(event) : false;
}
void GUIConfigureWorld::buildTreeView(std::map<std::string, ModSpec> mods,
gui::IGUITreeViewNode* node)
{
for(std::map<std::string,ModSpec>::iterator it = mods.begin();
it != mods.end(); ++it)
{
std::string modname = (*it).first;
ModSpec mod = (*it).second;
gui::IGUITreeViewNode* new_node =
node->addChildBack(narrow_to_wide(modname).c_str());
m_nodes.insert(std::make_pair(modname, new_node));
if(mod.is_modpack)
buildTreeView(mod.modpack_content, new_node);
else
{
// set icon for node: x for disabled mods, checkmark for enabled mods
bool mod_enabled = false;
if(m_settings.exists("load_mod_"+modname))
mod_enabled = m_settings.getBool("load_mod_"+modname);
if(mod_enabled)
new_node->setIcon(CHECKMARK_STR);
else
new_node->setIcon(CROSS_STR);
}
}
}
void GUIConfigureWorld::adjustSidebar()
{
gui::IGUITreeViewNode* node = m_treeview->getSelected();
std::wstring modname_w;
if(node->getText() != NULL)
modname_w = node->getText();
else
modname_w = L"N/A";
std::string modname = wide_to_narrow(modname_w);
ModSpec mspec;
std::map<std::string, ModSpec>::iterator it = m_addonmods.find(modname);
if(it != m_addonmods.end())
mspec = it->second;
m_dependencies_listbox->clear();
m_rdependencies_listbox->clear();
// if no mods installed, there is nothing to enable/disable, so we
// don't show buttons or checkbox on the sidebar
if(node->getParent() == m_treeview->getRoot() && !node->hasChilds())
{
m_disableall->setVisible(false);
m_enableall->setVisible(false);
m_enabled_checkbox->setVisible(false);
return;
}
// a modpack is not enabled/disabled by itself, only its cotnents
// are. so we show show enable/disable all buttons, but hide the
// checkbox
if(node->getParent() == m_treeview->getRoot() ||
mspec.is_modpack)
{
m_enabled_checkbox->setVisible(false);
m_disableall->setVisible(true);
m_enableall->setVisible(true);
m_modname_text->setText((L"Modpack: "+modname_w).c_str());
return;
}
// for a normal mod, we hide the enable/disable all buttons, but show the checkbox.
m_disableall->setVisible(false);
m_enableall->setVisible(false);
m_enabled_checkbox->setVisible(true);
m_modname_text->setText((L"Mod: "+modname_w).c_str());
// the mod is enabled unless it is disabled in the world.mt settings.
bool mod_enabled = true;
if(m_settings.exists("load_mod_"+modname))
mod_enabled = m_settings.getBool("load_mod_"+modname);
m_enabled_checkbox->setChecked(mod_enabled);
for(std::set<std::string>::iterator it=mspec.depends.begin();
it != mspec.depends.end(); ++it)
{
// check if it is an add-on mod or a game/world mod. We only
// want to show add-ons
std::string dependency = (*it);
if(m_gamemods.count(dependency) > 0)
dependency += " (" + m_gspec.id + ")";
else if(m_worldmods.count(dependency) > 0)
dependency += " (" + m_wspec.name + ")";
else if(m_addonmods.count(dependency) == 0)
dependency += " (missing)";
m_dependencies_listbox->addItem(narrow_to_wide(dependency).c_str());
}
// reverse dependencies of this mod:
std::pair< std::multimap<std::string, std::string>::iterator,
std::multimap<std::string, std::string>::iterator > rdep =
m_reverse_depends.equal_range(modname);
for(std::multimap<std::string,std::string>::iterator it = rdep.first;
it != rdep.second; ++it)
{
// check if it is an add-on mod or a game/world mod. We only
// want to show add-ons
std::string rdependency = (*it).second;
if(m_addonmods.count(rdependency) > 0)
m_rdependencies_listbox->addItem(narrow_to_wide(rdependency).c_str());
}
}
void GUIConfigureWorld::enableAllMods(std::map<std::string, ModSpec> mods,bool enable)
{
for(std::map<std::string, ModSpec>::iterator it = mods.begin();
it != mods.end(); ++it)
{
ModSpec mod = (*it).second;
if(mod.is_modpack)
// a modpack, recursively enable all mods in it
enableAllMods(mod.modpack_content,enable);
else // not a modpack
setEnabled(mod.name, enable);
}
}
void GUIConfigureWorld::enableMod(std::string modname)
{
std::map<std::string, ModSpec>::iterator mod_it = m_addonmods.find(modname);
if(mod_it == m_addonmods.end()){
errorstream << "enableMod() called with invalid mod name \"" << modname << "\"" << std::endl;
return;
}
ModSpec mspec = mod_it->second;
m_settings.setBool("load_mod_"+modname,true);
std::map<std::string,gui::IGUITreeViewNode*>::iterator it =
m_nodes.find(modname);
if(it != m_nodes.end())
(*it).second->setIcon(CHECKMARK_STR);
//also enable all dependencies
for(std::set<std::string>::iterator it=mspec.depends.begin();
it != mspec.depends.end(); ++it)
{
std::string dependency = *it;
// only enable it if it is an add-on mod
if(m_addonmods.count(dependency) > 0)
enableMod(dependency);
}
}
void GUIConfigureWorld::disableMod(std::string modname)
{
std::map<std::string, ModSpec>::iterator mod_it = m_addonmods.find(modname);
if(mod_it == m_addonmods.end()){
errorstream << "disableMod() called with invalid mod name \"" << modname << "\"" << std::endl;
return;
}
m_settings.setBool("load_mod_"+modname,false);
std::map<std::string,gui::IGUITreeViewNode*>::iterator it =
m_nodes.find(modname);
if(it != m_nodes.end())
(*it).second->setIcon(CROSS_STR);
//also disable all mods that depend on this one
std::pair<std::multimap<std::string, std::string>::iterator,
std::multimap<std::string, std::string>::iterator > rdep =
m_reverse_depends.equal_range(modname);
for(std::multimap<std::string,std::string>::iterator it = rdep.first;
it != rdep.second; ++it)
{
std::string rdependency = (*it).second;
// only disable it if it is an add-on mod
if(m_addonmods.count(rdependency) > 0)
disableMod(rdependency);
}
}

107
src/guiConfigureWorld.h Normal file
View File

@ -0,0 +1,107 @@
/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program 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 program 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 program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef GUICONFIGUREWORLD_HEADER
#define GUICONFIGUREWORLD_HEADER
#include "irrlichttypes_extrabloated.h"
#include "modalMenu.h"
#include "mods.h"
#include "subgame.h"
#include "settings.h"
namespace irr{
namespace gui{
class IGUITreeViewNode;
}
}
class GUIConfigureWorld : public GUIModalMenu
{
public:
GUIConfigureWorld(gui::IGUIEnvironment* env,
gui::IGUIElement* parent, s32 id,
IMenuManager *menumgr, WorldSpec wspec);
void regenerateGui(v2u32 screensize);
void drawMenu();
bool OnEvent(const SEvent& event);
private:
WorldSpec m_wspec;
SubgameSpec m_gspec;
// tree of installed add-on mods. key is the mod name, modpacks
// are not expanded.
std::map<std::string, ModSpec> m_addontree;
// like m_addontree, but modpacks are expanded.
std::map<std::string, ModSpec> m_addonmods;
// list of game mods (flattened)
std::map<std::string, ModSpec> m_gamemods;
// list of world mods (flattened)
std::map<std::string, ModSpec> m_worldmods;
// for each mod, the set of mods depending on it
std::multimap<std::string, std::string> m_reverse_depends;
// the settings in the world.mt file
Settings m_settings;
// maps modnames to nodes in m_treeview
std::map<std::string,gui::IGUITreeViewNode*> m_nodes;
gui::IGUIStaticText* m_modname_text;
gui::IGUITreeView* m_treeview;
gui::IGUIButton* m_enableall;
gui::IGUIButton* m_disableall;
gui::IGUICheckBox* m_enabled_checkbox;
gui::IGUIListBox* m_dependencies_listbox;
gui::IGUIListBox* m_rdependencies_listbox;
void buildTreeView(std::map<std::string,ModSpec> mods,
gui::IGUITreeViewNode* node);
void adjustSidebar();
void enableAllMods(std::map<std::string,ModSpec> mods, bool enable);
void setEnabled(std::string modname, bool enable)
{
if(enable)
enableMod(modname);
else
disableMod(modname);
};
void enableMod(std::string modname);
void disableMod(std::string modname);
// hack to work around wonky handling of double-click in
// irrlicht. store selected index of listbox items here so event
// handling can check whether it was a real double click on the
// same item. (irrlicht also reports a double click if you rapidly
// select two different items.)
int selecting_dep;
int selecting_rdep;
IMenuManager* m_menumgr;
};
#endif

204
src/guiConfirmMenu.cpp Normal file
View File

@ -0,0 +1,204 @@
/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program 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 program 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 program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "guiConfirmMenu.h"
#include "debug.h"
#include "serialization.h"
#include <string>
#include <IGUICheckBox.h>
#include <IGUIEditBox.h>
#include <IGUIButton.h>
#include <IGUIStaticText.h>
#include <IGUIFont.h>
#include "gettext.h"
enum
{
GUI_ID_YES = 101,
GUI_ID_NO,
};
GUIConfirmMenu::GUIConfirmMenu(gui::IGUIEnvironment* env,
gui::IGUIElement* parent, s32 id,
IMenuManager *menumgr,
ConfirmDest *dest,
std::wstring message_text
):
GUIModalMenu(env, parent, id, menumgr),
m_dest(dest),
m_message_text(message_text)
{
}
GUIConfirmMenu::~GUIConfirmMenu()
{
removeChildren();
if(m_dest)
delete m_dest;
}
void GUIConfirmMenu::removeChildren()
{
const core::list<gui::IGUIElement*> &children = getChildren();
core::list<gui::IGUIElement*> children_copy;
for(core::list<gui::IGUIElement*>::ConstIterator
i = children.begin(); i != children.end(); i++)
{
children_copy.push_back(*i);
}
for(core::list<gui::IGUIElement*>::Iterator
i = children_copy.begin();
i != children_copy.end(); i++)
{
(*i)->remove();
}
}
void GUIConfirmMenu::regenerateGui(v2u32 screensize)
{
/*
Remove stuff
*/
removeChildren();
/*
Calculate new sizes and positions
*/
core::rect<s32> rect(
screensize.X/2 - 580/2,
screensize.Y/2 - 300/2,
screensize.X/2 + 580/2,
screensize.Y/2 + 300/2
);
DesiredRect = rect;
recalculateAbsolutePosition(false);
v2s32 size = rect.getSize();
gui::IGUISkin *skin = Environment->getSkin();
gui::IGUIFont *font = skin->getFont();
s32 msg_h = font->getDimension(m_message_text.c_str()).Height;
s32 msg_w = font->getDimension(m_message_text.c_str()).Width;
if(msg_h > 200)
msg_h = 200;
if(msg_w > 540)
msg_w = 540;
/*
Add stuff
*/
{
core::rect<s32> rect(0, 0, msg_w, msg_h);
rect += v2s32(size.X/2-msg_w/2, size.Y/2-30/2 - msg_h/2);
Environment->addStaticText(m_message_text.c_str(),
rect, false, true, this, -1);
}
changeCtype("");
int bw = 100;
{
core::rect<s32> rect(0, 0, bw, 30);
rect = rect + v2s32(size.X/2-bw/2-(bw/2+5), size.Y/2-30/2+5 + msg_h/2);
wchar_t* text = wgettext("Yes");
Environment->addButton(rect, this, GUI_ID_YES,
text);
delete[] text;
}
{
core::rect<s32> rect(0, 0, bw, 30);
rect = rect + v2s32(size.X/2-bw/2+(bw/2+5), size.Y/2-30/2+5 + msg_h/2);
wchar_t* text = wgettext("No");
Environment->addButton(rect, this, GUI_ID_NO,
text);
delete[] text;
}
changeCtype("C");
}
void GUIConfirmMenu::drawMenu()
{
gui::IGUISkin* skin = Environment->getSkin();
if (!skin)
return;
video::IVideoDriver* driver = Environment->getVideoDriver();
video::SColor bgcolor(140,0,0,0);
driver->draw2DRectangle(bgcolor, AbsoluteRect, &AbsoluteClippingRect);
gui::IGUIElement::draw();
}
void GUIConfirmMenu::acceptInput(bool answer)
{
if(m_dest)
m_dest->answer(answer);
}
bool GUIConfirmMenu::OnEvent(const SEvent& event)
{
if(event.EventType==EET_KEY_INPUT_EVENT)
{
if(event.KeyInput.Key==KEY_ESCAPE && event.KeyInput.PressedDown)
{
acceptInput(false);
quitMenu();
return true;
}
if(event.KeyInput.Key==KEY_RETURN && event.KeyInput.PressedDown)
{
acceptInput(true);
quitMenu();
return true;
}
}
if(event.EventType==EET_GUI_EVENT)
{
if(event.GUIEvent.EventType==gui::EGET_ELEMENT_FOCUS_LOST
&& isVisible())
{
if(!canTakeFocus(event.GUIEvent.Element))
{
dstream<<"GUIConfirmMenu: Not allowing focus change."
<<std::endl;
// Returning true disables focus change
return true;
}
}
if(event.GUIEvent.EventType==gui::EGET_BUTTON_CLICKED)
{
switch(event.GUIEvent.Caller->getID())
{
case GUI_ID_YES:
acceptInput(true);
quitMenu();
// quitMenu deallocates menu
return true;
case GUI_ID_NO:
acceptInput(false);
quitMenu();
// quitMenu deallocates menu
return true;
}
}
}
return Parent ? Parent->OnEvent(event) : false;
}

View File

@ -17,18 +17,40 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef __CONVERT_JSON_H__ #ifndef GUICONFIRMMENU_HEADER
#define __CONVERT_JSON_H__ #define GUICONFIRMMENU_HEADER
#include "json/json.h" #include "irrlichttypes_extrabloated.h"
#include "modalMenu.h"
#include <string>
struct ModStoreMod; struct ConfirmDest
struct ModStoreModDetails; {
virtual void answer(bool answer) = 0;
virtual ~ConfirmDest() {};
};
std::vector<ModStoreMod> readModStoreList(Json::Value& modlist); class GUIConfirmMenu : public GUIModalMenu
ModStoreModDetails readModStoreModDetails(Json::Value& details); {
public:
GUIConfirmMenu(gui::IGUIEnvironment* env,
gui::IGUIElement* parent, s32 id,
IMenuManager *menumgr,
ConfirmDest *dest,
std::wstring message_text);
~GUIConfirmMenu();
Json::Value fetchJsonValue(const std::string url, void removeChildren();
struct curl_slist *chunk); // Remove and re-add (or reposition) stuff
void regenerateGui(v2u32 screensize);
void drawMenu();
void acceptInput(bool answer);
bool OnEvent(const SEvent& event);
private:
ConfirmDest *m_dest;
std::wstring m_message_text;
};
#endif #endif

280
src/guiCreateWorld.cpp Normal file
View File

@ -0,0 +1,280 @@
/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program 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 program 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 program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "guiCreateWorld.h"
#include "debug.h"
#include "serialization.h"
#include <string>
#include <IGUICheckBox.h>
#include <IGUIEditBox.h>
#include <IGUIButton.h>
#include <IGUIStaticText.h>
#include <IGUIFont.h>
#include <IGUIListBox.h>
#include "gettext.h"
#include "util/string.h"
enum
{
GUI_ID_NAME_INPUT = 101,
GUI_ID_GAME_LISTBOX,
GUI_ID_CREATE,
GUI_ID_CANCEL
};
GUICreateWorld::GUICreateWorld(gui::IGUIEnvironment* env,
gui::IGUIElement* parent, s32 id,
IMenuManager *menumgr,
CreateWorldDest *dest,
const std::vector<SubgameSpec> &games,
const std::string &initial_game
):
GUIModalMenu(env, parent, id, menumgr),
m_dest(dest),
m_games(games),
m_initial_game_i(0)
{
assert(games.size() > 0);
for(size_t i=0; i<games.size(); i++){
if(games[i].id == initial_game){
m_initial_game_i = i;
break;
}
}
}
GUICreateWorld::~GUICreateWorld()
{
removeChildren();
if(m_dest)
delete m_dest;
}
void GUICreateWorld::removeChildren()
{
const core::list<gui::IGUIElement*> &children = getChildren();
core::list<gui::IGUIElement*> children_copy;
for(core::list<gui::IGUIElement*>::ConstIterator
i = children.begin(); i != children.end(); i++)
{
children_copy.push_back(*i);
}
for(core::list<gui::IGUIElement*>::Iterator
i = children_copy.begin();
i != children_copy.end(); i++)
{
(*i)->remove();
}
}
void GUICreateWorld::regenerateGui(v2u32 screensize)
{
std::wstring name = L"";
{
gui::IGUIElement *e = getElementFromId(GUI_ID_NAME_INPUT);
if(e != NULL)
name = e->getText();
}
/*
Remove stuff
*/
removeChildren();
/*
Calculate new sizes and positions
*/
core::rect<s32> rect(
screensize.X/2 - 580/2,
screensize.Y/2 - 300/2,
screensize.X/2 + 580/2,
screensize.Y/2 + 300/2
);
DesiredRect = rect;
recalculateAbsolutePosition(false);
v2s32 topleft = v2s32(10+80, 10+70);
/*
Add stuff
*/
{
core::rect<s32> rect(0, 0, 100, 20);
rect += v2s32(0, 5) + topleft;
wchar_t* text = wgettext("World name");
Environment->addStaticText(text, rect, false, true, this, -1);
delete[] text;
}
{
core::rect<s32> rect(0, 0, 300, 30);
rect = rect + v2s32(100, 0) + topleft;
gui::IGUIElement *e =
Environment->addEditBox(name.c_str(), rect, true, this, GUI_ID_NAME_INPUT);
Environment->setFocus(e);
irr::SEvent evt;
evt.EventType = EET_KEY_INPUT_EVENT;
evt.KeyInput.Key = KEY_END;
evt.KeyInput.PressedDown = true;
evt.KeyInput.Char = 0;
evt.KeyInput.Control = 0;
evt.KeyInput.Shift = 0;
e->OnEvent(evt);
}
{
core::rect<s32> rect(0, 0, 100, 20);
rect += v2s32(0, 40+5) + topleft;
wchar_t* text = wgettext("Game");
Environment->addStaticText(text, rect, false, true, this, -1);
delete[] text;
}
{
core::rect<s32> rect(0, 0, 300, 80);
rect += v2s32(100, 40) + topleft;
gui::IGUIListBox *e = Environment->addListBox(rect, this,
GUI_ID_GAME_LISTBOX);
e->setDrawBackground(true);
for(u32 i=0; i<m_games.size(); i++){
std::wostringstream os(std::ios::binary);
os<<narrow_to_wide(m_games[i].name).c_str();
os<<L" [";
os<<narrow_to_wide(m_games[i].id).c_str();
os<<L"]";
e->addItem(os.str().c_str());
}
e->setSelected(m_initial_game_i);
}
changeCtype("");
{
core::rect<s32> rect(0, 0, 120, 30);
rect = rect + v2s32(170, 140) + topleft;
wchar_t* text = wgettext("Create");
Environment->addButton(rect, this, GUI_ID_CREATE,
text);
delete[] text;
}
{
core::rect<s32> rect(0, 0, 120, 30);
rect = rect + v2s32(300, 140) + topleft;
wchar_t* text = wgettext("Cancel");
Environment->addButton(rect, this, GUI_ID_CANCEL,
text);
delete [] text;
}
changeCtype("C");
}
void GUICreateWorld::drawMenu()
{
gui::IGUISkin* skin = Environment->getSkin();
if (!skin)
return;
video::IVideoDriver* driver = Environment->getVideoDriver();
video::SColor bgcolor(140,0,0,0);
driver->draw2DRectangle(bgcolor, AbsoluteRect, &AbsoluteClippingRect);
gui::IGUIElement::draw();
}
void GUICreateWorld::acceptInput()
{
if(m_dest)
{
int selected = -1;
{
gui::IGUIElement *e = getElementFromId(GUI_ID_GAME_LISTBOX);
if(e != NULL && e->getType() == gui::EGUIET_LIST_BOX)
selected = ((gui::IGUIListBox*)e)->getSelected();
}
std::wstring name;
{
gui::IGUIElement *e = getElementFromId(GUI_ID_NAME_INPUT);
if(e != NULL)
name = e->getText();
}
if(selected != -1 && name != L"")
m_dest->accepted(name, m_games[selected].id);
delete m_dest;
m_dest = NULL;
}
}
bool GUICreateWorld::OnEvent(const SEvent& event)
{
if(event.EventType==EET_KEY_INPUT_EVENT)
{
if(event.KeyInput.Key==KEY_ESCAPE && event.KeyInput.PressedDown)
{
quitMenu();
return true;
}
if(event.KeyInput.Key==KEY_RETURN && event.KeyInput.PressedDown)
{
acceptInput();
quitMenu();
return true;
}
}
if(event.EventType==EET_GUI_EVENT)
{
if(event.GUIEvent.EventType==gui::EGET_ELEMENT_FOCUS_LOST
&& isVisible())
{
if(!canTakeFocus(event.GUIEvent.Element))
{
dstream<<"GUICreateWorld: Not allowing focus change."
<<std::endl;
// Returning true disables focus change
return true;
}
}
bool accept_input = false;
if(event.GUIEvent.EventType==gui::EGET_BUTTON_CLICKED){
switch(event.GUIEvent.Caller->getID()){
case GUI_ID_CANCEL:
quitMenu();
return true;
break;
case GUI_ID_CREATE:
accept_input = true;
break;
}
}
if(event.GUIEvent.EventType==gui::EGET_EDITBOX_ENTER){
switch(event.GUIEvent.Caller->getID()){
case GUI_ID_NAME_INPUT:
accept_input = true;
break;
}
}
if(accept_input){
acceptInput();
quitMenu();
// quitMenu deallocates menu
return true;
}
}
return Parent ? Parent->OnEvent(event) : false;
}

64
src/guiCreateWorld.h Normal file
View File

@ -0,0 +1,64 @@
/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program 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 program 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 program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef GUICREATEWORLD_HEADER
#define GUICREATEWORLD_HEADER
#include "irrlichttypes_extrabloated.h"
#include "modalMenu.h"
#include <string>
#include "subgame.h"
struct CreateWorldDest
{
virtual void accepted(std::wstring name, std::string gameid) = 0;
virtual ~CreateWorldDest() {};
};
class GUICreateWorld : public GUIModalMenu
{
public:
GUICreateWorld(gui::IGUIEnvironment* env,
gui::IGUIElement* parent, s32 id,
IMenuManager *menumgr,
CreateWorldDest *dest,
const std::vector<SubgameSpec> &games,
const std::string &initial_game);
~GUICreateWorld();
void removeChildren();
/*
Remove and re-add (or reposition) stuff
*/
void regenerateGui(v2u32 screensize);
void drawMenu();
void acceptInput();
bool OnEvent(const SEvent& event);
private:
CreateWorldDest *m_dest;
std::vector<SubgameSpec> m_games;
int m_initial_game_i;
};
#endif

View File

@ -1,573 +0,0 @@
/*
Minetest
Copyright (C) 2013 sapier
This program 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 program 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 program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
extern "C" {
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
}
#include "irrlicht.h"
#include "porting.h"
#include "filesys.h"
#include "main.h"
#include "settings.h"
#include "guiMainMenu.h"
#include "guiEngine.h"
#if USE_CURL
#include <curl/curl.h>
#endif
/******************************************************************************/
int menuscript_ErrorHandler(lua_State *L) {
lua_getfield(L, LUA_GLOBALSINDEX, "debug");
if (!lua_istable(L, -1)) {
lua_pop(L, 1);
return 1;
}
lua_getfield(L, -1, "traceback");
if (!lua_isfunction(L, -1)) {
lua_pop(L, 2);
return 1;
}
lua_pushvalue(L, 1);
lua_pushinteger(L, 2);
lua_call(L, 2, 1);
return 1;
}
/******************************************************************************/
TextDestGuiEngine::TextDestGuiEngine(GUIEngine* engine)
{
m_engine = engine;
}
/******************************************************************************/
void TextDestGuiEngine::gotText(std::map<std::string, std::string> fields)
{
m_engine->handleButtons(fields);
}
/******************************************************************************/
void TextDestGuiEngine::gotText(std::wstring text)
{
m_engine->handleEvent(wide_to_narrow(text));
}
/******************************************************************************/
GUIEngine::GUIEngine( irr::IrrlichtDevice* dev,
gui::IGUIElement* parent,
IMenuManager *menumgr,
scene::ISceneManager* smgr,
MainMenuData* data) :
m_device(dev),
m_parent(parent),
m_menumanager(menumgr),
m_smgr(smgr),
m_data(data),
m_formspecgui(0),
m_buttonhandler(0),
m_menu(0),
m_startgame(false),
m_engineluastack(0),
m_luaerrorhandler(-1),
m_scriptdir(""),
m_irr_toplefttext(0),
m_clouds_enabled(true),
m_cloud()
{
//initialize texture pointers
for (unsigned int i = 0; i < TEX_LAYER_MAX; i++) {
m_textures[i] = 0;
}
// is deleted by guiformspec!
m_buttonhandler = new TextDestGuiEngine(this);
//create luastack
m_engineluastack = luaL_newstate();
//load basic lua modules
luaL_openlibs(m_engineluastack);
//init
guiLuaApi::initialize(m_engineluastack,this);
//push errorstring
if (m_data->errormessage != "")
{
lua_getglobal(m_engineluastack, "gamedata");
int gamedata_idx = lua_gettop(m_engineluastack);
lua_pushstring(m_engineluastack, "errormessage");
lua_pushstring(m_engineluastack,m_data->errormessage.c_str());
lua_settable(m_engineluastack, gamedata_idx);
m_data->errormessage = "";
}
//create topleft header
core::rect<s32> rect(0, 0, 500, 40);
rect += v2s32(4, 0);
std::string t = "Minetest " VERSION_STRING;
m_irr_toplefttext =
m_device->getGUIEnvironment()->addStaticText(narrow_to_wide(t).c_str(),
rect,false,true,0,-1);
//create formspecsource
m_formspecgui = new FormspecFormSource("",&m_formspecgui);
/* Create menu */
m_menu =
new GUIFormSpecMenu( m_device,
m_parent,
-1,
m_menumanager,
0 /* &client */,
0 /* gamedef */);
m_menu->allowClose(false);
m_menu->lockSize(true,v2u32(800,600));
m_menu->setFormSource(m_formspecgui);
m_menu->setTextDest(m_buttonhandler);
m_menu->useGettext(true);
std::string builtin_helpers
= porting::path_share + DIR_DELIM + "builtin"
+ DIR_DELIM + "mainmenu_helper.lua";
if (!runScript(builtin_helpers)) {
errorstream
<< "GUIEngine::GUIEngine unable to load builtin helper script"
<< std::endl;
return;
}
std::string menuscript = "";
if (g_settings->exists("main_menu_script"))
menuscript = g_settings->get("main_menu_script");
std::string builtin_menuscript =
porting::path_share + DIR_DELIM + "builtin"
+ DIR_DELIM + "mainmenu.lua";
lua_pushcfunction(m_engineluastack, menuscript_ErrorHandler);
m_luaerrorhandler = lua_gettop(m_engineluastack);
m_scriptdir = menuscript.substr(0,menuscript.find_last_of(DIR_DELIM)-1);
if((menuscript == "") || (!runScript(menuscript))) {
infostream
<< "GUIEngine::GUIEngine execution of custom menu failed!"
<< std::endl
<< "\tfalling back to builtin menu"
<< std::endl;
m_scriptdir = fs::RemoveRelativePathComponents(porting::path_share + DIR_DELIM + "builtin"+ DIR_DELIM);
if(!runScript(builtin_menuscript)) {
errorstream
<< "GUIEngine::GUIEngine unable to load builtin menu"
<< std::endl;
assert("no future without mainmenu" == 0);
}
}
run();
m_menumanager->deletingMenu(m_menu);
m_menu->drop();
m_menu = 0;
}
/******************************************************************************/
bool GUIEngine::runScript(std::string script) {
int ret = luaL_loadfile(m_engineluastack, script.c_str()) ||
lua_pcall(m_engineluastack, 0, 0, m_luaerrorhandler);
if(ret){
errorstream<<"========== ERROR FROM LUA WHILE CREATING MAIN MENU ==========="<<std::endl;
errorstream<<"Failed to load and run script from "<<std::endl;
errorstream<<script<<":"<<std::endl;
errorstream<<std::endl;
errorstream<<lua_tostring(m_engineluastack, -1)<<std::endl;
errorstream<<std::endl;
errorstream<<"=================== END OF ERROR FROM LUA ===================="<<std::endl;
lua_pop(m_engineluastack, 1); // Pop error message from stack
lua_pop(m_engineluastack, 1); // Pop the error handler from stack
return false;
}
return true;
}
/******************************************************************************/
void GUIEngine::run()
{
// Always create clouds because they may or may not be
// needed based on the game selected
video::IVideoDriver* driver = m_device->getVideoDriver();
cloudInit();
while(m_device->run() && (!m_startgame)) {
driver->beginScene(true, true, video::SColor(255,140,186,250));
if (m_clouds_enabled)
{
cloudPreProcess();
drawOverlay(driver);
}
else
drawBackground(driver);
drawHeader(driver);
drawFooter(driver);
m_device->getGUIEnvironment()->drawAll();
driver->endScene();
if (m_clouds_enabled)
cloudPostProcess();
else
sleep_ms(25);
}
m_menu->quitMenu();
}
/******************************************************************************/
void GUIEngine::handleEvent(std::string text)
{
lua_getglobal(m_engineluastack, "engine");
lua_getfield(m_engineluastack, -1, "event_handler");
if(lua_isnil(m_engineluastack, -1))
return;
luaL_checktype(m_engineluastack, -1, LUA_TFUNCTION);
lua_pushstring(m_engineluastack, text.c_str());
if(lua_pcall(m_engineluastack, 1, 0, m_luaerrorhandler))
scriptError("error: %s", lua_tostring(m_engineluastack, -1));
}
/******************************************************************************/
void GUIEngine::handleButtons(std::map<std::string, std::string> fields)
{
lua_getglobal(m_engineluastack, "engine");
lua_getfield(m_engineluastack, -1, "button_handler");
if(lua_isnil(m_engineluastack, -1))
return;
luaL_checktype(m_engineluastack, -1, LUA_TFUNCTION);
lua_newtable(m_engineluastack);
for(std::map<std::string, std::string>::const_iterator
i = fields.begin(); i != fields.end(); i++){
const std::string &name = i->first;
const std::string &value = i->second;
lua_pushstring(m_engineluastack, name.c_str());
lua_pushlstring(m_engineluastack, value.c_str(), value.size());
lua_settable(m_engineluastack, -3);
}
if(lua_pcall(m_engineluastack, 1, 0, m_luaerrorhandler))
scriptError("error: %s", lua_tostring(m_engineluastack, -1));
}
/******************************************************************************/
GUIEngine::~GUIEngine()
{
video::IVideoDriver* driver = m_device->getVideoDriver();
assert(driver != 0);
//TODO: clean up m_menu here
lua_close(m_engineluastack);
m_irr_toplefttext->setText(L"");
//initialize texture pointers
for (unsigned int i = 0; i < TEX_LAYER_MAX; i++) {
if (m_textures[i] != 0)
driver->removeTexture(m_textures[i]);
}
if (m_cloud.clouds)
m_cloud.clouds->drop();
}
/******************************************************************************/
void GUIEngine::cloudInit()
{
m_cloud.clouds = new Clouds(m_smgr->getRootSceneNode(),
m_smgr, -1, rand(), 100);
m_cloud.clouds->update(v2f(0, 0), video::SColor(255,200,200,255));
m_cloud.camera = m_smgr->addCameraSceneNode(0,
v3f(0,0,0), v3f(0, 60, 100));
m_cloud.camera->setFarValue(10000);
m_cloud.lasttime = m_device->getTimer()->getTime();
}
/******************************************************************************/
void GUIEngine::cloudPreProcess()
{
u32 time = m_device->getTimer()->getTime();
if(time > m_cloud.lasttime)
m_cloud.dtime = (time - m_cloud.lasttime) / 1000.0;
else
m_cloud.dtime = 0;
m_cloud.lasttime = time;
m_cloud.clouds->step(m_cloud.dtime*3);
m_cloud.clouds->render();
m_smgr->drawAll();
}
/******************************************************************************/
void GUIEngine::cloudPostProcess()
{
float fps_max = g_settings->getFloat("fps_max");
// Time of frame without fps limit
float busytime;
u32 busytime_u32;
// not using getRealTime is necessary for wine
u32 time = m_device->getTimer()->getTime();
if(time > m_cloud.lasttime)
busytime_u32 = time - m_cloud.lasttime;
else
busytime_u32 = 0;
busytime = busytime_u32 / 1000.0;
// FPS limiter
u32 frametime_min = 1000./fps_max;
if(busytime_u32 < frametime_min) {
u32 sleeptime = frametime_min - busytime_u32;
m_device->sleep(sleeptime);
}
}
/******************************************************************************/
void GUIEngine::drawBackground(video::IVideoDriver* driver)
{
v2u32 screensize = driver->getScreenSize();
video::ITexture* texture = m_textures[TEX_LAYER_BACKGROUND];
/* If no texture, draw background of solid color */
if(!texture){
video::SColor color(255,80,58,37);
core::rect<s32> rect(0, 0, screensize.X, screensize.Y);
driver->draw2DRectangle(color, rect, NULL);
return;
}
/* Draw background texture */
v2u32 sourcesize = texture->getSize();
driver->draw2DImage(texture,
core::rect<s32>(0, 0, screensize.X, screensize.Y),
core::rect<s32>(0, 0, sourcesize.X, sourcesize.Y),
NULL, NULL, true);
}
/******************************************************************************/
void GUIEngine::drawOverlay(video::IVideoDriver* driver)
{
v2u32 screensize = driver->getScreenSize();
video::ITexture* texture = m_textures[TEX_LAYER_OVERLAY];
/* If no texture, draw background of solid color */
if(!texture)
return;
/* Draw background texture */
v2u32 sourcesize = texture->getSize();
driver->draw2DImage(texture,
core::rect<s32>(0, 0, screensize.X, screensize.Y),
core::rect<s32>(0, 0, sourcesize.X, sourcesize.Y),
NULL, NULL, true);
}
/******************************************************************************/
void GUIEngine::drawHeader(video::IVideoDriver* driver)
{
core::dimension2d<u32> screensize = driver->getScreenSize();
video::ITexture* texture = m_textures[TEX_LAYER_HEADER];
/* If no texture, draw nothing */
if(!texture)
return;
f32 mult = (((f32)screensize.Width / 2)) /
((f32)texture->getOriginalSize().Width);
v2s32 splashsize(((f32)texture->getOriginalSize().Width) * mult,
((f32)texture->getOriginalSize().Height) * mult);
// Don't draw the header is there isn't enough room
s32 free_space = (((s32)screensize.Height)-320)/2;
if (free_space > splashsize.Y) {
core::rect<s32> splashrect(0, 0, splashsize.X, splashsize.Y);
splashrect += v2s32((screensize.Width/2)-(splashsize.X/2),
((free_space/2)-splashsize.Y/2)+10);
video::SColor bgcolor(255,50,50,50);
driver->draw2DImage(texture, splashrect,
core::rect<s32>(core::position2d<s32>(0,0),
core::dimension2di(texture->getSize())),
NULL, NULL, true);
}
}
/******************************************************************************/
void GUIEngine::drawFooter(video::IVideoDriver* driver)
{
core::dimension2d<u32> screensize = driver->getScreenSize();
video::ITexture* texture = m_textures[TEX_LAYER_FOOTER];
/* If no texture, draw nothing */
if(!texture)
return;
f32 mult = (((f32)screensize.Width)) /
((f32)texture->getOriginalSize().Width);
v2s32 footersize(((f32)texture->getOriginalSize().Width) * mult,
((f32)texture->getOriginalSize().Height) * mult);
// Don't draw the footer if there isn't enough room
s32 free_space = (((s32)screensize.Height)-320)/2;
if (free_space > footersize.Y) {
core::rect<s32> rect(0,0,footersize.X,footersize.Y);
rect += v2s32(screensize.Width/2,screensize.Height-footersize.Y);
rect -= v2s32(footersize.X/2, 0);
driver->draw2DImage(texture, rect,
core::rect<s32>(core::position2d<s32>(0,0),
core::dimension2di(texture->getSize())),
NULL, NULL, true);
}
}
/******************************************************************************/
bool GUIEngine::setTexture(texture_layer layer,std::string texturepath) {
video::IVideoDriver* driver = m_device->getVideoDriver();
assert(driver != 0);
if (m_textures[layer] != 0)
{
driver->removeTexture(m_textures[layer]);
m_textures[layer] = 0;
}
if ((texturepath == "") || !fs::PathExists(texturepath))
return false;
m_textures[layer] = driver->getTexture(texturepath.c_str());
if (m_textures[layer] == 0) return false;
return true;
}
/******************************************************************************/
#if USE_CURL
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp)
{
FILE* targetfile = (FILE*) userp;
fwrite(contents,size,nmemb,targetfile);
return size * nmemb;
}
#endif
bool GUIEngine::downloadFile(std::string url,std::string target) {
#if USE_CURL
//download file via curl
CURL *curl;
curl = curl_easy_init();
if (curl)
{
CURLcode res;
bool retval = true;
FILE* targetfile = fopen(target.c_str(),"wb");
if (targetfile) {
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, targetfile);
res = curl_easy_perform(curl);
if (res != CURLE_OK) {
errorstream << "File at url \"" << url
<<"\" not found (" << curl_easy_strerror(res) << ")" <<std::endl;
retval = false;
}
fclose(targetfile);
}
else {
retval = false;
}
curl_easy_cleanup(curl);
return retval;
}
#endif
return false;
}
/******************************************************************************/
void GUIEngine::scriptError(const char *fmt, ...)
{
va_list argp;
va_start(argp, fmt);
char buf[10000];
vsnprintf(buf, 10000, fmt, argp);
va_end(argp);
errorstream<<"MAINMENU ERROR: "<<buf;
}
/******************************************************************************/
void GUIEngine::setTopleftText(std::string append) {
std::string toset = "Minetest " VERSION_STRING;
if (append != "") {
toset += " / ";
toset += append;
}
m_irr_toplefttext->setText(narrow_to_wide(toset).c_str());
}

View File

@ -1,260 +0,0 @@
/*
Minetest
Copyright (C) 2013 sapier
This program 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 program 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 program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef GUI_ENGINE_H_
#define GUI_ENGINE_H_
/******************************************************************************/
/* Includes */
/******************************************************************************/
#include "irrlichttypes.h"
#include "modalMenu.h"
#include "clouds.h"
#include "guiLuaApi.h"
#include "guiFormSpecMenu.h"
/******************************************************************************/
/* Typedefs and macros */
/******************************************************************************/
#define MAX_MENUBAR_BTN_COUNT 10
#define MAX_MENUBAR_BTN_ID 256
#define MIN_MENUBAR_BTN_ID (MAX_MENUBAR_BTN_ID - MAX_MENUBAR_BTN_COUNT)
/** texture layer ids */
typedef enum {
TEX_LAYER_BACKGROUND = 0,
TEX_LAYER_OVERLAY,
TEX_LAYER_HEADER,
TEX_LAYER_FOOTER,
TEX_LAYER_MAX
} texture_layer;
/******************************************************************************/
/* forward declarations */
/******************************************************************************/
class GUIEngine;
struct MainMenuData;
/******************************************************************************/
/* declarations */
/******************************************************************************/
/** GUIEngine specific implementation of TextDest used within guiFormSpecMenu */
class TextDestGuiEngine : public TextDest
{
public:
/**
* default constructor
* @param engine the engine data is transmitted for further processing
*/
TextDestGuiEngine(GUIEngine* engine);
/**
* receive fields transmitted by guiFormSpecMenu
* @param fields map containing formspec field elements currently active
*/
void gotText(std::map<std::string, std::string> fields);
/**
* receive text/events transmitted by guiFormSpecMenu
* @param text textual representation of event
*/
void gotText(std::wstring text);
private:
/** target to transmit data to */
GUIEngine* m_engine;
};
/** implementation of main menu based uppon formspecs */
class GUIEngine {
public:
/** TextDestGuiEngine needs to transfer data to engine */
friend class TextDestGuiEngine;
/** guiLuaApi is used to initialize contained stack */
friend class guiLuaApi;
/**
* default constructor
* @param dev device to draw at
* @param parent parent gui element
* @param menumgr manager to add menus to
* @param smgr scene manager to add scene elements to
* @param data struct to transfer data to main game handling
*/
GUIEngine( irr::IrrlichtDevice* dev,
gui::IGUIElement* parent,
IMenuManager *menumgr,
scene::ISceneManager* smgr,
MainMenuData* data);
/** default destructor */
virtual ~GUIEngine();
protected:
/**
* process field data recieved from formspec
* @param fields data in field format
*/
void handleButtons(std::map<std::string, std::string> fields);
/**
* process events received from formspec
* @param text events in textual form
*/
void handleEvent(std::string text);
/**
* return dir of current menuscript
*/
std::string getScriptDir() {
return m_scriptdir;
}
private:
/* run main menu loop */
void run();
/** handler to limit frame rate within main menu */
void limitFrameRate();
/** device to draw at */
irr::IrrlichtDevice* m_device;
/** parent gui element */
gui::IGUIElement* m_parent;
/** manager to add menus to */
IMenuManager* m_menumanager;
/** scene manager to add scene elements to */
scene::ISceneManager* m_smgr;
/** pointer to data beeing transfered back to main game handling */
MainMenuData* m_data;
/** representation of form source to be used in mainmenu formspec */
FormspecFormSource* m_formspecgui;
/** formspec input receiver */
TextDestGuiEngine* m_buttonhandler;
/** the formspec menu */
GUIFormSpecMenu* m_menu;
/** variable used to abort menu and return back to main game handling */
bool m_startgame;
/**
* initialize lua stack
* @param L stack to initialize
*/
void initalize_api(lua_State * L);
/**
* run a lua script
* @param script full path to script to run
*/
bool runScript(std::string script);
/**
* script error handler to process errors within lua
*/
void scriptError(const char *fmt, ...);
/** lua stack */
lua_State* m_engineluastack;
/** lua internal stack number of error handler*/
int m_luaerrorhandler;
/** script basefolder */
std::string m_scriptdir;
/**
* draw background layer
* @param driver to use for drawing
*/
void drawBackground(video::IVideoDriver* driver);
/**
* draw overlay layer
* @param driver to use for drawing
*/
void drawOverlay(video::IVideoDriver* driver);
/**
* draw header layer
* @param driver to use for drawing
*/
void drawHeader(video::IVideoDriver* driver);
/**
* draw footer layer
* @param driver to use for drawing
*/
void drawFooter(video::IVideoDriver* driver);
/**
* load a texture for a specified layer
* @param layer draw layer to specify texture
* @param texturepath full path of texture to load
*/
bool setTexture(texture_layer layer,std::string texturepath);
/**
* download a file using curl
* @param url url to download
* @param target file to store to
*/
bool downloadFile(std::string url,std::string target);
/** array containing pointers to current specified texture layers */
video::ITexture* m_textures[TEX_LAYER_MAX];
/** draw version string in topleft corner */
void drawVersion();
/**
* specify text to be appended to version string
* @param text to set
*/
void setTopleftText(std::string append);
/** pointer to gui element shown at topleft corner */
irr::gui::IGUIStaticText* m_irr_toplefttext;
/** initialize cloud subsystem */
void cloudInit();
/** do preprocessing for cloud subsystem */
void cloudPreProcess();
/** do postprocessing for cloud subsystem */
void cloudPostProcess();
/** internam data required for drawing clouds */
struct clouddata {
/** delta time since last cloud processing */
f32 dtime;
/** absolute time of last cloud processing */
u32 lasttime;
/** pointer to cloud class */
Clouds* clouds;
/** camera required for drawing clouds */
scene::ICameraSceneNode* camera;
};
/** is drawing of clouds enabled atm */
bool m_clouds_enabled;
/** data used to draw clouds */
clouddata m_cloud;
};
#endif /* GUI_ENGINE_H_ */

View File

@ -1,133 +0,0 @@
/*
Minetest
Copyright (C) 2013 sapier
This program 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 program 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 program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "guiFileSelectMenu.h"
#include "util/string.h"
#include <locale.h>
GUIFileSelectMenu::GUIFileSelectMenu(gui::IGUIEnvironment* env,
gui::IGUIElement* parent, s32 id, IMenuManager *menumgr,
std::string title, std::string formname) :
GUIModalMenu(env, parent, id, menumgr)
{
m_title = narrow_to_wide(title);
m_parent = parent;
m_formname = formname;
m_text_dst = 0;
m_accepted = false;
m_previous_locale = setlocale(LC_ALL,0);
}
GUIFileSelectMenu::~GUIFileSelectMenu()
{
removeChildren();
setlocale(LC_ALL,m_previous_locale.c_str());
}
void GUIFileSelectMenu::removeChildren()
{
const core::list<gui::IGUIElement*> &children = getChildren();
core::list<gui::IGUIElement*> children_copy;
for (core::list<gui::IGUIElement*>::ConstIterator i = children.begin(); i
!= children.end(); i++)
{
children_copy.push_back(*i);
}
for (core::list<gui::IGUIElement*>::Iterator i = children_copy.begin(); i
!= children_copy.end(); i++)
{
(*i)->remove();
}
}
void GUIFileSelectMenu::regenerateGui(v2u32 screensize)
{
removeChildren();
m_fileOpenDialog = 0;
core::dimension2du size(600,400);
core::rect < s32 > rect(0,0,screensize.X,screensize.Y);
DesiredRect = rect;
recalculateAbsolutePosition(false);
m_fileOpenDialog =
Environment->addFileOpenDialog(m_title.c_str(),false,this,-1);
core::position2di pos = core::position2di(screensize.X/2 - size.Width/2,screensize.Y/2 -size.Height/2);
m_fileOpenDialog->setRelativePosition(pos);
m_fileOpenDialog->setMinSize(size);
}
void GUIFileSelectMenu::drawMenu()
{
gui::IGUISkin* skin = Environment->getSkin();
if (!skin)
return;
gui::IGUIElement::draw();
}
void GUIFileSelectMenu::acceptInput() {
if ((m_text_dst != 0) && (this->m_formname != "")){
std::map<std::string, std::string> fields;
if (m_accepted)
fields[m_formname + "_accepted"] = wide_to_narrow(m_fileOpenDialog->getFileName());
else
fields[m_formname + "_canceled"] = m_formname;
this->m_text_dst->gotText(fields);
}
}
bool GUIFileSelectMenu::OnEvent(const SEvent& event)
{
if (event.EventType == irr::EET_GUI_EVENT) {
int callerId = event.GUIEvent.Caller->getID();
if (callerId >= 0) {
std::cout << "CallerId:" << callerId << std::endl;
}
switch (event.GUIEvent.EventType) {
case gui::EGET_ELEMENT_CLOSED:
case gui::EGET_FILE_CHOOSE_DIALOG_CANCELLED:
m_accepted=false;
acceptInput();
quitMenu();
return true;
break;
case gui::EGET_DIRECTORY_SELECTED:
case gui::EGET_FILE_SELECTED:
m_accepted=true;
acceptInput();
quitMenu();
return true;
break;
default:
//ignore this event
break;
}
}
return Parent ? Parent->OnEvent(event) : false;
}

View File

@ -1,80 +0,0 @@
/*
Minetest
Copyright (C) 2013 sapier
This program 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 program 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 program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef GUIFILESELECTMENU_H_
#define GUIFILESELECTMENU_H_
#include <string>
#include "modalMenu.h"
#include "IGUIFileOpenDialog.h"
#include "guiFormSpecMenu.h" //required because of TextDest only !!!
class GUIFileSelectMenu: public GUIModalMenu
{
public:
GUIFileSelectMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent,
s32 id, IMenuManager *menumgr,
std::string title,
std::string formid);
~GUIFileSelectMenu();
void removeChildren();
/*
Remove and re-add (or reposition) stuff
*/
void regenerateGui(v2u32 screensize);
void drawMenu();
bool OnEvent(const SEvent& event);
bool isRunning() {
return m_running;
}
void setTextDest(TextDest * dest) {
m_text_dst = dest;
}
private:
void acceptInput();
std::wstring m_title;
bool m_accepted;
gui::IGUIElement* m_parent;
std::string m_selectedPath;
gui::IGUIFileOpenDialog* m_fileOpenDialog;
std::string m_previous_locale;
bool m_running;
TextDest *m_text_dst;
std::string m_formname;
};
#endif /* GUIFILESELECTMENU_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -21,8 +21,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#ifndef GUIINVENTORYMENU_HEADER #ifndef GUIINVENTORYMENU_HEADER
#define GUIINVENTORYMENU_HEADER #define GUIINVENTORYMENU_HEADER
#include <utility>
#include "irrlichttypes_extrabloated.h" #include "irrlichttypes_extrabloated.h"
#include "inventory.h" #include "inventory.h"
#include "inventorymanager.h" #include "inventorymanager.h"
@ -31,15 +29,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
class IGameDef; class IGameDef;
class InventoryManager; class InventoryManager;
typedef enum {
f_Button,
f_ListBox,
f_TabHeader,
f_CheckBox,
f_DropDown,
f_Unknown
} FormspecFieldType;
struct TextDest struct TextDest
{ {
virtual ~TextDest() {}; virtual ~TextDest() {};
@ -124,19 +113,10 @@ class GUIFormSpecMenu : public GUIModalMenu
pos(a_pos), pos(a_pos),
geom(a_geom) geom(a_geom)
{ {
scale = true;
}
ImageDrawSpec(const std::string &a_name,
v2s32 a_pos):
name(a_name),
pos(a_pos)
{
scale = false;
} }
std::string name; std::string name;
v2s32 pos; v2s32 pos;
v2s32 geom; v2s32 geom;
bool scale;
}; };
struct FieldSpec struct FieldSpec
@ -151,7 +131,7 @@ class GUIFormSpecMenu : public GUIModalMenu
fid(id) fid(id)
{ {
send = false; send = false;
ftype = f_Unknown; is_button = false;
is_exit = false; is_exit = false;
tooltip=""; tooltip="";
} }
@ -160,24 +140,12 @@ class GUIFormSpecMenu : public GUIModalMenu
std::wstring fdefault; std::wstring fdefault;
int fid; int fid;
bool send; bool send;
FormspecFieldType ftype; bool is_button;
bool is_exit; bool is_exit;
core::rect<s32> rect; core::rect<s32> rect;
std::string tooltip; std::string tooltip;
}; };
struct BoxDrawSpec {
BoxDrawSpec(v2s32 a_pos, v2s32 a_geom,irr::video::SColor a_color):
pos(a_pos),
geom(a_geom),
color(a_color)
{
}
v2s32 pos;
v2s32 geom;
irr::video::SColor color;
};
public: public:
GUIFormSpecMenu(irr::IrrlichtDevice* dev, GUIFormSpecMenu(irr::IrrlichtDevice* dev,
gui::IGUIElement* parent, s32 id, gui::IGUIElement* parent, s32 id,
@ -185,7 +153,6 @@ public:
InventoryManager *invmgr, InventoryManager *invmgr,
IGameDef *gamedef IGameDef *gamedef
); );
~GUIFormSpecMenu(); ~GUIFormSpecMenu();
void setFormSpec(const std::string &formspec_string, void setFormSpec(const std::string &formspec_string,
@ -208,20 +175,6 @@ public:
m_text_dst = text_dst; m_text_dst = text_dst;
} }
void allowClose(bool value)
{
m_allowclose = value;
}
void useGettext(bool value) {
m_use_gettext = true;
}
void lockSize(bool lock,v2u32 basescreensize=v2u32(0,0)) {
m_lock = lock;
m_lockscreensize = basescreensize;
}
void removeChildren(); void removeChildren();
/* /*
Remove and re-add (or reposition) stuff Remove and re-add (or reposition) stuff
@ -235,21 +188,18 @@ public:
void updateSelectedItem(); void updateSelectedItem();
ItemStack verifySelectedItem(); ItemStack verifySelectedItem();
void acceptInput(int evttype=-1); void acceptInput();
bool OnEvent(const SEvent& event); bool OnEvent(const SEvent& event);
int getListboxIndex(std::string listboxname);
protected: protected:
v2s32 getBasePos() const v2s32 getBasePos() const
{ {
return padding + offset + AbsoluteRect.UpperLeftCorner; return padding + AbsoluteRect.UpperLeftCorner;
} }
v2s32 padding; v2s32 padding;
v2s32 spacing; v2s32 spacing;
v2s32 imgsize; v2s32 imgsize;
v2s32 offset;
irr::IrrlichtDevice* m_device; irr::IrrlichtDevice* m_device;
InventoryManager *m_invmgr; InventoryManager *m_invmgr;
@ -264,10 +214,7 @@ protected:
std::vector<ImageDrawSpec> m_backgrounds; std::vector<ImageDrawSpec> m_backgrounds;
std::vector<ImageDrawSpec> m_images; std::vector<ImageDrawSpec> m_images;
std::vector<ImageDrawSpec> m_itemimages; std::vector<ImageDrawSpec> m_itemimages;
std::vector<BoxDrawSpec> m_boxes;
std::vector<FieldSpec> m_fields; std::vector<FieldSpec> m_fields;
std::vector<std::pair<FieldSpec,gui::IGUIListBox*> > m_listboxes;
std::vector<std::pair<FieldSpec,gui::IGUICheckBox*> > m_checkboxes;
ItemSpec *m_selected_item; ItemSpec *m_selected_item;
u32 m_selected_amount; u32 m_selected_amount;
@ -281,83 +228,6 @@ protected:
v2s32 m_pointer; v2s32 m_pointer;
gui::IGUIStaticText *m_tooltip_element; gui::IGUIStaticText *m_tooltip_element;
bool m_allowclose;
bool m_use_gettext;
bool m_lock;
v2u32 m_lockscreensize;
private:
typedef struct {
v2s32 size;
s32 helptext_h;
core::rect<s32> rect;
v2s32 basepos;
int bp_set;
v2u32 screensize;
std::map<std::wstring,int> listbox_selections;
} parserData;
typedef struct {
bool key_up;
bool key_down;
bool key_enter;
bool key_escape;
} fs_key_pendig;
std::vector<video::ITexture *> m_Textures;
fs_key_pendig current_keys_pending;
void parseElement(parserData* data,std::string element);
void parseSize(parserData* data,std::string element);
void parseList(parserData* data,std::string element);
void parseCheckbox(parserData* data,std::string element);
void parseImage(parserData* data,std::string element);
void parseItemImage(parserData* data,std::string element);
void parseButton(parserData* data,std::string element,std::string typ);
void parseBackground(parserData* data,std::string element);
void parseTextList(parserData* data,std::string element);
void parseDropDown(parserData* data,std::string element);
void parsePwdField(parserData* data,std::string element);
void parseField(parserData* data,std::string element,std::string type);
void parseSimpleField(parserData* data,std::vector<std::string> &parts);
void parseTextArea(parserData* data,std::vector<std::string>& parts,std::string type);
void parseLabel(parserData* data,std::string element);
void parseVertLabel(parserData* data,std::string element);
void parseImageButton(parserData* data,std::string element,std::string type);
void parseItemImageButton(parserData* data,std::string element);
void parseTabHeader(parserData* data,std::string element);
void parseBox(parserData* data,std::string element);
bool parseColor(std::string color, irr::video::SColor& outcolor);
};
class FormspecFormSource: public IFormSource
{
public:
FormspecFormSource(std::string formspec,FormspecFormSource** game_formspec)
{
m_formspec = formspec;
m_game_formspec = game_formspec;
}
~FormspecFormSource()
{
*m_game_formspec = 0;
}
void setForm(std::string formspec) {
m_formspec = formspec;
}
std::string getForm()
{
return m_formspec;
}
std::string m_formspec;
FormspecFormSource** m_game_formspec;
}; };
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@ -1,183 +0,0 @@
/*
Minetest
Copyright (C) 2013 sapier
This program 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 program 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 program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef GUILUAAPI_H_
#define GUILUAAPI_H_
/******************************************************************************/
/* Includes */
/******************************************************************************/
#include "serverlist.h"
/******************************************************************************/
/* Typedefs and macros */
/******************************************************************************/
typedef int (*lua_CFunction) (lua_State *L);
/******************************************************************************/
/* forward declarations */
/******************************************************************************/
class GUIEngine;
/******************************************************************************/
/* declarations */
/******************************************************************************/
/** Implementation of lua api support for mainmenu */
class guiLuaApi {
public:
/**
* initialize given Lua stack
* @param L lua stack to initialize
* @param engine pointer to GUIEngine element to use as reference
*/
static void initialize(lua_State* L,GUIEngine* engine);
/** default destructor */
virtual ~guiLuaApi() {}
private:
/**
* read a text variable from gamedata table within lua stack
* @param L stack to read variable from
* @param name name of variable to read
* @return string value of requested variable
*/
static std::string getTextData(lua_State *L, std::string name);
/**
* read a integer variable from gamedata table within lua stack
* @param L stack to read variable from
* @param name name of variable to read
* @return integer value of requested variable
*/
static int getIntegerData(lua_State *L, std::string name,bool& valid);
/**
* read a bool variable from gamedata table within lua stack
* @param L stack to read variable from
* @param name name of variable to read
* @return bool value of requested variable
*/
static int getBoolData(lua_State *L, std::string name,bool& valid);
/**
* get the corresponding engine pointer from a lua stack
* @param L stack to read pointer from
* @return pointer to GUIEngine
*/
static GUIEngine* get_engine(lua_State *L);
/**
* register a static member function as lua api call at current position of stack
* @param L stack to registe fct to
* @param name of function within lua
* @param fct C-Function to call on lua call of function
* @param top current top of stack
*/
static bool registerFunction( lua_State* L,
const char* name,
lua_CFunction fct,
int top
);
/**
* check if a path is within some of minetests folders
* @param path path to check
* @return true/false
*/
static bool isMinetestPath(std::string path);
//api calls
static int l_start(lua_State *L);
static int l_close(lua_State *L);
static int l_create_world(lua_State *L);
static int l_delete_world(lua_State *L);
static int l_get_worlds(lua_State *L);
static int l_get_games(lua_State *L);
static int l_get_favorites(lua_State *L);
static int l_delete_favorite(lua_State *L);
static int l_get_version(lua_State *L);
//gui
static int l_show_keys_menu(lua_State *L);
static int l_show_file_open_dialog(lua_State *L);
static int l_set_topleft_text(lua_State *L);
static int l_set_clouds(lua_State *L);
static int l_get_textlist_index(lua_State *L);
static int l_set_background(lua_State *L);
static int l_update_formspec(lua_State *L);
//settings
static int l_setting_set(lua_State *L);
static int l_setting_get(lua_State *L);
static int l_setting_getbool(lua_State *L);
static int l_setting_setbool(lua_State *L);
//filesystem
static int l_get_scriptdir(lua_State *L);
static int l_get_modpath(lua_State *L);
static int l_get_gamepath(lua_State *L);
static int l_get_dirlist(lua_State *L);
static int l_create_dir(lua_State *L);
static int l_delete_dir(lua_State *L);
static int l_copy_dir(lua_State *L);
static int l_extract_zip(lua_State *L);
static int l_get_modstore_details(lua_State *L);
static int l_get_modstore_list(lua_State *L);
static int l_download_file(lua_State *L);
};
#endif

1521
src/guiMainMenu.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -24,6 +24,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "modalMenu.h" #include "modalMenu.h"
#include <string> #include <string>
#include <list> #include <list>
#include "subgame.h"
#include "serverlist.h"
class IGameCallback;
enum {
SERVERLIST_FAVORITES,
SERVERLIST_PUBLIC,
};
enum enum
{ {
@ -36,31 +45,113 @@ enum
struct MainMenuData struct MainMenuData
{ {
// These are in the native format of the gui elements
// Generic
int selected_tab;
std::string selected_game;
std::string selected_game_name;
// Client options // Client options
std::string servername; std::string servername;
std::string serverdescription; std::string serverdescription;
std::string address; std::wstring address;
std::string port; std::wstring port;
std::string name; std::wstring name;
std::string password; std::wstring password;
bool fancy_trees;
bool smooth_lighting;
bool clouds_3d;
bool opaque_water;
bool mip_map;
bool anisotropic_filter;
bool bilinear_filter;
bool trilinear_filter;
int enable_shaders;
bool preload_item_visuals;
bool enable_particles;
bool liquid_finite;
// Server options // Server options
bool creative_mode;
bool enable_damage;
bool enable_public; bool enable_public;
int selected_world; int selected_world;
bool simple_singleplayer_mode; bool simple_singleplayer_mode;
// Actions // Actions
bool kill; std::wstring create_world_name;
std::string create_world_gameid;
bool only_refresh;
int selected_serverlist;
std::vector<WorldSpec> worlds;
std::vector<SubgameSpec> games;
std::vector<ServerListSpec> servers;
//error handling
std::string errormessage;
MainMenuData(): MainMenuData():
// Generic
selected_tab(0),
selected_game("minetest"),
selected_game_name("Minetest"),
// Client opts
fancy_trees(false),
smooth_lighting(false),
// Server opts
creative_mode(false),
enable_damage(false),
enable_public(false), enable_public(false),
selected_world(0), selected_world(0),
simple_singleplayer_mode(false), simple_singleplayer_mode(false),
errormessage("") // Actions
only_refresh(false),
selected_serverlist(SERVERLIST_FAVORITES)
{} {}
}; };
class GUIMainMenu : public GUIModalMenu
{
public:
GUIMainMenu(gui::IGUIEnvironment* env,
gui::IGUIElement* parent, s32 id,
IMenuManager *menumgr,
MainMenuData *data,
IGameCallback *gamecallback);
~GUIMainMenu();
void removeChildren();
// Remove and re-add (or reposition) stuff
void regenerateGui(v2u32 screensize);
void drawMenu();
void readInput(MainMenuData *dst);
void acceptInput();
bool getStatus()
{ return m_accepted; }
bool OnEvent(const SEvent& event);
void createNewWorld(std::wstring name, std::string gameid);
void deleteWorld(const std::vector<std::string> &paths);
int getTab();
void displayMessageMenu(std::wstring msg);
private:
MainMenuData *m_data;
bool m_accepted;
IGameCallback *m_gamecallback;
gui::IGUIEnvironment* env;
gui::IGUIElement* parent;
s32 id;
IMenuManager *menumgr;
std::vector<int> m_world_indices;
bool m_is_regenerating;
v2s32 m_topleft_client;
v2s32 m_size_client;
v2s32 m_topleft_server;
v2s32 m_size_server;
void updateGuiServerList();
void serverListOnSelected();
ServerListSpec getServerListSpec(std::string address, std::string port);
};
#endif #endif

View File

@ -178,7 +178,7 @@ void Hud::drawLuaElements() {
v2s32 pos(e->pos.X * screensize.X, e->pos.Y * screensize.Y); v2s32 pos(e->pos.X * screensize.X, e->pos.Y * screensize.Y);
switch (e->type) { switch (e->type) {
case HUD_ELEM_IMAGE: { case HUD_ELEM_IMAGE: {
video::ITexture *texture = tsrc->getTexture(e->text); video::ITexture *texture = tsrc->getTextureRaw(e->text);
if (!texture) if (!texture)
continue; continue;
@ -228,7 +228,7 @@ void Hud::drawStatbar(v2s32 pos, u16 corner, u16 drawdir, std::string texture, s
const video::SColor color(255, 255, 255, 255); const video::SColor color(255, 255, 255, 255);
const video::SColor colors[] = {color, color, color, color}; const video::SColor colors[] = {color, color, color, color};
video::ITexture *stat_texture = tsrc->getTexture(texture); video::ITexture *stat_texture = tsrc->getTextureRaw(texture);
if (!stat_texture) if (!stat_texture)
return; return;
@ -306,7 +306,7 @@ void Hud::drawCrosshair() {
return; return;
if (use_crosshair_image) { if (use_crosshair_image) {
video::ITexture *crosshair = tsrc->getTexture("crosshair.png"); video::ITexture *crosshair = tsrc->getTextureRaw("crosshair.png");
v2u32 size = crosshair->getOriginalSize(); v2u32 size = crosshair->getOriginalSize();
v2s32 lsize = v2s32(displaycenter.X - (size.X / 2), v2s32 lsize = v2s32(displaycenter.X - (size.X / 2),
displaycenter.Y - (size.Y / 2)); displaycenter.Y - (size.Y / 2));

View File

@ -229,6 +229,7 @@ public:
#ifndef SERVER #ifndef SERVER
m_main_thread = get_current_thread_id(); m_main_thread = get_current_thread_id();
m_driver = NULL;
#endif #endif
clear(); clear();
} }
@ -245,6 +246,13 @@ public:
delete cc; delete cc;
} }
if (m_driver != NULL) {
for (unsigned int i = 0; i < m_extruded_textures.size(); i++) {
m_driver->removeTexture(m_extruded_textures[i]);
}
m_extruded_textures.clear();
}
m_driver = NULL;
#endif #endif
for (std::map<std::string, ItemDefinition*>::iterator iter = for (std::map<std::string, ItemDefinition*>::iterator iter =
m_item_definitions.begin(); iter != m_item_definitions.end(); m_item_definitions.begin(); iter != m_item_definitions.end();
@ -299,6 +307,9 @@ public:
return m_item_definitions.find(name) != m_item_definitions.end(); return m_item_definitions.find(name) != m_item_definitions.end();
} }
#ifndef SERVER #ifndef SERVER
private:
static video::IVideoDriver * m_driver;
static std::vector<video::ITexture*> m_extruded_textures;
public: public:
ClientCached* createClientCachedDirect(const std::string &name, ClientCached* createClientCachedDirect(const std::string &name,
IGameDef *gamedef) const IGameDef *gamedef) const
@ -330,7 +341,7 @@ public:
cc->inventory_texture = NULL; cc->inventory_texture = NULL;
if(def->inventory_image != "") if(def->inventory_image != "")
{ {
cc->inventory_texture = tsrc->getTexture(def->inventory_image); cc->inventory_texture = tsrc->getTextureRaw(def->inventory_image);
} }
else if(def->type == ITEM_NODE) else if(def->type == ITEM_NODE)
{ {
@ -354,7 +365,7 @@ public:
imagename = def->inventory_image; imagename = def->inventory_image;
cc->wield_mesh = createExtrudedMesh( cc->wield_mesh = createExtrudedMesh(
tsrc->getTexture(imagename), tsrc->getTextureRaw(imagename),
driver, driver,
def->wield_scale * v3f(40.0, 40.0, 4.0)); def->wield_scale * v3f(40.0, 40.0, 4.0));
if(cc->wield_mesh == NULL) if(cc->wield_mesh == NULL)
@ -389,7 +400,7 @@ public:
scene::IMesh *node_mesh = mapblock_mesh.getMesh(); scene::IMesh *node_mesh = mapblock_mesh.getMesh();
assert(node_mesh); assert(node_mesh);
video::SColor c(255, 255, 255, 255); video::SColor c(255, 255, 255, 255);
if(g_settings->getBool("enable_shaders")) if(g_settings->getS32("enable_shaders") != 0)
c = MapBlock_LightColor(255, 0xffff, decode_light(f.light_source)); c = MapBlock_LightColor(255, 0xffff, decode_light(f.light_source));
setMeshColor(node_mesh, c); setMeshColor(node_mesh, c);
@ -405,33 +416,46 @@ public:
*/ */
if(cc->inventory_texture == NULL) if(cc->inventory_texture == NULL)
{ {
TextureFromMeshParams params; core::dimension2d<u32> dim(64,64);
params.mesh = node_mesh; std::string rtt_texture_name = "INVENTORY_"
params.dim.set(64, 64);
params.rtt_texture_name = "INVENTORY_"
+ def->name + "_RTT"; + def->name + "_RTT";
params.delete_texture_on_shutdown = true; v3f camera_position(0, 1.0, -1.5);
params.camera_position.set(0, 1.0, -1.5); camera_position.rotateXZBy(45);
params.camera_position.rotateXZBy(45); v3f camera_lookat(0, 0, 0);
params.camera_lookat.set(0, 0, 0); core::CMatrix4<f32> camera_projection_matrix;
// Set orthogonal projection // Set orthogonal projection
params.camera_projection_matrix.buildProjectionMatrixOrthoLH( camera_projection_matrix.buildProjectionMatrixOrthoLH(
1.65, 1.65, 0, 100); 1.65, 1.65, 0, 100);
params.ambient_light.set(1.0, 0.2, 0.2, 0.2);
params.light_position.set(10, 100, -50);
params.light_color.set(1.0, 0.5, 0.5, 0.5);
params.light_radius = 1000;
cc->inventory_texture = video::SColorf ambient_light(0.2,0.2,0.2);
tsrc->generateTextureFromMesh(params); v3f light_position(10, 100, -50);
video::SColorf light_color(0.5,0.5,0.5);
f32 light_radius = 1000;
cc->inventory_texture = generateTextureFromMesh(
node_mesh, device, dim, rtt_texture_name,
camera_position,
camera_lookat,
camera_projection_matrix,
ambient_light,
light_position,
light_color,
light_radius);
// render-to-target didn't work // render-to-target didn't work
if(cc->inventory_texture == NULL) if(cc->inventory_texture == NULL)
{ {
cc->inventory_texture = cc->inventory_texture =
tsrc->getTexture(f.tiledef[0].name); tsrc->getTextureRaw(f.tiledef[0].name);
} }
} }
else
{
if (m_driver == 0)
m_driver = driver;
m_extruded_textures.push_back(cc->inventory_texture);
}
/* /*
Use the node mesh as the wield mesh Use the node mesh as the wield mesh
@ -657,3 +681,9 @@ IWritableItemDefManager* createItemDefManager()
{ {
return new CItemDefManager(); return new CItemDefManager();
} }
#ifndef SERVER
//TODO very very very dirty hack!
video::IVideoDriver * CItemDefManager::m_driver = 0;
std::vector<video::ITexture*> CItemDefManager::m_extruded_textures;
#endif

View File

@ -78,7 +78,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "serverlist.h" #include "serverlist.h"
#include "sound.h" #include "sound.h"
#include "sound_openal.h" #include "sound_openal.h"
#include "guiEngine.h"
/* /*
Settings. Settings.
@ -661,6 +660,180 @@ private:
bool rightreleased; bool rightreleased;
}; };
struct MenuTextures
{
std::string current_gameid;
bool global_textures;
video::ITexture *background;
video::ITexture *overlay;
video::ITexture *header;
video::ITexture *footer;
MenuTextures():
global_textures(false),
background(NULL),
overlay(NULL),
header(NULL),
footer(NULL)
{}
static video::ITexture* getMenuTexture(const std::string &tname,
video::IVideoDriver* driver, const SubgameSpec *spec)
{
if(spec){
std::string path;
// eg. minetest_menu_background.png (for texture packs)
std::string pack_tname = spec->id + "_menu_" + tname + ".png";
path = getTexturePath(pack_tname);
if(path != "")
return driver->getTexture(path.c_str());
// eg. games/minetest_game/menu/background.png
path = getImagePath(spec->path + DIR_DELIM + "menu" + DIR_DELIM + tname + ".png");
if(path != "")
return driver->getTexture(path.c_str());
} else {
std::string path;
// eg. menu_background.png
std::string pack_tname = "menu_" + tname + ".png";
path = getTexturePath(pack_tname);
if(path != "")
return driver->getTexture(path.c_str());
}
return NULL;
}
void update(video::IVideoDriver* driver, const SubgameSpec *spec, int tab)
{
if(tab == TAB_SINGLEPLAYER){
if(spec->id == current_gameid)
return;
current_gameid = spec->id;
global_textures = false;
background = getMenuTexture("background", driver, spec);
overlay = getMenuTexture("overlay", driver, spec);
header = getMenuTexture("header", driver, spec);
footer = getMenuTexture("footer", driver, spec);
} else {
if(global_textures)
return;
current_gameid = "";
global_textures = true;
background = getMenuTexture("background", driver, NULL);
overlay = getMenuTexture("overlay", driver, NULL);
header = getMenuTexture("header", driver, NULL);
footer = getMenuTexture("footer", driver, NULL);
}
}
};
void drawMenuBackground(video::IVideoDriver* driver, const MenuTextures &menutextures)
{
v2u32 screensize = driver->getScreenSize();
video::ITexture *texture = menutextures.background;
/* If no texture, draw background of solid color */
if(!texture){
video::SColor color(255,80,58,37);
core::rect<s32> rect(0, 0, screensize.X, screensize.Y);
driver->draw2DRectangle(color, rect, NULL);
return;
}
/* Draw background texture */
v2u32 sourcesize = texture->getSize();
driver->draw2DImage(texture,
core::rect<s32>(0, 0, screensize.X, screensize.Y),
core::rect<s32>(0, 0, sourcesize.X, sourcesize.Y),
NULL, NULL, true);
}
void drawMenuOverlay(video::IVideoDriver* driver, const MenuTextures &menutextures)
{
v2u32 screensize = driver->getScreenSize();
video::ITexture *texture = menutextures.overlay;
/* If no texture, draw nothing */
if(!texture)
return;
/* Draw overlay texture */
v2u32 sourcesize = texture->getSize();
driver->draw2DImage(texture,
core::rect<s32>(0, 0, screensize.X, screensize.Y),
core::rect<s32>(0, 0, sourcesize.X, sourcesize.Y),
NULL, NULL, true);
}
void drawMenuHeader(video::IVideoDriver* driver, const MenuTextures &menutextures)
{
core::dimension2d<u32> screensize = driver->getScreenSize();
video::ITexture *texture = menutextures.header;
/* If no texture, draw nothing */
if(!texture)
return;
f32 mult = (((f32)screensize.Width / 2)) /
((f32)texture->getOriginalSize().Width);
v2s32 splashsize(((f32)texture->getOriginalSize().Width) * mult,
((f32)texture->getOriginalSize().Height) * mult);
// Don't draw the header is there isn't enough room
s32 free_space = (((s32)screensize.Height)-320)/2;
if (free_space > splashsize.Y) {
core::rect<s32> splashrect(0, 0, splashsize.X, splashsize.Y);
splashrect += v2s32((screensize.Width/2)-(splashsize.X/2),
((free_space/2)-splashsize.Y/2)+10);
video::SColor bgcolor(255,50,50,50);
driver->draw2DImage(texture, splashrect,
core::rect<s32>(core::position2d<s32>(0,0),
core::dimension2di(texture->getSize())),
NULL, NULL, true);
}
}
void drawMenuFooter(video::IVideoDriver* driver, const MenuTextures &menutextures)
{
core::dimension2d<u32> screensize = driver->getScreenSize();
video::ITexture *texture = menutextures.footer;
/* If no texture, draw nothing */
if(!texture)
return;
f32 mult = (((f32)screensize.Width)) /
((f32)texture->getOriginalSize().Width);
v2s32 footersize(((f32)texture->getOriginalSize().Width) * mult,
((f32)texture->getOriginalSize().Height) * mult);
// Don't draw the footer if there isn't enough room
s32 free_space = (((s32)screensize.Height)-320)/2;
if (free_space > footersize.Y) {
core::rect<s32> rect(0,0,footersize.X,footersize.Y);
rect += v2s32(screensize.Width/2,screensize.Height-footersize.Y);
rect -= v2s32(footersize.X/2, 0);
driver->draw2DImage(texture, rect,
core::rect<s32>(core::position2d<s32>(0,0),
core::dimension2di(texture->getSize())),
NULL, NULL, true);
}
}
static const SubgameSpec* getMenuGame(const MainMenuData &menudata)
{
for(size_t i=0; i<menudata.games.size(); i++){
if(menudata.games[i].id == menudata.selected_game){
return &menudata.games[i];
}
}
return NULL;
}
#endif // !SERVER #endif // !SERVER
// These are defined global so that they're not optimized too much. // These are defined global so that they're not optimized too much.
@ -1557,37 +1730,83 @@ int main(int argc, char *argv[])
// Initialize menu data // Initialize menu data
MainMenuData menudata; MainMenuData menudata;
menudata.kill = kill; if(g_settings->exists("selected_mainmenu_tab"))
menudata.address = address; menudata.selected_tab = g_settings->getS32("selected_mainmenu_tab");
menudata.name = playername; if(g_settings->exists("selected_serverlist"))
menudata.port = itos(port); menudata.selected_serverlist = g_settings->getS32("selected_serverlist");
menudata.errormessage = wide_to_narrow(error_message); if(g_settings->exists("selected_mainmenu_game")){
error_message = L""; menudata.selected_game = g_settings->get("selected_mainmenu_game");
menudata.selected_game_name = findSubgame(menudata.selected_game).name;
}
menudata.address = narrow_to_wide(address);
menudata.name = narrow_to_wide(playername);
menudata.port = narrow_to_wide(itos(port));
if(cmd_args.exists("password")) if(cmd_args.exists("password"))
menudata.password = cmd_args.get("password"); menudata.password = narrow_to_wide(cmd_args.get("password"));
menudata.fancy_trees = g_settings->getBool("new_style_leaves");
driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, g_settings->getBool("mip_map")); menudata.smooth_lighting = g_settings->getBool("smooth_lighting");
menudata.clouds_3d = g_settings->getBool("enable_3d_clouds");
menudata.opaque_water = g_settings->getBool("opaque_water");
menudata.mip_map = g_settings->getBool("mip_map");
menudata.anisotropic_filter = g_settings->getBool("anisotropic_filter");
menudata.bilinear_filter = g_settings->getBool("bilinear_filter");
menudata.trilinear_filter = g_settings->getBool("trilinear_filter");
menudata.enable_shaders = g_settings->getS32("enable_shaders");
menudata.preload_item_visuals = g_settings->getBool("preload_item_visuals");
menudata.enable_particles = g_settings->getBool("enable_particles");
menudata.liquid_finite = g_settings->getBool("liquid_finite");
driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, menudata.mip_map);
menudata.creative_mode = g_settings->getBool("creative_mode");
menudata.enable_damage = g_settings->getBool("enable_damage");
menudata.enable_public = g_settings->getBool("server_announce"); menudata.enable_public = g_settings->getBool("server_announce");
// Default to selecting nothing
menudata.selected_world = -1;
// Get world listing for the menu
std::vector<WorldSpec> worldspecs = getAvailableWorlds(); std::vector<WorldSpec> worldspecs = getAvailableWorlds();
// If there is only one world, select it
if(worldspecs.size() == 1){
menudata.selected_world = 0;
}
// Otherwise try to select according to selected_world_path
else if(g_settings->exists("selected_world_path")){
std::string trypath = g_settings->get("selected_world_path");
for(u32 i=0; i<worldspecs.size(); i++){
if(worldspecs[i].path == trypath){
menudata.selected_world = i;
break;
}
}
}
// If a world was commanded, append and select it // If a world was commanded, append and select it
if(commanded_world != ""){ if(commanded_world != ""){
std::string gameid = getWorldGameId(commanded_world, true); std::string gameid = getWorldGameId(commanded_world, true);
std::string name = _("[--world parameter]"); std::string name = _("[--world parameter]");
if(gameid == ""){ if(gameid == ""){
gameid = g_settings->get("default_game"); gameid = g_settings->get("default_game");
name += " [new]"; name += " [new]";
} }
//TODO find within worldspecs and set config WorldSpec spec(commanded_world, name, gameid);
worldspecs.push_back(spec);
menudata.selected_world = worldspecs.size()-1;
} }
// Copy worldspecs to menu
menudata.worlds = worldspecs;
// Get game listing
menudata.games = getAvailableGames();
// If selected game doesn't exist, take first from list
if(findSubgame(menudata.selected_game).id == "" &&
!menudata.games.empty()){
menudata.selected_game = menudata.games[0].id;
}
const SubgameSpec *menugame = getMenuGame(menudata);
MenuTextures menutextures;
menutextures.update(driver, menugame, menudata.selected_tab);
if(skip_main_menu == false) if(skip_main_menu == false)
{ {
video::IVideoDriver* driver = device->getVideoDriver(); video::IVideoDriver* driver = device->getVideoDriver();
float fps_max = g_settings->getFloat("fps_max");
infostream<<"Waiting for other menus"<<std::endl; infostream<<"Waiting for other menus"<<std::endl;
while(device->run() && kill == false) while(device->run() && kill == false)
{ {
@ -1595,6 +1814,7 @@ int main(int argc, char *argv[])
break; break;
driver->beginScene(true, true, driver->beginScene(true, true,
video::SColor(255,128,128,128)); video::SColor(255,128,128,128));
drawMenuBackground(driver, menutextures);
guienv->drawAll(); guienv->drawAll();
driver->endScene(); driver->endScene();
// On some computers framerate doesn't seem to be // On some computers framerate doesn't seem to be
@ -1603,40 +1823,170 @@ int main(int argc, char *argv[])
} }
infostream<<"Waited for other menus"<<std::endl; infostream<<"Waited for other menus"<<std::endl;
GUIEngine* temp = new GUIEngine(device, guiroot, &g_menumgr,smgr,&menudata); GUIMainMenu *menu =
new GUIMainMenu(guienv, guiroot, -1,
&g_menumgr, &menudata, g_gamecallback);
menu->allowFocusRemoval(true);
delete temp; if(error_message != L"")
//once finished you'll never end up here {
smgr->clear(); verbosestream<<"error_message = "
kill = menudata.kill; <<wide_to_narrow(error_message)<<std::endl;
GUIMessageMenu *menu2 =
new GUIMessageMenu(guienv, guiroot, -1,
&g_menumgr, error_message.c_str());
menu2->drop();
error_message = L"";
} }
//update worldspecs (necessary as new world may have been created) // Time is in milliseconds, for clouds
worldspecs = getAvailableWorlds(); u32 lasttime = device->getTimer()->getTime();
if (menudata.name == "") MenuMusicFetcher soundfetcher;
menudata.name = std::string("Guest") + itos(myrand_range(1000,9999)); ISoundManager *sound = NULL;
#if USE_SOUND
sound = createOpenALSoundManager(&soundfetcher);
#endif
if(!sound)
sound = &dummySoundManager;
SimpleSoundSpec spec;
spec.name = "main_menu";
spec.gain = 1;
s32 handle = sound->playSound(spec, true);
infostream<<"Created main menu"<<std::endl;
while(device->run() && kill == false)
{
if(menu->getStatus() == true)
break;
// Game can be selected in the menu
menugame = getMenuGame(menudata);
menutextures.update(driver, menugame, menu->getTab());
// Clouds for the main menu
bool cloud_menu_background = g_settings->getBool("menu_clouds");
if(menugame){
// If game has regular background and no overlay, don't use clouds
if(cloud_menu_background && menutextures.background &&
!menutextures.overlay){
cloud_menu_background = false;
}
// If game game has overlay and no regular background, always draw clouds
else if(menutextures.overlay && !menutextures.background){
cloud_menu_background = true;
}
}
// Time calc for the clouds
f32 dtime=0; // in seconds
if (cloud_menu_background) {
u32 time = device->getTimer()->getTime();
if(time > lasttime)
dtime = (time - lasttime) / 1000.0;
else else
playername = menudata.name; dtime = 0;
lasttime = time;
}
password = translatePassword(playername, narrow_to_wide(menudata.password)); //driver->beginScene(true, true, video::SColor(255,0,0,0));
driver->beginScene(true, true, video::SColor(255,140,186,250));
if (cloud_menu_background) {
// *3 otherwise the clouds would move very slowly
g_menuclouds->step(dtime*3);
g_menuclouds->render();
g_menucloudsmgr->drawAll();
drawMenuOverlay(driver, menutextures);
drawMenuHeader(driver, menutextures);
drawMenuFooter(driver, menutextures);
} else {
drawMenuBackground(driver, menutextures);
drawMenuHeader(driver, menutextures);
drawMenuFooter(driver, menutextures);
}
guienv->drawAll();
driver->endScene();
// On some computers framerate doesn't seem to be
// automatically limited
if (cloud_menu_background) {
// Time of frame without fps limit
float busytime;
u32 busytime_u32;
// not using getRealTime is necessary for wine
u32 time = device->getTimer()->getTime();
if(time > lasttime)
busytime_u32 = time - lasttime;
else
busytime_u32 = 0;
busytime = busytime_u32 / 1000.0;
// FPS limiter
u32 frametime_min = 1000./fps_max;
if(busytime_u32 < frametime_min) {
u32 sleeptime = frametime_min - busytime_u32;
device->sleep(sleeptime);
}
} else {
sleep_ms(25);
}
}
sound->stopSound(handle);
if(sound != &dummySoundManager){
delete sound;
sound = NULL;
}
// Save controls status
menu->readInput(&menudata);
infostream<<"Dropping main menu"<<std::endl;
menu->drop();
}
playername = wide_to_narrow(menudata.name);
if (playername == "")
playername = std::string("Guest") + itos(myrand_range(1000,9999));
password = translatePassword(playername, menudata.password);
//infostream<<"Main: password hash: '"<<password<<"'"<<std::endl; //infostream<<"Main: password hash: '"<<password<<"'"<<std::endl;
address = menudata.address; address = wide_to_narrow(menudata.address);
int newport = stoi(menudata.port); int newport = stoi(wide_to_narrow(menudata.port));
if(newport != 0) if(newport != 0)
port = newport; port = newport;
simple_singleplayer_mode = menudata.simple_singleplayer_mode; simple_singleplayer_mode = menudata.simple_singleplayer_mode;
// Save settings // Save settings
g_settings->setS32("selected_mainmenu_tab", menudata.selected_tab);
g_settings->setS32("selected_serverlist", menudata.selected_serverlist);
g_settings->set("selected_mainmenu_game", menudata.selected_game);
g_settings->set("new_style_leaves", itos(menudata.fancy_trees));
g_settings->set("smooth_lighting", itos(menudata.smooth_lighting));
g_settings->set("enable_3d_clouds", itos(menudata.clouds_3d));
g_settings->set("opaque_water", itos(menudata.opaque_water));
g_settings->set("mip_map", itos(menudata.mip_map));
g_settings->set("anisotropic_filter", itos(menudata.anisotropic_filter));
g_settings->set("bilinear_filter", itos(menudata.bilinear_filter));
g_settings->set("trilinear_filter", itos(menudata.trilinear_filter));
g_settings->setS32("enable_shaders", menudata.enable_shaders);
g_settings->set("preload_item_visuals", itos(menudata.preload_item_visuals));
g_settings->set("enable_particles", itos(menudata.enable_particles));
g_settings->set("liquid_finite", itos(menudata.liquid_finite));
g_settings->set("creative_mode", itos(menudata.creative_mode));
g_settings->set("enable_damage", itos(menudata.enable_damage));
g_settings->set("server_announce", itos(menudata.enable_public));
g_settings->set("name", playername); g_settings->set("name", playername);
g_settings->set("address", address); g_settings->set("address", address);
g_settings->set("port", itos(port)); g_settings->set("port", itos(port));
if(menudata.selected_world != -1)
if((menudata.selected_world >= 0) &&
(menudata.selected_world < worldspecs.size()))
g_settings->set("selected_world_path", g_settings->set("selected_world_path",
worldspecs[menudata.selected_world].path); worldspecs[menudata.selected_world].path);
@ -1660,20 +2010,42 @@ int main(int argc, char *argv[])
{ {
ServerListSpec server; ServerListSpec server;
server["name"] = menudata.servername; server["name"] = menudata.servername;
server["address"] = menudata.address; server["address"] = wide_to_narrow(menudata.address);
server["port"] = menudata.port; server["port"] = wide_to_narrow(menudata.port);
server["description"] = menudata.serverdescription; server["description"] = menudata.serverdescription;
ServerList::insert(server); ServerList::insert(server);
} }
// Set world path to selected one // Set world path to selected one
if ((menudata.selected_world >= 0) && if(menudata.selected_world != -1){
(menudata.selected_world < worldspecs.size())) {
worldspec = worldspecs[menudata.selected_world]; worldspec = worldspecs[menudata.selected_world];
infostream<<"Selected world: "<<worldspec.name infostream<<"Selected world: "<<worldspec.name
<<" ["<<worldspec.path<<"]"<<std::endl; <<" ["<<worldspec.path<<"]"<<std::endl;
} }
// Only refresh if so requested
if(menudata.only_refresh){
infostream<<"Refreshing menu"<<std::endl;
continue;
}
// Create new world if requested
if(menudata.create_world_name != L"")
{
std::string path = porting::path_user + DIR_DELIM
"worlds" + DIR_DELIM
+ wide_to_narrow(menudata.create_world_name);
// Create world if it doesn't exist
if(!initializeWorld(path, menudata.create_world_gameid)){
error_message = wgettext("Failed to initialize world");
errorstream<<wide_to_narrow(error_message)<<std::endl;
continue;
}
g_settings->set("selected_world_path", path);
g_settings->set("selected_mainmenu_game", menudata.create_world_gameid);
continue;
}
// If local game // If local game
if(current_address == "") if(current_address == "")
{ {
@ -1713,10 +2085,8 @@ int main(int argc, char *argv[])
} }
// Break out of menu-game loop to shut down cleanly // Break out of menu-game loop to shut down cleanly
if(device->run() == false || kill == true) { if(device->run() == false || kill == true)
g_settings->updateConfigFile(configpath.c_str());
break; break;
}
/* /*
Run game Run game

View File

@ -1653,8 +1653,6 @@ void Map::transformLiquidsFinite(std::map<v3s16, MapBlock*> & modified_blocks)
u16 loop_max = g_settings->getU16("liquid_loop_max"); u16 loop_max = g_settings->getU16("liquid_loop_max");
//if (m_transforming_liquid.size() > 0) errorstream << "Liquid queue size="<<m_transforming_liquid.size()<<std::endl;
while (m_transforming_liquid.size() > 0) while (m_transforming_liquid.size() > 0)
{ {
// This should be done here so that it is done when continue is used // This should be done here so that it is done when continue is used
@ -1773,7 +1771,7 @@ void Map::transformLiquidsFinite(std::map<v3s16, MapBlock*> & modified_blocks)
} }
// prevent lakes in air above unloaded blocks // prevent lakes in air above unloaded blocks
if (liquid_levels[D_TOP] == 0 && (p0.Y > water_level) && neighbors[D_BOTTOM].n.getContent() == CONTENT_IGNORE && !(loopcount % 3)) { if (liquid_levels[D_TOP] == 0 && (p0.Y > water_level || !fast_flood) && neighbors[D_BOTTOM].n.getContent() == CONTENT_IGNORE) {
--total_level; --total_level;
} }
@ -1796,17 +1794,12 @@ void Map::transformLiquidsFinite(std::map<v3s16, MapBlock*> & modified_blocks)
if (!neighbors[ii].l) if (!neighbors[ii].l)
continue; continue;
liquid_levels_want[ii] = want_level; liquid_levels_want[ii] = want_level;
if (liquid_levels_want[ii] < LIQUID_LEVEL_SOURCE && total_level > 0) { if (liquid_levels_want[ii] < LIQUID_LEVEL_SOURCE && total_level > 0
if (loopcount % 3 || liquid_levels[ii] <= 0){ && liquid_levels[ii] > liquid_levels_want[ii]
if (liquid_levels[ii] > liquid_levels_want[ii]) { ) {
++liquid_levels_want[ii]; ++liquid_levels_want[ii];
--total_level; --total_level;
} }
} else if (neighbors[ii].l > 0){
++liquid_levels_want[ii];
--total_level;
}
}
} }
for (u16 ii = 0; ii < 7; ++ii) { for (u16 ii = 0; ii < 7; ++ii) {
@ -3244,18 +3237,17 @@ v2s16 ServerMap::getSectorPos(std::string dirname)
{ {
unsigned int x, y; unsigned int x, y;
int r; int r;
std::string component; size_t spos = dirname.rfind(DIR_DELIM_C) + 1;
fs::RemoveLastPathComponent(dirname, &component, 1); assert(spos != std::string::npos);
if(component.size() == 8) if(dirname.size() - spos == 8)
{ {
// Old layout // Old layout
r = sscanf(component.c_str(), "%4x%4x", &x, &y); r = sscanf(dirname.substr(spos).c_str(), "%4x%4x", &x, &y);
} }
else if(component.size() == 3) else if(dirname.size() - spos == 3)
{ {
// New layout // New layout
fs::RemoveLastPathComponent(dirname, &component, 2); r = sscanf(dirname.substr(spos-4).c_str(), "%3x" DIR_DELIM "%3x", &x, &y);
r = sscanf(component.c_str(), "%3x" DIR_DELIM "%3x", &x, &y);
// Sign-extend the 12 bit values up to 16 bits... // Sign-extend the 12 bit values up to 16 bits...
if(x&0x800) x|=0xF000; if(x&0x800) x|=0xF000;
if(y&0x800) y|=0xF000; if(y&0x800) y|=0xF000;

View File

@ -452,11 +452,6 @@ static void makeFastFace(TileSpec tile, u16 li0, u16 li1, u16 li2, u16 li3,
// Position is at the center of the cube. // Position is at the center of the cube.
v3f pos = p * BS; v3f pos = p * BS;
float x0 = 0.0;
float y0 = 0.0;
float w = 1.0;
float h = 1.0;
v3f vertex_pos[4]; v3f vertex_pos[4];
v3s16 vertex_dirs[4]; v3s16 vertex_dirs[4];
getNodeVertexDirs(dir, vertex_dirs); getNodeVertexDirs(dir, vertex_dirs);
@ -493,8 +488,8 @@ static void makeFastFace(TileSpec tile, u16 li0, u16 li1, u16 li2, u16 li3,
vertex_dirs[3] = vertex_dirs[2]; vertex_dirs[3] = vertex_dirs[2];
vertex_dirs[2] = vertex_dirs[1]; vertex_dirs[2] = vertex_dirs[1];
vertex_dirs[1] = t; vertex_dirs[1] = t;
y0 += h; tile.texture.pos.Y += tile.texture.size.Y;
h *= -1; tile.texture.size.Y *= -1;
break; break;
case 5: //FXR270 case 5: //FXR270
t = vertex_dirs[0]; t = vertex_dirs[0];
@ -502,8 +497,8 @@ static void makeFastFace(TileSpec tile, u16 li0, u16 li1, u16 li2, u16 li3,
vertex_dirs[1] = vertex_dirs[2]; vertex_dirs[1] = vertex_dirs[2];
vertex_dirs[2] = vertex_dirs[3]; vertex_dirs[2] = vertex_dirs[3];
vertex_dirs[3] = t; vertex_dirs[3] = t;
y0 += h; tile.texture.pos.Y += tile.texture.size.Y;
h *= -1; tile.texture.size.Y *= -1;
break; break;
case 6: //FYR90 case 6: //FYR90
t = vertex_dirs[0]; t = vertex_dirs[0];
@ -511,8 +506,8 @@ static void makeFastFace(TileSpec tile, u16 li0, u16 li1, u16 li2, u16 li3,
vertex_dirs[3] = vertex_dirs[2]; vertex_dirs[3] = vertex_dirs[2];
vertex_dirs[2] = vertex_dirs[1]; vertex_dirs[2] = vertex_dirs[1];
vertex_dirs[1] = t; vertex_dirs[1] = t;
x0 += w; tile.texture.pos.X += tile.texture.size.X;
w *= -1; tile.texture.size.X *= -1;
break; break;
case 7: //FYR270 case 7: //FYR270
t = vertex_dirs[0]; t = vertex_dirs[0];
@ -520,16 +515,16 @@ static void makeFastFace(TileSpec tile, u16 li0, u16 li1, u16 li2, u16 li3,
vertex_dirs[1] = vertex_dirs[2]; vertex_dirs[1] = vertex_dirs[2];
vertex_dirs[2] = vertex_dirs[3]; vertex_dirs[2] = vertex_dirs[3];
vertex_dirs[3] = t; vertex_dirs[3] = t;
x0 += w; tile.texture.pos.X += tile.texture.size.X;
w *= -1; tile.texture.size.X *= -1;
break; break;
case 8: //FX case 8: //FX
y0 += h; tile.texture.pos.Y += tile.texture.size.Y;
h *= -1; tile.texture.size.Y *= -1;
break; break;
case 9: //FY case 9: //FY
x0 += w; tile.texture.pos.X += tile.texture.size.X;
w *= -1; tile.texture.size.X *= -1;
break; break;
default: default:
break; break;
@ -560,6 +555,11 @@ static void makeFastFace(TileSpec tile, u16 li0, u16 li1, u16 li2, u16 li3,
u8 alpha = tile.alpha; u8 alpha = tile.alpha;
float x0 = tile.texture.pos.X;
float y0 = tile.texture.pos.Y;
float w = tile.texture.size.X;
float h = tile.texture.size.Y;
face.vertices[0] = video::S3DVertex(vertex_pos[0], normal, face.vertices[0] = video::S3DVertex(vertex_pos[0], normal,
MapBlock_LightColor(alpha, li0, light_source), MapBlock_LightColor(alpha, li0, light_source),
core::vector2d<f32>(x0+w*abs_scale, y0+h)); core::vector2d<f32>(x0+w*abs_scale, y0+h));
@ -645,6 +645,12 @@ TileSpec getNodeTileN(MapNode mn, v3s16 p, u8 tileindex, MeshMakeData *data)
if(p == data->m_crack_pos_relative) if(p == data->m_crack_pos_relative)
{ {
spec.material_flags |= MATERIAL_FLAG_CRACK; spec.material_flags |= MATERIAL_FLAG_CRACK;
spec.texture = data->m_gamedef->tsrc()->getTextureRawAP(spec.texture);
}
// If animated, replace tile texture with one without texture atlas
if(spec.material_flags & MATERIAL_FLAG_ANIMATION_VERTICAL_FRAMES)
{
spec.texture = data->m_gamedef->tsrc()->getTextureRawAP(spec.texture);
} }
return spec; return spec;
} }
@ -711,7 +717,7 @@ TileSpec getNodeTile(MapNode mn, v3s16 p, v3s16 dir, MeshMakeData *data)
u16 tile_index=facedir*16 + dir_i; u16 tile_index=facedir*16 + dir_i;
TileSpec spec = getNodeTileN(mn, p, dir_to_tile[tile_index], data); TileSpec spec = getNodeTileN(mn, p, dir_to_tile[tile_index], data);
spec.rotation=dir_to_tile[tile_index + 1]; spec.rotation=dir_to_tile[tile_index + 1];
spec.texture = data->m_gamedef->tsrc()->getTexture(spec.texture_id); spec.texture = data->m_gamedef->tsrc()->getTexture(spec.texture.id);
return spec; return spec;
} }
@ -883,7 +889,23 @@ static void updateFastFaceRow(
continuous_tiles_count++; continuous_tiles_count++;
if(next_is_different) // This is set to true if the texture doesn't allow more tiling
bool end_of_texture = false;
/*
If there is no texture, it can be tiled infinitely.
If tiled==0, it means the texture can be tiled infinitely.
Otherwise check tiled agains continuous_tiles_count.
*/
if(tile.texture.atlas != NULL && tile.texture.tiled != 0)
{
if(tile.texture.tiled <= continuous_tiles_count)
end_of_texture = true;
}
// Do this to disable tiling textures
//end_of_texture = true; //DEBUG
if(next_is_different || end_of_texture)
{ {
/* /*
Create a face if there should be one Create a face if there should be one
@ -1038,7 +1060,7 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data):
const u16 indices[] = {0,1,2,2,3,0}; const u16 indices[] = {0,1,2,2,3,0};
const u16 indices_alternate[] = {0,1,3,2,3,1}; const u16 indices_alternate[] = {0,1,3,2,3,1};
if(f.tile.texture == NULL) if(f.tile.texture.atlas == NULL)
continue; continue;
const u16 *indices_p = indices; const u16 *indices_p = indices;
@ -1069,20 +1091,15 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data):
/* /*
Convert MeshCollector to SMesh Convert MeshCollector to SMesh
Also store animation info
*/ */
bool enable_bumpmapping = g_settings->getBool("enable_bumpmapping"); bool enable_shaders = (g_settings->getS32("enable_shaders") > 0);
bool enable_shaders = g_settings->getBool("enable_shaders");
video::E_MATERIAL_TYPE shadermat1 = m_gamedef->getShaderSource()-> video::E_MATERIAL_TYPE shadermat1 = m_gamedef->getShaderSource()->
getShader("test_shader_1").material; getShader("test_shader_1").material;
video::E_MATERIAL_TYPE shadermat2 = m_gamedef->getShaderSource()-> video::E_MATERIAL_TYPE shadermat2 = m_gamedef->getShaderSource()->
getShader("test_shader_2").material; getShader("test_shader_2").material;
video::E_MATERIAL_TYPE shadermat3 = m_gamedef->getShaderSource()-> video::E_MATERIAL_TYPE shadermat3 = m_gamedef->getShaderSource()->
getShader("test_shader_3").material; getShader("test_shader_3").material;
video::E_MATERIAL_TYPE bumpmaps1 = m_gamedef->getShaderSource()->
getShader("bumpmaps_solids").material;
video::E_MATERIAL_TYPE bumpmaps2 = m_gamedef->getShaderSource()->
getShader("bumpmaps_liquids").material;
for(u32 i = 0; i < collector.prebuffers.size(); i++) for(u32 i = 0; i < collector.prebuffers.size(); i++)
{ {
PreMeshBuffer &p = collector.prebuffers[i]; PreMeshBuffer &p = collector.prebuffers[i];
@ -1095,7 +1112,7 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data):
if(p.tile.material_flags & MATERIAL_FLAG_CRACK) if(p.tile.material_flags & MATERIAL_FLAG_CRACK)
{ {
ITextureSource *tsrc = data->m_gamedef->tsrc(); ITextureSource *tsrc = data->m_gamedef->tsrc();
std::string crack_basename = tsrc->getTextureName(p.tile.texture_id); std::string crack_basename = tsrc->getTextureName(p.tile.texture.id);
if(p.tile.material_flags & MATERIAL_FLAG_CRACK_OVERLAY) if(p.tile.material_flags & MATERIAL_FLAG_CRACK_OVERLAY)
crack_basename += "^[cracko"; crack_basename += "^[cracko";
else else
@ -1120,11 +1137,9 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data):
} }
// Replace tile texture with the first animation frame // Replace tile texture with the first animation frame
std::ostringstream os(std::ios::binary); std::ostringstream os(std::ios::binary);
os<<tsrc->getTextureName(p.tile.texture_id); os<<tsrc->getTextureName(p.tile.texture.id);
os<<"^[verticalframe:"<<(int)p.tile.animation_frame_count<<":0"; os<<"^[verticalframe:"<<(int)p.tile.animation_frame_count<<":0";
p.tile.texture = tsrc->getTexture( p.tile.texture = tsrc->getTexture(os.str());
os.str(),
&p.tile.texture_id);
} }
// - Classic lighting (shaders handle this by themselves) // - Classic lighting (shaders handle this by themselves)
if(!enable_shaders) if(!enable_shaders)
@ -1156,41 +1171,13 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data):
material.setFlag(video::EMF_FOG_ENABLE, true); material.setFlag(video::EMF_FOG_ENABLE, true);
//material.setFlag(video::EMF_ANTI_ALIASING, video::EAAM_OFF); //material.setFlag(video::EMF_ANTI_ALIASING, video::EAAM_OFF);
//material.setFlag(video::EMF_ANTI_ALIASING, video::EAAM_SIMPLE); //material.setFlag(video::EMF_ANTI_ALIASING, video::EAAM_SIMPLE);
material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; material.MaterialType
material.setTexture(0, p.tile.texture); = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF;
material.setTexture(0, p.tile.texture.atlas);
if (enable_shaders) { if(enable_shaders)
video::E_MATERIAL_TYPE smat1 = shadermat1; p.tile.applyMaterialOptionsWithShaders(material, shadermat1, shadermat2, shadermat3);
video::E_MATERIAL_TYPE smat2 = shadermat2; else
video::E_MATERIAL_TYPE smat3 = shadermat3;
if (enable_bumpmapping) {
ITextureSource *tsrc = data->m_gamedef->tsrc();
std::string fname_base = tsrc->getTextureName(p.tile.texture_id);
std::string normal_ext = "_normal.png";
size_t pos = fname_base.find(".");
std::string fname_normal = fname_base.substr(0, pos) + normal_ext;
if (tsrc->isKnownSourceImage(fname_normal)) {
// look for image extension and replace it
size_t i = 0;
while ((i = fname_base.find(".", i)) != std::string::npos) {
fname_base.replace(i, 4, normal_ext);
i += normal_ext.length();
}
material.setTexture(1, tsrc->getTexture(fname_base));
smat1 = bumpmaps1;
smat2 = bumpmaps2;
}
}
p.tile.applyMaterialOptionsWithShaders(material, smat1, smat2, smat3);
} else {
p.tile.applyMaterialOptions(material); p.tile.applyMaterialOptions(material);
}
// Create meshbuffer // Create meshbuffer
@ -1250,9 +1237,6 @@ MapBlockMesh::~MapBlockMesh()
bool MapBlockMesh::animate(bool faraway, float time, int crack, u32 daynight_ratio) bool MapBlockMesh::animate(bool faraway, float time, int crack, u32 daynight_ratio)
{ {
bool enable_shaders = (g_settings->getS32("enable_shaders") > 0);
bool enable_bumpmapping = g_settings->getBool("enable_bumpmapping");
if(!m_has_animation) if(!m_has_animation)
{ {
m_animation_force_timer = 100000; m_animation_force_timer = 100000;
@ -1275,8 +1259,8 @@ bool MapBlockMesh::animate(bool faraway, float time, int crack, u32 daynight_rat
ITextureSource *tsrc = m_gamedef->getTextureSource(); ITextureSource *tsrc = m_gamedef->getTextureSource();
std::ostringstream os; std::ostringstream os;
os<<basename<<crack; os<<basename<<crack;
buf->getMaterial().setTexture(0, AtlasPointer ap = tsrc->getTexture(os.str());
tsrc->getTexture(os.str())); buf->getMaterial().setTexture(0, ap.atlas);
} }
m_last_crack = crack; m_last_crack = crack;
@ -1303,23 +1287,11 @@ bool MapBlockMesh::animate(bool faraway, float time, int crack, u32 daynight_rat
// Create new texture name from original // Create new texture name from original
std::ostringstream os(std::ios::binary); std::ostringstream os(std::ios::binary);
os<<tsrc->getTextureName(tile.texture_id); os<<tsrc->getTextureName(tile.texture.id);
os<<"^[verticalframe:"<<(int)tile.animation_frame_count<<":"<<frame; os<<"^[verticalframe:"<<(int)tile.animation_frame_count<<":"<<frame;
// Set the texture // Set the texture
buf->getMaterial().setTexture(0, tsrc->getTexture(os.str())); AtlasPointer ap = tsrc->getTexture(os.str());
if (enable_shaders && enable_bumpmapping) buf->getMaterial().setTexture(0, ap.atlas);
{
std::string basename,normal;
basename = tsrc->getTextureName(tile.texture_id);
unsigned pos;
pos = basename.find(".");
normal = basename.substr (0, pos);
normal += "_normal.png";
os.str("");
os<<normal<<"^[verticalframe:"<<(int)tile.animation_frame_count<<":"<<frame;
if (tsrc->isKnownSourceImage(normal))
buf->getMaterial().setTexture(1, tsrc->getTexture(os.str()));
}
} }
// Day-night transition // Day-night transition

View File

@ -237,8 +237,6 @@ Decoration::~Decoration() {
void Decoration::resolveNodeNames(INodeDefManager *ndef) { void Decoration::resolveNodeNames(INodeDefManager *ndef) {
this->ndef = ndef;
if (c_place_on == CONTENT_IGNORE) if (c_place_on == CONTENT_IGNORE)
c_place_on = ndef->getId(place_on_name); c_place_on = ndef->getId(place_on_name);
} }
@ -293,7 +291,7 @@ void Decoration::placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) {
continue; continue;
int height = getHeight(); int height = getHeight();
int max_y = nmax.Y;// + MAP_BLOCKSIZE - 1; int max_y = nmax.Y + MAP_BLOCKSIZE;
if (y + 1 + height > max_y) { if (y + 1 + height > max_y) {
continue; continue;
#if 0 #if 0
@ -537,10 +535,28 @@ void DecoSchematic::generate(Mapgen *mg, PseudoRandom *pr, s16 max_y, v3s16 p) {
c_place_on != CONTENT_IGNORE) c_place_on != CONTENT_IGNORE)
return; return;
Rotation rot = (rotation == ROTATE_RAND) ? u32 i = 0;
(Rotation)pr->range(ROTATE_0, ROTATE_270) : rotation; for (s16 z = 0; z != size.Z; z++)
for (s16 y = 0; y != size.Y; y++) {
vi = vm->m_area.index(p.X, p.Y + y, p.Z + z);
for (s16 x = 0; x != size.X; x++, i++, vi++) {
if (!vm->m_area.contains(vi))
continue;
blitToVManip(p, vm, rot, false); if (schematic[i].getContent() == CONTENT_IGNORE)
continue;
content_t c = vm->m_data[vi].getContent();
if (c != CONTENT_AIR && c != CONTENT_IGNORE)
continue;
if (schematic[i].param1 && myrand_range(1, 256) > schematic[i].param1)
continue;
vm->m_data[vi] = schematic[i];
vm->m_data[vi].param1 = 0;
}
}
} }
@ -554,93 +570,39 @@ std::string DecoSchematic::getName() {
} }
void DecoSchematic::blitToVManip(v3s16 p, ManualMapVoxelManipulator *vm, void DecoSchematic::placeStructure(Map *map, v3s16 p) {
Rotation rot, bool force_placement) { assert(schematic != NULL);
int xstride = 1; ManualMapVoxelManipulator *vm = new ManualMapVoxelManipulator(map);
int ystride = size.X;
int zstride = size.X * size.Y;
s16 sx = size.X; if (flags & DECO_PLACE_CENTER_X)
s16 sy = size.Y; p.X -= (size.X + 1) / 2;
s16 sz = size.Z; if (flags & DECO_PLACE_CENTER_Y)
p.Y -= (size.Y + 1) / 2;
if (flags & DECO_PLACE_CENTER_Z)
p.Z -= (size.Z + 1) / 2;
int i_start, i_step_x, i_step_z; v3s16 bp1 = getNodeBlockPos(p);
switch (rot) { v3s16 bp2 = getNodeBlockPos(p + size - v3s16(1,1,1));
case ROTATE_90: vm->initialEmerge(bp1, bp2);
i_start = sx - 1;
i_step_x = zstride;
i_step_z = -xstride;
SWAP(s16, sx, sz);
break;
case ROTATE_180:
i_start = zstride * (sz - 1) + sx - 1;
i_step_x = -xstride;
i_step_z = -zstride;
break;
case ROTATE_270:
i_start = zstride * (sz - 1);
i_step_x = -zstride;
i_step_z = xstride;
SWAP(s16, sx, sz);
break;
default:
i_start = 0;
i_step_x = xstride;
i_step_z = zstride;
}
for (s16 z = 0; z != sz; z++) u32 i = 0;
for (s16 y = 0; y != sy; y++) { for (s16 z = 0; z != size.Z; z++)
u32 i = z * i_step_z + y * ystride + i_start; for (s16 y = 0; y != size.Y; y++) {
for (s16 x = 0; x != sx; x++, i += i_step_x) { u32 vi = vm->m_area.index(p.X, p.Y + y, p.Z + z);
u32 vi = vm->m_area.index(p.X + x, p.Y + y, p.Z + z); for (s16 x = 0; x != size.X; x++, i++, vi++) {
if (!vm->m_area.contains(vi)) if (!vm->m_area.contains(vi))
continue; continue;
if (schematic[i].getContent() == CONTENT_IGNORE) if (schematic[i].getContent() == CONTENT_IGNORE)
continue; continue;
if (!force_placement) {
content_t c = vm->m_data[vi].getContent();
if (c != CONTENT_AIR && c != CONTENT_IGNORE)
continue;
}
if (schematic[i].param1 && myrand_range(1, 256) > schematic[i].param1) if (schematic[i].param1 && myrand_range(1, 256) > schematic[i].param1)
continue; continue;
vm->m_data[vi] = schematic[i]; vm->m_data[vi] = schematic[i];
vm->m_data[vi].param1 = 0; vm->m_data[vi].param1 = 0;
if (rot)
vm->m_data[vi].rotateAlongYAxis(ndef, rot);
} }
} }
}
void DecoSchematic::placeStructure(Map *map, v3s16 p) {
assert(schematic != NULL);
ManualMapVoxelManipulator *vm = new ManualMapVoxelManipulator(map);
Rotation rot = (rotation == ROTATE_RAND) ?
(Rotation)myrand_range(ROTATE_0, ROTATE_270) : rotation;
v3s16 s = (rot == ROTATE_90 || rot == ROTATE_270) ?
v3s16(size.Z, size.Y, size.X) : size;
if (flags & DECO_PLACE_CENTER_X)
p.X -= (s.X + 1) / 2;
if (flags & DECO_PLACE_CENTER_Y)
p.Y -= (s.Y + 1) / 2;
if (flags & DECO_PLACE_CENTER_Z)
p.Z -= (s.Z + 1) / 2;
v3s16 bp1 = getNodeBlockPos(p);
v3s16 bp2 = getNodeBlockPos(p + s - v3s16(1,1,1));
vm->initialEmerge(bp1, bp2);
blitToVManip(p, vm, rot, true);
std::map<v3s16, MapBlock *> lighting_modified_blocks; std::map<v3s16, MapBlock *> lighting_modified_blocks;
std::map<v3s16, MapBlock *> modified_blocks; std::map<v3s16, MapBlock *> modified_blocks;
@ -665,7 +627,7 @@ bool DecoSchematic::loadSchematicFile() {
std::ifstream is(filename.c_str(), std::ios_base::binary); std::ifstream is(filename.c_str(), std::ios_base::binary);
u32 signature = readU32(is); u32 signature = readU32(is);
if (signature != MTSCHEM_FILE_SIGNATURE) { if (signature != 'MTSM') {
errorstream << "loadSchematicFile: invalid schematic " errorstream << "loadSchematicFile: invalid schematic "
"file" << std::endl; "file" << std::endl;
return false; return false;
@ -724,7 +686,7 @@ bool DecoSchematic::loadSchematicFile() {
void DecoSchematic::saveSchematicFile(INodeDefManager *ndef) { void DecoSchematic::saveSchematicFile(INodeDefManager *ndef) {
std::ofstream os(filename.c_str(), std::ios_base::binary); std::ofstream os(filename.c_str(), std::ios_base::binary);
writeU32(os, MTSCHEM_FILE_SIGNATURE); // signature writeU32(os, 'MTSM'); // signature
writeU16(os, 1); // version writeU16(os, 1); // version
writeV3S16(os, size); // schematic size writeV3S16(os, size); // schematic size
@ -864,16 +826,9 @@ void Mapgen::updateHeightmap(v3s16 nmin, v3s16 nmax) {
//TimeTaker t("Mapgen::updateHeightmap", NULL, PRECISION_MICRO); //TimeTaker t("Mapgen::updateHeightmap", NULL, PRECISION_MICRO);
int index = 0; int index = 0;
for (s16 z = nmin.Z; z <= nmax.Z; z++) { for (s16 z = nmin.Z; z <= nmax.Z; z++) {
for (s16 x = nmin.X; x <= nmax.X; x++, index++) { for (s16 x = nmin.X; x <= nmax.X; x++) {
s16 y = findGroundLevel(v2s16(x, z), nmin.Y, nmax.Y); s16 y = findGroundLevel(v2s16(x, z), nmin.Y, nmax.Y);
heightmap[index++] = y;
// if the values found are out of range, trust the old heightmap
if (y == nmax.Y && heightmap[index] > nmax.Y)
continue;
if (y == nmin.Y - 1 && heightmap[index] < nmin.Y)
continue;
heightmap[index] = y;
} }
} }
//printf("updateHeightmap: %dus\n", t.stop()); //printf("updateHeightmap: %dus\n", t.stop());
@ -881,10 +836,8 @@ void Mapgen::updateHeightmap(v3s16 nmin, v3s16 nmax) {
void Mapgen::updateLiquid(UniqueQueue<v3s16> *trans_liquid, v3s16 nmin, v3s16 nmax) { void Mapgen::updateLiquid(UniqueQueue<v3s16> *trans_liquid, v3s16 nmin, v3s16 nmax) {
bool isliquid, wasliquid, rare; bool isliquid, wasliquid;
v3s16 em = vm->m_area.getExtent(); v3s16 em = vm->m_area.getExtent();
rare = g_settings->getBool("liquid_finite");
int rarecnt = 0;
for (s16 z = nmin.Z; z <= nmax.Z; z++) { for (s16 z = nmin.Z; z <= nmax.Z; z++) {
for (s16 x = nmin.X; x <= nmax.X; x++) { for (s16 x = nmin.X; x <= nmax.X; x++) {
@ -894,8 +847,8 @@ void Mapgen::updateLiquid(UniqueQueue<v3s16> *trans_liquid, v3s16 nmin, v3s16 nm
for (s16 y = nmax.Y; y >= nmin.Y; y--) { for (s16 y = nmax.Y; y >= nmin.Y; y--) {
isliquid = ndef->get(vm->m_data[i]).isLiquid(); isliquid = ndef->get(vm->m_data[i]).isLiquid();
// there was a change between liquid and nonliquid, add to queue. no need to add every with liquid_finite // there was a change between liquid and nonliquid, add to queue
if (isliquid != wasliquid && (!rare || !(rarecnt++ % 36))) if (isliquid != wasliquid)
trans_liquid->push_back(v3s16(x, y, z)); trans_liquid->push_back(v3s16(x, y, z));
wasliquid = isliquid; wasliquid = isliquid;
@ -1072,12 +1025,9 @@ bool MapgenV7Params::readParams(Settings *settings) {
bool success = bool success =
settings->getNoiseParams("mgv7_np_terrain_base", np_terrain_base) && settings->getNoiseParams("mgv7_np_terrain_base", np_terrain_base) &&
settings->getNoiseParams("mgv7_np_terrain_alt", np_terrain_alt) && settings->getNoiseParams("mgv7_np_terrain_alt", np_terrain_alt) &&
settings->getNoiseParams("mgv7_np_terrain_mod", np_terrain_mod) &&
settings->getNoiseParams("mgv7_np_terrain_persist", np_terrain_persist) && settings->getNoiseParams("mgv7_np_terrain_persist", np_terrain_persist) &&
settings->getNoiseParams("mgv7_np_height_select", np_height_select) && settings->getNoiseParams("mgv7_np_height_select", np_height_select) &&
settings->getNoiseParams("mgv7_np_filler_depth", np_filler_depth) &&
settings->getNoiseParams("mgv7_np_mount_height", np_mount_height) &&
settings->getNoiseParams("mgv7_np_ridge_uwater", np_ridge_uwater) &&
settings->getNoiseParams("mgv7_np_mountain", np_mountain) &&
settings->getNoiseParams("mgv7_np_ridge", np_ridge); settings->getNoiseParams("mgv7_np_ridge", np_ridge);
return success; return success;
} }
@ -1086,12 +1036,9 @@ bool MapgenV7Params::readParams(Settings *settings) {
void MapgenV7Params::writeParams(Settings *settings) { void MapgenV7Params::writeParams(Settings *settings) {
settings->setNoiseParams("mgv7_np_terrain_base", np_terrain_base); settings->setNoiseParams("mgv7_np_terrain_base", np_terrain_base);
settings->setNoiseParams("mgv7_np_terrain_alt", np_terrain_alt); settings->setNoiseParams("mgv7_np_terrain_alt", np_terrain_alt);
settings->setNoiseParams("mgv7_np_terrain_mod", np_terrain_mod);
settings->setNoiseParams("mgv7_np_terrain_persist", np_terrain_persist); settings->setNoiseParams("mgv7_np_terrain_persist", np_terrain_persist);
settings->setNoiseParams("mgv7_np_height_select", np_height_select); settings->setNoiseParams("mgv7_np_height_select", np_height_select);
settings->setNoiseParams("mgv7_np_filler_depth", np_filler_depth);
settings->setNoiseParams("mgv7_np_mount_height", np_mount_height);
settings->setNoiseParams("mgv7_np_ridge_uwater", np_ridge_uwater);
settings->setNoiseParams("mgv7_np_mountain", np_mountain);
settings->setNoiseParams("mgv7_np_ridge", np_ridge); settings->setNoiseParams("mgv7_np_ridge", np_ridge);
} }

View File

@ -23,7 +23,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "irrlichttypes_extrabloated.h" #include "irrlichttypes_extrabloated.h"
#include "util/container.h" // UniqueQueue #include "util/container.h" // UniqueQueue
#include "gamedef.h" #include "gamedef.h"
#include "nodedef.h"
#include "mapnode.h" #include "mapnode.h"
#include "noise.h" #include "noise.h"
#include "settings.h" #include "settings.h"
@ -37,8 +36,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define MGV6_BIOME_BLEND 0x10 #define MGV6_BIOME_BLEND 0x10
#define MG_FLAT 0x20 #define MG_FLAT 0x20
#define MG_NOLIGHT 0x40 #define MG_NOLIGHT 0x40
#define MGV7_MOUNTAINS 0x80
#define MGV7_RIDGES 0x100
/////////////////// Ore generation flags /////////////////// Ore generation flags
// Use absolute value of height to determine ore placement // Use absolute value of height to determine ore placement
@ -64,6 +61,7 @@ class EmergeManager;
class MapBlock; class MapBlock;
class ManualMapVoxelManipulator; class ManualMapVoxelManipulator;
class VoxelManipulator; class VoxelManipulator;
class INodeDefManager;
struct BlockMakeData; struct BlockMakeData;
class VoxelArea; class VoxelArea;
class Map; class Map;
@ -216,8 +214,6 @@ struct CutoffData {
class Decoration { class Decoration {
public: public:
INodeDefManager *ndef;
int mapseed; int mapseed;
std::string place_on_name; std::string place_on_name;
content_t c_place_on; content_t c_place_on;
@ -262,8 +258,6 @@ public:
virtual std::string getName(); virtual std::string getName();
}; };
#define MTSCHEM_FILE_SIGNATURE 0x4d54534d // 'MTSM'
class DecoSchematic : public Decoration { class DecoSchematic : public Decoration {
public: public:
std::string filename; std::string filename;
@ -272,7 +266,6 @@ public:
std::vector<content_t> c_nodes; std::vector<content_t> c_nodes;
u32 flags; u32 flags;
Rotation rotation;
v3s16 size; v3s16 size;
MapNode *schematic; MapNode *schematic;
@ -284,9 +277,6 @@ public:
virtual int getHeight(); virtual int getHeight();
virtual std::string getName(); virtual std::string getName();
void blitToVManip(v3s16 p, ManualMapVoxelManipulator *vm,
Rotation rot, bool force_placement);
bool loadSchematicFile(); bool loadSchematicFile();
void saveSchematicFile(INodeDefManager *ndef); void saveSchematicFile(INodeDefManager *ndef);

View File

@ -172,6 +172,7 @@ void MapgenMathParams::writeParams(Settings *settings) {
MapgenMath::MapgenMath(int mapgenid, MapgenMathParams *params_, EmergeManager *emerge) : MapgenV7(mapgenid, params_, emerge) { MapgenMath::MapgenMath(int mapgenid, MapgenMathParams *params_, EmergeManager *emerge) : MapgenV7(mapgenid, params_, emerge) {
mg_params = params_; mg_params = params_;
this->flags |= MG_NOLIGHT; this->flags |= MG_NOLIGHT;
this->ridges = 0;
Json::Value & params = mg_params->params; Json::Value & params = mg_params->params;
invert = params["invert"].empty() ? 1 : params["invert"].asBool(); //params["invert"].empty()?1:params["invert"].asBool(); invert = params["invert"].empty() ? 1 : params["invert"].asBool(); //params["invert"].empty()?1:params["invert"].asBool();
@ -237,7 +238,7 @@ MapgenMath::~MapgenMath() {
//////////////////////// Map generator //////////////////////// Map generator
int MapgenMath::generateTerrain() { void MapgenMath::generateTerrain() {
MapNode n_air(CONTENT_AIR, LIGHT_SUN), n_water_source(c_water_source, LIGHT_SUN); MapNode n_air(CONTENT_AIR, LIGHT_SUN), n_water_source(c_water_source, LIGHT_SUN);
MapNode n_stone(c_stone, LIGHT_SUN); MapNode n_stone(c_stone, LIGHT_SUN);
@ -262,9 +263,9 @@ int MapgenMath::generateTerrain() {
double d = (*func)(vec.X, vec.Y, vec.Z, distance, iterations); double d = (*func)(vec.X, vec.Y, vec.Z, distance, iterations);
if ((!invert && d > 0) || (invert && d == 0) ) { if ((!invert && d > 0) || (invert && d == 0) ) {
if (vm->m_data[i].getContent() == CONTENT_IGNORE) if (vm->m_data[i].getContent() == CONTENT_IGNORE)
// vm->m_data[i] = (y > water_level + biome->filler) ? vm->m_data[i] = (y > water_level + biome->filler_height) ?
// MapNode(biome->c_filler) : n_stone; MapNode(biome->c_filler) : n_stone;
vm->m_data[i] = n_stone; // vm->m_data[i] = n_stone;
} else if (y <= water_level) { } else if (y <= water_level) {
vm->m_data[i] = n_water_source; vm->m_data[i] = n_water_source;
} else { } else {
@ -360,7 +361,7 @@ int MapgenMath::generateTerrain() {
#endif #endif
return 0;
} }
int MapgenMath::getGroundLevelAtPoint(v2s16 p) { int MapgenMath::getGroundLevelAtPoint(v2s16 p) {

View File

@ -42,7 +42,7 @@ class MapgenMath : public MapgenV7 {
MapgenMath(int mapgenid, MapgenMathParams *mg_params, EmergeManager *emerge); MapgenMath(int mapgenid, MapgenMathParams *mg_params, EmergeManager *emerge);
~MapgenMath(); ~MapgenMath();
int generateTerrain(); void generateTerrain();
int getGroundLevelAtPoint(v2s16 p); int getGroundLevelAtPoint(v2s16 p);
bool invert; bool invert;

View File

@ -24,8 +24,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "mapblock.h" #include "mapblock.h"
#include "mapnode.h" #include "mapnode.h"
#include "map.h" #include "map.h"
//#include "serverobject.h"
#include "content_sao.h" #include "content_sao.h"
#include "nodedef.h" #include "nodedef.h"
#include "content_mapnode.h" // For content_mapnode_get_new_name
#include "voxelalgorithms.h" #include "voxelalgorithms.h"
#include "profiler.h" #include "profiler.h"
#include "settings.h" // For g_settings #include "settings.h" // For g_settings
@ -40,27 +42,29 @@ with this program; if not, write to the Free Software Foundation, Inc.,
/////////////////// Mapgen V7 perlin noise default values /////////////////// Mapgen V7 perlin noise default values
NoiseParams nparams_v7_def_terrain_base = NoiseParams nparams_v7_def_terrain_base =
{4, 70, v3f(300, 300, 300), 82341, 6, 0.7}; {0, 80.0, v3f(250.0, 250.0, 250.0), 82341, 5, 0.6};
NoiseParams nparams_v7_def_terrain_alt = NoiseParams nparams_v7_def_terrain_alt =
{4, 25, v3f(600, 600, 600), 5934, 5, 0.6}; {0, 20.0, v3f(250.0, 250.0, 250.0), 5934, 5, 0.6};
NoiseParams nparams_v7_def_terrain_mod =
{0, 1.0, v3f(350.0, 350.0, 350.0), 85039, 5, 0.6};
NoiseParams nparams_v7_def_terrain_persist = NoiseParams nparams_v7_def_terrain_persist =
{0.6, 0.1, v3f(500, 500, 500), 539, 3, 0.6}; {0, 1.0, v3f(500.0, 500.0, 500.0), 539, 3, 0.6};
NoiseParams nparams_v7_def_height_select = NoiseParams nparams_v7_def_height_select =
{-0.5, 1, v3f(250, 250, 250), 4213, 5, 0.69}; {0.5, 0.5, v3f(250.0, 250.0, 250.0), 4213, 5, 0.69};
NoiseParams nparams_v7_def_filler_depth =
{0, 1.2, v3f(150, 150, 150), 261, 4, 0.7};
NoiseParams nparams_v7_def_mount_height =
{100, 30, v3f(500, 500, 500), 72449, 4, 0.6};
NoiseParams nparams_v7_def_ridge_uwater =
{0, 1, v3f(500, 500, 500), 85039, 4, 0.6};
NoiseParams nparams_v7_def_mountain =
{0, 1, v3f(250, 350, 250), 5333, 5, 0.68};
NoiseParams nparams_v7_def_ridge = NoiseParams nparams_v7_def_ridge =
{0, 1, v3f(100, 100, 100), 6467, 4, 0.75}; {0, 1.0, v3f(100.0, 100.0, 100.0), 6467, 4, 0.75};
/*
NoiseParams nparams_v6_def_beach =
{0.0, 1.0, v3f(250.0, 250.0, 250.0), 59420, 3, 0.50};
NoiseParams nparams_v6_def_cave =
{6.0, 6.0, v3f(250.0, 250.0, 250.0), 34329, 3, 0.50};
NoiseParams nparams_v6_def_humidity =
{0.5, 0.5, v3f(500.0, 500.0, 500.0), 72384, 4, 0.66};
NoiseParams nparams_v6_def_trees =
{0.0, 1.0, v3f(125.0, 125.0, 125.0), 2, 4, 0.66};
NoiseParams nparams_v6_def_apple_trees =
{0.0, 1.0, v3f(100.0, 100.0, 100.0), 342902, 3, 0.45};
*/
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -72,14 +76,11 @@ MapgenV7::MapgenV7(int mapgenid, MapgenV7Params *params, EmergeManager *emerge)
this->seed = (int)params->seed; this->seed = (int)params->seed;
this->water_level = params->water_level; this->water_level = params->water_level;
this->flags = params->flags | MGV7_MOUNTAINS | MGV7_RIDGES; this->flags = params->flags;
this->ridges = 1;
this->csize = v3s16(1, 1, 1) * params->chunksize * MAP_BLOCKSIZE; this->csize = v3s16(1, 1, 1) * params->chunksize * MAP_BLOCKSIZE;
this->ystride = csize.X; //////fix this
// amount of elements to skip for the next index
// for noise/height/biome maps (not vmanip)
this->ystride = csize.X;
this->zstride = csize.X * csize.Y;
this->biomemap = new u8[csize.X * csize.Z]; this->biomemap = new u8[csize.X * csize.Z];
this->heightmap = new s16[csize.X * csize.Z]; this->heightmap = new s16[csize.X * csize.Z];
@ -88,14 +89,9 @@ MapgenV7::MapgenV7(int mapgenid, MapgenV7Params *params, EmergeManager *emerge)
// Terrain noise // Terrain noise
noise_terrain_base = new Noise(&params->np_terrain_base, seed, csize.X, csize.Z); noise_terrain_base = new Noise(&params->np_terrain_base, seed, csize.X, csize.Z);
noise_terrain_alt = new Noise(&params->np_terrain_alt, seed, csize.X, csize.Z); noise_terrain_alt = new Noise(&params->np_terrain_alt, seed, csize.X, csize.Z);
noise_terrain_mod = new Noise(&params->np_terrain_mod, seed, csize.X, csize.Z);
noise_terrain_persist = new Noise(&params->np_terrain_persist, seed, csize.X, csize.Z); noise_terrain_persist = new Noise(&params->np_terrain_persist, seed, csize.X, csize.Z);
noise_height_select = new Noise(&params->np_height_select, seed, csize.X, csize.Z); noise_height_select = new Noise(&params->np_height_select, seed, csize.X, csize.Z);
noise_filler_depth = new Noise(&params->np_filler_depth, seed, csize.X, csize.Z);
noise_mount_height = new Noise(&params->np_mount_height, seed, csize.X, csize.Z);
noise_ridge_uwater = new Noise(&params->np_ridge_uwater, seed, csize.X, csize.Z);
// 3d terrain noise
noise_mountain = new Noise(&params->np_mountain, seed, csize.X, csize.Y, csize.Z);
noise_ridge = new Noise(&params->np_ridge, seed, csize.X, csize.Y, csize.Z); noise_ridge = new Noise(&params->np_ridge, seed, csize.X, csize.Y, csize.Z);
// Biome noise // Biome noise
@ -106,15 +102,11 @@ MapgenV7::MapgenV7(int mapgenid, MapgenV7Params *params, EmergeManager *emerge)
MapgenV7::~MapgenV7() { MapgenV7::~MapgenV7() {
delete noise_terrain_base; delete noise_terrain_base;
delete noise_terrain_mod;
delete noise_terrain_persist; delete noise_terrain_persist;
delete noise_height_select; delete noise_height_select;
delete noise_terrain_alt; delete noise_terrain_alt;
delete noise_filler_depth;
delete noise_mount_height;
delete noise_ridge_uwater;
delete noise_mountain;
delete noise_ridge; delete noise_ridge;
delete noise_heat; delete noise_heat;
delete noise_humidity; delete noise_humidity;
@ -125,28 +117,25 @@ MapgenV7::~MapgenV7() {
int MapgenV7::getGroundLevelAtPoint(v2s16 p) { int MapgenV7::getGroundLevelAtPoint(v2s16 p) {
// Base terrain calculation s16 groundlevel = baseTerrainLevelAtPoint(p.X, p.Y);
s16 y = baseTerrainLevelAtPoint(p.X, p.Y); float heat = NoisePerlin2D(bmgr->np_heat, p.X, p.Y, seed);
float humidity = NoisePerlin2D(bmgr->np_humidity, p.X, p.Y, seed);
Biome *b = bmgr->getBiome(heat, humidity, groundlevel);
// Ridge/river terrain calculation s16 y = groundlevel;
float width = 0.3; int iters = 1024; // don't even bother iterating more than 64 times..
float uwatern = NoisePerlin2DNoTxfm(noise_ridge_uwater->np, p.X, p.Y, seed) * 2;
// actually computing the depth of the ridge is much more expensive;
// if inside a river, simply guess
if (uwatern >= -width && uwatern <= width)
return water_level - 10;
// Mountain terrain calculation
int iters = 128; // don't even bother iterating more than 128 times..
while (iters--) { while (iters--) {
//current point would have been air if (y <= water_level)
if (!getMountainTerrainAtPoint(p.X, y, p.Y)) break;
return y;
y++; float ridgenoise = NoisePerlin3D(noise_ridge->np, p.X, y, p.Y, seed);
if (ridgenoise * (float)(y * y) < 15.0)
break;
y--;
} }
return y; return y + b->top_depth;
} }
@ -174,23 +163,11 @@ void MapgenV7::makeChunk(BlockMakeData *data) {
blockseed = emerge->getBlockSeed(full_node_min); //////use getBlockSeed2()! blockseed = emerge->getBlockSeed(full_node_min); //////use getBlockSeed2()!
c_stone = ndef->getId("mapgen_stone");
c_dirt = ndef->getId("mapgen_dirt");
c_dirt_with_grass = ndef->getId("mapgen_dirt_with_grass");
c_sand = ndef->getId("mapgen_sand");
c_water_source = ndef->getId("mapgen_water_source");
c_lava_source = ndef->getId("mapgen_lava_source");
c_ice = ndef->getId("default:ice");
if (c_ice == CONTENT_IGNORE)
c_ice = CONTENT_AIR;
// Make some noise // Make some noise
calculateNoise(); calculateNoise();
// Generate base terrain, mountains, and ridges with initial heightmaps // Calculate height map
s16 stone_surface_max_y = generateTerrain(); s16 stone_surface_max_y = calcHeightMap();
updateHeightmap(node_min, node_max);
// Calculate biomes // Calculate biomes
BiomeNoiseInput binput; BiomeNoiseInput binput;
@ -200,12 +177,24 @@ void MapgenV7::makeChunk(BlockMakeData *data) {
binput.height_map = heightmap; binput.height_map = heightmap;
bmgr->calcBiomes(&binput, biomemap); bmgr->calcBiomes(&binput, biomemap);
// Actually place the biome-specific nodes and what not c_stone = ndef->getId("mapgen_stone");
generateBiomes(); c_dirt = ndef->getId("mapgen_dirt");
c_dirt_with_grass = ndef->getId("mapgen_dirt_with_grass");
c_sand = ndef->getId("mapgen_sand");
c_water_source = ndef->getId("mapgen_water_source");
c_lava_source = ndef->getId("mapgen_lava_source");
generateTerrain();
if (this->ridges)
carveRidges();
if (flags & MG_CAVES) if (flags & MG_CAVES)
generateCaves(stone_surface_max_y); generateCaves(stone_surface_max_y);
addTopNodes();
updateHeightmap(node_min, node_max);
if (flags & MG_DUNGEONS) { if (flags & MG_DUNGEONS) {
DungeonGen dgen(ndef, data->seed, water_level); DungeonGen dgen(ndef, data->seed, water_level);
dgen.generate(vm, blockseed, full_node_min, full_node_max); dgen.generate(vm, blockseed, full_node_min, full_node_max);
@ -221,9 +210,6 @@ void MapgenV7::makeChunk(BlockMakeData *data) {
ore->placeOre(this, blockseed + i, node_min, node_max); ore->placeOre(this, blockseed + i, node_min, node_max);
} }
// Sprinkle some dust on top after everything else was generated
dustTopNodes();
//printf("makeChunk: %dms\n", t.stop()); //printf("makeChunk: %dms\n", t.stop());
updateLiquid(&data->transforming_liquid, full_node_min, full_node_max); updateLiquid(&data->transforming_liquid, full_node_min, full_node_max);
@ -244,14 +230,15 @@ void MapgenV7::calculateNoise() {
int y = node_min.Y; int y = node_min.Y;
int z = node_min.Z; int z = node_min.Z;
noise_terrain_mod->perlinMap2D(x, z);
noise_height_select->perlinMap2D(x, z); noise_height_select->perlinMap2D(x, z);
noise_height_select->transformNoiseMap(); noise_height_select->transformNoiseMap();
noise_terrain_persist->perlinMap2D(x, z); noise_terrain_persist->perlinMap2D(x, z);
noise_terrain_persist->transformNoiseMap();
float *persistmap = noise_terrain_persist->result; float *persistmap = noise_terrain_persist->result;
for (int i = 0; i != csize.X * csize.Z; i++) for (int i = 0; i != csize.X * csize.Z; i++)
persistmap[i] = rangelim(persistmap[i], 0.4, 0.9); persistmap[i] = abs(persistmap[i]);
noise_terrain_base->perlinMap2DModulated(x, z, persistmap); noise_terrain_base->perlinMap2DModulated(x, z, persistmap);
noise_terrain_base->transformNoiseMap(); noise_terrain_base->transformNoiseMap();
@ -259,20 +246,10 @@ void MapgenV7::calculateNoise() {
noise_terrain_alt->perlinMap2DModulated(x, z, persistmap); noise_terrain_alt->perlinMap2DModulated(x, z, persistmap);
noise_terrain_alt->transformNoiseMap(); noise_terrain_alt->transformNoiseMap();
noise_filler_depth->perlinMap2D(x, z);
if (flags & MGV7_MOUNTAINS) {
noise_mountain->perlinMap3D(x, y, z);
noise_mount_height->perlinMap2D(x, z);
noise_mount_height->transformNoiseMap();
}
if (flags & MGV7_RIDGES) {
noise_ridge->perlinMap3D(x, y, z); noise_ridge->perlinMap3D(x, y, z);
noise_ridge_uwater->perlinMap2D(x, z);
}
noise_heat->perlinMap2D(x, z); noise_heat->perlinMap2D(x, z);
noise_humidity->perlinMap2D(x, z); noise_humidity->perlinMap2D(x, z);
//printf("calculateNoise: %dus\n", t.stop()); //printf("calculateNoise: %dus\n", t.stop());
@ -287,56 +264,36 @@ Biome *MapgenV7::getBiomeAtPoint(v3s16 p) {
return bmgr->getBiome(heat, humidity, groundlevel); return bmgr->getBiome(heat, humidity, groundlevel);
} }
//needs to be updated
float MapgenV7::baseTerrainLevelAtPoint(int x, int z) {
float hselect = NoisePerlin2D(noise_height_select->np, x, z, seed);
hselect = rangelim(hselect, 0.0, 1.0);
float persist = NoisePerlin2D(noise_terrain_persist->np, x, z, seed); float MapgenV7::baseTerrainLevelAtPoint(int x, int z) {
persist = rangelim(persist, 0.4, 0.9); float terrain_mod = NoisePerlin2DNoTxfm(noise_terrain_mod->np, x, z, seed);
float hselect = NoisePerlin2D(noise_height_select->np, x, z, seed);
float persist = abs(NoisePerlin2DNoTxfm(noise_terrain_persist->np, x, z, seed));
noise_terrain_base->np->persist = persist; noise_terrain_base->np->persist = persist;
float height_base = NoisePerlin2D(noise_terrain_base->np, x, z, seed); float terrain_base = NoisePerlin2D(noise_terrain_base->np, x, z, seed);
float height_base = terrain_base * terrain_mod;
noise_terrain_alt->np->persist = persist; noise_terrain_alt->np->persist = persist;
float height_alt = NoisePerlin2D(noise_terrain_alt->np, x, z, seed); float height_alt = NoisePerlin2D(noise_terrain_alt->np, x, z, seed);
if (height_alt > height_base)
return height_alt;
return (height_base * hselect) + (height_alt * (1.0 - hselect)); return (height_base * hselect) + (height_alt * (1.0 - hselect));
} }
float MapgenV7::baseTerrainLevelFromMap(int index) { float MapgenV7::baseTerrainLevelFromMap(int index) {
float hselect = rangelim(noise_height_select->result[index], 0.0, 1.0); float terrain_mod = noise_terrain_mod->result[index];
float height_base = noise_terrain_base->result[index]; float hselect = noise_height_select->result[index];
float terrain_base = noise_terrain_base->result[index];
float height_base = terrain_base * terrain_mod;
float height_alt = noise_terrain_alt->result[index]; float height_alt = noise_terrain_alt->result[index];
if (height_alt > height_base)
return height_alt;
return (height_base * hselect) + (height_alt * (1.0 - hselect)); return (height_base * hselect) + (height_alt * (1.0 - hselect));
} }
bool MapgenV7::getMountainTerrainAtPoint(int x, int y, int z) {
float mnt_h_n = NoisePerlin2D(noise_mount_height->np, x, z, seed);
float height_modifier = -((float)y / rangelim(mnt_h_n, 80.0, 150.0));
float mnt_n = NoisePerlin3D(noise_mountain->np, x, y, z, seed);
return mnt_n + height_modifier >= 0.6;
}
bool MapgenV7::getMountainTerrainFromMap(int idx_xyz, int idx_xz, int y) {
float mounthn = noise_mount_height->result[idx_xz];
float height_modifier = -((float)y / rangelim(mounthn, 80.0, 150.0));
return (noise_mountain->result[idx_xyz] + height_modifier >= 0.6);
}
#if 0 #if 0
// Crap code to test log rivers as a proof-of-concept. Didn't work out too well.
void MapgenV7::carveRivers() { void MapgenV7::carveRivers() {
MapNode n_air(CONTENT_AIR), n_water_source(c_water_source); MapNode n_air(CONTENT_AIR), n_water_source(c_water_source);
MapNode n_stone(c_stone); MapNode n_stone(c_stone);
@ -371,26 +328,8 @@ void MapgenV7::carveRivers() {
#endif #endif
int MapgenV7::generateTerrain() { int MapgenV7::calcHeightMap() {
int ymax = generateBaseTerrain();
if (flags & MGV7_MOUNTAINS)
generateMountainTerrain();
if (flags & MGV7_RIDGES)
generateRidgeTerrain();
return ymax;
}
int MapgenV7::generateBaseTerrain() {
MapNode n_air(CONTENT_AIR);
MapNode n_stone(c_stone);
MapNode n_water(c_water_source);
int stone_surface_max_y = -MAP_GENERATION_LIMIT; int stone_surface_max_y = -MAP_GENERATION_LIMIT;
v3s16 em = vm->m_area.getExtent();
u32 index = 0; u32 index = 0;
for (s16 z = node_min.Z; z <= node_max.Z; z++) for (s16 z = node_min.Z; z <= node_max.Z; z++)
@ -403,50 +342,46 @@ int MapgenV7::generateBaseTerrain() {
if (surface_y > stone_surface_max_y) if (surface_y > stone_surface_max_y)
stone_surface_max_y = surface_y; stone_surface_max_y = surface_y;
u32 i = vm->m_area.index(x, node_min.Y, z);
for (s16 y = node_min.Y; y <= node_max.Y; y++) {
if (vm->m_data[i].getContent() == CONTENT_IGNORE) {
if (y <= surface_y)
vm->m_data[i] = n_stone;
else if (y <= water_level)
vm->m_data[i] = n_water;
else
vm->m_data[i] = n_air;
}
vm->m_area.add_y(em, i, 1);
}
} }
return stone_surface_max_y; return stone_surface_max_y;
} }
void MapgenV7::generateMountainTerrain() { void MapgenV7::generateTerrain() {
MapNode n_air(CONTENT_AIR), n_water_source(c_water_source);
MapNode n_stone(c_stone);
v3s16 em = vm->m_area.getExtent();
u32 index = 0;
for (s16 z = node_min.Z; z <= node_max.Z; z++)
for (s16 x = node_min.X; x <= node_max.X; x++, index++) {
s16 surface_y = heightmap[index];
Biome *biome = bmgr->biomes[biomemap[index]];
u32 i = vm->m_area.index(x, node_min.Y, z);
for (s16 y = node_min.Y; y <= node_max.Y; y++) {
if (vm->m_data[i].getContent() == CONTENT_IGNORE) {
if (y <= surface_y) {
vm->m_data[i] = (y > water_level + biome->filler_height) ?
MapNode(biome->c_filler) : n_stone;
} else if (y <= water_level) {
vm->m_data[i] = n_water_source;
} else {
vm->m_data[i] = n_air;
}
}
vm->m_area.add_y(em, i, 1);
}
}
}
void MapgenV7::carveRidges() {
if (node_max.Y <= water_level) if (node_max.Y <= water_level)
return; return;
MapNode n_stone(c_stone);
u32 j = 0;
for (s16 z = node_min.Z; z <= node_max.Z; z++)
for (s16 y = node_min.Y; y <= node_max.Y; y++) {
u32 vi = vm->m_area.index(node_min.X, y, z);
for (s16 x = node_min.X; x <= node_max.X; x++) {
int index = (z - node_min.Z) * csize.X + (x - node_min.X);
if (getMountainTerrainFromMap(j, index, y))
vm->m_data[vi] = n_stone;
vi++;
j++;
}
}
}
void MapgenV7::generateRidgeTerrain() {
MapNode n_water(c_water_source);
MapNode n_air(CONTENT_AIR); MapNode n_air(CONTENT_AIR);
u32 index = 0; u32 index = 0;
@ -454,152 +389,37 @@ void MapgenV7::generateRidgeTerrain() {
for (s16 y = node_min.Y; y <= node_max.Y; y++) { for (s16 y = node_min.Y; y <= node_max.Y; y++) {
u32 vi = vm->m_area.index(node_min.X, y, z); u32 vi = vm->m_area.index(node_min.X, y, z);
for (s16 x = node_min.X; x <= node_max.X; x++, index++, vi++) { for (s16 x = node_min.X; x <= node_max.X; x++, index++, vi++) {
int j = (z - node_min.Z) * csize.X + (x - node_min.X); // Removing this check will create huge underwater caverns,
// which are interesting but not desirable for gameplay
if (heightmap[j] < water_level - 4) if (y <= water_level)
continue; continue;
float widthn = (noise_terrain_persist->result[j] - 0.6) / 0.1; if (noise_ridge->result[index] * (float)(y * y) < 15.0)
//widthn = rangelim(widthn, -0.05, 0.5);
float width = 0.3; // TODO: figure out acceptable perlin noise values
float uwatern = noise_ridge_uwater->result[j] * 2;
if (uwatern < -width || uwatern > width)
continue;
float height_mod = (float)(y + 17) / 2.5;
float width_mod = (width - fabs(uwatern));
float nridge = noise_ridge->result[index] * (float)y / 7.0;
if (y < water_level)
nridge = -fabs(nridge) * 3.0 * widthn * 0.3;
if (nridge + width_mod * height_mod < 0.6)
continue; continue;
int j = (z - node_min.Z) * csize.Z + (x - node_min.X); //////obviously just temporary
if (y < ridge_heightmap[j]) if (y < ridge_heightmap[j])
ridge_heightmap[j] = y - 1; ridge_heightmap[j] = y - 1;
vm->m_data[vi] = (y > water_level) ? n_air : n_water; vm->m_data[vi] = n_air;
} }
} }
} }
/*
void MapgenV7::generateBiomes() { void MapgenV7::testBiomes() {
if (node_max.Y < water_level)
return;
MapNode n_air(CONTENT_AIR);
MapNode n_stone(c_stone);
MapNode n_water(c_water_source);
v3s16 em = vm->m_area.getExtent();
u32 index = 0; u32 index = 0;
for (s16 z = node_min.Z; z <= node_max.Z; z++) for (s16 z = node_min.Z; z <= node_min.Z; z++)
for (s16 x = node_min.X; x <= node_max.X; x++, index++) { for (s16 x = node_min.X; x <= node_min.X; x++) {;
Biome *biome = bmgr->biomes[biomemap[index]]; Biome *b = bmgr->getBiome(heat, humidity, 0);
s16 dfiller = biome->depth_filler + noise_filler_depth->result[index];
s16 y0_top = biome->depth_top;
s16 y0_filler = biome->depth_filler + biome->depth_top + dfiller;
s16 nplaced = 0;
u32 i = vm->m_area.index(x, node_max.Y, z);
content_t c_above = vm->m_data[i + em.X].getContent();
bool have_air = c_above == CONTENT_AIR;
for (s16 y = node_max.Y; y >= node_min.Y; y--) {
content_t c = vm->m_data[i].getContent();
// It could be the case that the elevation is equal to the chunk
// boundary, but the chunk above has not been generated yet
if (y == node_max.Y && c_above == CONTENT_IGNORE &&
y == heightmap[index] && c == c_stone) {
int j = (z - node_min.Z) * zstride +
(y - node_min.Y) * ystride +
(x - node_min.X);
have_air = !getMountainTerrainFromMap(j, index, y);
}
if (c == c_stone && have_air) {
content_t c_below = vm->m_data[i - em.X].getContent();
if (c_below != CONTENT_AIR) {
if (nplaced < y0_top) {
// A hack to prevent dirt_with_grass from being
// placed below water. TODO: fix later
content_t c_place = ((y < water_level) &&
(biome->c_top == c_dirt_with_grass)) ?
c_dirt : biome->c_top;
vm->m_data[i] = MapNode(c_place);
nplaced++;
} else if (nplaced < y0_filler && nplaced >= y0_top) {
vm->m_data[i] = MapNode(biome->c_filler);
nplaced++;
} else {
have_air = false;
nplaced = 0;
}
}
} else if (c == c_water_source) {
have_air = true;
nplaced = 0;
vm->m_data[i] = MapNode(biome->c_water);
} else if (c == CONTENT_AIR) {
have_air = true;
nplaced = 0;
}
vm->m_area.add_y(em, i, -1);
}
}
} }
// make an 80x80 grid with axes heat/humidity as a voroni diagram for biomes
// clear out y space for it first with air
// use absolute positioning, each chunk will be a +1 height
}*/
void MapgenV7::dustTopNodes() {
v3s16 em = vm->m_area.getExtent();
u32 index = 0;
if (water_level > node_max.Y)
return;
for (s16 z = node_min.Z; z <= node_max.Z; z++)
for (s16 x = node_min.X; x <= node_max.X; x++, index++) {
Biome *biome = bmgr->biomes[biomemap[index]];
if (biome->c_dust == CONTENT_IGNORE)
continue;
s16 y = node_max.Y;
u32 vi = vm->m_area.index(x, y, z);
for (; y >= node_min.Y; y--) {
if (vm->m_data[vi].getContent() != CONTENT_AIR)
break;
vm->m_area.add_y(em, vi, -1);
}
content_t c = vm->m_data[vi].getContent();
if (c == biome->c_water && biome->c_dust_water != CONTENT_IGNORE) {
if (y < node_min.Y)
continue;
vm->m_data[vi] = MapNode(biome->c_dust_water);
} else if (!ndef->get(c).buildable_to && c != CONTENT_IGNORE) {
if (y == node_max.Y)
continue;
vm->m_area.add_y(em, vi, 1);
vm->m_data[vi] = MapNode(biome->c_dust);
}
}
}
#if 0
void MapgenV7::addTopNodes() { void MapgenV7::addTopNodes() {
v3s16 em = vm->m_area.getExtent(); v3s16 em = vm->m_area.getExtent();
s16 ntopnodes; s16 ntopnodes;
@ -691,7 +511,6 @@ void MapgenV7::addTopNodes() {
} }
} }
} }
#endif
#include "mapgen_v6.h" #include "mapgen_v6.h"

View File

@ -24,34 +24,25 @@ with this program; if not, write to the Free Software Foundation, Inc.,
extern NoiseParams nparams_v7_def_terrain_base; extern NoiseParams nparams_v7_def_terrain_base;
extern NoiseParams nparams_v7_def_terrain_alt; extern NoiseParams nparams_v7_def_terrain_alt;
extern NoiseParams nparams_v7_def_terrain_mod;
extern NoiseParams nparams_v7_def_terrain_persist; extern NoiseParams nparams_v7_def_terrain_persist;
extern NoiseParams nparams_v7_def_height_select; extern NoiseParams nparams_v7_def_height_select;
extern NoiseParams nparams_v7_def_filler_depth;
extern NoiseParams nparams_v7_def_mount_height;
extern NoiseParams nparams_v7_def_ridge_uwater;
extern NoiseParams nparams_v7_def_mountain;
extern NoiseParams nparams_v7_def_ridge; extern NoiseParams nparams_v7_def_ridge;
struct MapgenV7Params : public MapgenParams { struct MapgenV7Params : public MapgenParams {
NoiseParams np_terrain_base; NoiseParams np_terrain_base;
NoiseParams np_terrain_alt; NoiseParams np_terrain_alt;
NoiseParams np_terrain_mod;
NoiseParams np_terrain_persist; NoiseParams np_terrain_persist;
NoiseParams np_height_select; NoiseParams np_height_select;
NoiseParams np_filler_depth;
NoiseParams np_mount_height;
NoiseParams np_ridge_uwater;
NoiseParams np_mountain;
NoiseParams np_ridge; NoiseParams np_ridge;
MapgenV7Params() { MapgenV7Params() {
np_terrain_base = nparams_v7_def_terrain_base; np_terrain_base = nparams_v7_def_terrain_base;
np_terrain_alt = nparams_v7_def_terrain_alt; np_terrain_alt = nparams_v7_def_terrain_alt;
np_terrain_mod = nparams_v7_def_terrain_mod;
np_terrain_persist = nparams_v7_def_terrain_persist; np_terrain_persist = nparams_v7_def_terrain_persist;
np_height_select = nparams_v7_def_height_select; np_height_select = nparams_v7_def_height_select;
np_filler_depth = nparams_v7_def_filler_depth;
np_mount_height = nparams_v7_def_mount_height;
np_ridge_uwater = nparams_v7_def_ridge_uwater;
np_mountain = nparams_v7_def_mountain;
np_ridge = nparams_v7_def_ridge; np_ridge = nparams_v7_def_ridge;
} }
@ -67,8 +58,8 @@ public:
BiomeDefManager *bmgr; BiomeDefManager *bmgr;
int ystride; int ystride;
int zstride;
u32 flags; u32 flags;
bool ridges;
u32 blockseed; u32 blockseed;
v3s16 node_min; v3s16 node_min;
@ -80,12 +71,10 @@ public:
Noise *noise_terrain_base; Noise *noise_terrain_base;
Noise *noise_terrain_alt; Noise *noise_terrain_alt;
Noise *noise_terrain_mod;
Noise *noise_terrain_persist; Noise *noise_terrain_persist;
Noise *noise_height_select; Noise *noise_height_select;
Noise *noise_filler_depth;
Noise *noise_mount_height;
Noise *noise_ridge_uwater;
Noise *noise_mountain;
Noise *noise_ridge; Noise *noise_ridge;
Noise *noise_heat; Noise *noise_heat;
@ -97,7 +86,6 @@ public:
content_t c_sand; content_t c_sand;
content_t c_water_source; content_t c_water_source;
content_t c_lava_source; content_t c_lava_source;
content_t c_ice;
content_t c_gravel; content_t c_gravel;
content_t c_cobble; content_t c_cobble;
content_t c_desert_sand; content_t c_desert_sand;
@ -112,20 +100,15 @@ public:
float baseTerrainLevelAtPoint(int x, int z); float baseTerrainLevelAtPoint(int x, int z);
float baseTerrainLevelFromMap(int index); float baseTerrainLevelFromMap(int index);
bool getMountainTerrainAtPoint(int x, int y, int z);
bool getMountainTerrainFromMap(int idx_xyz, int idx_xz, int y);
void calculateNoise(); void calculateNoise();
int calcHeightMap();
virtual int generateTerrain(); virtual void generateTerrain();
int generateBaseTerrain(); void carveRidges();
void generateMountainTerrain(); //void carveRivers(); //experimental
void generateRidgeTerrain();
void generateBiomes(); void testBiomes();
void dustTopNodes(); void addTopNodes();
//void addTopNodes();
void generateCaves(int max_stone_y); void generateCaves(int max_stone_y);
}; };

View File

@ -28,15 +28,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <string> #include <string>
#include <sstream> #include <sstream>
static const Rotation wallmounted_to_rot[] = {
ROTATE_0, ROTATE_180, ROTATE_90, ROTATE_270
};
static const u8 rot_to_wallmounted[] = {
2, 4, 3, 5
};
/* /*
MapNode MapNode
*/ */
@ -141,24 +132,6 @@ v3s16 MapNode::getWallMountedDir(INodeDefManager *nodemgr) const
} }
} }
void MapNode::rotateAlongYAxis(INodeDefManager *nodemgr, Rotation rot) {
ContentParamType2 cpt2 = nodemgr->get(*this).param_type_2;
if (cpt2 == CPT2_FACEDIR) {
u8 newrot = param2 & 3;
param2 &= ~3;
param2 |= (newrot + rot) & 3;
} else if (cpt2 == CPT2_WALLMOUNTED) {
u8 wmountface = (param2 & 7);
if (wmountface <= 1)
return;
Rotation oldrot = wallmounted_to_rot[wmountface - 2];
param2 &= ~7;
param2 |= rot_to_wallmounted[(oldrot - rot) & 3];
}
}
static std::vector<aabb3f> transformNodeBox(const MapNode &n, static std::vector<aabb3f> transformNodeBox(const MapNode &n,
const NodeBox &nodebox, INodeDefManager *nodemgr) const NodeBox &nodebox, INodeDefManager *nodemgr)
{ {

View File

@ -61,17 +61,6 @@ enum LightBank
LIGHTBANK_NIGHT LIGHTBANK_NIGHT
}; };
/*
Simple rotation enum.
*/
enum Rotation {
ROTATE_0,
ROTATE_90,
ROTATE_180,
ROTATE_270,
ROTATE_RAND,
};
/* /*
Masks for MapNode.param2 of flowing liquids Masks for MapNode.param2 of flowing liquids
*/ */
@ -193,8 +182,6 @@ struct MapNode
u8 getWallMounted(INodeDefManager *nodemgr) const; u8 getWallMounted(INodeDefManager *nodemgr) const;
v3s16 getWallMountedDir(INodeDefManager *nodemgr) const; v3s16 getWallMountedDir(INodeDefManager *nodemgr) const;
void rotateAlongYAxis(INodeDefManager *nodemgr, Rotation rot);
/* /*
Gets list of node boxes (used for rendering (NDT_NODEBOX) Gets list of node boxes (used for rendering (NDT_NODEBOX)
and collision) and collision)

View File

@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <iostream> #include <iostream>
#include <IAnimatedMesh.h> #include <IAnimatedMesh.h>
#include <SAnimatedMesh.h> #include <SAnimatedMesh.h>
#include <ICameraSceneNode.h>
// In Irrlicht 1.8 the signature of ITexture::lock was changed from // In Irrlicht 1.8 the signature of ITexture::lock was changed from
// (bool, u32) to (E_TEXTURE_LOCK_MODE, u32). // (bool, u32) to (E_TEXTURE_LOCK_MODE, u32).
@ -280,18 +281,16 @@ scene::IAnimatedMesh* createExtrudedMesh(video::ITexture *texture,
// img1 is in the texture's color format, convert to 8-bit ARGB // img1 is in the texture's color format, convert to 8-bit ARGB
video::IImage *img2 = driver->createImage(video::ECF_A8R8G8B8, size); video::IImage *img2 = driver->createImage(video::ECF_A8R8G8B8, size);
if (img2 == NULL) if (img2 != NULL)
{ {
img1->drop();
return NULL;
}
img1->copyTo(img2); img1->copyTo(img2);
img1->drop();
mesh = extrudeARGB(size.Width, size.Height, (u8*) img2->lock()); mesh = extrudeARGB(size.Width, size.Height, (u8*) img2->lock());
img2->unlock(); img2->unlock();
img2->drop(); img2->drop();
} }
img1->drop();
}
// Set default material // Set default material
mesh->getMeshBuffer(0)->getMaterial().setTexture(0, texture); mesh->getMeshBuffer(0)->getMaterial().setTexture(0, texture);
@ -408,3 +407,79 @@ void setMeshColorByNormalXYZ(scene::IMesh *mesh,
} }
} }
} }
video::ITexture *generateTextureFromMesh(scene::IMesh *mesh,
IrrlichtDevice *device,
core::dimension2d<u32> dim,
std::string texture_name,
v3f camera_position,
v3f camera_lookat,
core::CMatrix4<f32> camera_projection_matrix,
video::SColorf ambient_light,
v3f light_position,
video::SColorf light_color,
f32 light_radius)
{
video::IVideoDriver *driver = device->getVideoDriver();
if(driver->queryFeature(video::EVDF_RENDER_TO_TARGET) == false)
{
static bool warned = false;
if(!warned)
{
errorstream<<"generateTextureFromMesh(): EVDF_RENDER_TO_TARGET"
" not supported."<<std::endl;
warned = true;
}
return NULL;
}
// Create render target texture
video::ITexture *rtt = driver->addRenderTargetTexture(
dim, texture_name.c_str(), video::ECF_A8R8G8B8);
if(rtt == NULL)
{
errorstream<<"generateTextureFromMesh(): addRenderTargetTexture"
" returned NULL."<<std::endl;
return NULL;
}
// Set render target
driver->setRenderTarget(rtt, false, true, video::SColor(0,0,0,0));
// Get a scene manager
scene::ISceneManager *smgr_main = device->getSceneManager();
assert(smgr_main);
scene::ISceneManager *smgr = smgr_main->createNewSceneManager();
assert(smgr);
scene::IMeshSceneNode* meshnode = smgr->addMeshSceneNode(mesh, NULL, -1, v3f(0,0,0), v3f(0,0,0), v3f(1,1,1), true);
meshnode->setMaterialFlag(video::EMF_LIGHTING, true);
meshnode->setMaterialFlag(video::EMF_ANTI_ALIASING, true);
meshnode->setMaterialFlag(video::EMF_BILINEAR_FILTER, true);
scene::ICameraSceneNode* camera = smgr->addCameraSceneNode(0,
camera_position, camera_lookat);
// second parameter of setProjectionMatrix (isOrthogonal) is ignored
camera->setProjectionMatrix(camera_projection_matrix, false);
smgr->setAmbientLight(ambient_light);
smgr->addLightSceneNode(0, light_position, light_color, light_radius);
// Render scene
driver->beginScene(true, true, video::SColor(0,0,0,0));
smgr->drawAll();
driver->endScene();
// NOTE: The scene nodes should not be dropped, otherwise
// smgr->drop() segfaults
/*cube->drop();
camera->drop();
light->drop();*/
// Drop scene manager
smgr->drop();
// Unset render target
driver->setRenderTarget(0, false, true, 0);
return rtt;
}

View File

@ -69,4 +69,20 @@ void setMeshColorByNormalXYZ(scene::IMesh *mesh,
const video::SColor &colorY, const video::SColor &colorY,
const video::SColor &colorZ); const video::SColor &colorZ);
/*
Render a mesh to a texture.
Returns NULL if render-to-texture failed.
*/
video::ITexture *generateTextureFromMesh(scene::IMesh *mesh,
IrrlichtDevice *device,
core::dimension2d<u32> dim,
std::string texture_name,
v3f camera_position,
v3f camera_lookat,
core::CMatrix4<f32> camera_projection_matrix,
video::SColorf ambient_light,
v3f light_position,
video::SColorf light_color,
f32 light_radius);
#endif #endif

View File

@ -18,7 +18,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/ */
#include "mods.h" #include "mods.h"
#include "main.h"
#include "filesys.h" #include "filesys.h"
#include "strfnd.h" #include "strfnd.h"
#include "log.h" #include "log.h"
@ -26,7 +25,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "settings.h" #include "settings.h"
#include "strfnd.h" #include "strfnd.h"
#include <cctype> #include <cctype>
#include "convert_json.h"
static bool parseDependsLine(std::istream &is, static bool parseDependsLine(std::istream &is,
std::string &dep, std::set<char> &symbols) std::string &dep, std::set<char> &symbols)
@ -391,29 +389,3 @@ void ModConfiguration::resolveDependencies()
// Step 4: write back list of unsatisfied mods // Step 4: write back list of unsatisfied mods
m_unsatisfied_mods.assign(unsatisfied.begin(), unsatisfied.end()); m_unsatisfied_mods.assign(unsatisfied.begin(), unsatisfied.end());
} }
#if USE_CURL
Json::Value getModstoreUrl(std::string url)
{
struct curl_slist *chunk = NULL;
bool special_http_header = true;
try{
special_http_header = g_settings->getBool("modstore_disable_special_http_header");
}
catch(SettingNotFoundException &e) {
}
if (special_http_header)
chunk = curl_slist_append(chunk, "Accept: application/vnd.minetest.mmdb-v1+json");
Json::Value retval = fetchJsonValue(url,chunk);
if (chunk != NULL)
curl_slist_free_all(chunk);
return retval;
}
#endif

View File

@ -29,12 +29,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <map> #include <map>
#include <exception> #include <exception>
#include <list> #include <list>
#include "json/json.h"
#include "config.h"
#if USE_CURL
#include <curl/curl.h>
#endif
#define MODNAME_ALLOWED_CHARS "abcdefghijklmnopqrstuvwxyz0123456789_" #define MODNAME_ALLOWED_CHARS "abcdefghijklmnopqrstuvwxyz0123456789_"
@ -160,66 +154,4 @@ private:
}; };
#if USE_CURL
Json::Value getModstoreUrl(std::string url);
#else
inline Json::Value getModstoreUrl(std::string url) {
return Json::Value();
}
#endif
struct ModLicenseInfo {
int id;
std::string shortinfo;
std::string url;
};
struct ModAuthorInfo {
int id;
std::string username;
};
struct ModStoreMod {
int id;
std::string title;
std::string basename;
ModAuthorInfo author;
float rating;
bool valid;
};
struct ModStoreCategoryInfo {
int id;
std::string name;
};
struct ModStoreVersionEntry {
int id;
std::string date;
std::string file;
bool approved;
//ugly version number
int mtversion;
};
struct ModStoreModDetails {
/* version_set?? */
std::vector<ModStoreCategoryInfo> categories;
ModAuthorInfo author;
ModLicenseInfo license;
int id;
std::string title;
std::string basename;
std::string description;
std::string repository;
float rating;
std::vector<std::string> depends;
std::vector<std::string> softdeps;
std::string download_url;
std::string screenshot_url;
std::vector<ModStoreVersionEntry> versions;
bool valid;
};
#endif #endif

View File

@ -674,9 +674,7 @@ public:
// Tiles (fill in f->tiles[]) // Tiles (fill in f->tiles[])
for(u16 j=0; j<6; j++){ for(u16 j=0; j<6; j++){
// Texture // Texture
f->tiles[j].texture = tsrc->getTexture( f->tiles[j].texture = tsrc->getTexture(tiledef[j].name);
tiledef[j].name,
&f->tiles[j].texture_id);
// Alpha // Alpha
f->tiles[j].alpha = f->alpha; f->tiles[j].alpha = f->alpha;
// Material type // Material type
@ -691,9 +689,10 @@ public:
if(f->tiles[j].material_flags & if(f->tiles[j].material_flags &
MATERIAL_FLAG_ANIMATION_VERTICAL_FRAMES) MATERIAL_FLAG_ANIMATION_VERTICAL_FRAMES)
{ {
// Get texture size to determine frame count by // Get raw texture size to determine frame count by
// aspect ratio // aspect ratio
v2u32 size = f->tiles[j].texture->getOriginalSize(); video::ITexture *t = tsrc->getTextureRaw(tiledef[j].name);
v2u32 size = t->getOriginalSize();
int frame_height = (float)size.X / int frame_height = (float)size.X /
(float)tiledef[j].animation.aspect_w * (float)tiledef[j].animation.aspect_w *
(float)tiledef[j].animation.aspect_h; (float)tiledef[j].animation.aspect_h;
@ -716,9 +715,8 @@ public:
// Special tiles (fill in f->special_tiles[]) // Special tiles (fill in f->special_tiles[])
for(u16 j=0; j<CF_SPECIAL_COUNT; j++){ for(u16 j=0; j<CF_SPECIAL_COUNT; j++){
// Texture // Texture
f->special_tiles[j].texture = tsrc->getTexture( f->special_tiles[j].texture =
f->tiledef_special[j].name, tsrc->getTexture(f->tiledef_special[j].name);
&f->special_tiles[j].texture_id);
// Alpha // Alpha
f->special_tiles[j].alpha = f->alpha; f->special_tiles[j].alpha = f->alpha;
// Material type // Material type
@ -733,9 +731,10 @@ public:
if(f->special_tiles[j].material_flags & if(f->special_tiles[j].material_flags &
MATERIAL_FLAG_ANIMATION_VERTICAL_FRAMES) MATERIAL_FLAG_ANIMATION_VERTICAL_FRAMES)
{ {
// Get texture size to determine frame count by // Get raw texture size to determine frame count by
// aspect ratio // aspect ratio
v2u32 size = f->special_tiles[j].texture->getOriginalSize(); video::ITexture *t = tsrc->getTextureRaw(f->tiledef_special[j].name);
v2u32 size = t->getOriginalSize();
int frame_height = (float)size.X / int frame_height = (float)size.X /
(float)f->tiledef_special[j].animation.aspect_w * (float)f->tiledef_special[j].animation.aspect_w *
(float)f->tiledef_special[j].animation.aspect_h; (float)f->tiledef_special[j].animation.aspect_h;

View File

@ -312,6 +312,7 @@ public:
/* /*
Update tile textures to latest return values of TextueSource. Update tile textures to latest return values of TextueSource.
Call after updating the texture atlas of a TextureSource.
*/ */
virtual void updateTextures(ITextureSource *tsrc)=0; virtual void updateTextures(ITextureSource *tsrc)=0;

View File

@ -57,9 +57,7 @@ Particle::Particle(
float expirationtime, float expirationtime,
float size, float size,
bool collisiondetection, bool collisiondetection,
video::ITexture *texture, AtlasPointer ap
v2f texpos,
v2f texsize
): ):
scene::ISceneNode(smgr->getRootSceneNode(), smgr) scene::ISceneNode(smgr->getRootSceneNode(), smgr)
{ {
@ -72,9 +70,8 @@ Particle::Particle(
m_material.setFlag(video::EMF_BILINEAR_FILTER, false); m_material.setFlag(video::EMF_BILINEAR_FILTER, false);
m_material.setFlag(video::EMF_FOG_ENABLE, true); m_material.setFlag(video::EMF_FOG_ENABLE, true);
m_material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; m_material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
m_material.setTexture(0, texture); m_material.setTexture(0, ap.atlas);
m_texpos = texpos; m_ap = ap;
m_texsize = texsize;
// Particle related // Particle related
@ -183,19 +180,14 @@ void Particle::updateLight(ClientEnvironment &env)
void Particle::updateVertices() void Particle::updateVertices()
{ {
video::SColor c(255, m_light, m_light, m_light); video::SColor c(255, m_light, m_light, m_light);
f32 tx0 = m_texpos.X;
f32 tx1 = m_texpos.X + m_texsize.X;
f32 ty0 = m_texpos.Y;
f32 ty1 = m_texpos.Y + m_texsize.Y;
m_vertices[0] = video::S3DVertex(-m_size/2,-m_size/2,0, 0,0,0, m_vertices[0] = video::S3DVertex(-m_size/2,-m_size/2,0, 0,0,0,
c, tx0, ty1); c, m_ap.x0(), m_ap.y1());
m_vertices[1] = video::S3DVertex(m_size/2,-m_size/2,0, 0,0,0, m_vertices[1] = video::S3DVertex(m_size/2,-m_size/2,0, 0,0,0,
c, tx1, ty1); c, m_ap.x1(), m_ap.y1());
m_vertices[2] = video::S3DVertex(m_size/2,m_size/2,0, 0,0,0, m_vertices[2] = video::S3DVertex(m_size/2,m_size/2,0, 0,0,0,
c, tx1, ty0); c, m_ap.x1(), m_ap.y0());
m_vertices[3] = video::S3DVertex(-m_size/2,m_size/2,0, 0,0,0, m_vertices[3] = video::S3DVertex(-m_size/2,m_size/2,0, 0,0,0,
c, tx0, ty0); c ,m_ap.x0(), m_ap.y0());
for(u16 i=0; i<4; i++) for(u16 i=0; i<4; i++)
{ {
@ -256,19 +248,19 @@ void addNodeParticle(IGameDef* gamedef, scene::ISceneManager* smgr,
{ {
// Texture // Texture
u8 texid = myrand_range(0,5); u8 texid = myrand_range(0,5);
video::ITexture *texture = tiles[texid].texture; AtlasPointer ap = tiles[texid].texture;
// Only use first frame of animated texture
f32 ymax = 1;
if(tiles[texid].material_flags & MATERIAL_FLAG_ANIMATION_VERTICAL_FRAMES)
ymax /= tiles[texid].animation_frame_count;
float size = rand()%64/512.; float size = rand()%64/512.;
float visual_size = BS*size; float visual_size = BS*size;
v2f texsize(size*2, ymax*size*2); float texsize = size*2;
v2f texpos;
texpos.X = ((rand()%64)/64.-texsize.X); float x1 = ap.x1();
texpos.Y = ymax*((rand()%64)/64.-texsize.Y); float y1 = ap.y1();
ap.size.X = (ap.x1() - ap.x0()) * texsize;
ap.size.Y = (ap.x1() - ap.x0()) * texsize;
ap.pos.X = ap.x0() + (x1 - ap.x0()) * ((rand()%64)/64.-texsize);
ap.pos.Y = ap.y0() + (y1 - ap.y0()) * ((rand()%64)/64.-texsize);
// Physics // Physics
v3f velocity( (rand()%100/50.-1)/1.5, v3f velocity( (rand()%100/50.-1)/1.5,
@ -293,9 +285,7 @@ void addNodeParticle(IGameDef* gamedef, scene::ISceneManager* smgr,
rand()%100/100., // expiration time rand()%100/100., // expiration time
visual_size, visual_size,
true, true,
texture, ap);
texpos,
texsize);
} }
/* /*
@ -306,7 +296,7 @@ ParticleSpawner::ParticleSpawner(IGameDef* gamedef, scene::ISceneManager *smgr,
u16 amount, float time, u16 amount, float time,
v3f minpos, v3f maxpos, v3f minvel, v3f maxvel, v3f minacc, v3f maxacc, v3f minpos, v3f maxpos, v3f minvel, v3f maxvel, v3f minacc, v3f maxacc,
float minexptime, float maxexptime, float minsize, float maxsize, float minexptime, float maxexptime, float minsize, float maxsize,
bool collisiondetection, video::ITexture *texture, u32 id) bool collisiondetection, AtlasPointer ap, u32 id)
{ {
m_gamedef = gamedef; m_gamedef = gamedef;
m_smgr = smgr; m_smgr = smgr;
@ -324,7 +314,7 @@ ParticleSpawner::ParticleSpawner(IGameDef* gamedef, scene::ISceneManager *smgr,
m_minsize = minsize; m_minsize = minsize;
m_maxsize = maxsize; m_maxsize = maxsize;
m_collisiondetection = collisiondetection; m_collisiondetection = collisiondetection;
m_texture = texture; m_ap = ap;
m_time = 0; m_time = 0;
for (u16 i = 0; i<=m_amount; i++) for (u16 i = 0; i<=m_amount; i++)
@ -372,9 +362,7 @@ void ParticleSpawner::step(float dtime, ClientEnvironment &env)
exptime, exptime,
size, size,
m_collisiondetection, m_collisiondetection,
m_texture, m_ap);
v2f(0.0, 0.0),
v2f(1.0, 1.0));
m_spawntimes.erase(i); m_spawntimes.erase(i);
} }
else else
@ -410,9 +398,7 @@ void ParticleSpawner::step(float dtime, ClientEnvironment &env)
exptime, exptime,
size, size,
m_collisiondetection, m_collisiondetection,
m_texture, m_ap);
v2f(0.0, 0.0),
v2f(1.0, 1.0));
} }
} }
} }

View File

@ -42,9 +42,7 @@ class Particle : public scene::ISceneNode
float expirationtime, float expirationtime,
float size, float size,
bool collisiondetection, bool collisiondetection,
video::ITexture *texture, AtlasPointer texture
v2f texpos,
v2f texsize
); );
~Particle(); ~Particle();
@ -83,13 +81,16 @@ private:
core::aabbox3d<f32> m_box; core::aabbox3d<f32> m_box;
core::aabbox3d<f32> m_collisionbox; core::aabbox3d<f32> m_collisionbox;
video::SMaterial m_material; video::SMaterial m_material;
v2f m_texpos;
v2f m_texsize;
v3f m_pos; v3f m_pos;
v3f m_velocity; v3f m_velocity;
v3f m_acceleration; v3f m_acceleration;
float tex_x0;
float tex_x1;
float tex_y0;
float tex_y1;
LocalPlayer *m_player; LocalPlayer *m_player;
float m_size; float m_size;
AtlasPointer m_ap;
u8 m_light; u8 m_light;
bool m_collisiondetection; bool m_collisiondetection;
}; };
@ -108,7 +109,7 @@ class ParticleSpawner
float minexptime, float maxexptime, float minexptime, float maxexptime,
float minsize, float maxsize, float minsize, float maxsize,
bool collisiondetection, bool collisiondetection,
video::ITexture *texture, AtlasPointer ap,
u32 id); u32 id);
~ParticleSpawner(); ~ParticleSpawner();
@ -135,7 +136,7 @@ class ParticleSpawner
float m_maxexptime; float m_maxexptime;
float m_minsize; float m_minsize;
float m_maxsize; float m_maxsize;
video::ITexture *m_texture; AtlasPointer m_ap;
std::vector<float> m_spawntimes; std::vector<float> m_spawntimes;
bool m_collisiondetection; bool m_collisiondetection;
}; };

View File

@ -226,11 +226,9 @@ bool getstringfield(lua_State *L, int table,
if(lua_isstring(L, -1)){ if(lua_isstring(L, -1)){
size_t len = 0; size_t len = 0;
const char *ptr = lua_tolstring(L, -1, &len); const char *ptr = lua_tolstring(L, -1, &len);
if (ptr) {
result.assign(ptr, len); result.assign(ptr, len);
got = true; got = true;
} }
}
lua_pop(L, 1); lua_pop(L, 1);
return got; return got;
} }

Some files were not shown because too many files have changed in this diff Show More