public override void OnInitialize() { _vanillaItemSlot = new VanillaItemSlotWrapper(ItemSlot.Context.BankItem, 0.85f) { Left = { Pixels = 50 }, Top = { Pixels = 270 }, ValidItemFunc = item => item.IsAir || !item.IsAir }; _vanillaItemSlot2 = new VanillaItemSlotWrapper(ItemSlot.Context.BankItem, 0.85f) { Left = { Pixels = 200 }, Top = { Pixels = 270 }, ValidItemFunc = item => item.IsAir || !item.IsAir }; // Here we limit the items that can be placed in the slot. We are fine with placing an empty item in or a non-empty item that can be prefixed. Calling Prefix(-3) is the way to know if the item in question can take a prefix or not. Append(_vanillaItemSlot); Append(_vanillaItemSlot2); }
public override void OnInitialize() { //panel box //Box = new UIPanel(); int width = 200; int height = 80; //Box.SetPadding(0); //Box.Left.Set(screenX - width / 2 - (width / 27), 0f); //Box.Top.Set(screenY - height / 2 + (height / 8), 0f); //Box.Width.Set(width, 0f); //Box.Height.Set(height, 0f); //Box.BackgroundColor = new Color(47, 83, 136, 200); //Append(Box); //images int ImageWidth = 24; int ImageHeight = 24; Image5 = new UIImage(ModContent.GetTexture("ExtraExplosives/UI/ReforgeUI")); //Image5.Width.Set(ImageWidth, 0f); //Image5.Height.Set(ImageHeight, 0f); Image5.HAlign = .503f; //Image5.Left.Set(screenX - (Image5.Width.Pixels / 2), 0f); Image5.Top.Set(screenY - (Image5.Height.Pixels / 2), 0f); Image5.ImageScale = 1.2f; Append(Image5); Image = new UIImage(ModContent.GetTexture("ExtraExplosives/UI/UICheckRed")); //Image.Width.Set(ImageWidth, 0f); //Image.Height.Set(ImageHeight, 0f); Image.HAlign = .5f; //Image.Left.Set(screenX - (Image5.Width.Pixels / 2), 0f); Image.Top.Set(screenY - (Image5.Height.Pixels / 2 / 2), 0f); Image.ImageScale = 1.5f; Append(Image); Image2 = new UIImage(ModContent.GetTexture("ExtraExplosives/UI/UICheckRed")); //Image2.Width.Set(ImageWidth, 0f); //Image2.Height.Set(ImageHeight, 0f); Image2.HAlign = .47f; //Image2.Left.Set(screenX - (Image5.Width.Pixels / 2), 0f); Image2.Top.Set(screenY - (Image5.Height.Pixels / 2 / 2), 0f); Image2.ImageScale = 1.5f; Append(Image2); Image3 = new UIImage(ModContent.GetTexture("ExtraExplosives/UI/UICheckRed")); //Image3.Width.Set(ImageWidth, 0f); //Image3.Height.Set(ImageHeight, 0f); Image3.HAlign = .53f; //Image3.Left.Set(screenX - (Image5.Width.Pixels / 2), 0f); Image3.Top.Set(screenY - (Image5.Height.Pixels / 2 / 2), 0f); Image3.ImageScale = 1.5f; Append(Image3); Image4 = new UIImage(ModContent.GetTexture("ExtraExplosives/UI/Reforge")); Image4.HAlign = .5f; //Image4.Left.Set(screenX - (Image5.Width.Pixels / 2), 0f); Image4.Top.Set(screenY - (Image5.Height.Pixels / 1.6f), 0f); Image4.ImageScale = 1.4f; Append(Image4); ReforgeText = new UITextPanel <string>("Place an item in one (or all) of the slots to reforge"); //float widthText = ReforgeText.GetDimensions().Width; ReforgeText.HAlign = .5f; //ReforgeText.Left.Set(screenX - ReforgeText.Width.Pixels, 0f); ReforgeText.Top.Set(screenY - (Image5.Height.Pixels * 1.2f), 0f); Append(ReforgeText); //slots _vanillaItemSlot = new VanillaItemSlotWrapper(ItemSlot.Context.PrefixItem, 0.85f, "ExtraExplosives/UI/SwordIcon") { //Left = { Precent = .5f }, Top = { Pixels = screenY }, HAlign = .5f, ValidItemFunc = item => item.IsAir || !item.IsAir && item.Prefix(-3), }; _vanillaItemSlot2 = new VanillaItemSlotWrapper(ItemSlot.Context.PrefixItem, 0.85f, "ExtraExplosives/UI/SwordIcon") { //Left = { Pixels = screenX - 30 }, Top = { Pixels = screenY }, HAlign = .47f, ValidItemFunc = item => item.IsAir || !item.IsAir && item.Prefix(-3) }; _vanillaItemSlot3 = new VanillaItemSlotWrapper(ItemSlot.Context.PrefixItem, 0.85f, "ExtraExplosives/UI/SwordIcon") { //Left = { Pixels = screenX + 30 }, Top = { Pixels = screenY }, HAlign = .53f, ValidItemFunc = item => item.IsAir || !item.IsAir && item.Prefix(-3) }; // Here we limit the items that can be placed in the slot. We are fine with placing an empty item in or a non-empty item that can be prefixed. Calling Prefix(-3) is the way to know if the item in question can take a prefix or not. Append(_vanillaItemSlot); Append(_vanillaItemSlot2); Append(_vanillaItemSlot3); IsVisible = true; }
public override void OnInitialize() { Box = new UIImage(ModContent.GetTexture("ExtraExplosives/UI/CombineUI")); //Image5.Width.Set(ImageWidth, 0f); //Image5.Height.Set(ImageHeight, 0f); Box.Left.Set(100, 0f); Box.Top.Set(300, 0f); Box.ImageScale = 1.2f; Append(Box); //indicator Indicator2 = new UIImage(ModContent.GetTexture("ExtraExplosives/UI/Indicator")); Indicator2.Left.Set(97, 0); Indicator2.Top.Set(37, 0); Indicator2.ImageScale = 1.1f; Box.Append(Indicator2); //indicator Indicator = new UIImage(ModContent.GetTexture("ExtraExplosives/UI/Indicator")); Indicator.Left.Set(2, 0); Indicator.Top.Set(37, 0); Indicator.ImageScale = 1.1f; Box.Append(Indicator); //+1 Texture2D reforgeTexture = Main.reforgeTexture[0]; combineButton = new UIImage(reforgeTexture); combineButton.Left.Set(158, 0f); combineButton.Top.Set(Box.Height.Pixels / 2 - 7, 0f); Box.Append(combineButton); //+10 combineButtonTen = new UIImage(reforgeTexture); combineButtonTen.Left.Set(197, 0f); combineButtonTen.Top.Set(Box.Height.Pixels / 2 - 7, 0f); Box.Append(combineButtonTen); PlusIcon = new UIImage(ModContent.GetTexture("ExtraExplosives/UI/PlusIcon")); PlusIcon.HAlign = .29f; PlusIcon.VAlign = .6f; Box.Append(PlusIcon); text = new UITextPanel <string>("Currently Working Explosives: [c/AB40FF:Bullet Boom(Uses empty shells)]"); //float widthText = ReforgeText.GetDimensions().Width; //ReforgeText.Left.Set(screenX - ReforgeText.Width.Pixels, 0f); text.Left.Set(-40, 0f); text.Top.Set(140, 0f); Box.Append(text); _vanillaItemSlot = new VanillaItemSlotWrapper(ItemSlot.Context.BankItem, 0.85f, "ExtraExplosives/UI/BombIcon") { Left = { Pixels = 5 }, Top = { Pixels = 40 }, ValidItemFunc = item => item.IsAir || !item.IsAir }; _vanillaItemSlot2 = new VanillaItemSlotWrapper(ItemSlot.Context.BankItem, 0.85f, "ExtraExplosives/UI/AmmoIcon") { Left = { Pixels = 100 }, Top = { Pixels = 40 }, ValidItemFunc = item => item.IsAir || !item.IsAir }; // Here we limit the items that can be placed in the slot. We are fine with placing an empty item in or a non-empty item that can be prefixed. Calling Prefix(-3) is the way to know if the item in question can take a prefix or not. Box.Append(_vanillaItemSlot); Box.Append(_vanillaItemSlot2); }