Example #1
0
        internal void ChangeCategory(CodexEntry.Categories category) //swaps out all of the entry buttons based on the category
        {
            if (!(Parent is Codex))
            {
                return;
            }
            Codex parent = Parent as Codex;

            ActiveCategory = category;
            CodexHandler player = Main.LocalPlayer.GetModPlayer <CodexHandler>();

            parent.ClickableEntries.Clear();

            int offY = 0;

            foreach (CodexEntry entry in player.Entries.Where(n => n.Category == category && (!n.RequiresUpgradedBook || player.CodexState == 2)))
            {
                EntryButton button = new EntryButton(entry);
                parent.AddEntryButton(button, offY);
            }
        }
Example #2
0
 public CategoryButton(CodexEntry.Categories category, string text)
 {
     Category = category; Text = text;
 }