public UIBossCheckbox(BossInfo boss) { this.boss = boss; Width = StyleDimension.Fill; Height.Pixels = 15; checkbox = new UICheckbox(boss.progression, boss.name, 1f, false); if (boss.type == EntryType.Event) { checkbox.TextColor = Color.MediumPurple; } if (boss.type == EntryType.MiniBoss) { checkbox.TextColor = Color.CornflowerBlue; } if (boss.hidden) { checkbox.TextColor = Color.DarkGreen; } checkbox.Selected = boss.downed(); //checkbox.spawnItemID = boss.spawnItemID; Append(checkbox); moreInfo = new UIHoverImageButton(ModContent.GetTexture("BossChecklist/UIElements/info"), "More Info"); moreInfo.Left.Set(-24, 1f); moreInfo.SetVisibility(1f, 0.7f); moreInfo.OnClick += MoreInfo_OnClick; int index = BossChecklist.bossTracker.SortedBosses.IndexOf(boss); moreInfo.Id = index.ToString(); OnClick += Box_OnClick; }
public override void OnInitialize() { checklistPanel = new UIPanel(); checklistPanel.SetPadding(10); checklistPanel.Left.Pixels = 0; checklistPanel.HAlign = 1f; checklistPanel.Top.Set(50f, 0f); checklistPanel.Width.Set(250f, 0f); checklistPanel.Height.Set(-100, 1f); checklistPanel.BackgroundColor = new Color(73, 94, 171); toggleCompletedButton = new UIHoverImageButton(Main.magicPixel, "Toggle Completed"); toggleCompletedButton.OnClick += ToggleCompletedButtonClicked; toggleCompletedButton.Left.Pixels = spacing; toggleCompletedButton.Top.Pixels = 0; checklistPanel.Append(toggleCompletedButton); toggleMiniBossButton = new UIHoverImageButton(Main.magicPixel, "Toggle Mini Bosses"); toggleMiniBossButton.OnClick += ToggleMiniBossButtonClicked; toggleMiniBossButton.Left.Pixels = spacing + 32; toggleMiniBossButton.Top.Pixels = 0; checklistPanel.Append(toggleMiniBossButton); toggleEventButton = new UIHoverImageButton(Main.magicPixel, "Toggle Events"); toggleEventButton.OnClick += ToggleEventButtonClicked; toggleEventButton.Left.Pixels = spacing + 64; toggleEventButton.Top.Pixels = 0; checklistPanel.Append(toggleEventButton); toggleHiddenButton = new UIHoverImageButton(Main.magicPixel, "Toggle Show Hidden Bosses\n(Alt-Click to clear Hidden bosses)\n(Alt-Click on boss to hide)"); toggleHiddenButton.OnClick += ToggleHiddenButtonClicked; toggleHiddenButton.Left.Pixels = spacing + 96; toggleHiddenButton.Top.Pixels = 0; checklistPanel.Append(toggleHiddenButton); checklistList = new UIList(); checklistList.Top.Pixels = 32f + spacing; checklistList.Width.Set(-25f, 1f); checklistList.Height.Set(-32f, 1f); checklistList.ListPadding = 12f; checklistList.OnScrollWheel += OnScrollWheel_FixHotbarScroll; checklistPanel.Append(checklistList); FixedUIScrollbar checklistListScrollbar = new FixedUIScrollbar(); checklistListScrollbar.SetView(100f, 1000f); //checklistListScrollbar.Height.Set(0f, 1f); checklistListScrollbar.Top.Pixels = 32f + spacing; checklistListScrollbar.Height.Set(-32f - spacing, 1f); checklistListScrollbar.HAlign = 1f; checklistPanel.Append(checklistListScrollbar); checklistList.SetScrollbar(checklistListScrollbar); // Checklistlist populated when the panel is shown: UpdateCheckboxes() Append(checklistPanel); }