Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetItemLight() [3/4]

static Color Terraria.UI.ItemSlot.GetItemLight ( ref Color currentColor,
ref float scale,
int type,
bool outInTheWorld = false )
inlinestatic

Definition at line 2916 of file ItemSlot.cs.

2917 {
2918 if (type < 0 || type > ItemID.Count)
2919 {
2920 return currentColor;
2921 }
2922 if (type == 662 || type == 663 || type == 5444 || type == 5450)
2923 {
2924 currentColor.R = (byte)Main.DiscoR;
2925 currentColor.G = (byte)Main.DiscoG;
2926 currentColor.B = (byte)Main.DiscoB;
2927 currentColor.A = byte.MaxValue;
2928 }
2929 if (type == 5128)
2930 {
2931 currentColor.R = (byte)Main.DiscoR;
2932 currentColor.G = (byte)Main.DiscoG;
2933 currentColor.B = (byte)Main.DiscoB;
2934 currentColor.A = byte.MaxValue;
2935 }
2936 else if (ItemID.Sets.ItemIconPulse[type])
2937 {
2938 scale = Main.essScale;
2939 currentColor.R = (byte)((float)(int)currentColor.R * scale);
2940 currentColor.G = (byte)((float)(int)currentColor.G * scale);
2941 currentColor.B = (byte)((float)(int)currentColor.B * scale);
2942 currentColor.A = (byte)((float)(int)currentColor.A * scale);
2943 }
2944 else if (type == 58 || type == 184 || type == 4143)
2945 {
2946 scale = Main.essScale * 0.25f + 0.75f;
2947 currentColor.R = (byte)((float)(int)currentColor.R * scale);
2948 currentColor.G = (byte)((float)(int)currentColor.G * scale);
2949 currentColor.B = (byte)((float)(int)currentColor.B * scale);
2950 currentColor.A = (byte)((float)(int)currentColor.A * scale);
2951 }
2952 return currentColor;
2953 }
static bool[] ItemIconPulse
Definition ItemID.cs:1048
static readonly short Count
Definition ItemID.cs:12138

References Terraria.ID.ItemID.Count, Terraria.Main.DiscoB, Terraria.Main.DiscoG, Terraria.Main.DiscoR, Terraria.Main.essScale, Terraria.ID.ItemID.Sets.ItemIconPulse, and System.type.