Example #1
0
        private void Start()
        {
            m_btnStartStop.Text              = @"Stop";
            m_bIsRunning                     = true;
            m_tbxActionTagGroup.Enabled      = false;
            m_tbxBuffTagGroup.Enabled        = false;
            m_tbxExpActionTagGroup.Enabled   = false;
            m_tbxModifierTagGroup.Enabled    = false;
            m_tbxRequirementTagGroup.Enabled = false;
            m_tbxTargetTagGroup.Enabled      = false;
            m_chklbxFilter.Enabled           = false;

            m_prgProgress.Value   = 1;
            m_prgProgress.Step    = 1;
            m_prgProgress.Minimum = 1;
            m_prgProgress.Maximum = FileManager.AttribTree.RootNode.GetTotalFileCount();

            foreach (object item in m_chklbxFilter.CheckedItems)
            {
                string tagGroupName = item as string;
                var    tags         = RBFLibrary.GetTagGroup(tagGroupName);
                if (tags != null)
                {
                    m_keyFilter.AddRange(tags);
                }
            }

            m_crawlTargets = new List <CrawlerInfo>
            {
                new CrawlerInfo("GameData", v => HasRefWithStart(v, "entity_extensions"),
                                s => "entity_extensions", false),

                new CrawlerInfo("GameData", v => HasRefWithStart(v, "squad_extensions"),
                                s => "squad_extensions", false),

                new CrawlerInfo(m_tbxActionTagGroup.Text, v => HasRefWithStart(v, "actions"),
                                s => s.SubstringBetweenOccurrencs(1, 2, '\\') + "_actions"),

                new CrawlerInfo(m_tbxBuffTagGroup.Text, v => HasRefWithStart(v, "buffs"),
                                s => s.SubstringBetweenOccurrencs(1, 2, '\\') + "_buffs"),

                new CrawlerInfo(m_tbxExpActionTagGroup.Text,
                                v => HasRefWithStart(v, "wargear\\expendable_actions"),
                                s => "expendable_actions"),

                new CrawlerInfo(m_tbxModifierTagGroup.Text, v => HasRefWithStart(v, "modifiers"),
                                s => s.SubstringBetweenOccurrencs(1, 2, '\\')),

                new CrawlerInfo(m_tbxRequirementTagGroup.Text,
                                v => HasRefWithStart(v, "requirements"), s => "requirements"),

                new CrawlerInfo(m_tbxTargetTagGroup.Text, v => HasRefWithStart(v, "types\\targets"),
                                s => "targets"),
            };

            m_crawler             = new RBFCrawler(ScanFile, string.Empty, AdvanceProgress);
            m_crawler.OnFinished += OnCrawlerDone;
            m_crawler.Start();
        }
        private void BtnSearchClick(object sender, EventArgs e)
        {
            if (FileManager.AttribTree == null)
            {
                UIHelper.ShowError("The attrib-tree could not be found! Ensure that there is a mod loaded");
                return;
            }
            m_selectedItem = null;
            m_chklbxEntries.Items.Clear();
            m_progBarSearch.Value   = 1;
            m_progBarSearch.Step    = 1;
            m_progBarSearch.Minimum = 1;
            m_progBarSearch.Maximum = FileManager.AttribTree.RootNode.GetTotalFileCount();
            m_btnSearch.Enabled     = false;
            m_results = new Dictionary <string, DictEntry>();

            m_crawler             = new RBFCrawler(Search, FileManager.AttribTree.RootNode, AdvanceProgress);
            m_crawler.OnFinished += CrawlerOnFinished;
            m_crawler.Start();
        }
        private void BtnSearchClick(object sender, EventArgs e)
        {
            if (!m_chkbxSearchForKey.Checked && !m_chkbxSearchForValue.Checked)
            {
                UIHelper.ShowError("No search criteria specified!");
                return;
            }
            if (FileManager.AttribTree == null)
            {
                UIHelper.ShowError("The attrib-tree could not be found! Ensure that there is a mod loaded");
                return;
            }
            FSNodeDir startingNode = m_tbxInitialNode.Text == string.Empty
                                         ? FileManager.AttribTree.RootNode
                                         : FileManager.AttribTree.RootNode.GetSubNodeByPath(m_tbxInitialNode.Text) as
                                     FSNodeDir;

            if (startingNode == null)
            {
                UIHelper.ShowError(
                    "The specified starting node could not be found or is not a directory! " +
                    "Ensure that it exists in the attrib-tree!");
                return;
            }
            m_lbxSearchResults.Items.Clear();
            m_progBarSearch.Value   = 1;
            m_progBarSearch.Step    = 1;
            m_progBarSearch.Minimum = 1;
            m_progBarSearch.Maximum = startingNode.GetTotalFileCount();
            m_sSearchKey            = m_tbxSearchKey.Text;
            m_sSearchValue          = m_tbxSearchValue.Text;
            m_bSearchForKey         = m_chkbxSearchForKey.Checked;
            m_bSearchForValue       = m_chkbxSearchForValue.Checked;
            m_bFullText             = m_chkbxFullText.Checked;
            m_btnSearch.Enabled     = false;
            m_results             = new Dictionary <string, SearchResult>();
            m_crawler             = new RBFCrawler(Search, startingNode, AdvanceProgress);
            m_crawler.OnFinished += CrawlerOnFinished;
            m_crawler.Start();
        }
 private void BtnSearchClick(object sender, EventArgs e)
 {
     if (!m_chkbxSearchForKey.Checked && !m_chkbxSearchForValue.Checked)
     {
         UIHelper.ShowError("No search criteria specified!");
         return;
     }
     if (FileManager.AttribTree == null)
     {
         UIHelper.ShowError("The attrib-tree could not be found! Ensure that there is a mod loaded");
         return;
     }
     FSNodeDir startingNode = m_tbxInitialNode.Text == string.Empty
                                  ? FileManager.AttribTree.RootNode
                                  : FileManager.AttribTree.RootNode.GetSubNodeByPath(m_tbxInitialNode.Text) as
                                    FSNodeDir;
     if (startingNode == null)
     {
         UIHelper.ShowError(
             "The specified starting node could not be found or is not a directory! " +
             "Ensure that it exists in the attrib-tree!");
         return;
     }
     m_lbxSearchResults.Items.Clear();
     m_progBarSearch.Value = 1;
     m_progBarSearch.Step = 1;
     m_progBarSearch.Minimum = 1;
     m_progBarSearch.Maximum = startingNode.GetTotalFileCount();
     m_sSearchKey = m_tbxSearchKey.Text;
     m_sSearchValue = m_tbxSearchValue.Text;
     m_bSearchForKey = m_chkbxSearchForKey.Checked;
     m_bSearchForValue = m_chkbxSearchForValue.Checked;
     m_bFullText = m_chkbxFullText.Checked;
     m_btnSearch.Enabled = false;
     m_results = new Dictionary<string, SearchResult>();
     m_crawler = new RBFCrawler(Search, startingNode, AdvanceProgress);
     m_crawler.OnFinished += CrawlerOnFinished;
     m_crawler.Start();
 }
        private void BtnSearchClick(object sender, EventArgs e)
        {
            if (FileManager.AttribTree == null)
            {
                 UIHelper.ShowError("The attrib-tree could not be found! Ensure that there is a mod loaded");
                return;
            }
            m_selectedItem = null;
            m_chklbxEntries.Items.Clear();
            m_progBarSearch.Value = 1;
            m_progBarSearch.Step = 1;
            m_progBarSearch.Minimum = 1;
            m_progBarSearch.Maximum = FileManager.AttribTree.RootNode.GetTotalFileCount();
            m_btnSearch.Enabled = false;
            m_results = new Dictionary<string, DictEntry>();

            m_crawler = new RBFCrawler(Search, FileManager.AttribTree.RootNode, AdvanceProgress);
            m_crawler.OnFinished += CrawlerOnFinished;
            m_crawler.Start();
        }
        private void Start()
        {
            m_btnStartStop.Text = @"Stop";
            m_bIsRunning = true;
            m_tbxActionTagGroup.Enabled = false;
            m_tbxBuffTagGroup.Enabled = false;
            m_tbxExpActionTagGroup.Enabled = false;
            m_tbxModifierTagGroup.Enabled = false;
            m_tbxRequirementTagGroup.Enabled = false;
            m_tbxTargetTagGroup.Enabled = false;
            m_chklbxFilter.Enabled = false;

            m_prgProgress.Value = 1;
            m_prgProgress.Step = 1;
            m_prgProgress.Minimum = 1;
            m_prgProgress.Maximum = FileManager.AttribTree.RootNode.GetTotalFileCount();

            foreach (object item in m_chklbxFilter.CheckedItems)
            {
                string tagGroupName = item as string;
                var tags = RBFLibrary.GetTagGroup(tagGroupName);
                if (tags != null)
                    m_keyFilter.AddRange(tags);
            }

            m_crawlTargets = new List<CrawlerInfo>
                                 {
                                     new CrawlerInfo("GameData", v => HasRefWithStart(v, "entity_extensions"),
                                                     s => "entity_extensions", false),

                                     new CrawlerInfo("GameData", v => HasRefWithStart(v, "squad_extensions"),
                                                     s => "squad_extensions", false),

                                     new CrawlerInfo(m_tbxActionTagGroup.Text, v => HasRefWithStart(v, "actions"),
                                                     s => s.SubstringBetweenOccurrencs(1, 2, '\\') + "_actions"),

                                     new CrawlerInfo(m_tbxBuffTagGroup.Text, v => HasRefWithStart(v, "buffs"),
                                                     s => s.SubstringBetweenOccurrencs(1, 2, '\\') + "_buffs"),

                                     new CrawlerInfo(m_tbxExpActionTagGroup.Text,
                                                     v => HasRefWithStart(v, "wargear\\expendable_actions"),
                                                     s => "expendable_actions"),

                                     new CrawlerInfo(m_tbxModifierTagGroup.Text, v => HasRefWithStart(v, "modifiers"),
                                                     s => s.SubstringBetweenOccurrencs(1, 2, '\\')),

                                     new CrawlerInfo(m_tbxRequirementTagGroup.Text,
                                                     v => HasRefWithStart(v, "requirements"), s => "requirements"),

                                     new CrawlerInfo(m_tbxTargetTagGroup.Text, v => HasRefWithStart(v, "types\\targets"),
                                                     s => "targets"),
                                 };

            m_crawler = new RBFCrawler(ScanFile, string.Empty, AdvanceProgress);
            m_crawler.OnFinished += OnCrawlerDone;
            m_crawler.Start();
        }