public ClickFeature(OverlayPlugin plugin, XmlNode node) { mTriggerListener = new Action<ITrigger>(TriggerListener); mLeft = GetBool(node, false, "LeftClick"); mFrame = GetManager(plugin, node, "Click Feature").Name; List<ITrigger> triggers = new List<ITrigger>(); foreach (XmlNode trigger in GetChildrenOfChild(node, "Triggers")) { ITrigger t = plugin.GetTrigger(trigger, "JoystickClick trigger", null); if (t != null) { triggers.Add(t); } } mTriggers = triggers.ToArray(); }
public CloseBrowserFeature(OverlayPlugin plugin, XmlNode node) { mTriggerListener = new Action<ITrigger>(TriggerListener); mFrame = GetManager(plugin, node, "CloseBrowser Feature").Name; List<ITrigger> triggers = new List<ITrigger>(); foreach (XmlNode trigger in GetChildrenOfChild(node, "Triggers")) { ITrigger t = plugin.GetTrigger(trigger, "CloseBrowser trigger", null); if (t != null) { triggers.Add(t); } } mTriggers = triggers.ToArray(); if (plugin.Core[mFrame].Output is OpenSimController) mController = plugin.Core[mFrame].Output as OpenSimController; mPlugin = plugin; }
public KeyClickFeature(OverlayPlugin plugin, XmlNode node) { mTriggerListener = new Action<ITrigger>(TriggerListener); keys = node.Attributes["Keys"].Value; mFrame = GetManager(plugin, node, "Click Feature").Name; List<ITrigger> triggers = new List<ITrigger>(); foreach (XmlNode trigger in GetChildrenOfChild(node, "Triggers")) { ITrigger t = plugin.GetTrigger(trigger, "KeyClick trigger", null); if (t != null) { triggers.Add(t); } } mTriggers = triggers.ToArray(); if (plugin.Core[mFrame].Output is OpenSimController) mController = plugin.Core[mFrame].Output as OpenSimController; }
public SayFeature(OverlayPlugin plugin, XmlNode node) { mTriggerListener = new Action<ITrigger>(TriggerListener); mFrame = GetManager(plugin, node, "Say Feature").Name; List<ITrigger> triggers = new List<ITrigger>(); foreach (XmlNode trigger in GetChildrenOfChild(node, "Triggers")) { ITrigger t = plugin.GetTrigger(trigger, "Say trigger", null); if (t != null) { triggers.Add(t); } } mTriggers = triggers.ToArray(); if (plugin.Core[mFrame].Output is OpenSimController) mController = plugin.Core[mFrame].Output as OpenSimController; mPlugin = plugin; mMessageString = GetString(node, "click", "Message"); mChannel = GetInt(node, 1, "Channel"); }
private void LoadTriggers(XmlNode node, OverlayPlugin manager, string triggerType, List<ITrigger> list, Action onTrigger) { foreach (XmlElement child in GetChildrenOfChild(node, triggerType)) { ITrigger trigger = manager.GetTrigger(child, "video " + triggerType.TrimEnd('s'), null); if (trigger != null) { if (!GetBool(child, false, "AlwaysOn")) { list.Add(trigger); trigger.Active = false; } if (trigger is IFeature) AddFeature(trigger as IFeature); trigger.Triggered += onTrigger; } } }
public FlythroughState(OverlayPlugin manager, XmlNode node, IMediaPlayer player) : base(GetName(node, "flythrough state"), manager, node) { mStepListener = new Action<int>(mInput_StepStarted); mInput = manager.Core.GetPlugin<FlythroughPlugin>(); bool displaySubtitles = GetBool(node, false, "DisplaySubtitles"); mFlythrough = GetString(node, null, "File"); mAutoStepping = GetBool(node, true, "AutoStep"); mLoop = GetBool(node, true, "Loop"); if (mFlythrough == null) throw new ArgumentException("Unable to load flythrough state. No flythrough file specified."); mPlayer = player; if (mPlayer != null) mDefaultWindow = Manager[0]; if (displaySubtitles) { mSubtitlesText = Manager.MakeText(node.SelectSingleNode("child::SubtitleText")); mSubtitlesFont = Manager.MakeText(node.SelectSingleNode("child::SubtitleText")); } XmlNode stepTextNode = node.SelectSingleNode("child::StepText"); if (stepTextNode != null) mStepText = Manager.MakeText(stepTextNode); //mInput.CurrentEventChange += new Action<FlythroughEvent<Camera>,FlythroughEvent<Camera>>(mInput_CurrentEventChange); int subtitleTimeout = GetInt(node, 20, "SubtitleTimeout"); XmlNode stepsRoot = node.SelectSingleNode("child::Steps"); if (stepsRoot != null) { foreach (XmlNode child in stepsRoot.ChildNodes) { if (child is XmlElement) { Step step = new Step(this, child, mSubtitlesText, subtitleTimeout, mPlayer); mSteps.Add(step.StepNum, step); } } } if (displaySubtitles) AddFeature(mSubtitlesText); if (mStepText != null) AddFeature(mStepText); XmlNode triggersRoot = node.SelectSingleNode("child::Triggers"); if (triggersRoot != null) { foreach (XmlNode child in triggersRoot.ChildNodes) AddStepTrigger(manager.GetTrigger(child, "flythrough step", null)); } }