private void ImportButton_Click(object sender, EventArgs e) { if (MessageBox.Show("This will erase the existing triggers.", "Warning!", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } try { OpenFileDialog d = new OpenFileDialog(); d.Filter = "Script (*" + CoreGlobals.getWorkPaths().mScriptExtention + ")|*" + CoreGlobals.getWorkPaths().mScriptExtention; d.InitialDirectory = CoreGlobals.getWorkPaths().mScriptTriggerDirectory; if (d.ShowDialog() == DialogResult.OK) { XmlSerializer s = new XmlSerializer(typeof(TriggerRoot), new Type[] { }); Stream st = File.OpenRead(d.FileName); TriggerData = (TriggerRoot)s.Deserialize(st); st.Close(); } } catch (System.Exception ex) { CoreGlobals.getErrorManager().OnException(ex); } }
protected void SaveAs() { try { SaveFileDialog d = new SaveFileDialog(); d.Filter = GetFilter(); d.InitialDirectory = GetInitialDirectory(); if (d.ShowDialog() == DialogResult.OK) { XmlSerializer s = new XmlSerializer(typeof(TriggerRoot), new Type[] { }); Stream st = File.Open(d.FileName, FileMode.Create); mSavedFileName = d.FileName; TriggerRoot root = TriggerData; root.Name = Path.GetFileName(mSavedFileName); root.Type = mType; s.Serialize(st, root); //s.Serialize(st, TriggerData); st.Close(); this.Parent.Text = Path.GetFileName(d.FileName); triggerHostArea1.Scan(true); XMBProcessor.CreateXMB(mSavedFileName, false); } } catch (System.Exception ex) { CoreGlobals.getErrorManager().OnException(ex); } }
public EventEditorContext(EditorWindow window, OverviewEditorContext overviewContext, TriggerRoot triggerRoot, List <Trigger> triggers, GlobalSymbolTable symbolTable) { _triggerRoot = triggerRoot; _overviewContext = overviewContext; _window = window; _triggers = new TriggerCollection(this, _overviewContext, _triggerRoot); _symbolTable = symbolTable; }
private void Save() { try { if (mSavedFileName != "") { XmlSerializer s = new XmlSerializer(typeof(TriggerRoot), new Type[] { }); Stream st = File.Open(mSavedFileName, FileMode.Create); TriggerRoot root = TriggerData; root.Name = Path.GetFileName(mSavedFileName); root.Type = mType; s.Serialize(st, root); st.Close(); triggerHostArea1.Scan(true); TriggerFinalBake.eBuildMode mode = TriggerFinalBake.eBuildMode.NoOptimizations; try { mode = (TriggerFinalBake.eBuildMode)Enum.Parse(typeof(TriggerFinalBake.eBuildMode), buildMode.SelectedItem.ToString()); } catch (System.Exception ex2) { CoreGlobals.getErrorManager().OnException(ex2); } //must have _raw_ tag for optimizations if (mSavedFileName.Contains(TriggerFinalBake.sTriggerRaw) == false && TriggerFinalBake.eBuildMode.NoOptimizations != mode) { CoreGlobals.ShowMessage("filename not compatible with optimizations."); mode = TriggerFinalBake.eBuildMode.NoOptimizations; } if (TriggerFinalBake.eBuildMode.NoOptimizations == mode) { XMBProcessor.CreateXMB(mSavedFileName, false); } else { string tempFile = TriggerFinalBake.OptimizeTriggerScript(mSavedFileName, mode); XMBProcessor.CreateXMB(tempFile, false); //File.Copy(tempFile + ".xmb", mSavedFileName + ".xmb", true); } } else { SaveAs(); } } catch (System.Exception ex) { CoreGlobals.getErrorManager().OnException(ex); } }
private void CreateTrigger() { var prefab = Resources.Load <TriggerRoot>(SRDebugPaths.TriggerPrefabPath); if (prefab == null) { Debug.LogError("[SRDebugger] Error loading trigger prefab"); return; } _trigger = SRInstantiate.Instantiate(prefab); _trigger.CachedTransform.SetParent(CachedTransform, true); SetTriggerPosition(_trigger.TriggerTransform, _position); switch (Settings.Instance.TriggerBehaviour) { case Settings.TriggerBehaviours.TripleTap: { _trigger.TripleTapButton.onClick.AddListener(OnTriggerButtonClick); _trigger.TapHoldButton.gameObject.SetActive(false); break; } case Settings.TriggerBehaviours.TapAndHold: { _trigger.TapHoldButton.onLongPress.AddListener(OnTriggerButtonClick); _trigger.TripleTapButton.gameObject.SetActive(false); break; } case Settings.TriggerBehaviours.DoubleTap: { _trigger.TripleTapButton.RequiredTapCount = 2; _trigger.TripleTapButton.onClick.AddListener(OnTriggerButtonClick); _trigger.TapHoldButton.gameObject.SetActive(false); break; } default: throw new Exception("Unhandled TriggerBehaviour"); } SRDebuggerUtil.EnsureEventSystemExists(); UnityEngine.SceneManagement.SceneManager.activeSceneChanged += OnActiveSceneChanged; if (Settings.Instance.ErrorNotification) { _consoleService = SRServiceManager.GetService <IConsoleService>(); _consoleService.Error += OnError; } }
private void Initialize() { if (_initialized) { return; } _initialized = true; _root = GetComponentInParent <TriggerRoot>(); }
public void AddNewTab(TriggerRoot root) { InternalScriptDescription newPage = new InternalScriptDescription(); newPage.Name = root.Name; mInternalDefinitions.Add(newPage); AddNewTab(newPage, root, root.Name); }
void InternalScriptsList_ObjectDeleted(ObjectEditorControl sender, object selectedObject) { //throw new Exception("The method or operation is not implemented."); //MessageBox.Show("The method or operation is not implemented."); //return; PhoenixEditor.ScenarioEditor.InternalScriptDescription des = selectedObject as PhoenixEditor.ScenarioEditor.InternalScriptDescription; if (des != null && MessageBox.Show("", "Are you sure you want to delete the script " + des.Name, MessageBoxButtons.YesNo) == DialogResult.Yes) { if (mParentTabs != null && mSimMain != null) { Control toremove = null; foreach (Control c in mParentTabs.Controls) { if (c == des.mOwnedPage) { toremove = c; } } if (toremove != null) { mParentTabs.Controls.Remove(toremove); } TriggerRoot rootToRemove = null; foreach (TriggerRoot r in mSimMain.TriggerData) { if (r == des.mTriggerRoot) { rootToRemove = r; } } if (rootToRemove != null) { mSimMain.TriggerData.Remove(rootToRemove); } } } //if (mParentTabs != null) //{ // foreach(Control c in mParentTabs) // { // } //} }
void InternalScriptsList_NewObjectAdded(ObjectEditorControl sender, object selectedObject) { InternalScriptDescription newPage = selectedObject as InternalScriptDescription; //if(newPage != null) //{ // if(mParentTabs != null) // { //TabPage p = new TabPage(); //mParentTabs.Controls.Add(p); //TriggerEditor ed = new TriggerEditor(); //p.Controls.Add(ed); //ed.Dock = DockStyle.Fill; //ed.mBaseClientParent = this.mBaseClientParent; //TriggerRoot newRoot = new TriggerRoot(); //mSimMain.TriggerData.Add(newRoot); //ed.TriggerData = newRoot; //newPage.mOwnedPage = p; //newPage.Name = "Script"; //p.Tag = ed; TriggerRoot newRoot = new TriggerRoot(); mSimMain.TriggerData.Add(newRoot); AddNewTab(newPage, newRoot, "Script"); //TabPage p = new TabPage(); //mParentTabs.Controls.Add(p); //TriggerEditor ed = new TriggerEditor(); //p.Controls.Add(ed); //ed.Dock = DockStyle.Fill; //ed.mBaseClientParent = this.mBaseClientParent; //ed.TriggerData = newRoot; //newPage.mOwnedPage = p; //newPage.Name = "Script"; //p.Tag = ed; // } //} }
public void MovieEnd() { TriggerRoot root = NGUITools.FindInParents <TriggerRoot>(gameObject); if (root != null && root.isTriggerNextWave) { if (m_triggerNextWaveTimes <= 0) { CoreEntry.gGameMgr.TriggerNextWave(); m_triggerNextWaveTimes = 1; } } gameObject.SetActive(false); }
public ScriptPage() { InitializeComponent(); TriggerSystemMain.Init(); //this.previewNavWindow1.MasterControl = triggerHostArea1; triggerHostArea1.ViewChanged += new EventHandler(triggerHostArea1_ViewChanged); previewNavWindow1.BorderStyle = BorderStyle.FixedSingle; TriggerData = new TriggerRoot(); triggerHostArea1.ScanComplete += new EventHandler(triggerHostArea1_ScanComplete); ErrorPanel.Click += new EventHandler(ErrorPanel_Click); buildMode.Items.AddRange(Enum.GetNames(typeof(TriggerFinalBake.eBuildMode))); buildMode.SelectedIndex = 0; }
private void CreateTrigger() { var prefab = Resources.Load <TriggerRoot>(SRDebugPaths.TriggerPrefabPath); if (prefab == null) { Debug.LogError("[SRDebugger] Error loading trigger prefab"); return; } _trigger = SRInstantiate.Instantiate(prefab); _trigger.CachedTransform.SetParent(CachedTransform, true); SetTriggerPosition(_trigger.TriggerTransform, _position); switch (Settings.Instance.TriggerBehaviour) { case Settings.TriggerBehaviours.TripleTap: { _trigger.TripleTapButton.onClick.AddListener(OnTriggerButtonClick); _trigger.TapHoldButton.gameObject.SetActive(false); break; } case Settings.TriggerBehaviours.TapAndHold: { _trigger.TapHoldButton.onLongPress.AddListener(OnTriggerButtonClick); _trigger.TripleTapButton.gameObject.SetActive(false); break; } default: throw new Exception("Unhandled TriggerBehaviour"); } SRDebuggerUtil.EnsureEventSystemExists(); }
public void AddNewTab(InternalScriptDescription newPage, TriggerRoot root, string name) { if (newPage != null && mParentTabs != null) { this.SuspendLayout(); TabPage p = new TabPage(); mParentTabs.Controls.Add(p); TriggerEditor ed = new TriggerEditor(); p.Controls.Add(ed); ed.Dock = DockStyle.Fill; ed.mBaseClientParent = this.mBaseClientParent; ed.TriggerData = root; newPage.mTriggerRoot = root; newPage.mOwnedPage = p; newPage.Name = name;// "Script"; p.Tag = ed; this.ResumeLayout(); } }
private void LoadScript() { try { OpenFileDialog d = new OpenFileDialog(); d.Filter = GetFilter(); d.InitialDirectory = GetInitialDirectory(); if (d.ShowDialog() == DialogResult.OK) { XmlSerializer s = new XmlSerializer(typeof(TriggerRoot), new Type[] { }); Stream st = File.OpenRead(d.FileName); TriggerData = (TriggerRoot)s.Deserialize(st); st.Close(); this.Parent.Text = Path.GetFileName(d.FileName); mSavedFileName = d.FileName; } } catch (System.Exception ex) { CoreGlobals.getErrorManager().OnException(ex); } }
public TriggerCollection(EventEditorContext context, OverviewEditorContext overviewContext, TriggerRoot root) { _rootNode = new TriggerCollectionNode(context, overviewContext, root.gameObject); _triggers = new List<Trigger>(); _context = context; _overviewContext = overviewContext; Initialize(); }
public void Initialize() { if (_overviewContext == null) { _overviewContext = new OverviewEditorContext(); } if (_eventEditorContext == null || _eventEditorContext.TriggerRoot == null) { TriggerRoot triggerRoot = GameObject.FindObjectOfType <TriggerRoot>(); if (!triggerRoot) { triggerRoot = (new GameObject("Events")).AddComponent <TriggerRoot>(); } GlobalSymbolTableAccessor accessor = triggerRoot.GetComponent <GlobalSymbolTableAccessor>(); if (!accessor.GlobalSymbolTable) { accessor.GlobalSymbolTable = ScriptableObject.CreateInstance <GlobalSymbolTable>(); } List <Trigger> triggers = new List <Trigger>(); PopulateTriggerList(triggerRoot.transform, triggers); _eventEditorContext = new EventEditorContext(this, _overviewContext, triggerRoot, triggers, accessor.GlobalSymbolTable); _variableView.Context = _eventEditorContext; _overviewTab.Context = _eventEditorContext; _triggerEditor.Context = _eventEditorContext; return; } if (Selection.activeGameObject) { TriggerRoot[] roots = Selection.activeGameObject.GetComponentsInParent <TriggerRoot>(true); TriggerRoot selectedRoot = null; if (roots.Length != 0) { selectedRoot = roots[0]; } if (selectedRoot) { if (selectedRoot != _eventEditorContext.TriggerRoot) { List <Trigger> triggers = new List <Trigger>(); PopulateTriggerList(selectedRoot.transform, triggers); GlobalSymbolTableAccessor accessor = selectedRoot.GetComponent <GlobalSymbolTableAccessor>(); accessor.hideFlags = HideFlags.None; if (!accessor.GlobalSymbolTable) { accessor.GlobalSymbolTable = ScriptableObject.CreateInstance <GlobalSymbolTable>(); } //SelectTrigger(null); _eventEditorContext = new EventEditorContext(this, _overviewContext, selectedRoot, triggers, accessor.GlobalSymbolTable); _variableView.Context = _eventEditorContext; _overviewTab.Context = _eventEditorContext; _triggerEditor.Context = _eventEditorContext; } } } if (_eventEditorContext.TriggerRoot) { _eventEditorContext.TriggerRoot.gameObject.hideFlags = HideFlags.None; _eventEditorContext.TriggerRoot.hideFlags = HideFlags.None; } }
public TriggerTemplatePage() { InitializeComponent(); TriggerSystemMain.Init(); triggerHostArea1.ViewChanged += new EventHandler(triggerHostArea1_ViewChanged); previewNavWindow1.BorderStyle = BorderStyle.FixedSingle; TemplateAttributesPropertyGrid.IgnoreProperties("TriggerTemplateMapping", new string[] { "InputMappings", "OutputMappings", "TriggerInputs", "TriggerOutputs", "GroupID", "ID", "X", "Y", "Name", "CommentOut" }); TemplateAttributesPropertyGrid.AddMetaDataForProp("TriggerTemplateMapping", "SizeX", "Min", 30); TemplateAttributesPropertyGrid.AddMetaDataForProp("TriggerTemplateMapping", "SizeX", "Max", 800); TemplateAttributesPropertyGrid.AddMetaDataForProp("TriggerTemplateMapping", "SizeY", "Min", 30); TemplateAttributesPropertyGrid.AddMetaDataForProp("TriggerTemplateMapping", "SizeY", "Max", 500); TemplateAttributesPropertyGrid.AddMetaDataForProp("TriggerTemplateMapping", "Image", "FileFilter", "Images (*.bmp)|*.bmp"); TemplateAttributesPropertyGrid.AddMetaDataForProp("TriggerTemplateMapping", "Image", "RootDirectory", CoreGlobals.getWorkPaths().mBaseDirectory); TemplateAttributesPropertyGrid.AddMetaDataForProp("TriggerTemplateMapping", "Image", "StartingDirectory", Path.Combine(CoreGlobals.getWorkPaths().mAppIconDir, "TriggerEditor")); TemplateAttributesPropertyGrid.SetTypeEditor("TriggerTemplateMapping", "Image", typeof(FileNameProperty)); TemplateAttributesPropertyGrid.AnyPropertyChanged += new ObjectEditorControl.PropertyChanged(onAnyPropertyChanged); InputVarsBasicTypedSuperList.UseLabels = false; OutputVarsBasicTypedSuperList.UseLabels = false; InputTriggersBasicTypedSuperList.UseLabels = false; OutputTriggersBasicTypedSuperList.UseLabels = false; InputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateInputVariable", "Type", "ReadOnly", true); InputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateInputVariable", "ID", "Ignore", true); //InputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateInputVariable", "Optional", "Ignore", true); InputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateInputVariable", "SigID", "Ignore", true); InputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateInputVariable", "BindID", "TriggerNamespace", mMainTriggerSystem.MainNamespace); InputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateInputVariable", "BindID", "UpdateEvent", true); InputVarsBasicTypedSuperList.SetTypeEditor("TriggersTemplateInputVariable", "BindID", typeof(VariableIDProperty)); InputVarsBasicTypedSuperList.mListDataObjectType = typeof(TriggersTemplateInputVariable); InputVarsBasicTypedSuperList.SelectedObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(basicTypedSuperList1_SelectedObjectPropertyChanged); InputVarsBasicTypedSuperList.AnyObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(onAnyPropertyChanged); InputVarsBasicTypedSuperList.NeedsResize += new EventHandler(BasicTypedSuperList_Changed); OutputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateOutputVariable", "Type", "ReadOnly", true); OutputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateOutputVariable", "ID", "Ignore", true); //OutputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateOutputVariable", "Optional", "Ignore", true); OutputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateOutputVariable", "SigID", "Ignore", true); OutputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateOutputVariable", "BindID", "TriggerNamespace", mMainTriggerSystem.MainNamespace); OutputVarsBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateOutputVariable", "BindID", "UpdateEvent", true); OutputVarsBasicTypedSuperList.SetTypeEditor("TriggersTemplateOutputVariable", "BindID", typeof(VariableIDProperty)); OutputVarsBasicTypedSuperList.mListDataObjectType = typeof(TriggersTemplateOutputVariable); OutputVarsBasicTypedSuperList.SelectedObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(basicTypedSuperList1_SelectedObjectPropertyChanged); OutputVarsBasicTypedSuperList.AnyObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(onAnyPropertyChanged); OutputVarsBasicTypedSuperList.NeedsResize += new EventHandler(BasicTypedSuperList_Changed); InputTriggersBasicTypedSuperList.IgnoreProperties("TriggersTemplateInputActionBinder", new string[] { "Color", "TargetIDs", "_TargetID", "BindID" }); InputTriggersBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateInputActionBinder", "_BindID", "ReadOnly", true); InputTriggersBasicTypedSuperList.SetTypeEditor("TriggersTemplateInputActionBinder", "_BindID", typeof(TriggerBindIDProperty)); InputTriggersBasicTypedSuperList.SelectedObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(InputTriggersBasicTypedSuperList_SelectedObjectPropertyChanged); InputTriggersBasicTypedSuperList.mListDataObjectType = typeof(TriggersTemplateInputActionBinder); InputTriggersBasicTypedSuperList.AnyObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(onAnyPropertyChanged); InputTriggersBasicTypedSuperList.NeedsResize += new EventHandler(BasicTypedSuperList_Changed); OutputTriggersBasicTypedSuperList.IgnoreProperties("TriggersTemplateOutputActionBinder", new string[] { "Color", "TargetIDs", "_TargetID", "BindID" }); OutputTriggersBasicTypedSuperList.AddMetaDataForProp("TriggersTemplateOutputActionBinder", "_BindID", "ReadOnly", true); OutputTriggersBasicTypedSuperList.SetTypeEditor("TriggersTemplateOutputActionBinder", "_BindID", typeof(TriggerBindIDProperty)); OutputTriggersBasicTypedSuperList.SelectedObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(OutputTriggersBasicTypedSuperList_SelectedObjectPropertyChanged); OutputTriggersBasicTypedSuperList.mListDataObjectType = typeof(TriggersTemplateOutputActionBinder); OutputTriggersBasicTypedSuperList.AnyObjectPropertyChanged += new BasicTypedSuperList.PropertyChanged(onAnyPropertyChanged); OutputTriggersBasicTypedSuperList.NeedsResize += new EventHandler(BasicTypedSuperList_Changed); TriggerRoot trigroot = new TriggerRoot(); mFakeTriggerSystem.TriggerData = trigroot; triggerHostArea2.CurrentTriggerNamespace = mFakeTriggerSystem.MainNamespace; TemplateDefinition = new TriggerTemplateDefinition(); }
private static void InternalScan(object input)//bool bfilter, List<string> filterList) { ScanSettings settings = input as ScanSettings; bool bfilter = settings.bFilter; List <string> filterList = settings.filterList; //TreeNode templateNode = new TreeNode("Scanning Templates"); List <ScanResults> scanResults = mScanResults; // new List<ScanResults>(); List <string> templates = settings.templates; // TriggerSystemMain.mTriggerDefinitions.GetTemplateFileNames(); foreach (string filename in templates) { if (bfilter == true && filterList.Contains(filename.ToLower()) == false) { continue; } try { if (filename.Contains("customswatches.xml") == true) { continue; } XmlSerializer s = new XmlSerializer(typeof(TriggerTemplateDefinition), new Type[] { }); Stream st = File.OpenRead(filename); TriggerTemplateDefinition def = (TriggerTemplateDefinition)s.Deserialize(st); st.Close(); TriggerNamespace ns = new TriggerNamespace(); //ns.TriggerData = def.TriggerSystemRoot; //TriggerRoot output = ns.TriggerData; ns.mDebugInfo.Clear(); ns.PreProcessObjectGraph(def.TriggerSystemRoot, false, def.TriggerTemplateMapping.GetActivatedTriggers(), def.TriggerTemplateMapping.GetInitializedVars()); if (ns.mDebugInfo.Count > 0) { lock (scanResults) { //TreeNode thisFile = new TreeNode(); foreach (TriggerSystemDebugInfo d in ns.mDebugInfo) { //TreeNode info = new TreeNode(d.ToString()); //info.Tag = d; //SetNodeProps(info, d); //thisFile.Nodes.Add(info); scanResults.Add(new ScanResults(filename, "Template", d)); } } //thisFile.Text = filename; //templateNode.Nodes.Add(thisFile); } } catch (System.Exception ex) { //templateNode.Nodes.Add("Fatal error loading " + filename + " " + ex.ToString()); } } //this.ScanResultsTreeView.Nodes.Add(templateNode); //this.ScanResultsTreeView.Refresh(); //TreeNode powerNode = new TreeNode("Scanning Powers/Abilites/Triggerscripts"); List <string> scripts = settings.scripts;// new List<string>(); //scripts.AddRange(TriggerSystemMain.mTriggerDefinitions.GetPowerFileNames()); //scripts.AddRange(TriggerSystemMain.mTriggerDefinitions.GetAbilityFileNames()); //scripts.AddRange(TriggerSystemMain.mTriggerDefinitions.GetGeneralScriptFileNames()); foreach (string filename in scripts) { if (bfilter == true && filterList.Contains(filename.ToLower()) == false) { continue; } try { if (filename.Contains("customswatches.xml") == true) { continue; } XmlSerializer s = new XmlSerializer(typeof(TriggerRoot), new Type[] { }); Stream st = File.OpenRead(filename); TriggerRoot root = (TriggerRoot)s.Deserialize(st); st.Close(); //TriggerNamespace ns = new TriggerNamespace(); //ns.TriggerData = root; ////TriggerRoot output = ns.TriggerData; TriggerNamespace ns = new TriggerNamespace(); ns.mDebugInfo.Clear(); ns.PreProcessObjectGraph(root, false); if (ns.mDebugInfo.Count > 0) { //TreeNode thisFile = new TreeNode(); lock (scanResults) { foreach (TriggerSystemDebugInfo d in ns.mDebugInfo) { //TreeNode info = new TreeNode(d.ToString()); //info.Tag = d; //SetNodeProps(info, d); //thisFile.Nodes.Add(info); scanResults.Add(new ScanResults(filename, "AbilityPowerTScript", d)); } } //thisFile.Text = filename; //powerNode.Nodes.Add(thisFile); } } catch (System.Exception ex) { //powerNode.Nodes.Add("Fatal error loading " + filename + " " + ex.ToString()); } } //this.ScanResultsTreeView.Nodes.Add(powerNode); //this.ScanResultsTreeView.Refresh(); //TreeNode scenarioNode = new TreeNode("Scanning Scenarios"); //string[] scenarioFiles = CoreGlobals.getWorkPaths().GetScenarioFiles(); List <string> scenarioFiles = settings.scenarios; foreach (string filename in scenarioFiles) { if (bfilter == true && filterList.Contains(filename.ToLower()) == false) { continue; } try { if (filename.Contains("customswatches.xml") == true) { continue; } XmlSerializer s = new XmlSerializer(typeof(ScenarioXML), new Type[] { }); Stream st = File.OpenRead(filename); ScenarioXML scenXml = (ScenarioXML)s.Deserialize(st); st.Close(); foreach (TriggerRoot ts in scenXml.mTriggers) { //TriggerNamespace ns = new TriggerNamespace(); //ns.TriggerData = ts; ////TriggerRoot output = ns.TriggerData; TriggerNamespace ns = new TriggerNamespace(); ns.mDebugInfo.Clear(); ns.PreProcessObjectGraph(ts, false); if (ns.mDebugInfo.Count > 0) { lock (scanResults) { //TreeNode thisFile = new TreeNode(); foreach (TriggerSystemDebugInfo d in ns.mDebugInfo) { //TreeNode info = new TreeNode(d.ToString()); //SetNodeProps(info, d); //info.Tag = d; //thisFile.Nodes.Add(info); scanResults.Add(new ScanResults(filename, "Scenario", d)); } } //thisFile.Text = filename; //scenarioNode.Nodes.Add(thisFile); } } } catch (System.Exception ex) { //scenarioNode.Nodes.Add("Fatal error loading " + filename + " " + ex.ToString()); } } System.Threading.Interlocked.Decrement(ref mRemainingTasks); //this.ScanResultsTreeView.Nodes.Add(scenarioNode); //ScanResultsTreeView.ImageList = l; //this.ScanResultsTreeView.Refresh(); //return scanResults; }