From 54b760f7c091355daa8be5ae436626a29b45a4a7 Mon Sep 17 00:00:00 2001 From: Nathanael Overton Date: Thu, 18 Sep 2025 17:09:36 -0400 Subject: [PATCH 1/2] Removed unused variables from a Lucrecia proj --- Projectiles/Melee/LucreciaSmallProjectile.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/Projectiles/Melee/LucreciaSmallProjectile.cs b/Projectiles/Melee/LucreciaSmallProjectile.cs index f972eb300a..a86b802a74 100644 --- a/Projectiles/Melee/LucreciaSmallProjectile.cs +++ b/Projectiles/Melee/LucreciaSmallProjectile.cs @@ -24,13 +24,10 @@ namespace CalamityMod.Projectiles.Melee { public new string LocalizationCategory => "Projectiles.Melee"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - public int TargetIndex = -1; public static float MaxWidth = 30; public ref float Time => ref Projectile.ai[0]; - public static Asset BloomTex; - public static Asset SlashTex; public static Asset TrailTex; public override void SetStaticDefaults() From d670ce69576c01e70181537095d349bff42fada0 Mon Sep 17 00:00:00 2001 From: Big E Date: Thu, 18 Sep 2025 19:12:37 -0400 Subject: [PATCH 2/2] + Added a start index input to StartDialogue for Dialogue Display --- UI/DialogueDisplay/DialogueDisplayUI.cs | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/UI/DialogueDisplay/DialogueDisplayUI.cs b/UI/DialogueDisplay/DialogueDisplayUI.cs index e3c8640665..8a8c51b0f3 100644 --- a/UI/DialogueDisplay/DialogueDisplayUI.cs +++ b/UI/DialogueDisplay/DialogueDisplayUI.cs @@ -137,17 +137,9 @@ namespace CalamityMod.UI.DialogueDisplay /// public int DialogueTimer = 0; /// - /// Which page are we reading? - /// - //public int currentPage; - /// /// The position from which the text originates /// public Vector2 Position = Vector2.Zero; - /// - /// How many page there are - /// - //public int pageCount => DialogueData.Length; public bool SwitchingPage = false; public bool ProgressDialogue = true; @@ -495,7 +487,7 @@ namespace CalamityMod.UI.DialogueDisplay else ColorParams.Add(Param); } - if (ID == "BorderColors") + else if (ID == "BorderColors") { if (float.TryParse(Param, out float result)) Params.Add(result); @@ -998,7 +990,7 @@ namespace CalamityMod.UI.DialogueDisplay /// /// The name of the dialogue's localization key /// The position of the text in the world - public static void StartDialogue(string key, Vector2 startPosition, int Uptime = -1, bool progressDialogue = true, DisplayEffect effects = null, float wrapWidth = -1) + public static void StartDialogue(string key, Vector2 startPosition, int startIndex = 0, int Uptime = -1, bool progressDialogue = true, DisplayEffect effects = null, float wrapWidth = -1) { UI ??= new(); State ??= new(); @@ -1006,7 +998,10 @@ namespace CalamityMod.UI.DialogueDisplay DialogueTextData textData = Deserialize(key); - DialogueDisplay display = new(textData.Pages[0], effects, wrapWidth: wrapWidth) + if (startIndex >= textData.PageCount) + startIndex = textData.PageCount - 1; + + DialogueDisplay display = new(textData.Pages[startIndex], effects, wrapWidth: wrapWidth) { Position = startPosition, ProgressDialogue = progressDialogue, @@ -1027,7 +1022,7 @@ namespace CalamityMod.UI.DialogueDisplay /// The name of the dialogue's localization key /// The entity this dialogue will appear with /// The entity this dialogue will appear with - public static void StartDialogue(string key, Entity entity, int Uptime = -1, DisplayEffect effects = null, float wrapWidth = -1) + public static void StartDialogue(string key, Entity entity, int startIndex = 0, int Uptime = -1, DisplayEffect effects = null, float wrapWidth = -1) { UI ??= new(); State ??= new(); @@ -1035,7 +1030,10 @@ namespace CalamityMod.UI.DialogueDisplay DialogueTextData textData = Deserialize(key); - DialogueDisplay display = new(textData[0], effects, wrapWidth: wrapWidth) + if (startIndex >= textData.PageCount) + startIndex = textData.PageCount - 1; + + DialogueDisplay display = new(textData[startIndex], effects, wrapWidth: wrapWidth) { Position = entity.Center };