mirror of
https://github.com/moparisthebest/minetest
synced 2024-11-16 22:35:07 -05:00
Remove lots of debug output from modmgr
Fix RUN_IN_PLACE=0 mod install (now mods are saved in user folder in that case) Fix text of field element not unescaped correctly
This commit is contained in:
parent
7dbbbfc665
commit
494fa0c81a
@ -459,10 +459,8 @@ function modmgr.dialog_configure_world()
|
|||||||
"checkbox[0,0.8;cb_mod_enabled;enabled;"
|
"checkbox[0,0.8;cb_mod_enabled;enabled;"
|
||||||
|
|
||||||
if modmgr.worldconfig.global_mods[shortname] then
|
if modmgr.worldconfig.global_mods[shortname] then
|
||||||
print("checkbox " .. shortname .. " enabled")
|
|
||||||
retval = retval .. "true"
|
retval = retval .. "true"
|
||||||
else
|
else
|
||||||
print("checkbox " .. shortname .. " disabled")
|
|
||||||
retval = retval .. "false"
|
retval = retval .. "false"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -516,7 +514,7 @@ function modmgr.get_dependencys(modfolder)
|
|||||||
end
|
end
|
||||||
dependencyfile:close()
|
dependencyfile:close()
|
||||||
else
|
else
|
||||||
print(filename .. " not found")
|
print("Modmgr:" .. filename .. " not found")
|
||||||
end
|
end
|
||||||
|
|
||||||
return toadd
|
return toadd
|
||||||
@ -546,10 +544,8 @@ function modmgr.get_worldconfig(worldpath)
|
|||||||
else
|
else
|
||||||
local key = parts[1]:trim():sub(10)
|
local key = parts[1]:trim():sub(10)
|
||||||
if parts[2]:trim() == "true" then
|
if parts[2]:trim() == "true" then
|
||||||
print("found enabled mod: >" .. key .. "<")
|
|
||||||
worldconfig.global_mods[key] = true
|
worldconfig.global_mods[key] = true
|
||||||
else
|
else
|
||||||
print("found disabled mod: >" .. key .. "<")
|
|
||||||
worldconfig.global_mods[key] = false
|
worldconfig.global_mods[key] = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -557,13 +553,12 @@ function modmgr.get_worldconfig(worldpath)
|
|||||||
end
|
end
|
||||||
worldfile:close()
|
worldfile:close()
|
||||||
else
|
else
|
||||||
print(filename .. " not found")
|
print("Modmgr: " .. filename .. " not found")
|
||||||
end
|
end
|
||||||
|
|
||||||
--read gamemods
|
--read gamemods
|
||||||
local gamemodpath = engine.get_gamepath() .. DIR_DELIM .. worldconfig.id .. DIR_DELIM .. "mods"
|
local gamemodpath = engine.get_gamepath() .. DIR_DELIM .. worldconfig.id .. DIR_DELIM .. "mods"
|
||||||
|
|
||||||
print("reading game mods from: " .. dump(gamemodpath))
|
|
||||||
get_mods(gamemodpath,worldconfig.game_mods)
|
get_mods(gamemodpath,worldconfig.game_mods)
|
||||||
|
|
||||||
return worldconfig
|
return worldconfig
|
||||||
@ -642,7 +637,9 @@ function modmgr.installmod(modfilename,basename)
|
|||||||
|
|
||||||
if clean_path ~= nil then
|
if clean_path ~= nil then
|
||||||
local targetpath = engine.get_modpath() .. DIR_DELIM .. clean_path
|
local targetpath = engine.get_modpath() .. DIR_DELIM .. clean_path
|
||||||
engine.copy_dir(basefolder.path,targetpath)
|
if not engine.copy_dir(basefolder.path,targetpath) then
|
||||||
|
gamedata.errormessage = "Failed to install " .. basename .. " to " .. targetpath
|
||||||
|
end
|
||||||
else
|
else
|
||||||
gamedata.errormessage = "Install Mod: unable to find suitable foldername for modpack "
|
gamedata.errormessage = "Install Mod: unable to find suitable foldername for modpack "
|
||||||
.. modfilename
|
.. modfilename
|
||||||
|
@ -1010,7 +1010,7 @@ void GUIFormSpecMenu::parseTextArea(parserData* data,std::vector<std::string>& p
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GUIFormSpecMenu::parseField(parserData* data,std::string element,std::string type) {
|
void GUIFormSpecMenu::parseField(parserData* data,std::string element,std::string type) {
|
||||||
std::vector<std::string> parts = split(element,';');
|
std::vector<std::string> parts = split(element,';',true);
|
||||||
|
|
||||||
if (parts.size() == 3) {
|
if (parts.size() == 3) {
|
||||||
parseSimpleField(data,parts);
|
parseSimpleField(data,parts);
|
||||||
|
@ -807,9 +807,8 @@ int guiLuaApi::l_set_topleft_text(lua_State *L)
|
|||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
int guiLuaApi::l_get_modpath(lua_State *L)
|
int guiLuaApi::l_get_modpath(lua_State *L)
|
||||||
{
|
{
|
||||||
//TODO this path may be controversial!
|
|
||||||
std::string modpath
|
std::string modpath
|
||||||
= fs::RemoveRelativePathComponents(porting::path_share + DIR_DELIM + "mods" + DIR_DELIM);
|
= fs::RemoveRelativePathComponents(porting::path_user + DIR_DELIM + "mods" + DIR_DELIM);
|
||||||
lua_pushstring(L, modpath.c_str());
|
lua_pushstring(L, modpath.c_str());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -818,7 +817,7 @@ int guiLuaApi::l_get_modpath(lua_State *L)
|
|||||||
int guiLuaApi::l_get_gamepath(lua_State *L)
|
int guiLuaApi::l_get_gamepath(lua_State *L)
|
||||||
{
|
{
|
||||||
std::string gamepath
|
std::string gamepath
|
||||||
= fs::RemoveRelativePathComponents(porting::path_share + DIR_DELIM + "games" + DIR_DELIM);
|
= fs::RemoveRelativePathComponents(porting::path_share + DIR_DELIM + "games" + DIR_DELIM);
|
||||||
lua_pushstring(L, gamepath.c_str());
|
lua_pushstring(L, gamepath.c_str());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1009,7 +1008,7 @@ bool guiLuaApi::isMinetestPath(std::string path) {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
/* mods */
|
/* mods */
|
||||||
if (fs::PathStartsWith(path,fs::RemoveRelativePathComponents(porting::path_share + DIR_DELIM + "mods")))
|
if (fs::PathStartsWith(path,fs::RemoveRelativePathComponents(porting::path_user + DIR_DELIM + "mods")))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
/* worlds */
|
/* worlds */
|
||||||
|
Loading…
Reference in New Issue
Block a user