public override void OnInitialize() { StartupPage = new UIImage(ModContent.GetTexture("VampKnives/UI/StartupBook0")); StartupPage.Width.Set(TextureWidth, 0f); StartupPage.Height.Set(TextureHeight, 0f); StartupPage.HAlign = StartupPage.VAlign = 0.5f; // 1 WikiButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/WikiButton"), "Close the UI"); WikiButton.VAlign = 0.295f; WikiButton.HAlign = 0.755f; WikiButton.Width.Set(84, 0f); WikiButton.Height.Set(26, 0f); WikiButton.OnClick += new MouseEvent(WikiButtonClicked); DiscordButton = new EntranceButton(ModContent.GetTexture("VampKnives/UI/DiscordButton"), "Close the UI"); DiscordButton.VAlign = 0.481f; DiscordButton.HAlign = 0.645f; DiscordButton.Width.Set(105, 0f); DiscordButton.Height.Set(26, 0f); DiscordButton.OnClick += new MouseEvent(DiscordButtonClicked); StartupPage.Append(DiscordButton); StartupPage.Append(WikiButton); base.Append(StartupPage); }
public override void OnInitialize() { mainPanel = new UIDragableElement(); //mainPanel.Left.Set(300f, 0f); //mainPanel.Top.Set(300f, 0f); mainPanel.HAlign = 0.5f; mainPanel.VAlign = 0.5f; mainPanel.Width.Set(300f, 0f); mainPanel.Height.Set(188f, 0f); //mainPanel.SetPadding(12); //mainPanel.SetPadding(0); Append(mainPanel); if (offsetX != -1) { mainPanel.Left.Set(offsetX, 0f); mainPanel.Top.Set(offsetY, 0f); //mainPanel.HAlign = 0f; //mainPanel.VAlign = 0f; } //mainPanel.BackgroundColor = UICommon.DefaultUIBlue; var panelBackground = new UIImage(ModContent.GetTexture("SpiritMod/Tiles/Furniture/SlotMachine/SlotMachineBaseFramer")); panelBackground.SetPadding(12); mainPanel.Append(panelBackground); mainPanel.AddDragTarget(panelBackground); Texture2D closeTexture = ModContent.GetTexture("SpiritMod/Tiles/Furniture/SlotMachine/Close"); UIImageButton closeButton = new UIImageButton(closeTexture); closeButton.Left.Set(-50, 1f); closeButton.Top.Set(5, 0f); closeButton.Width.Set(15, 0f); closeButton.Height.Set(15, 0f); closeButton.OnClick += CloseButton_OnClick; panelBackground.Append(closeButton); Texture2D pullTexture = ModContent.GetTexture("SpiritMod/Tiles/Furniture/SlotMachine/SlotMachineBaseFramer"); UIImageButton pullButton = new UIImageButton(pullTexture); pullButton.Left.Set(-10, 1f); pullButton.Top.Set(-8, 0f); pullButton.Width.Set(24, 0f); pullButton.Height.Set(24, 0f); pullButton.OnClick += PullButton_OnClick; panelBackground.Append(pullButton); }
public override void OnActivate() { const int x = 570; const int y = 275; IconFlash = new UIImage(FargowiltasSouls.UserInterfaceManager.SoulTogglerButton_MouseOverTexture); IconFlash.Left.Set(x - 2, 0); IconFlash.Top.Set(y - 2, 0); Append(IconFlash); Icon = new UIImage(FargowiltasSouls.UserInterfaceManager.SoulTogglerButtonTexture); Icon.Left.Set(x, 0); //26 Icon.Top.Set(y, 0); //300 Append(Icon); IconHighlight = new UIHoverTextImageButton(FargowiltasSouls.UserInterfaceManager.SoulTogglerButton_MouseOverTexture, "Configure Accessory Effects"); IconHighlight.Left.Set(-2, 0); IconHighlight.Top.Set(-2, 0); IconHighlight.SetVisibility(1f, 0); IconHighlight.OnClick += IconHighlight_OnClick; Icon.Append(IconHighlight); OncomingMutant = new UIOncomingMutant(FargowiltasSouls.UserInterfaceManager.OncomingMutantTexture.Value, FargowiltasSouls.UserInterfaceManager.OncomingMutantAuraTexture.Value, "Eternity Mode is enabled", "M*******t Mode is enabled"); OncomingMutant.Left.Set(610, 0); OncomingMutant.Top.Set(250, 0); Append(OncomingMutant); base.OnActivate(); }
public override void OnInitialize() { base.OnInitialize(); int top = 262; if (PboneUtils.CrossMod.IsModLoaded("Fargowiltas")) { top += 28; } if (PboneUtils.CrossMod.IsModLoaded("FargowiltasSouls")) { top += 58; } Icon = new UIImage(PboneUtils.Textures.UI.BuffTogglerInventoryButton); Icon.Left.Set(26, 0f); Icon.Top.Set(top, 0f); Append(Icon); IconHighlight = new UIHoverTextImageButton(PboneUtils.Textures.UI.BuffTogglerInventoryButton_MouseOver, "dummy"); IconHighlight.Left.Set(-2, 0f); IconHighlight.Top.Set(-2, 0f); IconHighlight.SetVisibility(1f, 0f); IconHighlight.OnClick += IconHighlight_OnClick; Icon.Append(IconHighlight); base.OnActivate(); }
public override void OnInitialize() { iconList = new List <CharacterIcon>(); iconList.Add(new CharacterIcon(TerrariaMoba.Instance.GetTexture("Textures/Sylvia/SylviaIcon"), CharacterEnum.Sylvia)); iconList.Add(new CharacterIcon(TerrariaMoba.Instance.GetTexture("Textures/Lock"), CharacterEnum.Null)); iconList.Add(new CharacterIcon(TerrariaMoba.Instance.GetTexture("Textures/Lock"), CharacterEnum.Null)); iconList.Add(new CharacterIcon(TerrariaMoba.Instance.GetTexture("Textures/Lock"), CharacterEnum.Null)); iconList.Add(new CharacterIcon(TerrariaMoba.Instance.GetTexture("Textures/Lock"), CharacterEnum.Null)); iconList.Add(new CharacterIcon(TerrariaMoba.Instance.GetTexture("Textures/Lock"), CharacterEnum.Null)); iconList.Add(new CharacterIcon(TerrariaMoba.Instance.GetTexture("Textures/Lock"), CharacterEnum.Null)); iconList.Add(new CharacterIcon(TerrariaMoba.Instance.GetTexture("Textures/Lock"), CharacterEnum.Null)); iconList.Add(new CharacterIcon(TerrariaMoba.Instance.GetTexture("Textures/Lock"), CharacterEnum.Null)); iconList.Add(new CharacterIcon(TerrariaMoba.Instance.GetTexture("Textures/Lock"), CharacterEnum.Null)); background = new UIImage(TerrariaMoba.Instance.GetTexture("Textures/CharacterSelect")); background.VAlign = 0.5f; background.HAlign = 0.5f; Append(background); for (int i = 0; i < numCharacterPortraits; i++) { iconList[i].Left.Set(fromEdge + (spacing * (i % 5)), 0); iconList[i].Top.Set(fromEdge + (spacing * (i / 5)), 0); background.Append(iconList[i]); } checkmark = new UIImage(TerrariaMoba.Instance.GetTexture("Textures/CheckMarkUnselected")); checkmark.Left.Set(306, 0); checkmark.Top.Set(156, 0); checkmark.OnClick += OnCheckClick; checkmark.OnMouseOver += OnCheckMouseOver; background.Append(checkmark); }
public override void OnInitialize() { mainPanel = new UIDragableElement(); mainPanel.HAlign = 0.5f; mainPanel.VAlign = 0.5f; mainPanel.Width.Set(756f, 0f); mainPanel.Height.Set(323f, 0f); mainPanel.OnScrollWheel += OnScrollWheel_FixHotbarScroll; Append(mainPanel); if (offsetX != -1) { mainPanel.Left.Set(offsetX, 0f); mainPanel.Top.Set(offsetY, 0f); } var panelBackground = new UIImage(ModContent.GetTexture("SpiritMod/Items/Books/UI/MaterialUI/EnchantedLeafMaterialPage")); panelBackground.SetPadding(12); mainPanel.Append(panelBackground); mainPanel.AddDragTarget(panelBackground); Texture2D closeTexture = ModContent.GetTexture("SpiritMod/Items/Books/UI/closeButton"); UIImageButton closeButton = new UIImageButton(closeTexture); closeButton.Left.Set(-20, 1f); closeButton.Top.Set(5, 0f); closeButton.Width.Set(15, 0f); closeButton.Height.Set(15, 0f); closeButton.OnClick += CloseButton_OnClick; panelBackground.Append(closeButton); UIElement messageBoxPanel = new UIElement { Width = { Percent = 1f }, Height = { Pixels = -50, Percent = 1f }, Top = { Pixels = 50, }, }; panelBackground.Append(messageBoxPanel); mainPanel.AddDragTarget(messageBoxPanel); }
public override void OnInitialize() { BackgroundPanel = new DraggablePanel(); BackgroundPanel.SetPadding(0); BackgroundPanel.Left.Set(400f, 0f); BackgroundPanel.Top.Set(100f, 0f); BackgroundPanel.Width.Set(600f, 0f); BackgroundPanel.Height.Set(400f, 0f); BackgroundPanel.BackgroundColor = new Color(73, 94, 171); NPCBackgroundPanel = new UIImage(ModContent.GetTexture("PissAndShit/UI/NPCPanelBackground")); NPCBackgroundPanel.SetPadding(0); NPCBackgroundPanel.Left.Set(10f, 0f); NPCBackgroundPanel.Top.Set(60f, 0f); NPCBackgroundPanel.Width.Set(280f, 0f); NPCBackgroundPanel.Height.Set(330f, 0f); BackgroundPanel.Append(NPCBackgroundPanel); NPCImage = new UIImage(Main.npcTexture[PaSWorld.deathHandNPCType]); NPCImage.Left.Set(240f, 0f); NPCImage.Top.Set(20f, 0f); NPCImage.Width.Set(280f, 0f); NPCImage.Height.Set(330f, 0f); NPCBackgroundPanel.Append(NPCImage); Texture2D buttonKillTexture = ModContent.GetTexture("PissAndShit/UI/DeathHandKillButton"); UIHoverImageButton killButton = new UIHoverImageButton(buttonKillTexture, "Kill NPC"); killButton.Left.Set(10, 0f); killButton.Top.Set(10, 0f); killButton.Width.Set(40, 0f); killButton.Height.Set(40, 0f); killButton.OnClick += new MouseEvent(KillButtonClicked); BackgroundPanel.Append(killButton); Texture2D buttonDamageTexture = ModContent.GetTexture("PissAndShit/UI/DeathHandDamageButton"); UIHoverImageButton damageButton = new UIHoverImageButton(buttonDamageTexture, "Damage NPC"); damageButton.Left.Set(60, 0f); damageButton.Top.Set(10, 0f); damageButton.Width.Set(40, 0f); damageButton.Height.Set(40, 0f); damageButton.OnClick += new MouseEvent(DamageButtonClicked); BackgroundPanel.Append(damageButton); Append(BackgroundPanel); }
public override void OnInitialize() { levelFrame = new UIImage(ModContent.GetTexture(nameof(TerraLands) + "/UI/Textures/LevelFrame")); levelFrame.Left.Set(-(levelFrame.Width.Pixels / 2f), 0.5f); levelFrame.Top.Set(-levelFrame.Height.Pixels, 0.95f); levelText = new UIText("Level 1", 0.9f); levelText.Left.Set(0, 0.44f); levelText.Top.Set(0f, 1f); levelFrame.Append(levelText); levelProgressConstraint = new UIElement { Width = levelFrame.Width, Height = levelFrame.Height, OverflowHidden = true }; levelFrame.Append(levelProgressConstraint); levelProgress = new UIImage(ModContent.GetTexture(nameof(TerraLands) + "/UI/Textures/LevelProgress")); levelProgressConstraint.Append(levelProgress); Append(levelFrame); }
public override void OnActivate() { Icon = new UIImage(Fargowiltas.UserInterfaceManager.SoulTogglerButtonTexture); Icon.Left.Set(26, 0f); Icon.Top.Set(300, 0f); Append(Icon); IconHighlight = new UIHoverTextImageButton(Fargowiltas.UserInterfaceManager.SoulTogglerButton_MouseOverTexture, "Configure Accessory Effects"); IconHighlight.Left.Set(-2, 0f); IconHighlight.Top.Set(-2, 0f); IconHighlight.SetVisibility(1f, 0f); IconHighlight.OnClick += IconHighlight_OnClick; Icon.Append(IconHighlight); base.OnActivate(); }
public override void OnActivate() { Icon = new UIImage(Fargowiltas.UserInterfaceManager.StatsButtonTexture); Icon.Left.Set(26, 0f); Icon.Top.Set(262, 0f); Append(Icon); IconHighlight = new UIHoverTextImageButton(Fargowiltas.UserInterfaceManager.StatsButton_MouseOverTexture, "Stat Sheet"); IconHighlight.Left.Set(-2, 0f); IconHighlight.Top.Set(-2, 0f); IconHighlight.SetVisibility(1f, 0f); IconHighlight.OnClick += IconHighlight_OnClick; Icon.Append(IconHighlight); base.OnActivate(); }
public UIElement ProvideUIElement(BestiaryUICollectionInfo info) { if (info.UnlockState == BestiaryEntryUnlockState.NotKnownAtAll_0) { return((UIElement)null); } if (this.GameMode != Main.GameMode) { return((UIElement)null); } UIElement uiElement = new UIElement() { Width = new StyleDimension(0.0f, 1f), Height = new StyleDimension(109f, 0.0f) }; int num1 = 99; int num2 = 35; int num3 = 3; int num4 = 0; UIImage uiImage1 = new UIImage((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_HP", (AssetRequestMode)1)); uiImage1.Top = new StyleDimension((float)num4, 0.0f); uiImage1.Left = new StyleDimension((float)num3, 0.0f); UIImage uiImage2 = uiImage1; UIImage uiImage3 = new UIImage((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_Attack", (AssetRequestMode)1)); uiImage3.Top = new StyleDimension((float)(num4 + num2), 0.0f); uiImage3.Left = new StyleDimension((float)num3, 0.0f); UIImage uiImage4 = uiImage3; UIImage uiImage5 = new UIImage((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_Defense", (AssetRequestMode)1)); uiImage5.Top = new StyleDimension((float)(num4 + num2), 0.0f); uiImage5.Left = new StyleDimension((float)(num3 + num1), 0.0f); UIImage uiImage6 = uiImage5; UIImage uiImage7 = new UIImage((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_Knockback", (AssetRequestMode)1)); uiImage7.Top = new StyleDimension((float)num4, 0.0f); uiImage7.Left = new StyleDimension((float)(num3 + num1), 0.0f); UIImage uiImage8 = uiImage7; uiElement.Append((UIElement)uiImage2); uiElement.Append((UIElement)uiImage4); uiElement.Append((UIElement)uiImage6); uiElement.Append((UIElement)uiImage8); int num5 = -10; int num6 = 0; int monetaryValue = (int)this.MonetaryValue; string text1 = Utils.Clamp <int>(monetaryValue / 1000000, 0, 999).ToString(); string text2 = Utils.Clamp <int>(monetaryValue % 1000000 / 10000, 0, 99).ToString(); string text3 = Utils.Clamp <int>(monetaryValue % 10000 / 100, 0, 99).ToString(); string text4 = Utils.Clamp <int>(monetaryValue % 100 / 1, 0, 99).ToString(); if (monetaryValue / 1000000 < 1) { text1 = "-"; } if (monetaryValue / 10000 < 1) { text2 = "-"; } if (monetaryValue / 100 < 1) { text3 = "-"; } if (monetaryValue < 1) { text4 = "-"; } string text5 = this.LifeMax.ToString(); string text6 = this.Damage.ToString(); string text7 = this.Defense.ToString(); string text8 = (double)this.KnockbackResist <= 0.800000011920929 ? ((double)this.KnockbackResist <= 0.400000005960464 ? ((double)this.KnockbackResist <= 0.0 ? Language.GetText("BestiaryInfo.KnockbackNone").Value : Language.GetText("BestiaryInfo.KnockbackLow").Value) : Language.GetText("BestiaryInfo.KnockbackMedium").Value) : Language.GetText("BestiaryInfo.KnockbackHigh").Value; if (info.UnlockState < BestiaryEntryUnlockState.CanShowStats_2) { string str1; text4 = str1 = "?"; text3 = str1; text2 = str1; text1 = str1; string str2; text8 = str2 = "???"; text7 = str2; text6 = str2; text5 = str2; } UIText uiText1 = new UIText(text5, 1f, false); uiText1.HAlign = 1f; uiText1.VAlign = 0.5f; uiText1.Left = new StyleDimension((float)num5, 0.0f); uiText1.Top = new StyleDimension((float)num6, 0.0f); uiText1.IgnoresMouseInteraction = true; UIText uiText2 = uiText1; UIText uiText3 = new UIText(text8, 1f, false); uiText3.HAlign = 1f; uiText3.VAlign = 0.5f; uiText3.Left = new StyleDimension((float)num5, 0.0f); uiText3.Top = new StyleDimension((float)num6, 0.0f); uiText3.IgnoresMouseInteraction = true; UIText uiText4 = uiText3; UIText uiText5 = new UIText(text6, 1f, false); uiText5.HAlign = 1f; uiText5.VAlign = 0.5f; uiText5.Left = new StyleDimension((float)num5, 0.0f); uiText5.Top = new StyleDimension((float)num6, 0.0f); uiText5.IgnoresMouseInteraction = true; UIText uiText6 = uiText5; UIText uiText7 = new UIText(text7, 1f, false); uiText7.HAlign = 1f; uiText7.VAlign = 0.5f; uiText7.Left = new StyleDimension((float)num5, 0.0f); uiText7.Top = new StyleDimension((float)num6, 0.0f); uiText7.IgnoresMouseInteraction = true; UIText uiText8 = uiText7; uiImage2.Append((UIElement)uiText2); uiImage4.Append((UIElement)uiText6); uiImage6.Append((UIElement)uiText8); uiImage8.Append((UIElement)uiText4); if (monetaryValue > 0) { UIHorizontalSeparator horizontalSeparator1 = new UIHorizontalSeparator(2, true); horizontalSeparator1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); horizontalSeparator1.Color = new Color(89, 116, 213, (int)byte.MaxValue) * 0.9f; horizontalSeparator1.Left = new StyleDimension(0.0f, 0.0f); horizontalSeparator1.Top = new StyleDimension((float)(num6 + num2 * 2), 0.0f); UIHorizontalSeparator horizontalSeparator2 = horizontalSeparator1; uiElement.Append((UIElement)horizontalSeparator2); int num7 = num3; int num8 = num6 + num2 * 2 + 8; int num9 = 49; UIImage uiImage9 = new UIImage((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_Platinum", (AssetRequestMode)1)); uiImage9.Top = new StyleDimension((float)num8, 0.0f); uiImage9.Left = new StyleDimension((float)num7, 0.0f); UIImage uiImage10 = uiImage9; UIImage uiImage11 = new UIImage((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_Gold", (AssetRequestMode)1)); uiImage11.Top = new StyleDimension((float)num8, 0.0f); uiImage11.Left = new StyleDimension((float)(num7 + num9), 0.0f); UIImage uiImage12 = uiImage11; UIImage uiImage13 = new UIImage((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_Silver", (AssetRequestMode)1)); uiImage13.Top = new StyleDimension((float)num8, 0.0f); uiImage13.Left = new StyleDimension((float)(num7 + num9 * 2 + 1), 0.0f); UIImage uiImage14 = uiImage13; UIImage uiImage15 = new UIImage((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_Copper", (AssetRequestMode)1)); uiImage15.Top = new StyleDimension((float)num8, 0.0f); uiImage15.Left = new StyleDimension((float)(num7 + num9 * 3 + 1), 0.0f); UIImage uiImage16 = uiImage15; if (text1 != "-") { uiElement.Append((UIElement)uiImage10); } if (text2 != "-") { uiElement.Append((UIElement)uiImage12); } if (text3 != "-") { uiElement.Append((UIElement)uiImage14); } if (text4 != "-") { uiElement.Append((UIElement)uiImage16); } int num10 = num5 + 3; float textScale = 0.85f; UIText uiText9 = new UIText(text1, textScale, false); uiText9.HAlign = 1f; uiText9.VAlign = 0.5f; uiText9.Left = new StyleDimension((float)num10, 0.0f); uiText9.Top = new StyleDimension((float)num6, 0.0f); UIText uiText10 = uiText9; UIText uiText11 = new UIText(text2, textScale, false); uiText11.HAlign = 1f; uiText11.VAlign = 0.5f; uiText11.Left = new StyleDimension((float)num10, 0.0f); uiText11.Top = new StyleDimension((float)num6, 0.0f); UIText uiText12 = uiText11; UIText uiText13 = new UIText(text3, textScale, false); uiText13.HAlign = 1f; uiText13.VAlign = 0.5f; uiText13.Left = new StyleDimension((float)num10, 0.0f); uiText13.Top = new StyleDimension((float)num6, 0.0f); UIText uiText14 = uiText13; UIText uiText15 = new UIText(text4, textScale, false); uiText15.HAlign = 1f; uiText15.VAlign = 0.5f; uiText15.Left = new StyleDimension((float)num10, 0.0f); uiText15.Top = new StyleDimension((float)num6, 0.0f); UIText uiText16 = uiText15; uiImage10.Append((UIElement)uiText10); uiImage12.Append((UIElement)uiText12); uiImage14.Append((UIElement)uiText14); uiImage16.Append((UIElement)uiText16); } else { uiElement.Height.Pixels = (float)(num6 + num2 * 2 - 4); } uiImage4.OnUpdate += new UIElement.ElementEvent(this.ShowStats_Attack); uiImage6.OnUpdate += new UIElement.ElementEvent(this.ShowStats_Defense); uiImage2.OnUpdate += new UIElement.ElementEvent(this.ShowStats_Life); uiImage8.OnUpdate += new UIElement.ElementEvent(this.ShowStats_Knockback); return(uiElement); }
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); }
public override void OnInitialize() { Visible = false; /* * baseLayer = new UIPanel(); * baseLayer.HAlign = 0.5f; * baseLayer.VAlign = 0.5f; * baseLayer.Width.Set(1358 * horizontalScale,0); * baseLayer.Height.Set(622 * verticalScale,0); * baseLayer.BackgroundColor = new Color(0,0,0,100); * baseLayer.BorderColor = new Color(0,0,0,0); */ cookbookSkin = new UIImage(ModContent.GetTexture("ExtraExplosives/UI/AnarchistCookbookUI/CookbookSkin")); //cookbookSkin.ImageScale = horizontalScale; cookbookSkin.Width.Pixels = 1358; // * horizontalScale; cookbookSkin.Height.Pixels = 622; // * verticalScale; cookbookSkin.Left.Pixels = Main.screenWidth / 2 - cookbookSkin.Width.Pixels / 2; cookbookSkin.Top.Pixels = Main.screenHeight / 2 - cookbookSkin.Height.Pixels / 2; //cookbookSkin.ImageScale = horizontalScale; //baseLayer.Append(cookbookSkin); tabs = new UIElement(); tabs.Width.Pixels = 300; tabs.Height.Pixels = cookbookSkin.Width.Pixels; test = new UIPanel(); test.BackgroundColor = Color.Black; test.Width = tabs.Width; test.Height = tabs.Height; tabs.VAlign = 0.5f; //tabs.Top.Pixels = -32 * verticalScale; tabs.Left.Pixels = cookbookSkin.Width.Pixels - 180; //tabs.Append(test); //tabs.Left.Pixels = (cookbookSkin.Width.Pixels - 180) * horizontalScale; //tabs.Left.Pixels = Main.screenWidth / 2;// + cookbookSkin.Width.Pixels / 2; //cookbookSkin.Append(tabs); handyNotesPages = new HandyNotesPages(); handyNotesPages.BackgroundColor = new Color(100, 100, 100); cookbookSkin.Append(handyNotesPages); randomNotesPages = new RandomNotesPages(); randomNotesPages.BackgroundColor = new Color(100, 100, 100); cookbookSkin.Append(randomNotesPages); resourcefulNotesPages = new ResourcefulNotesPages(); resourcefulNotesPages.BackgroundColor = new Color(100, 100, 100); cookbookSkin.Append(resourcefulNotesPages); safetyNotesPages = new SafetyNotesPages(); safetyNotesPages.BackgroundColor = new Color(100, 100, 100); cookbookSkin.Append(safetyNotesPages); utilityNotesPages = new UtilityNotesPages(); utilityNotesPages.BackgroundColor = new Color(100, 100, 100); cookbookSkin.Append(utilityNotesPages); HandyNotes = new UIHoverImage(ModContent.GetTexture("ExtraExplosives/UI/AnarchistCookbookUI/HandyNotesTab"), "Handy Notes"); HandyNotes.Left.Set(8, 0); HandyNotes.Top.Set(-24, 0); HandyNotes.VAlign = 1 / 6f; HandyNotes.Width.Set(60 * horizontalScale, 0); HandyNotes.Height.Set(100 * verticalScale, 0); HandyNotes.OnClick += new MouseEvent(MoveToHandyNotesPage); tabs.Append(HandyNotes); RandomNotes = new UIHoverImage(ModContent.GetTexture("ExtraExplosives/UI/AnarchistCookbookUI/RandomNotesTab"), "Random Notes"); RandomNotes.Left.Set(0, 0); RandomNotes.Top.Set(-12, 0); RandomNotes.VAlign = 2 / 6f; RandomNotes.Width.Set(60 * horizontalScale, 0); RandomNotes.Height.Set(100 * verticalScale, 0); RandomNotes.OnClick += new MouseEvent(MoveToRandomNotesPage); tabs.Append(RandomNotes); ResourcefulNotes = new UIHoverImage(ModContent.GetTexture("ExtraExplosives/UI/AnarchistCookbookUI/ResourcefulNotesTab"), "Resourceful Notes"); ResourcefulNotes.Left.Set(4, 0); ResourcefulNotes.Top.Set(0, 0); ResourcefulNotes.VAlign = 3 / 6f; ResourcefulNotes.Width.Set(60 * horizontalScale, 0); ResourcefulNotes.Height.Set(100 * verticalScale, 0); ResourcefulNotes.OnClick += new MouseEvent(MoveToResourcefulNotesPage); tabs.Append(ResourcefulNotes); SafetyNotes = new UIHoverImage(ModContent.GetTexture("ExtraExplosives/UI/AnarchistCookbookUI/SafetyNotesTab"), "SafetyNotes"); SafetyNotes.Left.Set(16, 0); SafetyNotes.Top.Set(12, 0); SafetyNotes.VAlign = 4 / 6f; SafetyNotes.Width.Set(60 * horizontalScale, 0); SafetyNotes.Height.Set(100 * verticalScale, 0); SafetyNotes.OnClick += new MouseEvent(MoveToSafetyNotesPage); tabs.Append(SafetyNotes); UtilityNotes = new UIHoverImage(ModContent.GetTexture("ExtraExplosives/UI/AnarchistCookbookUI/UtilityNotesTab"), "Utility Notes"); UtilityNotes.Left.Set(12, 0); UtilityNotes.Top.Set(24, 0); UtilityNotes.VAlign = 5 / 6f; UtilityNotes.Width.Set(60 * horizontalScale, 0); UtilityNotes.Height.Set(100 * verticalScale, 0); UtilityNotes.OnClick += new MouseEvent(MoveToUtilityNotesPage); tabs.Append(UtilityNotes); Append(cookbookSkin); Append(tabs); }
public override void Update(GameTime gameTime) { if (Main.LocalPlayer.dead) { Visible = false; } horizontalScale = Main.screenWidth / 1920f; verticalScale = Main.screenHeight / 1017f; // Cookbook texture alignment //cookbookSkin.ImageScale = horizontalScale; //Main.NewText(cookbookSkin.Width.Pixels + " " + cookbookSkin.Height.Pixels); //cookbookSkin.Width.Pixels = 1358;// * horizontalScale; //cookbookSkin.Height.Pixels = 622;// * verticalScale; cookbookSkin.Left.Pixels = (Main.screenWidth / 2 - cookbookSkin.Width.Pixels / 2); // * horizontalScale; //cookbookSkin.Left.Pixels = (1920 / 2 - cookbookSkin.Width.Pixels / 2);// * horizontalScale; cookbookSkin.Top.Pixels = (Main.screenHeight / 2 - cookbookSkin.Height.Pixels / 2); // * verticalScale; //cookbookSkin.Top.Pixels = (1017 / 2 - cookbookSkin.Height.Pixels / 2);// * verticalScale; //cookbookSkin.ImageScale = horizontalScale; //Main.NewText($"{cookbookSkin.Width.Pixels}, {cookbookSkin.Height.Pixels}"); // Tabs alignment //tabs.HAlign = 1.1f; //tabs.Left.Pixels = Main.screenWidth * 0.62f; //Main.NewText(1358 * horizontalScale); //tabs.VAlign = 0.5f; //tabs.Width.Pixels = 300 * horizontalScale; //tabs.Height.Pixels = cookbookSkin.Height.Pixels;// * verticalScale; //tabs.Height.Pixels = cookbookSkin.Width.Pixels * 2; test.Width = tabs.Width; test.Height = tabs.Height; /*cookbookSkin.ImageScale = horizontalScale; * cookbookSkin.Height.Pixels = 622 * verticalScale; * cookbookSkin.Width.Pixels = 1358 * horizontalScale; * cookbookSkin.HAlign = 0; * cookbookSkin.VAlign = 0; * cookbookSkin.Left.Pixels = 0; * cookbookSkin.Top.Pixels = 0;*/ // baseLayer.RemoveChild(cookbookSkin); //baseLayer.Append(cookbookSkin); //Main.NewText(Main.screenWidth + " : " + Main.screenHeight); //cookbookSkin.Left.Pixels = baseLayer.Width.Pixels/2; //cookbookSkin.Top.Pixels = baseLayer.Height.Pixels/2; //cookbookSkin.Height.Pixels = 648 * verticalScale; //cookbookSkin.Width.Pixels = 1358 * horizontalScale; //HandyNotes.ImageScale = verticalScale; //RandomNotes.ImageScale = verticalScale; //ResourcefulNotes.ImageScale = verticalScale; //SafetyNotes.ImageScale = verticalScale; //UtilityNotes.ImageScale = verticalScale; /*HandyNotes.Top.Set(((cookbookSkin.Height.Pixels/12) * 1),0); * RandomNotes.Top.Set(((cookbookSkin.Height.Pixels/12) * 3),0); * ResourcefulNotes.Top.Set(((cookbookSkin.Height.Pixels/12) * 5),0); * SafetyNotes.Top.Set(((cookbookSkin.Height.Pixels/12) * 7),0); * UtilityNotes.Top.Set(((cookbookSkin.Height.Pixels/12) * 9),0);*/ HandyNotes.VAlign = 1 / 6f; RandomNotes.VAlign = 2 / 6f; ResourcefulNotes.VAlign = 3 / 6f; SafetyNotes.VAlign = 4 / 6f; UtilityNotes.VAlign = 5 / 6f; if (!originalDrawUpdate) { originalDrawUpdate = true; cookbookSkin.RemoveAllChildren(); cookbookSkin.Append(handyNotesPages); cookbookSkin.Append(tabs); handyNotesPages.MakeVisible(); } //tabs.Left.Pixels = cookbookSkin.Width.Pixels - 180; if (Main.playerInventory) { Visible = false; } if (!Visible) { ButtonUI.Visible = true; } if (cookbookSkin.ContainsPoint(Main.MouseScreen) && Visible) { Main.LocalPlayer.mouseInterface = true; } base.Update(gameTime); }
public override void OnInitialize() { bar = new UIImage(TerrariaMoba.Instance.GetTexture("Textures/MobaBarBackground")); bar.VAlign = 0.95f; bar.HAlign = 0.5f; Append(bar); ability1Panel = new UIAbilityIcon(TerrariaMoba.Instance.GetTexture("Textures/Lock"), ""); ability1Panel.Top.Set(50, 0); ability1Panel.Left.Set(268, 0); ability1Cooldown = new UIText(""); ability1Cooldown.VAlign = 0.5f; ability1Cooldown.HAlign = 0.5f; ability1Panel.Append(ability1Cooldown); ability2Panel = new UIAbilityIcon(TerrariaMoba.Instance.GetTexture("Textures/Lock"), ""); ability2Panel.Top.Set(50, 0); ability2Panel.Left.Set(338, 0); ability2Cooldown = new UIText(""); ability2Cooldown.VAlign = 0.5f; ability2Cooldown.HAlign = 0.5f; ability2Panel.Append(ability2Cooldown); ultimatePanel = new UIAbilityIcon(TerrariaMoba.Instance.GetTexture("Textures/Lock"), ""); ultimatePanel.Top.Set(50, 0); ultimatePanel.Left.Set(408, 0); ultimateCooldown = new UIText(""); ultimateCooldown.VAlign = 0.5f; ultimateCooldown.HAlign = 0.5f; ultimatePanel.Append(ultimateCooldown); traitPanel = new UIAbilityIcon(TerrariaMoba.Instance.GetTexture("Textures/Lock"), ""); traitPanel.Top.Set(50, 0); traitPanel.Left.Set(478, 0); traitCooldown = new UIText(""); traitCooldown.VAlign = 0.5f; traitCooldown.HAlign = 0.5f; traitPanel.Append(traitCooldown); lifeBar = new ResourceBar(Color.DarkGreen, Color.Lime, 0); lifeBar.Left.Set(54, 0); lifeBar.Top.Set(5, 0); lifeBar.Width.Set(432, 0); lifeBar.Height.Set(14, 0); lifeText = new UIText(""); lifeText.VAlign = 0.5f; lifeText.HAlign = 0.5f; lifeText.TextColor = new Color(255f, 255f, 255f, 0f); lifeBar.Append(lifeText); manaBar = new ResourceBar(Color.DarkBlue, Color.DarkCyan, 1); manaBar.Left.Set(54, 0); manaBar.Top.Set(22, 0); manaBar.Width.Set(432, 0); manaBar.Height.Set(14, 0); manaText = new UIText(""); manaText.VAlign = 0.5f; manaText.HAlign = 0.5f; manaText.TextColor = new Color(255, 255, 255, 0); manaBar.Append(manaText); experienceBar = new ResourceBar(Color.DarkGray, Color.LightGray, 2); experienceBar.Left.Set(164, 0); experienceBar.Top.Set(50, 0); experienceBar.Width.Set(6, 0); experienceBar.Height.Set(52, 0); levelText = new UIText(""); levelText.Left.Set(224, 0); levelText.Top.Set(92, 0); levelText.Width.Set(6, 0); levelText.Height.Set(6, 0); characterIcon = new UIImage(TerrariaMoba.Instance.GetTexture("Textures/Lock")); characterIcon.Left.Set(180, 0); characterIcon.Top.Set(50, 0); deathTimer = new UIText(""); deathTimer.VAlign = 0.5f; deathTimer.HAlign = 0.5f; characterIcon.Append(deathTimer); moveSpeedIcon = new UIImage(TerrariaMoba.Instance.GetTexture("Textures/moveSpeedImage")); moveSpeedIcon.Left.Set(16, 0); moveSpeedIcon.Top.Set(54, 0); moveSpeedText = new UIText(""); moveSpeedText.Left.Set(32, 0); moveSpeedText.Top.Set(58, 0); defenseIcon = new UIImage(TerrariaMoba.Instance.GetTexture("Textures/defenseImage")); defenseIcon.Left.Set(16, 0); defenseIcon.Top.Set(72, 0); defenseText = new UIText(""); defenseText.Left.Set(32, 0); defenseText.Top.Set(72, 0); bar.Append(lifeBar); bar.Append(manaBar); bar.Append(experienceBar); bar.Append(defenseText); bar.Append(moveSpeedText); bar.Append(ability1Panel); bar.Append(ability2Panel); bar.Append(ultimatePanel); bar.Append(traitPanel); bar.Append(characterIcon); bar.Append(levelText); bar.Append(moveSpeedIcon); bar.Append(defenseIcon); }
public override void OnInitialize() { mainPanel = new UIImage(mainPanelTexture) { HAlign = 0.5f, VAlign = 0.35f }; mainPanel.Width.Set(mainPanelTexture.Width, 0); mainPanel.Height.Set(mainPanelTexture.Height, 0); Append(mainPanel); dimensionTransportButton = new UIImageButton(defaultDimensionTexture) { HAlign = 0.5f, VAlign = 0.5f }; dimensionTransportButton.Width.Set(188, 0); dimensionTransportButton.Height.Set(68, 0); dimensionTransportButton.OnClick += delegate { availableDimensions[selectedDimensionIndex].Item3.Invoke(); }; mainPanel.Append(dimensionTransportButton); selectedDimensionName = new UIText(defaultText) { HAlign = 0.5f }; selectedDimensionName.Top.Set(-32, 0); mainPanel.Append(selectedDimensionName); leftArrow = new UIImageButton(leftArrowTex) { HAlign = 0.15f, VAlign = 0.5f }; leftArrow.Width.Set(leftArrowTex.Width, 0); leftArrow.Height.Set(leftArrowTex.Height, 0); leftArrow.OnClick += delegate { selectedDimensionIndex -= 1; Main.PlaySound(SoundID.MenuTick); }; mainPanel.Append(leftArrow); rightArrow = new UIImageButton(rightArrowTex) { HAlign = 0.85f, VAlign = 0.5f }; rightArrow.Width.Set(rightArrowTex.Width, 0); rightArrow.Height.Set(rightArrowTex.Height, 0); rightArrow.OnClick += delegate { selectedDimensionIndex += 1; Main.PlaySound(SoundID.MenuTick); }; mainPanel.Append(rightArrow); exitButton = new UIImageButton(exitButtonTexture) { HAlign = 0.5f, }; exitButton.Top.Set(mainPanel.Height.Pixels - 20, 0); exitButton.Width.Set(exitButtonTexture.Width, 0); exitButton.Height.Set(exitButtonTexture.Height, 0); exitButton.OnClick += delegate { Disable(); }; mainPanel.Append(exitButton); }
public override void OnInitialize() { mainPanel = new UIDragableElement(); //mainPanel.Left.Set(300f, 0f); //mainPanel.Top.Set(300f, 0f); mainPanel.HAlign = 0.5f; mainPanel.VAlign = 0.5f; mainPanel.Width.Set(400f, 0f); mainPanel.Height.Set(600f, 0f); //mainPanel.SetPadding(12); //mainPanel.SetPadding(0); mainPanel.OnScrollWheel += OnScrollWheel_FixHotbarScroll; Append(mainPanel); if (offsetX != -1) { mainPanel.Left.Set(offsetX, 0f); mainPanel.Top.Set(offsetY, 0f); //mainPanel.HAlign = 0f; //mainPanel.VAlign = 0f; } //mainPanel.BackgroundColor = UICommon.DefaultUIBlue; var panelBackground = new UIImage(ModContent.GetTexture("SpiritMod/Items/Books/UI/BookBackground")); panelBackground.SetPadding(12); mainPanel.Append(panelBackground); mainPanel.AddDragTarget(panelBackground); Texture2D closeTexture = ModContent.GetTexture("SpiritMod/Items/Books/UI/closeButton"); UIImageButton closeButton = new UIImageButton(closeTexture); closeButton.Left.Set(-15, 1f); closeButton.Top.Set(0, 0f); closeButton.Width.Set(15, 0f); closeButton.Height.Set(15, 0f); closeButton.OnClick += CloseButton_OnClick; panelBackground.Append(closeButton); UIText titleLabel = new UIText(title, 1.2f); //titleLabel.Left.Set(8, 0f); //titleLabel.Top.Set(8, 0f); panelBackground.Append(titleLabel); mainPanel.AddDragTarget(titleLabel); UIText authorLabel = new UIText(author, 0.7f); authorLabel.Left.Set(12, 0f); authorLabel.Top.Set(24, 0f); panelBackground.Append(authorLabel); mainPanel.AddDragTarget(authorLabel); //UIPanel messageBoxPanel = new UIPanel { // Width = { Percent = 1f }, // Height = { Pixels = -110, Percent = 1f }, // Top = { Pixels = 110, }, // BackgroundColor = UICommon.MainPanelBackground //}; //mainPanel.Append(messageBoxPanel); UIElement messageBoxPanel = new UIElement { Width = { Percent = 1f }, Height = { Pixels = -50, Percent = 1f }, Top = { Pixels = 50, }, }; panelBackground.Append(messageBoxPanel); mainPanel.AddDragTarget(messageBoxPanel); UIMessageBox messageBox = new UIMessageBox(bookContents) { //Width = { Pixels = -25, Percent = 1f }, Width = { Percent = 1f }, // no scrollbar option Height = { Percent = 1f }, //Height = { Pixels = -44, Percent = 1f }, //Top = { Pixels = 44, }, //HAlign = 0.5f }; messageBoxPanel.Append(messageBox); mainPanel.AddDragTarget(messageBox); //mainPanel.Append(messageBox); //var messageBoxScrollbar = new FixedUIScrollbar(ModContent.GetInstance<SpiritMod>().BookUserInterface) { // Height = { Pixels = -20, Percent = 1f }, // VAlign = 0.5f, // HAlign = 1f //}.WithView(100f, 1000f); //messageBoxPanel.Append(messageBoxScrollbar); var messageBoxScrollbar = new InvisibleUIScrollbar(ModContent.GetInstance <SpiritMod>().BookUserInterface) { Height = { Pixels = -20, Percent = 1f }, VAlign = 0.5f, HAlign = 1f }.WithView(100f, 1000f); messageBoxPanel.Append(messageBoxScrollbar); messageBox.SetScrollbar(messageBoxScrollbar); //var messageBoxScrollbar = new FixedUIScrollbar(ModContent.GetInstance<SpiritMod>().BookUserInterface) { // Height = { Pixels = -20, Percent = 1f }, // VAlign = 0.5f, // HAlign = 1f //}.WithView(100f, 1000f); ////messageBoxPanel.Append(messageBoxScrollbar); //messageBox.Append(messageBoxScrollbar); //messageBox.SetScrollbar(messageBoxScrollbar); }
//Main.NewText(Main.UIScale); //this was a terrible idea // Utils.DrawBorderStringFourWay(spriteBatch, ProjectPhoenix.Smokey ?? Main.fontItemStack, inputText, (Main.UIScale * 0.25f), (Main.UIScale * 0.6666667f), Color.Black, Color.White, new Vector2(0.3f), 1.2f); public override void OnInitialize() { unload = false; unloadDone = false; UIImage panel = new UIImage(ModContent.GetTexture("ProjectPhoenix/UI/port")); panel.Width.Set(736f, 0f); panel.Height.Set(154f, 0f); panel.HAlign = 0.1979167f; panel.VAlign = 0.77f; panel.ImageScale = 1f; Append(panel); clicky = new UIImage(ModContent.GetTexture("ProjectPhoenix/UI/arrow")); clicky.Width.Set(64f, 0); clicky.Height.Set(64f, 0); clicky.Left.Set(620f, 0f); clicky.Top.Set(99.5f, 0f); panel.Append(clicky); UIElement area = new UIElement(); area.Left.Set(226, 0); area.Top.Set(112, 0f); area.Width.Set(700, 0f); area.Height.Set(300, 0); area.HAlign = 0.13f; area.VAlign = 0.77f; Append(area); text.Left.Set(0f, 0f); text.Top.Set(24f, 0f); text.Width.Set(0, 0); text.Height.Set(155, 0); text.SetText(" "); area.Append(text); /*UIPanel panel2 = new UIPanel(); * panel2.Width.Set(32, 0); * panel2.Height.Set(32, 0); * panel2.HAlign = 0.6604167f; // 1 * panel2.VAlign = 0.6979167f; */ port = new UIImage(ModContent.GetTexture("ProjectPhoenix/UI/blank")); port.Width.Set(128f, 0f); port.Height.Set(128f, 0f); port.HAlign = 0.01741667f; port.VAlign = 0.78125f; port.SetPadding(12f); panel.Append(port); UIImageButton fin = new UIImageButton(ModContent.GetTexture("ProjectPhoenix/UI/blank")); fin.Width.Set(760f, 0f); fin.Height.Set(170f, 0f); fin.HAlign = 0.1979167f; fin.VAlign = 0.77f; fin.OnClick += new MouseEvent(PlayButtonClicked); panel.Append(fin); }
public UIElement ProvideUIElement(BestiaryUICollectionInfo info) { if (info.UnlockState == BestiaryEntryUnlockState.NotKnownAtAll_0) { return(null); } int gameMode = Main.GameMode; if (GameMode != gameMode) { return(null); } UIElement uIElement = new UIElement { Width = new StyleDimension(0f, 1f), Height = new StyleDimension(109f, 0f) }; int num = 99; int num2 = 35; int num3 = 3; int num4 = 0; UIImage uIImage = new UIImage(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_HP", (AssetRequestMode)1)) { Top = new StyleDimension(num4, 0f), Left = new StyleDimension(num3, 0f) }; UIImage uIImage2 = new UIImage(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_Attack", (AssetRequestMode)1)) { Top = new StyleDimension(num4 + num2, 0f), Left = new StyleDimension(num3, 0f) }; UIImage uIImage3 = new UIImage(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_Defense", (AssetRequestMode)1)) { Top = new StyleDimension(num4 + num2, 0f), Left = new StyleDimension(num3 + num, 0f) }; UIImage uIImage4 = new UIImage(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_Knockback", (AssetRequestMode)1)) { Top = new StyleDimension(num4, 0f), Left = new StyleDimension(num3 + num, 0f) }; uIElement.Append(uIImage); uIElement.Append(uIImage2); uIElement.Append(uIImage3); uIElement.Append(uIImage4); int num5 = -10; int num6 = 0; int num7 = (int)MonetaryValue; string text = Utils.Clamp(num7 / 1000000, 0, 999).ToString(); string text2 = Utils.Clamp(num7 % 1000000 / 10000, 0, 99).ToString(); string text3 = Utils.Clamp(num7 % 10000 / 100, 0, 99).ToString(); string text4 = Utils.Clamp(num7 % 100 / 1, 0, 99).ToString(); if (num7 / 1000000 < 1) { text = "-"; } if (num7 / 10000 < 1) { text2 = "-"; } if (num7 / 100 < 1) { text3 = "-"; } if (num7 < 1) { text4 = "-"; } string text5 = LifeMax.ToString(); string text6 = Damage.ToString(); string text7 = Defense.ToString(); string text8 = (KnockbackResist > 0.8f) ? Language.GetText("BestiaryInfo.KnockbackHigh").Value : ((KnockbackResist > 0.4f) ? Language.GetText("BestiaryInfo.KnockbackMedium").Value : ((!(KnockbackResist > 0f)) ? Language.GetText("BestiaryInfo.KnockbackNone").Value : Language.GetText("BestiaryInfo.KnockbackLow").Value)); if (info.UnlockState < BestiaryEntryUnlockState.CanShowStats_2) { text = (text2 = (text3 = (text4 = "?"))); text5 = (text6 = (text7 = (text8 = "???"))); } UIText element = new UIText(text5) { HAlign = 1f, VAlign = 0.5f, Left = new StyleDimension(num5, 0f), Top = new StyleDimension(num6, 0f), IgnoresMouseInteraction = true }; UIText element2 = new UIText(text8) { HAlign = 1f, VAlign = 0.5f, Left = new StyleDimension(num5, 0f), Top = new StyleDimension(num6, 0f), IgnoresMouseInteraction = true }; UIText element3 = new UIText(text6) { HAlign = 1f, VAlign = 0.5f, Left = new StyleDimension(num5, 0f), Top = new StyleDimension(num6, 0f), IgnoresMouseInteraction = true }; UIText element4 = new UIText(text7) { HAlign = 1f, VAlign = 0.5f, Left = new StyleDimension(num5, 0f), Top = new StyleDimension(num6, 0f), IgnoresMouseInteraction = true }; uIImage.Append(element); uIImage2.Append(element3); uIImage3.Append(element4); uIImage4.Append(element2); if (num7 > 0) { UIHorizontalSeparator element5 = new UIHorizontalSeparator { Width = StyleDimension.FromPixelsAndPercent(0f, 1f), Color = new Color(89, 116, 213, 255) * 0.9f, Left = new StyleDimension(0f, 0f), Top = new StyleDimension(num6 + num2 * 2, 0f) }; uIElement.Append(element5); int num8 = num3; int num9 = num6 + num2 * 2 + 8; int num10 = 49; UIImage uIImage5 = new UIImage(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_Platinum", (AssetRequestMode)1)) { Top = new StyleDimension(num9, 0f), Left = new StyleDimension(num8, 0f) }; UIImage uIImage6 = new UIImage(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_Gold", (AssetRequestMode)1)) { Top = new StyleDimension(num9, 0f), Left = new StyleDimension(num8 + num10, 0f) }; UIImage uIImage7 = new UIImage(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_Silver", (AssetRequestMode)1)) { Top = new StyleDimension(num9, 0f), Left = new StyleDimension(num8 + num10 * 2 + 1, 0f) }; UIImage uIImage8 = new UIImage(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_Copper", (AssetRequestMode)1)) { Top = new StyleDimension(num9, 0f), Left = new StyleDimension(num8 + num10 * 3 + 1, 0f) }; if (text != "-") { uIElement.Append(uIImage5); } if (text2 != "-") { uIElement.Append(uIImage6); } if (text3 != "-") { uIElement.Append(uIImage7); } if (text4 != "-") { uIElement.Append(uIImage8); } int num11 = num5 + 3; float textScale = 0.85f; UIText element6 = new UIText(text, textScale) { HAlign = 1f, VAlign = 0.5f, Left = new StyleDimension(num11, 0f), Top = new StyleDimension(num6, 0f) }; UIText element7 = new UIText(text2, textScale) { HAlign = 1f, VAlign = 0.5f, Left = new StyleDimension(num11, 0f), Top = new StyleDimension(num6, 0f) }; UIText element8 = new UIText(text3, textScale) { HAlign = 1f, VAlign = 0.5f, Left = new StyleDimension(num11, 0f), Top = new StyleDimension(num6, 0f) }; UIText element9 = new UIText(text4, textScale) { HAlign = 1f, VAlign = 0.5f, Left = new StyleDimension(num11, 0f), Top = new StyleDimension(num6, 0f) }; uIImage5.Append(element6); uIImage6.Append(element7); uIImage7.Append(element8); uIImage8.Append(element9); } else { uIElement.Height.Pixels = num6 + num2 * 2 - 4; } uIImage2.OnUpdate += ShowStats_Attack; uIImage3.OnUpdate += ShowStats_Defense; uIImage.OnUpdate += ShowStats_Life; uIImage4.OnUpdate += ShowStats_Knockback; return(uIElement); }
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); }
public override void OnInitialize() { mainPanel = new UIDragableElement(); //mainPanel.Left.Set(300f, 0f); //mainPanel.Top.Set(300f, 0f); mainPanel.HAlign = 0.5f; mainPanel.VAlign = 0.5f; mainPanel.Width.Set(1280f, 0f); mainPanel.Height.Set(720f, 0f); //mainPanel.SetPadding(12); //mainPanel.SetPadding(0); mainPanel.OnScrollWheel += OnScrollWheel_FixHotbarScroll; Append(mainPanel); if (offsetX != -1) { mainPanel.Left.Set(offsetX, 0f); mainPanel.Top.Set(offsetY, 0f); //mainPanel.HAlign = 0f; //mainPanel.VAlign = 0f; } //mainPanel.BackgroundColor = UICommon.DefaultUIBlue; var panelBackground = new UIImage(ModContent.GetTexture("SpiritMod/Items/Books/UI/LuminousOcean")); panelBackground.SetPadding(12); mainPanel.Append(panelBackground); mainPanel.AddDragTarget(panelBackground); Texture2D closeTexture = ModContent.GetTexture("SpiritMod/Items/Books/UI/closeButton"); UIImageButton closeButton = new UIImageButton(closeTexture); closeButton.Left.Set(-30, 1f); closeButton.Top.Set(5, 0f); closeButton.Width.Set(15, 0f); closeButton.Height.Set(15, 0f); closeButton.OnClick += CloseButton_OnClick; panelBackground.Append(closeButton); //UIPanel messageBoxPanel = new UIPanel { // Width = { Percent = 1f }, // Height = { Pixels = -110, Percent = 1f }, // Top = { Pixels = 110, }, // BackgroundColor = UICommon.MainPanelBackground //}; //mainPanel.Append(messageBoxPanel); UIElement messageBoxPanel = new UIElement { Width = { Percent = 1f }, Height = { Pixels = -50, Percent = 1f }, Top = { Pixels = 50, }, }; panelBackground.Append(messageBoxPanel); mainPanel.AddDragTarget(messageBoxPanel); //var messageBoxScrollbar = new FixedUIScrollbar(ModContent.GetInstance<SpiritMod>().BookUserInterface) { // Height = { Pixels = -20, Percent = 1f }, // VAlign = 0.5f, // HAlign = 1f //}.WithView(100f, 1000f); ////messageBoxPanel.Append(messageBoxScrollbar); //messageBox.Append(messageBoxScrollbar); //messageBox.SetScrollbar(messageBoxScrollbar); }
public override void OnInitialize() { OldAverageColors.Add(new Color(1, 1, 1, 1)); Background.HAlign = 0.7f; Background.VAlign = 0.5f; Append(Background); IngredientSlot[0] = new CustomItemSlot(0, 0.9f) { IsValidItem = item => item.IsAir || !item.IsAir && PotionOverhaul.PotionIngredients.Contains(item.type), BackgroundTexture = backgroundTexture, EmptyTexture = iconTextureIngredient, HoverText = "Ingredient" }; IngredientSlot[0].HAlign = 0.275f; IngredientSlot[0].VAlign = 0.125f; Background.Append(IngredientSlot[0]); IngredientSlot[1] = new CustomItemSlot(0, 0.9f) { IsValidItem = item => item.IsAir || !item.IsAir && PotionOverhaul.PotionIngredients.Contains(item.type), BackgroundTexture = backgroundTexture, EmptyTexture = iconTextureIngredient, HoverText = "Ingredient" }; IngredientSlot[1].HAlign = 0.50f; IngredientSlot[1].VAlign = 0.075f; Background.Append(IngredientSlot[1]); IngredientSlot[2] = new CustomItemSlot(0, 0.9f) { IsValidItem = item => item.IsAir || !item.IsAir && PotionOverhaul.PotionIngredients.Contains(item.type), BackgroundTexture = backgroundTexture, EmptyTexture = iconTextureIngredient, HoverText = "Ingredient" }; IngredientSlot[2].HAlign = 0.725f; IngredientSlot[2].VAlign = 0.125f; Background.Append(IngredientSlot[2]); PotionSlot = new CustomItemSlot(0, 0.9f) { IsValidItem = item => item.IsAir, BackgroundTexture = backgroundTexture, EmptyTexture = iconTexturePotion, HoverText = "Potion" }; PotionSlot.HAlign = 0.50f; PotionSlot.VAlign = 0.85f; PotionSlot.OnClick += OnPotionSlot; Background.Append(PotionSlot); NameBeingEdited.HAlign = 0.50f; NameBeingEdited.VAlign = 0.925f; Background.Append(NameBeingEdited); BrewButton.HAlign = 0.50f; BrewButton.VAlign = 0.45f; BrewButton.OnClick += OnBrewButton; Background.Append(BrewButton); SaveButton.HAlign = 0.030f; SaveButton.VAlign = 0.970f; SaveButton.OnClick += OnSaveButton; Background.Append(SaveButton); NameEditButton.HAlign = 0.65f; NameEditButton.VAlign = 0.825f; NameEditButton.OnClick += OnNameEdit; NameEditor = new UIVirtualKeyboard("", PotionSlot.Item.Name, null, null, 0, false); NameEditor.HAlign = 1f; NameEditor.VAlign = 1f; NameEditor.RemoveAllChildren(); OldIngredients = IngredientSlot.Select(e => e.Item.type).ToArray(); }
public override void OnInitialize() { back.Left.Set(20, 0); back.Top.Set(260, 0); back.Width.Set(132, 0f); back.Height.Set(132, 0f); base.Append(back); charm.Left.Set(58, 0); charm.Top.Set(58, 0); charm.Width.Set(16, 0f); charm.Height.Set(16, 0f); charm.ImageScale = 0; back.Append(charm); stamina.Left.Set(340, 0); stamina.Top.Set(20, 0); stamina.Width.Set(22, 0f); stamina.Height.Set(22, 0f); stamina.ImageScale = 0; back.Append(stamina); wind.Left.Set(0, 0); wind.Top.Set(40, 0); wind.Width.Set(32, 0); wind.Height.Set(32, 0); wind.OnClick += new MouseEvent(Select); back.Append(wind); wisp.Left.Set(15, 0); wisp.Top.Set(75, 0); wisp.Width.Set(32, 0); wisp.Height.Set(32, 0); wisp.OnClick += new MouseEvent(Select); back.Append(wisp); pure.Left.Set(50, 0); pure.Top.Set(90, 0); pure.Width.Set(32, 0); pure.Height.Set(32, 0); pure.OnClick += new MouseEvent(Select); back.Append(pure); smash.Left.Set(85, 0); smash.Top.Set(75, 0); smash.Width.Set(32, 0); smash.Height.Set(32, 0); smash.OnClick += new MouseEvent(Select); back.Append(smash); shadow.Left.Set(100, 0); shadow.Top.Set(40, 0); shadow.Width.Set(32, 0); shadow.Height.Set(32, 0); shadow.OnClick += new MouseEvent(Select); back.Append(shadow); //------------------------- up1.Left.Set(25, 0); up1.Top.Set(0, 0); up1.Width.Set(32, 0); up1.Height.Set(32, 0); up1.OnClick += new MouseEvent(Upgrade); back.Append(up1); up2.Left.Set(75, 0); up2.Top.Set(0, 0); up2.Width.Set(32, 0); up2.Height.Set(32, 0); up2.OnClick += new MouseEvent(Upgrade); back.Append(up2); //------------------------- Name.Left.Set(170, 0); Name.Top.Set(280, 0); base.Append(Name); Line1.Left.Set(0, 0); Line1.Top.Set(30, 0); Name.Append(Line1); Line2.Left.Set(0, 0); Line2.Top.Set(50, 0); Name.Append(Line2); Line3.Left.Set(0, 0); Line3.Top.Set(65, 0); Name.Append(Line3); }
public override void OnInitialize() { mainPanel = new UIPanel(); mainPanel.BackgroundColor = new Color(28, 36, 66) * 0.95f; mainPanel.Width.Set(440, 0f); mainPanel.Height.Set(310, 0f); mainPanel.HAlign = 0.5f; mainPanel.VAlign = 0.5f; //Append(mainPanel); spriteContainer = new UIPanel(); spriteContainer.BackgroundColor = new Color(20, 25, 46) * 1f; spriteContainer.Width.Set(148, 0f); spriteContainer.Height.Set(110, 0f); spriteContainer.HAlign = 0.1f; spriteContainer.VAlign = 0.46f; gender = new SummaryImage(ModContent.GetTexture("Terramon/UI/Summary/" + "Male"), "Male"); gender.Top.Set(-4, 0f); gender.Left.Set(-14, 1f); //spriteContainer.Append(gender); caughtBall = new SummaryImage(ModContent.GetTexture("Terramon/Minisprites/Ball1"), "Caught in a Poké Ball"); caughtBall.Top.Set(-12, 1f); caughtBall.Left.Set(-14, 1f); //spriteContainer.Append(caughtBall); Texture2D overworldTexture = ModContent.GetTexture($"Terramon/Pokemon/FirstGeneration/Normal/{target}/{target}"); overworldSprite = new SummarySprite(overworldTexture); overworldSprite.HAlign = 0.5f; overworldSprite.VAlign = 0.5f; //spriteContainer.Append(overworldSprite); name = new UIText("Charmeleon", 0.55f, true); name.Top.Set(-41, 0f); name.Left.Set(-2, 0f); lv = new UIText("Lv 16", 0.75f, false); //spriteContainer.Append(name); //spriteContainer.Append(lv); trainerMemoHeader = new UIText("Trainer Memo", 0.35f, true); trainerMemoHeader.HAlign = 0.5f; trainerMemoHeader.Top.Set(34, 1f); //spriteContainer.Append(trainerMemoHeader); memo1 = new UIText("Adamant nature.", 0.3f, true); memo1.HAlign = 0.5f; memo1.Top.Set(54, 1f); //spriteContainer.Append(memo1); memo2 = new UIText("Caught in the cavern layer", 0.3f, true); memo2.HAlign = 0.5f; memo2.Top.Set(68, 1f); //spriteContainer.Append(memo2); memo3 = new UIText("at Lv 5.", 0.3f, true); memo3.HAlign = 0.5f; memo3.Top.Set(82, 1f); //spriteContainer.Append(memo3); //mainPanel.Append(spriteContainer); headingPanel = new UIPanel(); headingPanel.BackgroundColor = new Color(63, 82, 151) * 1f; headingPanel.Width.Set(340, 0f); headingPanel.Height.Set(64, 0f); headingPanel.HAlign = 0.5f; headingPanel.Top.Set(-38, 0f); UIText text = new UIText("Pokémon Summary", 0.8f, true); text.HAlign = 0.5f; text.VAlign = 0.5f; //headingPanel.Append(text); //mainPanel.Append(headingPanel); // == Pokédex UI == pokedexTexture = new UIImage(ModContent.GetTexture("Terramon/UI/Pokedex/Pokedex")); pokedexTexture.HAlign = 0.5f; pokedexTexture.VAlign = 3.8f; Append(pokedexTexture); pokedexText = new UIText("Pokédex", 0.65f, true); pokedexText.HAlign = 0.5f; pokedexText.Top.Set(50, 0f); pokedexTexture.Append(pokedexText); pokedexShowingNumbers = new UIText("Showing No. 001-018", 1f, false); pokedexShowingNumbers.HAlign = 0.185f; pokedexShowingNumbers.Top.Set(30, 0f); pokedexTexture.Append(pokedexShowingNumbers); pokedexPercentComplete = new UIText("100% Completed", 1f, false); pokedexPercentComplete.HAlign = 0.795f; pokedexPercentComplete.Top.Set(30, 0f); pokedexTexture.Append(pokedexPercentComplete); upArrow = new DexArrow(DexArrowDirection.Up); upArrow.Left.Set(588, 0f); upArrow.Top.Set(135, 0f); pokedexTexture.Append(upArrow); downArrow = new DexArrow(DexArrowDirection.Down); downArrow.Left.Set(588, 0f); downArrow.Top.Set(250, 0f); pokedexTexture.Append(downArrow); dexSlot1 = new DexSlot(1); dexSlot1.Top.Set(84, 0f); dexSlot1.Left.Set(129, 0f); pokedexTexture.Append(dexSlot1); dexSlot1x = new DexSlotHitbox(1); dexSlot1x.Left.Set(131, 0f); dexSlot1x.Top.Set(103, 0f); pokedexTexture.Append(dexSlot1x); dexSlot2 = new DexSlot(2); dexSlot2.Top.Set(84, 0f); dexSlot2.Left.Set(204, 0f); pokedexTexture.Append(dexSlot2); dexSlot2x = new DexSlotHitbox(2); dexSlot2x.Left.Set(206, 0f); dexSlot2x.Top.Set(103, 0f); pokedexTexture.Append(dexSlot2x); dexSlot3 = new DexSlot(3); dexSlot3.Top.Set(84, 0f); dexSlot3.Left.Set(279, 0f); pokedexTexture.Append(dexSlot3); dexSlot3x = new DexSlotHitbox(3); dexSlot3x.Left.Set(281, 0f); dexSlot3x.Top.Set(103, 0f); pokedexTexture.Append(dexSlot3x); dexSlot4 = new DexSlot(4); dexSlot4.Top.Set(84, 0f); dexSlot4.Left.Set(354, 0f); pokedexTexture.Append(dexSlot4); dexSlot4x = new DexSlotHitbox(4); dexSlot4x.Left.Set(356, 0f); dexSlot4x.Top.Set(103, 0f); pokedexTexture.Append(dexSlot4x); dexSlot5 = new DexSlot(5); dexSlot5.Top.Set(84, 0f); dexSlot5.Left.Set(429, 0f); pokedexTexture.Append(dexSlot5); dexSlot5x = new DexSlotHitbox(5); dexSlot5x.Left.Set(431, 0f); dexSlot5x.Top.Set(103, 0f); pokedexTexture.Append(dexSlot5x); dexSlot6 = new DexSlot(6); dexSlot6.Top.Set(84, 0f); dexSlot6.Left.Set(504, 0f); pokedexTexture.Append(dexSlot6); dexSlot6x = new DexSlotHitbox(6); dexSlot6x.Left.Set(506, 0f); dexSlot6x.Top.Set(103, 0f); pokedexTexture.Append(dexSlot6x); dexSlot7 = new DexSlot(7); dexSlot7.Top.Set(158, 0f); // + 74 dexSlot7.Left.Set(129, 0f); pokedexTexture.Append(dexSlot7); dexSlot7x = new DexSlotHitbox(7); dexSlot7x.Left.Set(131, 0f); dexSlot7x.Top.Set(177, 0f); pokedexTexture.Append(dexSlot7x); dexSlot8 = new DexSlot(8); dexSlot8.Top.Set(158, 0f); dexSlot8.Left.Set(204, 0f); pokedexTexture.Append(dexSlot8); dexSlot8x = new DexSlotHitbox(8); dexSlot8x.Left.Set(206, 0f); dexSlot8x.Top.Set(177, 0f); pokedexTexture.Append(dexSlot8x); dexSlot9 = new DexSlot(9); dexSlot9.Top.Set(158, 0f); dexSlot9.Left.Set(279, 0f); pokedexTexture.Append(dexSlot9); dexSlot9x = new DexSlotHitbox(9); dexSlot9x.Left.Set(281, 0f); dexSlot9x.Top.Set(177, 0f); pokedexTexture.Append(dexSlot9x); dexSlot10 = new DexSlot(10); dexSlot10.Top.Set(158, 0f); dexSlot10.Left.Set(354, 0f); pokedexTexture.Append(dexSlot10); dexSlot10x = new DexSlotHitbox(10); dexSlot10x.Left.Set(356, 0f); dexSlot10x.Top.Set(177, 0f); pokedexTexture.Append(dexSlot10x); dexSlot11 = new DexSlot(11); dexSlot11.Top.Set(158, 0f); dexSlot11.Left.Set(429, 0f); pokedexTexture.Append(dexSlot11); dexSlot11x = new DexSlotHitbox(11); dexSlot11x.Left.Set(431, 0f); dexSlot11x.Top.Set(177, 0f); pokedexTexture.Append(dexSlot11x); dexSlot12 = new DexSlot(12); dexSlot12.Top.Set(158, 0f); dexSlot12.Left.Set(504, 0f); pokedexTexture.Append(dexSlot12); dexSlot12x = new DexSlotHitbox(12); dexSlot12x.Left.Set(506, 0f); dexSlot12x.Top.Set(177, 0f); pokedexTexture.Append(dexSlot12x); dexSlot13 = new DexSlot(13); dexSlot13.Top.Set(232, 0f); // + 74 dexSlot13.Left.Set(129, 0f); pokedexTexture.Append(dexSlot13); dexSlot13x = new DexSlotHitbox(13); dexSlot13x.Left.Set(131, 0f); dexSlot13x.Top.Set(250, 0f); pokedexTexture.Append(dexSlot13x); dexSlot14 = new DexSlot(14); dexSlot14.Top.Set(232, 0f); dexSlot14.Left.Set(204, 0f); pokedexTexture.Append(dexSlot14); dexSlot14x = new DexSlotHitbox(14); dexSlot14x.Left.Set(206, 0f); dexSlot14x.Top.Set(250, 0f); pokedexTexture.Append(dexSlot14x); dexSlot15 = new DexSlot(15); dexSlot15.Top.Set(232, 0f); dexSlot15.Left.Set(279, 0f); pokedexTexture.Append(dexSlot15); dexSlot15x = new DexSlotHitbox(15); dexSlot15x.Left.Set(281, 0f); dexSlot15x.Top.Set(250, 0f); pokedexTexture.Append(dexSlot15x); dexSlot16 = new DexSlot(16); dexSlot16.Top.Set(232, 0f); dexSlot16.Left.Set(354, 0f); pokedexTexture.Append(dexSlot16); dexSlot16x = new DexSlotHitbox(16); dexSlot16x.Left.Set(356, 0f); dexSlot16x.Top.Set(250, 0f); pokedexTexture.Append(dexSlot16x); dexSlot17 = new DexSlot(17); dexSlot17.Top.Set(232, 0f); dexSlot17.Left.Set(429, 0f); pokedexTexture.Append(dexSlot17); dexSlot17x = new DexSlotHitbox(17); dexSlot17x.Left.Set(431, 0f); dexSlot17x.Top.Set(250, 0f); pokedexTexture.Append(dexSlot17x); dexSlot18 = new DexSlot(18); dexSlot18.Top.Set(232, 0f); dexSlot18.Left.Set(504, 0f); pokedexTexture.Append(dexSlot18); dexSlot18x = new DexSlotHitbox(18); dexSlot18x.Left.Set(506, 0f); dexSlot18x.Top.Set(250, 0f); pokedexTexture.Append(dexSlot18x); DexInit(); // == End Pokédex UI == Append(TerramonMod.ZoomAnimator = new Animator()); base.OnInitialize(); }