From d0cb4fc3262df2afe2ef34396c7960f7afee6b89 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 25 Feb 2013 23:04:38 +0000 Subject: Move map related settings from [Startup] to a new [Map] section in OpenSim.ini Existing map settings in [Startup] will continue to work, and if present will override anything in [Map] However, the proper place for such settings would now be [Map] This is to reduce the use of [Startup] as a bag for non-generic settings which should really go in sections, in common with other settings. This commit also extends Diva's previous work to allow a default setting to be given when looking at multiple sections for settings. --- .../CoreModules/World/Warp3DMap/Warp3DImageModule.cs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region/CoreModules/World/Warp3DMap') diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs index 5e0dfa7..ed2b06a 100644 --- a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs @@ -71,8 +71,8 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap { m_config = source; - IConfig startupConfig = m_config.Configs["Startup"]; - if (startupConfig.GetString("MapImageModule", "MapImageModule") != "Warp3DImageModule") + if (Util.GetConfigVarFromSections( + m_config, "MapImageModule", new string[] { "Startup", "Map" }, "MapImageModule") != "Warp3DImageModule") return; m_Enabled = true; @@ -143,16 +143,12 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap bool drawPrimVolume = true; bool textureTerrain = true; - try - { - IConfig startupConfig = m_config.Configs["Startup"]; - drawPrimVolume = startupConfig.GetBoolean("DrawPrimOnMapTile", drawPrimVolume); - textureTerrain = startupConfig.GetBoolean("TextureOnMapTile", textureTerrain); - } - catch - { - m_log.Warn("[WARP 3D IMAGE MODULE]: Failed to load StartupConfig"); - } + string[] configSections = new string[] { "Map", "Startup" }; + + drawPrimVolume + = Util.GetConfigVarFromSections(m_config, "DrawPrimOnMapTile", configSections, drawPrimVolume); + textureTerrain + = Util.GetConfigVarFromSections(m_config, "TextureOnMapTile", configSections, textureTerrain); m_colors.Clear(); -- cgit v1.1