public override void OnInitialize() { Background = new EntranceBackgroundPanel(); AltarTE = new BloodAltarTE(); Background.BackgroundColor = Color.Black; Background.BorderColor = Color.DarkGray; Background.Width.Set(BackgroundWidth, 0f); Background.Height.Set(BackgroundHeight, 0f); Background.HAlign = 0.7f; // 1 Background.VAlign = 0.5f; base.Append(Background); AltarTitle = new UIImage(ModContent.GetTexture("VampKnives/UI/BloodAltarTitle")); AltarTitle.HAlign = 0.5f; AltarTitle.VAlign = 0.015f; Background.Append(AltarTitle); //ClaimButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/ClaimButton"), "Claim this altar (you pay for the rituals performed at this altar)"); //ClaimButton.VAlign = 0.015f; //ClaimButton.HAlign = 0.05f; //ClaimButton.Width.Set(128, 0f); //ClaimButton.Height.Set(33, 0f); //ClaimButton.OnClick += new MouseEvent(ClaimButtonClicked); //Background.Append(ClaimButton); CloseButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/CloseButton"), "Close the UI"); CloseButton.VAlign = 0.015f; CloseButton.HAlign = 0.95f; CloseButton.Width.Set(32, 0f); CloseButton.Height.Set(32, 0f); CloseButton.OnClick += new MouseEvent(CloseButtonClicked); Background.Append(CloseButton); //_vanillaItemSlot = new VanillaItemSlotWrapper(ItemSlot.Context.BankItem, 0.85f) //{ // HoverText = "Upgrade Slot", // ValidItemFunc = item => item.IsAir || !item.IsAir && (GetModItem(item.type) is Items.KnifeDamageItem) //}; //_vanillaItemSlot.HAlign = 0.5f; //_vanillaItemSlot.VAlign = 0.05f; //Background.Append(_vanillaItemSlot); RitualOfStoneButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/RitualOfEarth"), "Perform the ritual of the earth, summon any of these five materials for 1 bp each"); RitualOfStoneButton.VAlign = RoSButtonVPos; RitualOfStoneButton.HAlign = 0.5f; RitualOfStoneButton.Width.Set(ButtonSize.X, 0f); RitualOfStoneButton.Height.Set(ButtonSize.Y, 0f); RitualOfStoneButton.OnClick += new MouseEvent(StoneRitualButtonClicked); Background.Append(RitualOfStoneButton); RoEStone = new EntranceButton(ModContent.GetTexture("VampKnives/UI/StoneButton"), ""); RoEStone.VAlign = 1.5f; RoEStone.HAlign = 0.1f; RoEStone.Width.Set(32, 0f); RoEStone.Height.Set(32, 0f); RoEStone.OnClick += new MouseEvent(StoneButtonClicked); RitualOfStoneButton.Append(RoEStone); RoEDirt = new EntranceButton(ModContent.GetTexture("VampKnives/UI/DirtButton"), ""); RoEDirt.VAlign = 1.5f; RoEDirt.HAlign = 0.3f; RoEDirt.Width.Set(32, 0f); RoEDirt.Height.Set(32, 0f); RoEDirt.OnClick += new MouseEvent(DirtButtonClicked); RitualOfStoneButton.Append(RoEDirt); RoESand = new EntranceButton(ModContent.GetTexture("VampKnives/UI/SandButton"), ""); RoESand.VAlign = 1.5f; RoESand.HAlign = 0.5f; RoESand.Width.Set(32, 0f); RoESand.Height.Set(32, 0f); RoESand.OnClick += new MouseEvent(SandButtonClicked); RitualOfStoneButton.Append(RoESand); RoESilt = new EntranceButton(ModContent.GetTexture("VampKnives/UI/SiltButton"), ""); RoESilt.VAlign = 1.5f; RoESilt.HAlign = 0.7f; RoESilt.Width.Set(32, 0f); RoESilt.Height.Set(32, 0f); RoESilt.OnClick += new MouseEvent(SiltButtonClicked); RitualOfStoneButton.Append(RoESilt); RoESnow = new EntranceButton(ModContent.GetTexture("VampKnives/UI/SnowButton"), ""); RoESnow.VAlign = 1.5f; RoESnow.HAlign = 0.9f; RoESnow.Width.Set(32, 0f); RoESnow.Height.Set(32, 0f); RoESnow.OnClick += new MouseEvent(SnowButtonClicked); RitualOfStoneButton.Append(RoESnow); RitualOfTheMinerButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/RitualOfTheMiner"), "Perform the ritual of the miner"); RitualOfTheMinerButton.VAlign = RoMButtonVPos; RitualOfTheMinerButton.HAlign = 0.5f; RitualOfTheMinerButton.Width.Set(ButtonSize.X, 0f); RitualOfTheMinerButton.Height.Set(ButtonSize.Y, 0f); RitualOfTheMinerButton.OnClick += new MouseEvent(MinerRitualButtonClicked); Background.Append(RitualOfTheMinerButton); CopperTinButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/CopperTinButton"), "Copper/Tin: 1bp"); CopperTinButton.VAlign = RoMButtonsVPos1; CopperTinButton.HAlign = 0f; CopperTinButton.Width.Set(32, 0f); CopperTinButton.Height.Set(32, 0f); CopperTinButton.OnClick += new MouseEvent(CopperTinButtonClicked); Background.Append(CopperTinButton); IronLeadButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/IronLeadButton"), "Iron/Lead: 2bp"); IronLeadButton.VAlign = RoMButtonsVPos1; IronLeadButton.HAlign = 0.2f; IronLeadButton.Width.Set(32, 0f); IronLeadButton.Height.Set(32, 0f); IronLeadButton.OnClick += new MouseEvent(IronLeadButtonClicked); Background.Append(IronLeadButton); SilverTungstenButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/SilverTungstenButton"), "Silver/Tungsten: 4bp"); SilverTungstenButton.VAlign = RoMButtonsVPos1; SilverTungstenButton.HAlign = 0.4f; SilverTungstenButton.Width.Set(32, 0f); SilverTungstenButton.Height.Set(32, 0f); SilverTungstenButton.OnClick += new MouseEvent(SilverTungstenButtonClicked); Background.Append(SilverTungstenButton); GoldPlatinumButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/GoldPlatinumButton"), "Gold/Platinum: 8bp"); GoldPlatinumButton.VAlign = RoMButtonsVPos1; GoldPlatinumButton.HAlign = 0.6f; GoldPlatinumButton.Width.Set(32, 0f); GoldPlatinumButton.Height.Set(32, 0f); GoldPlatinumButton.OnClick += new MouseEvent(GoldPlatinumButtonClicked); Background.Append(GoldPlatinumButton); MeteoriteButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/MeteoriteButton"), "Meteorite: 12bp"); MeteoriteButton.VAlign = RoMButtonsVPos1; MeteoriteButton.HAlign = 0.8f; MeteoriteButton.Width.Set(32, 0f); MeteoriteButton.Height.Set(32, 0f); MeteoriteButton.OnClick += new MouseEvent(MeteoriteButtonClicked); Background.Append(MeteoriteButton); DemoniteCrimtaneButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/DemoniteCrimtaneButton"), "Demonite/Crimtane: 16bp"); DemoniteCrimtaneButton.VAlign = RoMButtonsVPos1; DemoniteCrimtaneButton.HAlign = 1f; DemoniteCrimtaneButton.Width.Set(32, 0f); DemoniteCrimtaneButton.Height.Set(32, 0f); DemoniteCrimtaneButton.OnClick += new MouseEvent(DemoniteCrimtaneButtonClicked); Background.Append(DemoniteCrimtaneButton); HellstoneButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/HellstoneButton"), "Hellstone: 24bp"); HellstoneButton.VAlign = RoMButtonsVPos2; HellstoneButton.HAlign = 0f; HellstoneButton.Width.Set(32, 0f); HellstoneButton.Height.Set(32, 0f); HellstoneButton.OnClick += new MouseEvent(HellstoneButtonClicked); Background.Append(HellstoneButton); CobaltPalladiumButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/CobaltPalladiumButton"), "Cobalt/Palladium: 50bp"); CobaltPalladiumButton.VAlign = RoMButtonsVPos2; CobaltPalladiumButton.HAlign = 0.2f; CobaltPalladiumButton.Width.Set(32, 0f); CobaltPalladiumButton.Height.Set(32, 0f); CobaltPalladiumButton.OnClick += new MouseEvent(CobaltPalladiumButtonClicked); Background.Append(CobaltPalladiumButton); MythrilOrichalcumButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/MythrilOrichalcumButton"), "Mythril/Orichalcum: 75bp"); MythrilOrichalcumButton.VAlign = RoMButtonsVPos2; MythrilOrichalcumButton.HAlign = 0.4f; MythrilOrichalcumButton.Width.Set(32, 0f); MythrilOrichalcumButton.Height.Set(32, 0f); MythrilOrichalcumButton.OnClick += new MouseEvent(MythrilOrichalcumButtonClicked); Background.Append(MythrilOrichalcumButton); AdamantiteTitaniumButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/AdamantiteTitaniumButton"), "Adamantite/Titanium: 100bp"); AdamantiteTitaniumButton.VAlign = RoMButtonsVPos2; AdamantiteTitaniumButton.HAlign = 0.6f; AdamantiteTitaniumButton.Width.Set(32, 0f); AdamantiteTitaniumButton.Height.Set(32, 0f); AdamantiteTitaniumButton.OnClick += new MouseEvent(AdamantiteTitaniumButtonClicked); Background.Append(AdamantiteTitaniumButton); ChlorophyteButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/ChlorophyteButton"), "Chlorophyte: 150bp"); ChlorophyteButton.VAlign = RoMButtonsVPos2; ChlorophyteButton.HAlign = 0.8f; ChlorophyteButton.Width.Set(32, 0f); ChlorophyteButton.Height.Set(32, 0f); ChlorophyteButton.OnClick += new MouseEvent(ChlorophyteButtonClicked); Background.Append(ChlorophyteButton); LuminiteButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/LuminiteButton"), "Luminite: 300bp"); LuminiteButton.VAlign = RoMButtonsVPos2; LuminiteButton.HAlign = 1f; LuminiteButton.Width.Set(32, 0f); LuminiteButton.Height.Set(32, 0f); LuminiteButton.OnClick += new MouseEvent(LuminiteButtonClicked); Background.Append(LuminiteButton); UIFlatPanel SharpnessUnderline = new UIFlatPanel(); SharpnessUnderline.BackgroundColor = Color.White; SharpnessUnderline.VAlign = -0.2f; SharpnessUnderline.HAlign = 0.5f; SharpnessUnderline.Width.Set(ButtonSize.X, 0f); SharpnessUnderline.Height.Set(6, 0f); //RitualOfStoneButton.Append(SharpnessUnderline); UIText Sharpness = new UIText("Rituals"); Sharpness.Top.Set(-25, 0f); Sharpness.HAlign = 0.5f; //SharpnessUnderline.Append(Sharpness); Texture2D ActiveImage = ModContent.GetTexture("VampKnives/UI/ActiveButton"); EarthActive = new UIImage(ActiveImage); EarthActive.HAlign = 0f; EarthActive.VAlign = RoSButtonVPos + 0.01f; Background.Append(EarthActive); //OwnerActiveText = new UIText(OwnerText); //OwnerActiveText.HAlign = 0.6f; //OwnerActiveText.VAlign = 0.025f; //Background.Append(OwnerActiveText); EarthActiveText = new UIText("Dirt"); EarthActiveText.HAlign = 1f; EarthActiveText.VAlign = RoSButtonVPos + 0.01f; Background.Append(EarthActiveText); MinerActive = new UIImage(ActiveImage); MinerActive.HAlign = 0f; MinerActive.VAlign = RoMButtonVPos + 0.01f; Background.Append(MinerActive); MinerActiveText = new UIText("Copper"); MinerActiveText.HAlign = 1f; MinerActiveText.VAlign = RoMButtonVPos + 0.01f; Background.Append(MinerActiveText); MidasActive = new UIImage(ActiveImage); MidasActive.HAlign = 0f; MidasActive.VAlign = RoMiButtonVPos - 0.01f; Background.Append(MidasActive); MidasActiveText = new UIText("Copper"); MidasActiveText.HAlign = 1f; MidasActiveText.VAlign = RoMiButtonVPos - 0.01f; Background.Append(MidasActiveText); RitualOfMidasButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/RitualOfMidasButton"), ""); RitualOfMidasButton.HAlign = 0.5f; RitualOfMidasButton.VAlign = RoMiButtonVPos; RitualOfMidasButton.OnClick += new MouseEvent(MidasRitualButtonClicked); Background.Append(RitualOfMidasButton); CopperCoinButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/CopperCoinButton"), ""); CopperCoinButton.VAlign = 1.5f; CopperCoinButton.HAlign = 0.2f; CopperCoinButton.Width.Set(32, 0f); CopperCoinButton.Height.Set(32, 0f); CopperCoinButton.OnClick += new MouseEvent(CopperCoinButtonClick); RitualOfMidasButton.Append(CopperCoinButton); SilverCoinButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/SilverCoinButton"), ""); SilverCoinButton.VAlign = 1.5f; SilverCoinButton.HAlign = 0.4f; SilverCoinButton.Width.Set(32, 0f); SilverCoinButton.Height.Set(32, 0f); SilverCoinButton.OnClick += new MouseEvent(SilverCoinButtonClick); RitualOfMidasButton.Append(SilverCoinButton); GoldCoinButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/GoldCoinButton"), ""); GoldCoinButton.VAlign = 1.5f; GoldCoinButton.HAlign = 0.6f; GoldCoinButton.Width.Set(32, 0f); GoldCoinButton.Height.Set(32, 0f); GoldCoinButton.OnClick += new MouseEvent(GoldCoinButtonClick); RitualOfMidasButton.Append(GoldCoinButton); PlatinumCoinButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/PlatinumCoinButton"), ""); PlatinumCoinButton.VAlign = 1.5f; PlatinumCoinButton.HAlign = 0.8f; PlatinumCoinButton.Width.Set(32, 0f); PlatinumCoinButton.Height.Set(32, 0f); PlatinumCoinButton.OnClick += new MouseEvent(PlatinumCoinButtonClick); RitualOfMidasButton.Append(PlatinumCoinButton); _vanillaItemSlot = new VanillaItemSlotWrapper(ItemSlot.Context.BankItem, 0.85f) { HoverText = "Blood Crystal Slot", ValidItemFunc = item => item.IsAir || !item.IsAir && (GetModItem(item.type) is BloodCrystalSoul) && AltarTE.RoSoType == -69 }; _vanillaItemSlot.HAlign = 0.06f; _vanillaItemSlot.VAlign = RoSoButtonVPos; Background.Append(_vanillaItemSlot); BCSlot = new UIImage(ModContent.GetTexture("VampKnives/UI/BCSlot")); BCSlot.ImageScale = 1.45f; BCSlot.HAlign = 0.46f; BCSlot.VAlign = 0.49f; _vanillaItemSlot.Append(BCSlot); BCEject = new EntranceButton(ModContent.GetTexture("VampKnives/UI/EjectButton"), "Subtract from the spawn delay"); BCEject.HAlign = 0.06f; BCEject.VAlign = RoSoButtonVPos + 0.087f; BCEject.Width.Set(112, 0f); BCEject.Height.Set(33, 0f); BCEject.OnClick += new MouseEvent(BCEjectButtonClicked); Background.Append(BCEject); RitualOfSoulsButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/RitualOfSoulsButton"), "Perform the ritual of souls, summon any of these five materials for 1 bp each"); RitualOfSoulsButton.VAlign = RoSoButtonVPos; RitualOfSoulsButton.HAlign = 0.56f; RitualOfSoulsButton.Width.Set(ButtonSize.X, 0f); RitualOfSoulsButton.Height.Set(ButtonSize.Y, 0f); RitualOfSoulsButton.OnClick += new MouseEvent(SoulsRitualButtonClicked); Background.Append(RitualOfSoulsButton); SoulsActive = new UIImage(ActiveImage); SoulsActive.HAlign = 0f; SoulsActive.VAlign = RoSoButtonVPos - 0.003f; Background.Append(SoulsActive); SoulsActiveText = new UIText("None"); SoulsActiveText.HAlign = 1f; SoulsActiveText.VAlign = RoSoButtonVPos - 0.01f; Background.Append(SoulsActiveText); SoulsNPC = new UIText("None"); SoulsNPC.HAlign = 0.5f + 0.2f; SoulsNPC.VAlign = RoSoButtonVPos + 0.05f; Background.Append(SoulsNPC); SpawnDelay = new UIText("None"); SpawnDelay.HAlign = 0.5f + 0.2f; SpawnDelay.VAlign = RoSoButtonVPos + 0.08f; Background.Append(SpawnDelay); AddDelayButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/ButtonPlus"), "Add to the spawn delay"); AddDelayButton.VAlign = RoSoButtonVPos + 0.087f; AddDelayButton.HAlign = 0.72f + 0.16f; AddDelayButton.Width.Set(32, 0f); AddDelayButton.Height.Set(32, 0f); AddDelayButton.OnClick += new MouseEvent(AddDelayButtonClicked); Background.Append(AddDelayButton); SubtractDelayButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/ButtonMinus"), "Subtract from the spawn delay"); SubtractDelayButton.VAlign = RoSoButtonVPos + 0.087f; SubtractDelayButton.HAlign = 0.28f + 0.18f; SubtractDelayButton.Width.Set(32, 0f); SubtractDelayButton.Height.Set(32, 0f); SubtractDelayButton.OnClick += new MouseEvent(SubtractDelayButtonClicked); Background.Append(SubtractDelayButton); }
public override void OnInitialize() { Background = new EntranceBackgroundPanel(); Background.BackgroundColor = Color.Black; Background.BorderColor = Color.DarkGray; Background.Width.Set(BackgroundWidth, 0f); Background.Height.Set(BackgroundHeight, 0f); Background.HAlign = Background.VAlign = 0.5f; // 1 base.Append(Background); CloseButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/CloseButton"), "Close the UI"); CloseButton.VAlign = 0.015f; CloseButton.HAlign = 0.97f; CloseButton.Width.Set(32, 0f); CloseButton.Height.Set(32, 0f); CloseButton.OnClick += new MouseEvent(CloseButtonClicked); Background.Append(CloseButton); _vanillaItemSlot = new VanillaItemSlotWrapper(ItemSlot.Context.BankItem, 0.85f) { HoverText = "Upgrade Slot", ValidItemFunc = item => item.IsAir || !item.IsAir && (GetModItem(item.type) is Items.KnifeDamageItem) }; _vanillaItemSlot.HAlign = 0.5f; _vanillaItemSlot.VAlign = 0.05f; Background.Append(_vanillaItemSlot); Item UIItem = Main.mouseItem; bool skipCheck = false; Item UpgradeUIItem = Main.LocalPlayer.GetModPlayer <VampPlayer>().UpgradeItem; if (!UpgradeUIItem.IsAir) { skipCheck = true; UIItem = UpgradeUIItem; } if (skipCheck || !UIItem.IsAir && _vanillaItemSlot.Valid(UIItem)) { _vanillaItemSlot.Item = UIItem.Clone(); UIItem.TurnToAir(); //The previous item reference (mouse item or saved item) gets cleared } //RenameBox = new UITextBox(""); //RenameBox.Width.Set(ButtonSize.X, 0f); //RenameBox.VAlign = 0.05f; //RenameBox.HAlign = 0.1f; //Background.Append(RenameBox); UIFlatPanel SharpnessUnderline = new UIFlatPanel(); SharpnessUnderline.BackgroundColor = Color.White; SharpnessUnderline.VAlign = 0.2f; SharpnessUnderline.HAlign = 0.1f; SharpnessUnderline.Width.Set(ButtonSize.X, 0f); SharpnessUnderline.Height.Set(6, 0f); Background.Append(SharpnessUnderline); UIText Sharpness = new UIText("Sharpness"); Sharpness.Top.Set(-25, 0f); Sharpness.HAlign = 0.5f; SharpnessUnderline.Append(Sharpness); SharpnessUpgradeText1 = new UIText("1) +10% Damage"); SharpnessUpgradeText1.TextColor = Color.Gray; SharpnessUpgradeText1.Top.Set(TextOffset, 0f); SharpnessUpgradeText1.HAlign = 0.5f; SharpnessUnderline.Append(SharpnessUpgradeText1); SharpnessUpgradeText2 = new UIText("2) +20% Damage"); SharpnessUpgradeText2.TextColor = Color.Gray; SharpnessUpgradeText2.Top.Set(TextOffset * 2, 0f); SharpnessUpgradeText2.HAlign = 0.5f; SharpnessUnderline.Append(SharpnessUpgradeText2); SharpnessUpgradeText3 = new UIText("3) +30% Damage"); SharpnessUpgradeText3.TextColor = Color.Gray; SharpnessUpgradeText3.Top.Set(TextOffset * 3, 0f); SharpnessUpgradeText3.HAlign = 0.5f; SharpnessUnderline.Append(SharpnessUpgradeText3); SharpnessUpgradeText4 = new UIText("4) +40% Damage"); SharpnessUpgradeText4.TextColor = Color.Gray; SharpnessUpgradeText4.Top.Set(TextOffset * 4, 0f); SharpnessUpgradeText4.HAlign = 0.5f; SharpnessUnderline.Append(SharpnessUpgradeText4); SharpnessUpgradeText5 = new UIText("5) +50% Damage"); SharpnessUpgradeText5.TextColor = Color.Gray; SharpnessUpgradeText5.Top.Set(TextOffset * 5, 0f); SharpnessUpgradeText5.HAlign = 0.5f; SharpnessUnderline.Append(SharpnessUpgradeText5); SharpnessUpgradeText6 = new UIText("6) +60% Damage"); SharpnessUpgradeText6.TextColor = Color.Gray; SharpnessUpgradeText6.Top.Set(TextOffset * 6, 0f); SharpnessUpgradeText6.HAlign = 0.5f; SharpnessUnderline.Append(SharpnessUpgradeText6); SharpnessUpgradeText7 = new UIText("7) +70% Damage"); SharpnessUpgradeText7.TextColor = Color.Gray; SharpnessUpgradeText7.Top.Set(TextOffset * 7, 0f); SharpnessUpgradeText7.HAlign = 0.5f; SharpnessUnderline.Append(SharpnessUpgradeText7); SharpnessUpgradeText8 = new UIText("8) +80% Damage"); SharpnessUpgradeText8.TextColor = Color.Gray; SharpnessUpgradeText8.Top.Set(TextOffset * 8, 0f); SharpnessUpgradeText8.HAlign = 0.5f; SharpnessUnderline.Append(SharpnessUpgradeText8); SharpnessUpgradeText9 = new UIText("9) +90% Damage"); SharpnessUpgradeText9.TextColor = Color.Gray; SharpnessUpgradeText9.Top.Set(TextOffset * 9, 0f); SharpnessUpgradeText9.HAlign = 0.5f; SharpnessUnderline.Append(SharpnessUpgradeText9); SharpnessUpgradeText10 = new UIText("10) +100% Damage"); SharpnessUpgradeText10.TextColor = Color.Gray; SharpnessUpgradeText10.Top.Set(TextOffset * 10, 0f); SharpnessUpgradeText10.HAlign = 0.5f; SharpnessUnderline.Append(SharpnessUpgradeText10); UIFlatPanel CritUnderline = new UIFlatPanel(); CritUnderline.BackgroundColor = Color.White; CritUnderline.VAlign = 0.2f; CritUnderline.HAlign = 0.5f; CritUnderline.Width.Set(ButtonSize.X, 0f); CritUnderline.Height.Set(6, 0f); Background.Append(CritUnderline); UIText Crit = new UIText("Crit"); Crit.Top.Set(-25, 0f); Crit.HAlign = 0.5f; CritUnderline.Append(Crit); CritUpgradeText1 = new UIText("1) 2% Crit chance"); CritUpgradeText1.TextColor = Color.Gray; CritUpgradeText1.Top.Set(TextOffset, 0f); CritUpgradeText1.HAlign = 0.5f; CritUnderline.Append(CritUpgradeText1); CritUpgradeText2 = new UIText("2) 3% Crit chance"); CritUpgradeText2.TextColor = Color.Gray; CritUpgradeText2.Top.Set(TextOffset * 2, 0f); CritUpgradeText2.HAlign = 0.5f; CritUnderline.Append(CritUpgradeText2); CritUpgradeText3 = new UIText("3) 5% Crit chance"); CritUpgradeText3.TextColor = Color.Gray; CritUpgradeText3.Top.Set(TextOffset * 3, 0f); CritUpgradeText3.HAlign = 0.5f; CritUnderline.Append(CritUpgradeText3); CritUpgradeText4 = new UIText("4) 7% Crit chance"); CritUpgradeText4.TextColor = Color.Gray; CritUpgradeText4.Top.Set(TextOffset * 4, 0f); CritUpgradeText4.HAlign = 0.5f; CritUnderline.Append(CritUpgradeText4); CritUpgradeText5 = new UIText("5) 10% Crit chance"); CritUpgradeText5.TextColor = Color.Gray; CritUpgradeText5.Top.Set(TextOffset * 5, 0f); CritUpgradeText5.HAlign = 0.5f; CritUnderline.Append(CritUpgradeText5); CritUpgradeText6 = new UIText("6) 12% Crit chance"); CritUpgradeText6.TextColor = Color.Gray; CritUpgradeText6.Top.Set(TextOffset * 6, 0f); CritUpgradeText6.HAlign = 0.5f; CritUnderline.Append(CritUpgradeText6); CritUpgradeText7 = new UIText("7) 13% Crit chance"); CritUpgradeText7.TextColor = Color.Gray; CritUpgradeText7.Top.Set(TextOffset * 7, 0f); CritUpgradeText7.HAlign = 0.5f; CritUnderline.Append(CritUpgradeText7); CritUpgradeText8 = new UIText("8) 18% Crit chance"); CritUpgradeText8.TextColor = Color.Gray; CritUpgradeText8.Top.Set(TextOffset * 8, 0f); CritUpgradeText8.HAlign = 0.5f; CritUnderline.Append(CritUpgradeText8); CritUpgradeText9 = new UIText("9) 19% Crit chance"); CritUpgradeText9.TextColor = Color.Gray; CritUpgradeText9.Top.Set(TextOffset * 9, 0f); CritUpgradeText9.HAlign = 0.5f; CritUnderline.Append(CritUpgradeText9); CritUpgradeText10 = new UIText("10) 20% Crit chance"); CritUpgradeText10.TextColor = Color.Gray; CritUpgradeText10.Top.Set(TextOffset * 10, 0f); CritUpgradeText10.HAlign = 0.5f; CritUnderline.Append(CritUpgradeText10); UIFlatPanel SpecialUnderline = new UIFlatPanel(); SpecialUnderline.BackgroundColor = Color.White; SpecialUnderline.VAlign = 0.2f; SpecialUnderline.HAlign = 0.9f; SpecialUnderline.Width.Set(ButtonSize.X, 0f); SpecialUnderline.Height.Set(6, 0f); Background.Append(SpecialUnderline); UIText Special = new UIText("Special"); Special.Top.Set(-25, 0f); Special.HAlign = 0.5f; SpecialUnderline.Append(Special); Texture2D UpgradeButtonTexture = ModContent.GetTexture("VampKnives/UI/UpgradeButton"); UpgradeSharpnessButton = new EntranceButton(UpgradeButtonTexture, ""); UpgradeSharpnessButton.VAlign = 0.9f; UpgradeSharpnessButton.HAlign = 0.1f; UpgradeSharpnessButton.Width.Set(ButtonSize.X, 0f); UpgradeSharpnessButton.Height.Set(ButtonSize.Y, 0f); UpgradeSharpnessButton.OnClick += new MouseEvent(LegacyButtonClicked); Background.Append(UpgradeSharpnessButton); UpgradeCritButton = new EntranceButton(UpgradeButtonTexture, ""); UpgradeCritButton.VAlign = 0.9f; UpgradeCritButton.HAlign = 0.5f; UpgradeCritButton.Width.Set(ButtonSize.X, 0f); UpgradeCritButton.Height.Set(ButtonSize.Y, 0f); UpgradeCritButton.OnClick += new MouseEvent(NormalButtonClicked); Background.Append(UpgradeCritButton); UpgradeSpecialButton = new EntranceButton(UpgradeButtonTexture, ""); UpgradeSpecialButton.VAlign = 0.4f; UpgradeSpecialButton.HAlign = 0.9f; UpgradeSpecialButton.Width.Set(ButtonSize.X, 0f); UpgradeSpecialButton.Height.Set(ButtonSize.Y, 0f); UpgradeSpecialButton.OnClick += new MouseEvent(UnforgivingButtonClicked); Background.Append(UpgradeSpecialButton); UpgradeSpecialButton2 = new EntranceButton(UpgradeButtonTexture, ""); UpgradeSpecialButton2.VAlign = 0.65f; UpgradeSpecialButton2.HAlign = 0.9f; UpgradeSpecialButton2.Width.Set(ButtonSize.X, 0f); UpgradeSpecialButton2.Height.Set(ButtonSize.Y, 0f); UpgradeSpecialButton2.OnClick += new MouseEvent(SpecialButton2Clicked); Background.Append(UpgradeSpecialButton2); UpgradeSpecialButton3 = new EntranceButton(UpgradeButtonTexture, ""); UpgradeSpecialButton3.VAlign = 0.9f; UpgradeSpecialButton3.HAlign = 0.9f; UpgradeSpecialButton3.Width.Set(ButtonSize.X, 0f); UpgradeSpecialButton3.Height.Set(ButtonSize.Y, 0f); UpgradeSpecialButton3.OnClick += new MouseEvent(SpecialButton3Clicked); Background.Append(UpgradeSpecialButton3); Texture2D DamageImage = ModContent.GetTexture("VampKnives/UI/WhetstoneUI"); DamageItem = new UIImage(DamageImage); DamageItem.HAlign = 1.3f; DamageItem.VAlign = 0.5f; UpgradeSharpnessButton.Append(DamageItem); Texture2D CritImage = ModContent.GetTexture("VampKnives/UI/CritEmblemUI"); CritItem = new UIImage(CritImage); CritItem.HAlign = 1.3f; CritItem.VAlign = 0.5f; UpgradeCritButton.Append(CritItem); Texture2D RicochetImage = ModContent.GetTexture("VampKnives/UI/RicochetEssenceUI"); RicochetItem = new UIImage(RicochetImage); RicochetItem.HAlign = 1.3f; RicochetItem.VAlign = 0.5f; UpgradeSpecialButton.Append(RicochetItem); Texture2D PenetrateImage = ModContent.GetTexture("VampKnives/UI/PiercingTipUI"); PenetrateItem = new UIImage(PenetrateImage); PenetrateItem.HAlign = 1.3f; PenetrateItem.VAlign = 0.5f; UpgradeSpecialButton2.Append(PenetrateItem); Texture2D LifestealImage = ModContent.GetTexture("VampKnives/UI/StableCrimsonCrystalUI"); LifeStealItem = new UIImage(LifestealImage); LifeStealItem.HAlign = 1.3f; LifeStealItem.VAlign = 0.5f; UpgradeSpecialButton3.Append(LifeStealItem); DamagePrice = new UIText("x" + DamageBuyPrice); DamagePrice.HAlign = 1.25f; DamagePrice.VAlign = 0.5f; DamageItem.Append(DamagePrice); CritPrice = new UIText("x" + CritBuyPrice); CritPrice.HAlign = 1.25f; CritPrice.VAlign = 0.5f; CritItem.Append(CritPrice); RicochetPrice = new UIText("x" + RicochetBuyPrice); RicochetPrice.HAlign = 1.25f; RicochetPrice.VAlign = 0.5f; RicochetItem.Append(RicochetPrice); PenetratePrice = new UIText("x" + PenetrateBuyPrice); PenetratePrice.HAlign = 1.25f; PenetratePrice.VAlign = 0.5f; PenetrateItem.Append(PenetratePrice); LifeStealPrice = new UIText("x" + LifeStealBuyPrice); LifeStealPrice.HAlign = 1.25f; LifeStealPrice.VAlign = 0.5f; LifeStealItem.Append(LifeStealPrice); SpecialUpgradeText1 = new UIText("+1% chance to shoot\na knife that ricochets\n Current chance: " + Ricochet); SpecialUpgradeText1.TextColor = Color.Gray; SpecialUpgradeText1.Top.Set(-((TextOffset * 2) + TextOffset / 3), 0f); SpecialUpgradeText1.HAlign = 0.5f; UpgradeSpecialButton.Append(SpecialUpgradeText1); SpecialUpgradeText2 = new UIText("+1 to number of enemies\n the knife penetrates\n Current number: " + Penetrate); SpecialUpgradeText2.TextColor = Color.Gray; SpecialUpgradeText2.Top.Set(-((TextOffset * 2) + TextOffset / 3), 0f); SpecialUpgradeText2.HAlign = 0.5f; UpgradeSpecialButton2.Append(SpecialUpgradeText2); SpecialUpgradeText3 = new UIText("+1 increase to knife\n lifesteal\n Current increase: " + Lifesteal); SpecialUpgradeText3.TextColor = Color.Gray; SpecialUpgradeText3.Top.Set(-((TextOffset * 2) + TextOffset / 3), 0f); SpecialUpgradeText3.HAlign = 0.5f; UpgradeSpecialButton3.Append(SpecialUpgradeText3); }