the tooltip fork

needs to be applied everywhere else but tired
This commit is contained in:
Altixal committed 2025-07-30 07:42:17 +07:00
1 parent c15ef4a12f
commit 8df0b0a38d
6 files changed
+32 -6

No files matched your search

+1 -1
View File
@@ -322,7 +322,7 @@ namespace CalamityMod.ILEditing
return;
}
if ((CalamityKeybinds.ArmorSetBonusHotKey != null && CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.Auto) || CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.Off)
if ((CalamityKeybinds.ArmorSetBonusHotKey.GetAssignedKeys().Count != 0 && CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.Auto) || CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.Off)
return;
orig(self, keyDir);
+1 -2
View File
@@ -111,8 +111,7 @@ namespace CalamityMod.Items.Armor.Wulfrum
armorPlayer.wulfrumSet = true;
Color AbilityBriefColor = Color.Lerp(new Color(194, 255, 67), new Color(112, 244, 244), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f));
var hotkey = CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString();
player.setBonus = this.GetLocalization("SetBonus").Format(AbilityBriefColor.Hex3(), hotkey, BastionTime.FramesToSeconds(), TimeLostPerHit.FramesToSeconds());
player.setBonus = this.GetLocalization("SetBonus").Format(AbilityBriefColor.Hex3(), CalamityUtils.GetArmorSetBonusKey(), BastionTime.FramesToSeconds(), TimeLostPerHit.FramesToSeconds());
if (PowerModeEngaged(player, out var cd))
{
@@ -3,6 +3,11 @@ RogueDamage: "{0}% increased rogue damage"
RogueCrit: "{0}% increased rogue critical strike chance"
RogueVelocity: "{0}% increased rogue velocity"
RogueStealth: +{0} maximum stealth
// Armor Set Bonus key states
BothArmorSetBonusKeys: Press {0} or Double tap {1}
NoArmorSetBonusKey: Press the Armor Set Bonus key
ArmorSetBonusKey: Press {0}
DoubleTapDown: Double tap {0}
// Miscellaneous stats/info
AggroBoost: Enemies are more likely to target you
AggroReduction: Enemies are less likely to target you
@@ -249,7 +249,7 @@ CalamityClientConfig: {
Tooltip:
'''
Allows all armor set bonuses to be triggered by the vanilla double-tap {$Key.DOWN} hotkey (or {$Key.UP} depending on your settings).
Set to Auto to automatically turn off double-tap as long as {$Keybinds.ArmorSetBonus.DisplayName} is bound.
Set to Auto to automatically turn off double-tap as long as Calamity's {$Keybinds.ArmorSetBonus.DisplayName} hotkey is bound.
'''
Options: {
@@ -305,7 +305,7 @@ WulfrumHat: {
'''
SetBonus:
'''
[c/{0}:Wulfrum Bastion - Press {1} to equip a power armor, costing one] [i:CalamityMod/WulfrumMetalScrap] [c/{0}:{$Items.Materials.WulfrumMetalScrap.DisplayName}]
[c/{0}:Wulfrum Bastion - {1} to equip a power armor, costing one] [i:CalamityMod/WulfrumMetalScrap] [c/{0}:{$Items.Materials.WulfrumMetalScrap.DisplayName}]
[c/6EC05D:While active, you can only use the integrated fusion cannon, but your defensive stats are increased]
[c/6EC05D:The armor lasts up to {2} {^2:second;seconds}, but each hit loses {3} {^3:second;seconds} of duration]
[c/BEBEBE:Hold Shift to see the stats of the fusion cannon]
+23 -1
View File
@@ -1,4 +1,6 @@
using Terraria.ID;
using CalamityMod.Enums;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
@@ -99,5 +101,25 @@ namespace CalamityMod
public static string Round(this float number, string precision = "N4") => float.Parse((number).ToString(precision)).ToString();
public static string Round(this double number, string precision = "N4") => float.Parse((number).ToString(precision)).ToString();
#endregion
public static string GetArmorSetBonusKey()
{
ModKeybind setBonusKey = CalamityKeybinds.ArmorSetBonusHotKey;
bool hasHotkey = setBonusKey.GetAssignedKeys().Count != 0;
string directionKey = (Main.ReversedUpDownArmorSetBonuses ? Language.GetTextValue("Key.UP") : Language.GetTextValue("Key.DOWN"));
// Allow both
if (hasHotkey && CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.On)
return GetText("Common.BothArmorSetBonusKeys").Format(setBonusKey.TooltipHotkeyString(), directionKey);
// Literally bind nothing (mentions the key name to you)
else if (!hasHotkey && CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.Off)
return GetTextValue("Common.NoArmorSetBonusKey");
// Hotkey only
else if (hasHotkey)
return GetText("Common.ArmorSetBonusKey").Format(setBonusKey.TooltipHotkeyString());
// Double tap only
else
return GetText("Common.DoubleTapDown").Format(directionKey);
}
}
}