예제 #1
0
        private static bool Item_IsTheSameAs(On.Terraria.Item.orig_IsTheSameAs orig, Item self, Item compareItem)
        {
            bool b = orig(self, compareItem) && (self.color == compareItem.color || self.color == default || compareItem.color == default);

#if DEBUG
            if (self.netID == ItemID.Gel && compareItem.netID == ItemID.Gel)
            {
                if (!ColorfulGel.TryGetGelItemColorName(self, out string color1))
                {
                    color1 = "unknown";
                }
                if (!ColorfulGel.TryGetGelItemColorName(compareItem, out string color2))
                {
                    color2 = "unknown";
                }

                Main.NewText(new List <TextSnippet>()
                {
                    new TextSnippet("Comparing gel: "),
                    new TextSnippet(color1, self.color),
                    new TextSnippet(" and "),
                    new TextSnippet(color2, compareItem.color),
                    new TextSnippet($": {b}"),
                });
            }
#endif
            return(b);
        }
예제 #2
0
 private static string Item_AffixName(On.Terraria.Item.orig_AffixName orig, Item self)
 {
     if (ColorfulGel.TryGetGelItemColorName(self, out string c))
     {
         return(orig(self) + " (" + c + ")");
     }
     return(orig(self));
 }