From ea3f29b244cb7b2ff285a0bb6613be767c9d98c3 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:06:03 -0700 Subject: [PATCH] custom icons --- NPCs/CalamityGlobalNPC.cs | 1 + UI/{ => DebuffSystem}/BestiaryDebuffInfo.cs | 27 +++++++++++++++++--- UI/DebuffSystem/ColdDebuffType.png | Bin 0 -> 255 bytes UI/DebuffSystem/ElectricityDebuffType.png | Bin 0 -> 234 bytes UI/DebuffSystem/HeatDebuffType.png | Bin 0 -> 259 bytes UI/DebuffSystem/SicknessDebuffType.png | Bin 0 -> 262 bytes UI/DebuffSystem/WaterDebuffType.png | Bin 0 -> 247 bytes 7 files changed, 25 insertions(+), 3 deletions(-) rename UI/{ => DebuffSystem}/BestiaryDebuffInfo.cs (79%) create mode 100644 UI/DebuffSystem/ColdDebuffType.png create mode 100644 UI/DebuffSystem/ElectricityDebuffType.png create mode 100644 UI/DebuffSystem/HeatDebuffType.png create mode 100644 UI/DebuffSystem/SicknessDebuffType.png create mode 100644 UI/DebuffSystem/WaterDebuffType.png diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index f888f91cbc..e90c4502bf 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -58,6 +58,7 @@ using CalamityMod.Systems; using CalamityMod.Tiles.FurnitureAuric; using CalamityMod.Tiles.Ores; using CalamityMod.UI; +using CalamityMod.UI.DebuffSystem; using CalamityMod.Walls.DraedonStructures; using CalamityMod.World; using Microsoft.CodeAnalysis; diff --git a/UI/BestiaryDebuffInfo.cs b/UI/DebuffSystem/BestiaryDebuffInfo.cs similarity index 79% rename from UI/BestiaryDebuffInfo.cs rename to UI/DebuffSystem/BestiaryDebuffInfo.cs index e22956d6ce..1a08b81c3f 100644 --- a/UI/BestiaryDebuffInfo.cs +++ b/UI/DebuffSystem/BestiaryDebuffInfo.cs @@ -4,9 +4,10 @@ using Terraria; using Terraria.GameContent.Bestiary; using Terraria.GameContent.UI.Elements; using Terraria.Localization; +using Terraria.ModLoader; using Terraria.UI; -namespace CalamityMod.UI +namespace CalamityMod.UI.DebuffSystem { public class BestiaryDebuffInfo : IBestiaryInfoElement { @@ -51,16 +52,36 @@ namespace CalamityMod.UI // Add all five elements to the panel, each one below the previous for (int i = 0; i < 5; i++) { + string path = "CalamityMod/UI/DebuffSystem/"; + switch (i) + { + case 0: + path += "Heat"; + break; + case 1: + path += "Sickness"; + break; + case 2: + path += "Cold"; + break; + case 3: + path += "Electricity"; + break; + case 4: + path += "Water"; + break; + } + path += "DebuffType"; float topPos = 0.2f + i * 0.175f; // Icon - UIImage elementImage = new UIImage(Main.Assets.Request("Images/UI/Bestiary/Stat_Knockback")) + UIImage elementImage = new UIImage(ModContent.Request(path)) { HAlign = 0f, VAlign = 0f, Width = StyleDimension.FromPixelsAndPercent(0f, 1f), Height = StyleDimension.FromPixelsAndPercent(0f, 1f), Top = new StyleDimension(0f, topPos - 0.0525f), - Left = new StyleDimension(0f, 0f), + Left = new StyleDimension(8f, 0f), ImageScale = 0.8f, }; backgroundPanel.Append(elementImage); diff --git a/UI/DebuffSystem/ColdDebuffType.png b/UI/DebuffSystem/ColdDebuffType.png new file mode 100644 index 0000000000000000000000000000000000000000..eb0a88f11a4aef5fa48ab549419c5bc63996b16e GIT binary patch literal 255 zcmeAS@N?(olHy`uVBq!ia0vp^LO?9R!3-o1bjN}y#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvVv3w_=LEs*4+R6^Z)X@->sH>mWbWfe)0dQxBr2Xik@0>K#HRz$S?Rm1Tfrd z-Wv%N<1FxqEM{QfI}E~%$MaXD00m<_T^vI+g17cMaxoZkFmHAH{a;=`@I%1u$80=l z8Ef7w+%FjF?VhD@^|Jb-$6L>28QBXoYdz%NxJ)-JKO_IZ8QVj5c}_%&s~ifrY%j;r nF`>jkjX)S3j3^P6!lvI6=10X`wFN)4xr&)mNB|5xGf|3I-VYnP=0Db|u8zu^Bs!0>w;UocRBv%n*= zn1O-sFbFdq&tH)O6b$xsaSYK2u00pc#h}39a`EHF|E9+?0w+}Mf7BxOXSK4;SCvIs z6SFcL8)mwsRc}y`n_T4UdLVM|^v#p*Stb3+aa!}gWMtr$B-(^ W{IKc!x4S^&89ZJ6T-G@yGywo(TvdMn literal 0 HcmV?d00001 diff --git a/UI/DebuffSystem/HeatDebuffType.png b/UI/DebuffSystem/HeatDebuffType.png new file mode 100644 index 0000000000000000000000000000000000000000..8b25d715bb4dc37b19812f8b2e54523043c10ff5 GIT binary patch literal 259 zcmeAS@N?(olHy`uVBq!ia0vp^LO?9R!3-o1bjN}y#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;{0X`wFJFFyrl{5Ul&G5s7;s0i}|9^h~WrDU?WC1Dmk|4j}|6sr%<<0B{ z6yhxKh%9Dc;5!V$jK}j=qyPm|JY5_^G=f{tI|?-@@Hk)Gmbvr)#HZbQE*El6*|aHc zEjxDR?z_*XX-rCaF_UMCOw_EMTs`%>N43-pNyEPuf}*Q_G%U|vHxHl!PC{xWt~$(69CQSTVMbH literal 0 HcmV?d00001 diff --git a/UI/DebuffSystem/SicknessDebuffType.png b/UI/DebuffSystem/SicknessDebuffType.png new file mode 100644 index 0000000000000000000000000000000000000000..db56ba844955181a82e20d6f327aeb8ffb6cb113 GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^LO?9R!3-o1bjN}y#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6d34x4LxK`F!|xFLRoD!6rSE21NlU1)%&Zi=R3`inAohFZe$c zFa-NofNbF`@Q5sCVBk9p!i>lBSEK+1<2_v*Lo|Z-p7Z8wP~c&?@bC0r|24rKiX3`# zc|Ul}Uij^lz01@>`Qu(LXNs0Tp2x82Oxn8x!kq~QkGhRq&nOwps8pKr!lvI6;{0X`wFoVNQ_L!TOF|16yT`^2|@lQ;ea%KX^G@*GI9mjw9*{|5sGDQ{*s zpb%$)M`SSr1K(i~W;~w1A_XWI;pyTSq7htsu95420tZXL)-V6`vLL+`gtvWs{iPhb-TQy^R*aigE8dB*PoB{QIgt{S0?Z fztd@Z%sEZ`Rv$ZSYeq~W&<+MqS3j3^P6