From 6a8353af36ed1a55a8da8e0645a1536b40f70caa Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 16 Nov 2014 10:27:10 -0800 Subject: Improved SpecialUIModule so that it sends the floater data properly. --- .../ViewerSupport/SpecialUIModule.cs | 23 ++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/OptionalModules') diff --git a/OpenSim/Region/OptionalModules/ViewerSupport/SpecialUIModule.cs b/OpenSim/Region/OptionalModules/ViewerSupport/SpecialUIModule.cs index 0a8c83a..51f60bb 100644 --- a/OpenSim/Region/OptionalModules/ViewerSupport/SpecialUIModule.cs +++ b/OpenSim/Region/OptionalModules/ViewerSupport/SpecialUIModule.cs @@ -120,9 +120,10 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport m_log.DebugFormat("[SPECIAL UI]: OnSimulatorFeaturesRequest in {0}", m_scene.RegionInfo.RegionName); if (m_Helper.ShouldSend(agentID) && m_Helper.UserLevel(agentID) <= m_UserLevel) { + OSDMap extrasMap; + OSDMap specialUI = new OSDMap(); using (StreamReader s = new StreamReader(Path.Combine(VIEWER_SUPPORT_DIR, "panel_toolbar.xml"))) { - OSDMap extrasMap; if (features.ContainsKey("OpenSimExtras")) extrasMap = (OSDMap)features["OpenSimExtras"]; else @@ -131,11 +132,29 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport features["OpenSimExtras"] = extrasMap; } - OSDMap specialUI = new OSDMap(); specialUI["toolbar"] = OSDMap.FromString(s.ReadToEnd()); extrasMap["special-ui"] = specialUI; } m_log.DebugFormat("[SPECIAL UI]: Sending panel_toolbar.xml in {0}", m_scene.RegionInfo.RegionName); + + if (Directory.Exists(Path.Combine(VIEWER_SUPPORT_DIR, "Floaters"))) + { + OSDMap floaters = new OSDMap(); + uint n = 0; + foreach (String name in Directory.GetFiles(Path.Combine(VIEWER_SUPPORT_DIR, "Floaters"), "*.xml")) + { + using (StreamReader s = new StreamReader(name)) + { + string simple_name = Path.GetFileNameWithoutExtension(name); + m_log.DebugFormat("[XXX]: Reading {0} ({1})", name, simple_name); + OSDMap floater = new OSDMap(); + floaters[simple_name] = OSDMap.FromString(s.ReadToEnd()); + n++; + } + } + specialUI["floaters"] = floaters; + m_log.DebugFormat("[SPECIAL UI]: Sending {0} floaters", n); + } } else m_log.DebugFormat("[SPECIAL UI]: NOT Sending panel_toolbar.xml in {0}", m_scene.RegionInfo.RegionName); -- cgit v1.1