mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 03:45:35 +08:00
fix enable from config on some legacy modules
This commit is contained in:
@@ -55,6 +55,8 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport
|
|||||||
|
|
||||||
private Scene m_scene;
|
private Scene m_scene;
|
||||||
|
|
||||||
|
private bool m_Enabled = false;
|
||||||
|
|
||||||
private Dictionary<UUID, Dictionary<int, FloaterData>> m_floaters = new Dictionary<UUID, Dictionary<int, FloaterData>>();
|
private Dictionary<UUID, Dictionary<int, FloaterData>> m_floaters = new Dictionary<UUID, Dictionary<int, FloaterData>>();
|
||||||
|
|
||||||
public string Name
|
public string Name
|
||||||
@@ -69,6 +71,11 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport
|
|||||||
|
|
||||||
public void Initialise(IConfigSource config)
|
public void Initialise(IConfigSource config)
|
||||||
{
|
{
|
||||||
|
IConfig moduleConfig = config.Configs["DynamicFloaterModule"];
|
||||||
|
if (moduleConfig != null)
|
||||||
|
{
|
||||||
|
m_Enabled = moduleConfig.GetBoolean("enabled", false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
@@ -77,10 +84,13 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport
|
|||||||
|
|
||||||
public void AddRegion(Scene scene)
|
public void AddRegion(Scene scene)
|
||||||
{
|
{
|
||||||
m_scene = scene;
|
if(m_Enabled)
|
||||||
scene.EventManager.OnNewClient += OnNewClient;
|
{
|
||||||
scene.EventManager.OnClientClosed += OnClientClosed;
|
m_scene = scene;
|
||||||
m_scene.RegisterModuleInterface<IDynamicFloaterModule>(this);
|
scene.EventManager.OnNewClient += OnNewClient;
|
||||||
|
scene.EventManager.OnClientClosed += OnClientClosed;
|
||||||
|
m_scene.RegisterModuleInterface<IDynamicFloaterModule>(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RegionLoaded(Scene scene)
|
public void RegionLoaded(Scene scene)
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport
|
|||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
|
private bool m_Enabled = false;
|
||||||
private class MenuItemData
|
private class MenuItemData
|
||||||
{
|
{
|
||||||
public string Title;
|
public string Title;
|
||||||
@@ -75,6 +76,11 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport
|
|||||||
|
|
||||||
public void Initialise(IConfigSource config)
|
public void Initialise(IConfigSource config)
|
||||||
{
|
{
|
||||||
|
IConfig moduleConfig = config.Configs["DynamicMenuModule"];
|
||||||
|
if (moduleConfig != null)
|
||||||
|
{
|
||||||
|
m_Enabled = moduleConfig.GetBoolean("enabled", false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
@@ -83,17 +89,22 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport
|
|||||||
|
|
||||||
public void AddRegion(Scene scene)
|
public void AddRegion(Scene scene)
|
||||||
{
|
{
|
||||||
m_scene = scene;
|
if (m_Enabled)
|
||||||
scene.EventManager.OnRegisterCaps += OnRegisterCaps;
|
{
|
||||||
m_scene.RegisterModuleInterface<IDynamicMenuModule>(this);
|
m_scene = scene;
|
||||||
|
scene.EventManager.OnRegisterCaps += OnRegisterCaps;
|
||||||
|
m_scene.RegisterModuleInterface<IDynamicMenuModule>(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RegionLoaded(Scene scene)
|
public void RegionLoaded(Scene scene)
|
||||||
{
|
{
|
||||||
ISimulatorFeaturesModule featuresModule = m_scene.RequestModuleInterface<ISimulatorFeaturesModule>();
|
if (m_Enabled)
|
||||||
|
{
|
||||||
if (featuresModule != null)
|
ISimulatorFeaturesModule featuresModule = m_scene.RequestModuleInterface<ISimulatorFeaturesModule>();
|
||||||
featuresModule.OnSimulatorFeaturesRequest += OnSimulatorFeaturesRequest;
|
if (featuresModule != null)
|
||||||
|
featuresModule.OnSimulatorFeaturesRequest += OnSimulatorFeaturesRequest;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveRegion(Scene scene)
|
public void RemoveRegion(Scene scene)
|
||||||
|
|||||||
@@ -54,11 +54,12 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport
|
|||||||
public class SpecialUIModule : INonSharedRegionModule
|
public class SpecialUIModule : INonSharedRegionModule
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private const string VIEWER_SUPPORT_DIR = "ViewerSupport";
|
private const string VIEWER_SUPPORT_DIR = "ViewerSupport";
|
||||||
|
|
||||||
private Scene m_scene;
|
private Scene m_scene;
|
||||||
private SimulatorFeaturesHelper m_Helper;
|
private SimulatorFeaturesHelper m_Helper;
|
||||||
private bool m_Enabled;
|
private bool m_Enabled = false;
|
||||||
private int m_UserLevel;
|
private int m_UserLevel;
|
||||||
|
|
||||||
public string Name
|
public string Name
|
||||||
|
|||||||
Reference in New Issue
Block a user