--Search through the missionlist to find a map that matches mapName,
--then insert the new flags into said entry.
--Use this when you know the map already exists, but this content patch is just
--adding new gamemodes (otherwise you should just add whole new entries to the missionlist)
function AddNewGameModes(missionList, mapName, newFlags)
for i, mission in missionList do
if mission.mapluafile == mapName then
for flag, value in pairs(newFlags) do
mission[flag] = value
end
end
end
end
--insert totally new maps here:
local sp_n = 0
local mp_n = 0
sp_n = table.getn(sp_missionselect_listbox_contents)
sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "ABC%s_%s", era_g = 1, era_c = 1, mode_con_g = 1, mode_con_c = 1,}
mp_n = table.getn(mp_missionselect_listbox_contents)
mp_missionselect_listbox_contents[mp_n+1] = sp_missionselect_listbox_contents[sp_n+1]
-- associate this mission name with the current downloadable content directory
-- (this tells the engine which maps are downloaded, so you need to include all new mission lua's here)
-- first arg: mapluafile from above
-- second arg: mission script name
-- third arg: level memory modifier. the arg to LuaScript.cpp: DEFAULT_MODEL_MEMORY_PLUS(x)
AddDownloadableContent("ABC","ABCg_con",4)
AddDownloadableContent("ABC","ABCc_con",4)
AddDownloadableContent("bes2","bes2g_con",4)
AddDownloadableContent("cor1","cor1g_con",4)
AddDownloadableContent("dag1","dag1g_con",4)
AddDownloadableContent("dea1","dea1g_con",4)
AddDownloadableContent("end1","end1g_con",4)
AddDownloadableContent("fel1","fel1g_con",4)
AddDownloadableContent("hot1","hot1g_con",4)
AddDownloadableContent("KAM1","KAM1g_con",4)
AddDownloadableContent("kas2","kas2g_con",4)
AddDownloadableContent("mus1","mus1g_con",4)
AddDownloadableContent("myg1","myg1g_con",4)
AddDownloadableContent("pol1","pol1g_con",4)
AddDownloadableContent("rhn1","rhn1g_con",4)
AddDownloadableContent("rhn2","rhn2g_con",4)
AddDownloadableContent("tan1","tan1g_con",4)
AddDownloadableContent("tat2","tat2g_con",4)
AddDownloadableContent("tat3","tat3g_con",4)
AddDownloadableContent("uta1","uta1g_con",4)
AddDownloadableContent("yav1","yav1g_con",4)
AddDownloadableContent("yav2","yav2g_con",4)
-- all done
newEntry = nil
n = nil
-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\ABC\\data\\_LVL_PC\\core.lvl")