From e314dcb6504e62cf35c3d75cc4e01b252ace3d2b Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 18 Nov 2021 21:59:17 -0600 Subject: [PATCH 1/2] Fixed schematics being swappable during decryption --- UI/CodebreakerUI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/CodebreakerUI.cs b/UI/CodebreakerUI.cs index 46f8a49f1d..a6d0021a0e 100644 --- a/UI/CodebreakerUI.cs +++ b/UI/CodebreakerUI.cs @@ -225,7 +225,7 @@ namespace CalamityMod.UI ref Item playerHandItem = ref Main.mouseItem; // Handle mouse click interactions. - if (Main.mouseLeft && Main.mouseLeftRelease) + if (Main.mouseLeft && Main.mouseLeftRelease && codebreakerTileEntity.DecryptionCountdown <= 0) { // If the player's hand item is empty and the codebreaker has a schematic, grab it. // This doesn't work if the Codebreaker is busy decrypting the schematic in question. From f1b040a94607983c882c2810bdee07f6ab7e8138 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 18 Nov 2021 22:05:30 -0600 Subject: [PATCH 2/2] Enchantment description line splits --- Items/CalamityGlobalItemTooltip.cs | 7 +++++-- UI/CalamitasEnchantments/CalamitasEnchantUI.cs | 4 +++- UI/CalamitasEnchantments/EnchantmentManager.cs | 8 ++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 63fd27088d..bf48711159 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -246,8 +246,11 @@ namespace CalamityMod.Items { if (!item.IsAir && AppliedEnchantment.HasValue) { - TooltipLine descriptionLine = new TooltipLine(mod, "Enchantment", CalamityUtils.ColorMessage(AppliedEnchantment.Value.Description, Color.DarkRed)); - tooltips.Add(descriptionLine); + foreach (string line in AppliedEnchantment.Value.Description.Split('\n')) + { + TooltipLine descriptionLine = new TooltipLine(mod, "Enchantment", CalamityUtils.ColorMessage(line, Color.DarkRed)); + tooltips.Add(descriptionLine); + } } } #endregion diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index f50032b56a..4a8676b685 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -197,7 +197,9 @@ namespace CalamityMod.UI.CalamitasEnchants { Vector2 vectorDrawPosition = descriptionDrawPositionTopLeft.ToVector2(); Vector2 scale = new Vector2(0.8f, 0.825f) * MathHelper.Clamp(ResolutionRatio, 0.825f, 1f) * Main.UIScale; - foreach (string line in Utils.WordwrapString(SelectedEnchantment.Value.Description, Main.fontMouseText, 400, 16, out _)) + + string unifiedDescription = SelectedEnchantment.Value.Description.Replace("\n", " "); + foreach (string line in Utils.WordwrapString(unifiedDescription, Main.fontMouseText, 400, 16, out _)) { if (string.IsNullOrEmpty(line)) continue; diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 107d875838..e1c2744853 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -190,14 +190,14 @@ namespace CalamityMod.UI.CalamitasEnchants player => player.Calamity().closeProximityRewardEnchant = true, item => item.IsEnchantable() && item.damage > 0 && item.shoot > ProjectileID.None && !item.Calamity().trueMelee), - new Enchantment("Ephemeral", "Causes the damage output of this item to discharge from exhaustive use. Its damage returns naturally when not being used. It starts off with more damage than it normally would have.", + new Enchantment("Ephemeral", "Causes the damage output of this item to discharge from exhaustive use.\nIts damage returns naturally when not being used. It starts off with more damage than it normally would have.", 600, "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Ephemeral", null, player => player.Calamity().dischargingItemEnchant = true, item => item.IsEnchantable() && item.damage > 0 && !item.summon), - new Enchantment("Hellbound", "Causes minions to be created with a 40 second timer. Once it runs out, they explode violently. Minions do more damage the longer they live and idly explode as well.", + new Enchantment("Hellbound", "Causes minions to be created with a 40 second timer.\nOnce it runs out, they explode violently. Minions do more damage the longer they live and idly explode as well.", 700, "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Hellbound", null, @@ -247,7 +247,7 @@ namespace CalamityMod.UI.CalamitasEnchants player => player.Calamity().manaMonsterEnchant = true, item => item.IsEnchantable() && item.damage > 0 && item.magic && item.mana > 0), - new Enchantment("Withering", "When hurt, you heal a percentage of the damage taken based on how much accumulated damage you did overall beforehand, up to 100%." + + new Enchantment("Withering", "When hurt, you heal a percentage of the damage taken based on how much accumulated damage you did overall beforehand, up to 100%.\n" + "After this, you gain a damage boost while holding this item but also take exponential damage over time the longer you hold it.", 1000, "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Withered", @@ -255,7 +255,7 @@ namespace CalamityMod.UI.CalamitasEnchants player => player.Calamity().witheringWeaponEnchant = true, item => item.IsEnchantable() && item.damage > 0 && !item.summon), - new Enchantment("Persecuted", "When attacked, or over time, demon portals appear near you. If sufficiently damaged they are friendly; otherwise they attack you. They become angered if a portal is damaged.", + new Enchantment("Persecuted", "When attacked, or over time, demon portals appear near you.\nIf sufficiently damaged they are friendly; otherwise they attack you. They become angered if a portal is damaged.", 1100, "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Persecuted", null,