Ejemplo n.º 1
0
        private string GenerateDebugInfo(MultiSourceTreeNode node, NodeInfo info)
        {
            string nodeInfoText = "<b>Node Entry Information</b><br />";

            foreach (NodeInfo entry in node.InfoEntries)
            {
                nodeInfoText += entry.NodeType + " - " + entry.Identifier + "<br/><br/>Active States: (<i>";
                string states = "";
                foreach (NodeStateSubscriber subscriber in entry.Subscriptions)
                {
                    if (subscriber.Active)
                    {
                        states += subscriber.State.Name + ", ";
                    }
                }
                nodeInfoText += states.Substring(0, states.Length - 2);
                nodeInfoText += "</i>)";
            }
            return(nodeInfoText);
        }
Ejemplo n.º 2
0
        private void view_map_list(MultiSourceTreeNode node, NodeInfo info)
        {
            TagArchive archive             = (TagArchive)currentGame.GlobalTagLibrary;
            TagArchiveFileTableEntry entry =
                (TagArchiveFileTableEntry)archive.MissingFilesArchive.FileTable.GetEntry(info.Identifier, EntryType.File);

            List <string> maps = new List <string>();
            BitArray      bits = new BitArray(BitConverter.GetBytes(entry.MapsBitmask));

            for (int x = 0; x < currentGame.Maps.Length; x++)
            {
                if (bits[x])
                {
                    maps.Add(currentGame.Maps[x].Filename);
                }
            }

            string        text = "The specified tag <b>" + info.Identifier + "</b> ";
            List <TagSet> sets = archive.BuildTagLocationList(new string[] { info.Identifier }, currentGame);

            if (sets.Count == 0)
            {
                text += "does not exist in any of the available maps.";
            }
            else
            {
                string mapfile     = currentGame.Maps[sets[0].MapIndex].Filename;
                string mapListText = "exists in the following maps:<br />";
                foreach (string map in maps)
                {
                    mapListText += "- " + map;
                    if (map == mapfile)
                    {
                        mapListText += " <i>*preferred source</i>";
                    }
                    mapListText += "<br />";
                }
                text += mapListText;
            }
            MessageBoxEx.Show(text, "Unextracted Tag Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Ejemplo n.º 3
0
        private bool templateElementHasDefault(MultiSourceTreeNode node, NodeInfo info)
        {
            string element = info.Tag as string;

            if (element == null)
            {
                return(false);
            }

            foreach (TemplateTag tag in projectManager.Project.Template.TagSet)
            {
                if (tag.Name == element)
                {
                    if (tag.DefaultFile != "" && tag.DefaultFile != null)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Ejemplo n.º 4
0
 private void removeFolderFromProject(MultiSourceTreeNode node, NodeInfo info)
 {
     // Get a list of all files in this folder.
     projectManager.Project.RemoveFolderReference(info.Identifier);
 }
Ejemplo n.º 5
0
 private bool RecycleBinContentsCheck(MultiSourceTreeNode node, NodeInfo info)
 {
     return(Core.Prometheus.Instance.ProjectManager.Project.RecycleBin.ContainsFiles());
 }
Ejemplo n.º 6
0
 private bool RecycleBinDocumentNotOpenTest(MultiSourceTreeNode node, NodeInfo info)
 {
     return(!Core.Prometheus.Instance.DocumentManager.DocumentExists(GetRecycleBinDocumentTitle()));
 }
Ejemplo n.º 7
0
        private void infoHandler(MultiSourceTreeNode node, NodeInfo info)
        {
            string nodeInfoText = GenerateDebugInfo(node, info);

            MessageBoxEx.Show(nodeInfoText, "Debug", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Ejemplo n.º 8
0
        private bool documentOpenedTest(MultiSourceTreeNode node, NodeInfo info)
        {
            TagPath path = new TagPath(info.Identifier, projectManager.GameID, TagLocation.Project);

            return(!Core.Prometheus.Instance.DocumentManager.DocumentExists(path.ToPath()));
        }
Ejemplo n.º 9
0
 private void removeFromProject(MultiSourceTreeNode node, NodeInfo info)
 {
     projectManager.Project.RemoveTagReference(info.Identifier);
 }
Ejemplo n.º 10
0
        private void extractFromGameArchive(MultiSourceTreeNode node, NodeInfo info)
        {
            TagPath path = new TagPath(info.Identifier, projectManager.GameID, TagLocation.Archive);

            AddGameTagToProject(path);
        }
Ejemplo n.º 11
0
        private void treeView_AfterCheck(object sender, TreeViewEventArgs e)
        {
            // We are only worried about nodes of types "unextractedfolder" and unextractedfile".
            if (!(e.Node is MultiSourceTreeNode))
            {
                return;
            }
            MultiSourceTreeNode node = (MultiSourceTreeNode)e.Node;

            try
            {
                Cursor = Cursors.WaitCursor;
                foreach (NodeInfo entry in node.InfoEntries)
                {
                    if (entry.NodeType is UnextractedHLTGroupNodeType)
                    {
                        string group = entry.Identifier.Trim('[', ']');
                        foreach (TypeTableEntry typeEntry in currentGame.TypeTable.GetHighLevelTypes(group))
                        {
                            string[] files = ((TagArchive)currentGame.GlobalTagLibrary).MissingFilesArchive.GetFileList(
                                "", typeEntry.FullName, true);

                            foreach (string file in files)
                            {
                                if (e.Node.Checked)
                                {
                                    AddToQueue(file);
                                }
                                else
                                {
                                    RemoveFromQueue(file);
                                }
                            }
                        }
                    }
                    else if (entry.NodeType is UnextractedHLTNodeType)
                    {
                        if (e.Node.Checked)
                        {
                            AddToQueue(entry.Identifier);
                        }
                        else
                        {
                            RemoveFromQueue(entry.Identifier);
                        }
                    }
                    else if (entry.NodeType is UnextractedFolderNodeType)
                    {
                        TagArchiveNodeSource source = (TagArchiveNodeSource)entry.ParentSource;
                        string[]             files  = source.Library.MissingFilesArchive.GetFileList(entry.Identifier, "*", true);
                        foreach (string file in files)
                        {
                            if (e.Node.Checked)
                            {
                                AddToQueue(file);
                            }
                            else
                            {
                                RemoveFromQueue(file);
                            }
                        }
                    }
                    else if (entry.NodeType is UnextractedFileNodeType)
                    {
                        if (e.Node.Checked)
                        {
                            AddToQueue(entry.Identifier);
                        }
                        else
                        {
                            RemoveFromQueue(entry.Identifier);
                        }
                    }
                }
                UpdateExtractionButton();
                treeView.GetLastNode().EnsureVisible();
            }
            finally
            {
                Cursor = Cursors.Default;
            }
        }
Ejemplo n.º 12
0
 private void includeInProject(MultiSourceTreeNode node, NodeInfo info)
 {
     projectManager.Project.AddTagReference(info.Identifier);
 }
Ejemplo n.º 13
0
 private void selectProjectTag_click(MultiSourceTreeNode node, NodeInfo info)
 {
     MessageBoxEx.Show("Not yet implemented.");
 }
Ejemplo n.º 14
0
 private void revertToDefault(MultiSourceTreeNode node, NodeInfo info)
 {
     projectManager.Project.Templates.RemoveByTagPath(info.Identifier);
 }