diff --git a/CalamityConfig.cs b/CalamityConfig.cs index 50aadd38e3..52d83cccbb 100644 --- a/CalamityConfig.cs +++ b/CalamityConfig.cs @@ -141,7 +141,7 @@ namespace CalamityMod [BackgroundColor(192, 54, 64, 192)] [SliderColor(224, 165, 56, 128)] [Range(0f, 100f)] - [DefaultValue(49.47917f)] + [DefaultValue(ChargeMeterUI.DefaultChargePosX)] [Tooltip("$Mods.CalamityMod.Config.EntryTooltip.ChargeMeterPosX")] public float ChargeMeterPosX { get; set; } @@ -149,7 +149,7 @@ namespace CalamityMod [BackgroundColor(192, 54, 64, 192)] [SliderColor(224, 165, 56, 128)] [Range(0f, 100f)] - [DefaultValue(43f)] + [DefaultValue(ChargeMeterUI.DefaultChargePosY)] [Tooltip("$Mods.CalamityMod.Config.EntryTooltip.ChargeMeterPosY")] public float ChargeMeterPosY { get; set; } @@ -163,7 +163,7 @@ namespace CalamityMod [BackgroundColor(192, 54, 64, 192)] [SliderColor(224, 165, 56, 128)] [Range(0f, 100f)] - [DefaultValue(53.5417f)] + [DefaultValue(SpeedrunTimerUI.DefaultTimerPosX)] [Tooltip("$Mods.CalamityMod.Config.EntryTooltip.SpeedrunTimerPosX")] public float SpeedrunTimerPosX { get; set; } @@ -171,7 +171,7 @@ namespace CalamityMod [BackgroundColor(192, 54, 64, 192)] [SliderColor(224, 165, 56, 128)] [Range(0f, 100f)] - [DefaultValue(0.01481f)] + [DefaultValue(SpeedrunTimerUI.DefaultTimerPosY)] [Tooltip("$Mods.CalamityMod.Config.EntryTooltip.SpeedrunTimerPosY")] public float SpeedrunTimerPosY { get; set; } #endregion @@ -327,11 +327,6 @@ namespace CalamityMod // Because it is impossible to know the item IDs of Calamity items until runtime, // and we have many config titles which use embedded Calamity items, // we need to dynamically declare those items and inject them as dynamic localization. - // - // TODO -- this doesn't work, see CalamityMod for more info - // if you do fix this, you will need to add _ in front of all entry title keys above - // or alternatively change the mechanism via which the dynamic localizations are injected - // You are not allowed to get registered mod translations in any way internal static void RegisterDynamicLocalization() { static string EmbedItem(int itemID, string suffix = "") => $"[i:{itemID}] {suffix}"; diff --git a/UI/ChargeMeterUI.cs b/UI/ChargeMeterUI.cs index f1d6d5d5cb..2e575f95d1 100644 --- a/UI/ChargeMeterUI.cs +++ b/UI/ChargeMeterUI.cs @@ -10,8 +10,10 @@ namespace CalamityMod.UI { public class ChargeMeterUI { - public static Vector2 DrawPosition = new Vector2(CalamityConfig.Instance.ChargeMeterPosX, CalamityConfig.Instance.ChargeMeterPosY); - public static Vector2 Offset = DrawPosition; + internal const float DefaultChargePosX = 49.47917f; + internal const float DefaultChargePosY = 43f; + private const float MouseDragEpsilon = 0.05f; // 0.05% + public static void Draw(SpriteBatch spriteBatch, Player player) { if (DrawPosition.X <= 60f && DrawPosition.Y <= 20f) diff --git a/UI/SpeedrunTimerUI.cs b/UI/SpeedrunTimerUI.cs index 74e0299c7f..6ca4b91b95 100644 --- a/UI/SpeedrunTimerUI.cs +++ b/UI/SpeedrunTimerUI.cs @@ -35,7 +35,7 @@ namespace CalamityMod.UI public class SpeedrunTimerUI { internal const float DefaultTimerPosX = 46f; - internal const float DefaultTimerPosY = 1f; + internal const float DefaultTimerPosY = 1.481f; public static void Draw(Player player) {