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(); }
public CrawlerInfo(string tagGroupName, Func <AttributeValue, bool> selector, Func <string, string> categoryMaker, bool usesTagGroup = true) { TagGroupName = tagGroupName; Selector = selector; CategoryMaker = categoryMaker; UsesTagGroup = usesTagGroup; if (usesTagGroup) { Tags = new HashSet <string>(); var currentTags = RBFLibrary.GetTagGroup(tagGroupName); if (currentTags != null) { Tags.AddRange(currentTags); } } Entries = new Dictionary <string, AttribInfo>(); }
public LibraryCrawlerForm() { InitializeComponent(); m_advanceProgress = new MethodInvoker(m_prgProgress.PerformStep); var taggroups = RBFLibrary.GetTagGroupNames(); foreach (string tag in taggroups) { m_chklbxFilter.Items.Add(tag); } if (RBFLibrary.GetTagGroup("modifiers") != null) { m_tbxModifierTagGroup.Text = @"modifiers"; } if (RBFLibrary.GetTagGroup("actions") != null) { m_tbxActionTagGroup.Text = @"actions"; } if (RBFLibrary.GetTagGroup("targets") != null) { m_tbxTargetTagGroup.Text = @"targets"; } if (RBFLibrary.GetTagGroup("buffs") != null) { m_tbxBuffTagGroup.Text = @"buffs"; } if (RBFLibrary.GetTagGroup("expendable_actions") != null) { m_tbxExpActionTagGroup.Text = @"expendable_actions"; } if (RBFLibrary.GetTagGroup("requirements") != null) { m_tbxRequirementTagGroup.Text = @"requirements"; } }