From 20653830fbd0c0104a62e9c1b71744284b77b754 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Wed, 2 Jan 2008 07:13:34 +0000 Subject: * Refactored out function to load specified AssetSet Xml This commit dedicated to 'Mohawk - Bad Girls (Need Love Too)' --- .../AssetLoader/Filesystem/AssetLoaderFileSystem.cs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'OpenSim/Framework/AssetLoader') diff --git a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs index 46e6ae1..d6ce0c5 100644 --- a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs +++ b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs @@ -79,18 +79,23 @@ namespace OpenSim.Framework.AssetLoader.Filesystem //info.loaded=true; } - public void ForEachXmlAsset(Action action) + public void ForEachDefaultXmlAsset(Action action) { - List assets = new List(); - string assetSetsPath = Path.Combine(Util.assetsDir(), "AssetSets.xml"); - - if (File.Exists(assetSetsPath)) + string assetSetFilename = Path.Combine(Util.assetsDir(), "AssetSets.xml"); + + ForEachDefaultXmlAsset(assetSetFilename, action); + } + + public void ForEachDefaultXmlAsset(string assetSetFilename, Action action) + { + List assets = new List(); + if (File.Exists(assetSetFilename)) { string assetSetPath = "ERROR"; try { - XmlConfigSource source = new XmlConfigSource(assetSetsPath); + XmlConfigSource source = new XmlConfigSource(assetSetFilename); for (int i = 0; i < source.Configs.Count; i++) { @@ -111,9 +116,9 @@ namespace OpenSim.Framework.AssetLoader.Filesystem "Asset set control file assets/AssetSets.xml does not exist! No assets loaded."); } - assets.ForEach(action); + assets.ForEach(action); } - + /// /// Use the asset set information at path to load assets /// -- cgit v1.1