99 public static readonly
int Count = 34;
114 ItemType = itemAfter.
type;
116 if (transferAmount != 0)
194 new Color(50, 106, 64),
195 new Color(46, 106, 98),
196 new Color(45, 85, 105)
199 new Color(35, 106, 126),
200 new Color(50, 89, 140),
201 new Color(57, 70, 128)
204 new Color(122, 63, 83),
205 new Color(104, 46, 85),
206 new Color(84, 37, 87)
310 public static void Handle(
Item[] inv,
int context = 0,
int slot = 0)
355 Main.cursorOverride = 10;
359 Main.cursorOverride = 6;
368 Main.cursorOverride = 6;
379 flag =
Main.
LocalPlayer.tileEntityAnchor.GetTileEntity().OverrideItemSlotHover(inv, context, slot);
388 Main.cursorOverride = 9;
396 if (
item.maxStack == 1 &&
item.Prefix(-3))
398 Main.cursorOverride = 9;
405 Main.cursorOverride = 9;
410 Main.cursorOverride = 9;
418 Main.cursorOverride = 8;
442 Main.cursorOverride = 7;
454 flag2 =
Main.
LocalPlayer.tileEntityAnchor.GetTileEntity().OverrideItemSlotHover(inv, context, slot);
467 Main.cursorOverride = 10;
472 Main.cursorOverride = 9;
476 if (
item.maxStack == 1 &&
item.Prefix(-3))
478 Main.cursorOverride = 9;
485 Main.cursorOverride = 9;
492 Main.cursorOverride = 9;
497 Main.cursorOverride = 6;
505 Main.cursorOverride = 8;
529 Main.cursorOverride = 7;
539 Main.cursorOverride = 2;
541 else if (
item.type > 0 &&
item.stack > 0)
543 Main.cursorOverride = 3;
554 if (
Main.
LocalPlayer.tileEntityAnchor.IsInValidUseTileEntity() &&
Main.
LocalPlayer.tileEntityAnchor.GetTileEntity().OverrideItemSlotLeftClick(inv, context, slot))
573 item.favorited = !
item.favorited;
654 if (num != 3 && !flag)
665 if (context == 11 && !inv[slot].FitsAccessoryVanitySlot)
670 if (inv[slot].stack > 0)
678 if (inv[slot].stack > 0)
699 if (inv[slot].
type == 0 || inv[slot].stack < 1)
701 inv[slot] =
new Item();
711 Main.mouseItem.stack = 0;
716 int num2 = Main.mouseItem.maxStack - inv[slot].
stack;
717 inv[slot].
stack += num2;
718 Main.mouseItem.stack -= num2;
725 Main.mouseItem =
new Item();
742 if (inv[slot].stack > 0)
767 if (inv[slot].
type == 0 || inv[slot].stack < 1)
769 inv[slot] =
new Item();
773 Main.mouseItem =
new Item();
786 if (inv[slot].
type == 0 || inv[slot].stack < 1)
788 inv[slot] =
new Item();
792 Main.mouseItem =
new Item();
807 if (inv[slot].stack > 0)
829 if ((context == 23 || context == 24) &&
Main.
netMode == 1)
843 if (inv[slot].stack > 0)
868 if (inv[slot].
type == 0 || inv[slot].stack < 1)
870 inv[slot] =
new Item();
874 Main.mouseItem =
new Item();
887 if (inv[slot].
type == 0 || inv[slot].stack < 1)
889 inv[slot] =
new Item();
893 Main.mouseItem =
new Item();
908 if (inv[slot].stack > 0)
940 HandleShopSlot(inv, slot, rightClickIsValid:
false, leftClickIsValid:
true);
960 Main.stackSplit = 9999;
974 if ((uint)context > 2u && context != 5 && context != 32)
997 if ((uint)context <= 4u || context == 7 || context == 32)
1010 if ((uint)context <= 4u || context == 32)
1026 if (inv[slot].
type <= 0)
1033 if (inv[slot].
type < 71 || inv[slot].
type > 74)
1043 else if (inv[slot].
value == 0)
1053 else if (!inv[slot].favorited)
1056 player.trashItem = inv[slot].
Clone();
1075 if (inv[slot].
type > 0 && inv[slot].stack > 0)
1077 if (!inv[slot].favorited)
1099 if (
Main.
mouseItem.type > 0 && (context == 0 || context == 1 || context == 2 || context == 6 || context == 15 || context == 7 || context == 4 || context == 32 || context == 3))
1134 if ((uint)context <= 4u || context == 32)
1136 flag = player.chest == -1;
1143 if (inv[slot].
type >= 71 && inv[slot].
type <= 74)
1149 if (!inv[slot].favorited)
1168 if (checkItem.
type == 0 || checkItem.
type == 71 || checkItem.
type == 72 || checkItem.
type == 73 || checkItem.
type == 74)
1193 if (checkItem.
Prefix(-3) || checkItem.
type == 0)
1208 if (checkItem.
type == 0 || (checkItem.
headSlot > -1 && slot == 0) || (checkItem.
bodySlot > -1 && slot == 1) || (checkItem.
legSlot > -1 && slot == 2))
1214 if (checkItem.
type == 0 || (checkItem.
headSlot > 0 && slot == 0) || (checkItem.
bodySlot > 0 && slot == 1) || (checkItem.
legSlot > 0 && slot == 2))
1226 if (checkItem.
type == 0 || (checkItem.
headSlot > -1 && slot == 10) || (checkItem.
bodySlot > -1 && slot == 11) || (checkItem.
legSlot > -1 && slot == 12))
1256 if (checkItem.
type == 0 && inv[slot].
type > 0)
1264 else if (inv[slot].
type == 0 && checkItem.
type > 0 && (checkItem.
type < 71 || checkItem.
type > 74))
1300 if (checkItem.
type == 0 && inv[slot].
type > 0)
1330 HandleShopSlot(inv, slot, rightClickIsValid:
true, leftClickIsValid:
false);
1372 if (inv[slot].maxStack == 1)
1388 bool flag2 = inv[slot].
maxStack <= 1 && inv[slot].
stack <= 1;
1389 if (context == 0 && flag2)
1393 if (context == 3 && flag2)
1397 if (context == 4 && flag2)
1401 if (context == 32 && flag2)
1409 int num = Main.superFastStack + 1;
1410 for (
int i = 0; i < num; i++)
1429 Main.mouseItem = inv[slot].
Clone();
1435 Main.mouseItem.stack = 0;
1436 if (inv[slot].favorited && inv[slot].stack == 1)
1438 Main.mouseItem.favorited =
true;
1442 Main.mouseItem.favorited =
false;
1451 if (inv[slot].stack <= 0)
1453 inv[slot] =
new Item();
1460 if ((context == 23 || context == 24) &&
Main.
netMode == 1)
1482 Main.stackSplit = 30;
1500 else if (
item.type == 3093)
1504 else if (
item.type == 4345)
1508 else if (
item.type == 4410)
1512 else if (
item.type == 1774)
1516 else if (
item.type == 3085)
1518 if (!player.
ConsumeItem(327, reverseOrder:
false, includeVoidBag:
true))
1524 else if (
item.type == 4879)
1532 else if (
item.type == 1869)
1538 if (
item.type != 599 &&
item.type != 600 &&
item.type != 601)
1545 if (
item.stack == 0)
1550 Main.stackSplit = 30;
1551 Main.mouseRightRelease =
false;
1562 bool flag = context != 11 || item.FitsAccessoryVanitySlot ||
item.IsAir;
1563 if (flag && context == 11 && inv[slot].wingSlot > 0)
1565 for (
int i = 3; i < 10; i++)
1567 if (inv[i].wingSlot > 0 && i != slot - 10)
1577 Utils.Swap(ref inv[slot], ref inv[slot - 10]);
1580 if (inv[slot].stack > 0)
1611 Main.mouseItem = inv[slot].
Clone();
1640 item.ChangeItemType((
item.type == 5325) ? 4131 : 5325);
1645 item.ChangeItemType((
item.type == 5059) ? 5060 : 5059);
1649 item.ChangeItemType(5329);
1653 item.ChangeItemType(5330);
1657 item.ChangeItemType(5324);
1662 item.ChangeItemType((
item.type == 4346) ? 5391 : 4346);
1667 item.ChangeItemType((
item.type == 5323) ? 5455 : 5323);
1672 item.ChangeItemType((
item.type == 4767) ? 5453 : 4767);
1677 item.ChangeItemType((
item.type == 5309) ? 5454 : 5309);
1681 item.ChangeItemType(5360);
1685 item.ChangeItemType(5361);
1689 item.ChangeItemType(5359);
1693 item.ChangeItemType(5358);
1697 item.ChangeItemType(5358);
1705 if (newType == 5324 || newType == 5329 || newType == 5330 || newType == 4346 || newType == 5391 || newType == 5358 || newType == 5361 || newType == 5360 || newType == 5359)
1713 Main.stackSplit = 30;
1714 Main.mouseRightRelease =
false;
1725 bool flag = (Main.mouseRight && rightClickIsValid) || (
Main.
mouseLeft && leftClickIsValid);
1730 int num = Main.superFastStack + 1;
1732 for (
int i = 0; i < num; i++)
1745 if (inv[slot].
value > 0)
1757 if (inv[slot].
prefix != 0)
1761 Main.mouseItem.stack = 0;
1763 if (!inv[slot].buyOnce)
1769 if (inv[slot].buyOnce && --inv[slot].stack <= 0)
1799 flag = UILinkPointNavigator.CurrentPoint == gamepadPointForSlot;
1817 if (
item.type > 0 &&
item.stack > 0 &&
item.favorited && context != 13 && context != 21 && context != 22 && context != 14)
1828 float num2 = (float)(
int)Main.mouseTextColor / 255f;
1829 num2 = num2 * 0.2f + 0.8f;
1830 color2 = color2.MultiplyRGBA(
new Color(num2, num2, num2));
1832 else if (!highlightThingsForMouse &&
item.type > 0 &&
item.stack > 0 && num != 0 && context != 13 && context != 21 && context != 22)
1835 float num3 = (float)(
int)Main.mouseTextColor / 255f;
1836 num3 = num3 * 0.2f + 0.8f;
1837 color2 = ((num != 1) ? color2.MultiplyRGBA(
new Color(num3 / 2f, num3, num3 / 2f)) : color2.MultiplyRGBA(
new Color(num3, num3 / 2f, num3 / 2f)));
1839 else if (context == 0 && slot < 10)
1904 color2 =
new Color(b, b, b, b);
1915 color2 =
new Color(53, 69, 127, 255);
1927 float num4 = (float)(
int)color2.A / 255f;
1928 num4 = ((!(num4 < 0.7f)) ? 1f :
Utils.
GetLerpValue(0f, 0.7f, num4, clamped:
true));
1929 color2 = Color.White * num4;
1936 float num5 = Main.invAlpha / 255f;
1937 Color value2 =
new Color(63, 65, 151, 255) * num5;
1941 color2 =
Color.
Lerp(value2, value3, num6 / 2f);
1946 float num7 = Main.invAlpha / 255f;
1947 Color value4 =
new Color(130, 62, 102, 255) * num7;
1950 value4 =
new Color(104, 52, 52, 255) * num7;
1955 color2 =
Color.
Lerp(value4, value5, num8 / 2f);
2040 if ((
item.type <= 0 ||
item.stack <= 0) && num9 != -1)
2043 Rectangle rectangle = value6.Frame(3, 6, num9 % 3, num9 / 3);
2044 rectangle.Width -= 2;
2045 rectangle.Height -= 2;
2046 spriteBatch.
Draw(value6, position +
value.Size() / 2f * inventoryScale, rectangle, Color.White * 0.35f, 0f, rectangle.Size() / 2f, inventoryScale,
SpriteEffects.None, 0f);
2049 if (
item.type > 0 &&
item.stack > 0)
2051 float scale =
DrawItemIcon(
item, context, spriteBatch, position + vector / 2f, inventoryScale, 32f, color);
2054 spriteBatch.
Draw(
TextureAssets.
Wire.Value, position +
new Vector2(40f, 40f) * inventoryScale,
new Rectangle(4, 58, 8, 8), color, 0f,
new Vector2(4f), 1f,
SpriteEffects.None, 0f);
2061 spriteBatch.
Draw(value7, position + vector2 +
new Vector2(40f, 40f) * inventoryScale, rectangle2, color, 0f, rectangle2.Size() / 2f, 1f,
SpriteEffects.None, 0f);
2063 if (
item.type == 5324 ||
item.type == 5329 ||
item.type == 5330)
2071 Rectangle rectangle5 = value10.Frame(3, 1, 2);
2072 spriteBatch.
Draw(value10, position + vector3 +
new Vector2(40f, 40f) * inventoryScale, rectangle5, color, 0f, rectangle5.Size() / 2f, 1f,
SpriteEffects.None, 0f);
2078 Rectangle rectangle4 = value9.Frame(3, 1, 1);
2079 spriteBatch.
Draw(value9, position + vector3 +
new Vector2(40f, 40f) * inventoryScale, rectangle4, color, 0f, rectangle4.Size() / 2f, 1f,
SpriteEffects.None, 0f);
2086 spriteBatch.
Draw(value8, position + vector3 +
new Vector2(40f, 40f) * inventoryScale, rectangle3, color, 0f, rectangle3.Size() / 2f, 1f,
SpriteEffects.None, 0f);
2093 ChatManager.
DrawColorCodedStringWithShadow(spriteBatch,
FontAssets.
ItemStack.Value,
item.stack.ToString(), position +
new Vector2(10f, 26f) * inventoryScale, color, 0f,
Vector2.
Zero,
new Vector2(inventoryScale), -1f, inventoryScale);
2100 for (
int i = 0; i < 58; i++)
2102 if (inv[i].
type == 3822)
2104 num10 += inv[i].
stack;
2112 if (
item.useAmmo > 0)
2114 int useAmmo =
item.useAmmo;
2116 for (
int j = 0; j < 58; j++)
2118 if (inv[j].ammo == useAmmo)
2120 num10 += inv[j].
stack;
2124 if (
item.fishingPole > 0)
2127 for (
int k = 0; k < 58; k++)
2129 if (inv[k].bait > 0)
2131 num10 += inv[k].
stack;
2135 if (
item.tileWand > 0)
2137 int tileWand =
item.tileWand;
2139 for (
int l = 0; l < 58; l++)
2141 if (inv[l].
type == tileWand)
2143 num10 += inv[l].
stack;
2147 if (
item.type == 509 ||
item.type == 851 ||
item.type == 850 ||
item.type == 3612 ||
item.type == 3625 ||
item.type == 3611)
2150 for (
int m = 0; m < 58; m++)
2152 if (inv[m].
type == 530)
2154 num10 += inv[m].
stack;
2161 ChatManager.
DrawColorCodedStringWithShadow(spriteBatch,
FontAssets.
ItemStack.Value, num10.ToString(), position +
new Vector2(8f, 30f) * inventoryScale, color, 0f,
Vector2.
Zero,
new Vector2(inventoryScale * 0.8f), -1f, inventoryScale);
2165 string text =
string.Concat(slot + 1);
2170 ChatManager.
DrawColorCodedStringWithShadow(spriteBatch,
FontAssets.
ItemStack.Value,
text, position +
new Vector2(8f, 4f) * inventoryScale, color, 0f,
Vector2.
Zero,
new Vector2(inventoryScale), -1f, inventoryScale);
2172 if (context == 13 &&
item.potion)
2178 if ((context == 10 || context == 18) && item.expertOnly && !
Main.
expertMode)
2185 else if (context == 6)
2188 Vector2 position4 = position +
value.Size() * inventoryScale / 2f - value11.Size() * inventoryScale / 2f;
2189 spriteBatch.
Draw(value11, position4,
null,
new Color(100, 100, 100, 100), 0f,
default(
Vector2), inventoryScale,
SpriteEffects.None, 0f);
2191 if (context == 0 && slot < 10)
2193 float num11 = inventoryScale;
2194 string text2 =
string.Concat(slot + 1);
2208 ChatManager.
DrawColorCodedStringWithShadow(spriteBatch,
FontAssets.
ItemStack.Value, text2, position +
new Vector2(6f, 4 + num12) * inventoryScale, baseColor, 0f,
Vector2.
Zero,
new Vector2(inventoryScale), -1f, inventoryScale);
2210 if (gamepadPointForSlot != -1)
2235 color =
default(
Color);
2236 if (loadoutIndex < 0 || loadoutIndex >= 3)
2265 return (hue + (
float)loadoutIndex / 8f) % 1f;
2275 int num =
item.type;
2276 if ((uint)(num - 5358) <= 3u && context == 31)
2285 Vector2 origin = frame.Size() / 2f;
2286 spriteBatch.
Draw(
value, screenPositionForItemCenter, frame,
item.GetAlpha(itemLight), 0f, origin, finalDrawScale, effects, 0f);
2289 Color newColor = environmentColor;
2292 newColor.A =
byte.MaxValue;
2294 spriteBatch.
Draw(
value, screenPositionForItemCenter, frame,
item.GetColor(newColor), 0f, origin, finalDrawScale, effects, 0f);
2307 spriteBatch.
Draw(value3, screenPositionForItemCenter, frame, white, 0f, origin, finalDrawScale, effects, 0f);
2313 spriteBatch.
Draw(color:
new Color(
Main.
DiscoR,
Main.
DiscoG,
Main.
DiscoB), texture: value2, position: screenPositionForItemCenter, sourceRectangle: frame, rotation: 0f, origin: origin, scale: finalDrawScale, effects: effects, layerDepth: 0f);
2317 return finalDrawScale;
2322 itemLight = currentWhite;
2326 if ((
float)frame.Width > sizeLimit || (
float)frame.Height > sizeLimit)
2328 num = ((frame.Width <= frame.Height) ? (sizeLimit / (
float)frame.Height) : (sizeLimit / (float)frame.Width));
2330 finalDrawScale = scale * num * scale2;
2354 result = 100 + num2;
2358 if (inv == localPlayer.
dye)
2371 result = 185 + slot;
2392 result = 400 + slot;
2395 result = 2700 + slot;
2407 result = 1500 + UILinkPointNavigator.Shortcuts.CRAFT_CurrentRecipeSmall + 1;
2417 result = 5100 + slot;
2420 result = 5100 + slot;
2423 result = 5108 + slot;
2426 result = 5000 + slot;
2429 result = 5002 + slot;
2432 result = 3000 + slot;
2439 result = 15000 + slot;
2462 Main.hoverItemName =
Lang.
inter[3].Value;
2464 if (inv[slot].
type > 0 && inv[slot].stack > 0)
2467 Main.hoverItemName = inv[slot].
Name;
2468 if (inv[slot].stack > 1)
2470 Main.hoverItemName = Main.hoverItemName +
" (" + inv[slot].
stack +
")";
2472 Main.HoverItem = inv[slot].
Clone();
2473 Main.HoverItem.tooltipContext = context;
2474 if (context == 8 && slot <= 2)
2476 Main.HoverItem.wornArmor =
true;
2483 Main.HoverItem.social =
true;
2486 Main.HoverItem.buy =
true;
2491 if (context == 10 || context == 11 || context == 24)
2493 Main.hoverItemName =
Lang.
inter[9].Value;
2499 if (context == 8 || context == 9 || context == 23 || context == 26)
2501 if (slot == 0 || slot == 10 || context == 26)
2503 Main.hoverItemName =
Lang.
inter[12].Value;
2505 else if (slot == 1 || slot == 11)
2507 Main.hoverItemName =
Lang.
inter[13].Value;
2509 else if (slot == 2 || slot == 12)
2511 Main.hoverItemName =
Lang.
inter[14].Value;
2513 else if (slot >= 10)
2518 if (context == 12 || context == 25 || context == 27 || context == 33)
2520 Main.hoverItemName =
Lang.
inter[57].Value;
2524 Main.hoverItemName =
Lang.
inter[90].Value;
2528 Main.hoverItemName =
Lang.
inter[91].Value;
2532 Main.hoverItemName =
Lang.
inter[92].Value;
2536 Main.hoverItemName =
Lang.
inter[93].Value;
2540 Main.hoverItemName =
Lang.
inter[94].Value;
2559 if (inv[slot].dye > 0)
2561 inv[slot] =
DyeSwap(inv[slot], out success);
2564 Main.EquipPageSelected = 0;
2573 Main.EquipPageSelected = 2;
2582 Main.EquipPageSelected = 2;
2591 Main.EquipPageSelected = 2;
2599 Main.EquipPageSelected = 2;
2607 Main.EquipPageSelected = 2;
2613 inv[slot] =
ArmorSwap(inv[slot], out success);
2616 Main.EquipPageSelected = 0;
2662 if (itemCollection[slot].IsTheSameAs(
item))
2666 if (itemCollection[slot].wingSlot > 0 &&
item.
wingSlot > 0)
2671 for (
int i = 0; i < itemCollection.Length; i++)
2673 if (slot < 10 && i < 10)
2675 if (
item.wingSlot > 0 && itemCollection[i].
wingSlot > 0)
2679 if (slot >= 10 && i >= 10 &&
item.wingSlot > 0 && itemCollection[i].
wingSlot > 0)
2684 if (
item.IsTheSameAs(itemCollection[i]))
2701 for (
int i = 0; i < 10; i++)
2737 if (
item.headSlot == -1 &&
item.bodySlot == -1 &&
item.legSlot == -1 && !
item.accessory)
2742 int num = ((item.vanity && !
item.accessory) ? 10 : 0);
2743 item.favorited =
false;
2745 if (
item.headSlot != -1)
2750 else if (
item.bodySlot != -1)
2755 else if (
item.legSlot != -1)
2760 else if (
item.accessory)
2763 for (
int i = 3; i < 10; i++)
2775 for (
int j = 0; j < player.
armor.Length; j++)
2781 if (j < 10 && item.wingSlot > 0 && player.
armor[j].
wingSlot > 0)
2799 for (
int k = 0; k < player.
armor.Length; k++)
2820 item.favorited =
false;
2834 for (
int i = 0; i < 4; i++)
2839 _ = coinsArray[3 - i];
2849 for (
int j = 0; j < 4; j++)
2852 int num = ((j == 0 && coinsArray[3 - j] > 99) ? (-6) : 0);
2920 return currentColor;
2927 currentColor.A =
byte.MaxValue;
2934 currentColor.A =
byte.MaxValue;
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);
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);
2952 return currentColor;
2965 float num3 = (float)(
int)Main.mouseTextColor / 255f;
2966 float num4 = 1f - (1f - num3) * (1f - num3);
2968 Color color = Color.White * num4 * num;
2970 float num5 = (float)
Math.
PI * 2f / (
float)radial.RadialCount;
2971 float num6 = -(float)
Math.
PI / 2f;
2972 for (
int i = 0; i < radial.RadialCount; i++)
2974 int num7 = radial.Bindings[i];
2975 Vector2 vector =
new Vector2(150f, 0f).RotatedBy(num6 + num5 * (
float)i) * num2;
2977 if (radial.SelectedBinding == i)
2985 Main.inventoryScale = num2 * num8;
2987 Main.inventoryScale = inventoryScale;
3004 float num3 = (float)(
int)Main.mouseTextColor / 255f;
3005 float num4 = 1f - (1f - num3) * (1f - num3);
3007 Color color = Color.White * num4 * num;
3009 float num6 = -(float)
Math.
PI / 2f;
3017 item.SetDefaults(28);
3050 Vector2 vector =
new Vector2(120f, 0f).RotatedBy(num6 + num5 * (
float)i) * num2;
3058 Main.inventoryScale = num2 * num7;
3060 Main.inventoryScale = inventoryScale;
3061 sb.
Draw(value2, position + vector +
new Vector2(34f, 20f) * 0.85f * num2 * num7,
null, color * num7, 0f,
value.Size() / 2f, num2 * num7 * 1.3f,
SpriteEffects.None, 0f);
3072 if (player.
chest != -1)
3077 float num = (float)(
int)Main.mouseTextColor / 255f;
3078 float num2 = 1f - (1f - num) * (1f - num);
3080 Color color = Color.White * num2;
3082 for (
int i = 0; i < 4; i++)
3097 return gamepadInstructions;
3109 if (inv ==
null || inv[slot] ==
null ||
Main.
mouseItem ==
null)
3113 if (context == 0 || context == 1 || context == 2)
3115 if (inv[slot].
type > 0 && inv[slot].stack > 0)
3132 if (inv[slot].maxStack > 1)
3137 if (inv[slot].maxStack == 1 &&
Equippable(inv, context, slot))
3160 if (context == 3 || context == 4 || context == 32)
3162 if (inv[slot].
type > 0 && inv[slot].stack > 0)
3175 if (inv[slot].maxStack > 1)
3180 if (inv[slot].maxStack == 1 &&
Equippable(inv, context, slot))
3208 if (inv[slot].
type > 0 && inv[slot].stack > 0)
3227 if (context == 8 || context == 9 || context == 16 || context == 17 || context == 18 || context == 19 || context == 20)
3229 if (inv[slot].
type > 0 && inv[slot].stack > 0)
3242 if (context == 8 && slot >= 3)
3258 if ((context == 16 || context == 17 || context == 18 || context == 19 || context == 20) && slot < 2)
3260 bool flag2 = player.
hideMisc[slot];
3288 if (context == 8 && slot >= 3)
3309 if ((context == 16 || context == 17 || context == 18 || context == 19 || context == 20) && slot < 2)
3311 bool flag4 = player.
hideMisc[slot];
3323 Main.mouseLeftRelease =
false;
3341 if (inv[slot].
type > 0 && inv[slot].stack > 0)
3354 if (context == 12 || context == 25 || context == 27 || context == 33)
3357 if (inv == player.
dye)
3385 bool flag8 = player.
hideMisc[slot];
3409 if (inv[slot].
type > 0 && inv[slot].stack > 0)
3443 if (inv[slot].
type > 0 && inv[slot].stack > 0)
3458 flag6 =
Main.
mouseItem.Prefix(-3) || Main.mouseItem.type == 0;
3464 if (inv[slot].
type > 0 && inv[slot].stack > 0)
3487 bool flag5 = Main.mouseItem.type > 0 && (context == 0 || context == 1 || context == 2 || context == 6 || context == 15 || context == 7 || context == 4 || context == 32 || context == 3);
3490 if (flag5 &&
string.IsNullOrEmpty(overrideInstructions))
3500 else if (!
string.IsNullOrEmpty(overrideInstructions))
3511 Main.mouseLeft =
true;
3513 Main.mouseLeft = mouseLeft;
3518 Main.cursorOverride = cursorOverride;
3595 if (
item.damage > 0 &&
item.ammo == 0)
3599 else if (
item.createTile >= 0 ||
item.createWall > 0)
3619 if (
item.type > 0 &&
item.stack > 0 &&
item.useStyle != 0)
3621 return item.useTime > 0;
3628 Main.EquipPage = -1;
3635 else if (
item.mountType != -1)
3651 else if (
item.legSlot != -1 ||
item.headSlot != -1 ||
item.bodySlot != -1 ||
item.accessory)
void Draw(Texture2D texture, Vector2 position, Color color)
static float Clamp(float value, float min, float max)
static void PlaySound(int type, Vector2 position, int style=1)
void AddItemToShop(Item newItem)
virtual bool TryGetItemGamepadOverrideInstructions(Item[] inv, int context, int slot, out string instruction)
static void NotifyItemPickup(Player player, Item item)
static void HandleOnEquip(Player player, Item item, int context)
static Asset< DynamicSpriteFont > ItemStack
static Asset< DynamicSpriteFont > MouseText
static Asset< Texture2D > InventoryBack13
static Asset< Texture2D > InventoryBack7
static Asset< Texture2D > InventoryBack8
static Asset< Texture2D > InventoryBack9
static Asset< Texture2D > InventoryBack
static Asset< Texture2D >[] GlowMask
static Asset< Texture2D > Cd
static Asset< Texture2D > InventoryBack5
static Asset< Texture2D > Trash
static Asset< Texture2D > InventoryBack4
static Asset< Texture2D > InventoryBack14
static Asset< Texture2D >[] HotbarRadial
static Asset< Texture2D > InventoryBack6
static Asset< Texture2D >[] Item
static Asset< Texture2D > InventoryBack18
static Asset< Texture2D >[] Extra
static Asset< Texture2D > InventoryBack3
static Asset< Texture2D > InventoryBack19
static Asset< Texture2D > Wire
static Asset< Texture2D > InventoryBack15
static Asset< Texture2D > InventoryBack17
static Asset< Texture2D > InventoryBack12
static Asset< Texture2D > InventoryBack2
static Asset< Texture2D > InventoryBack10
static Asset< Texture2D > QuicksIcon
static string GenerateTag(Item I)
static void DrawSavings(SpriteBatch sb, int currencyIndex, float shopx, float shopy, bool horizontal=false)
static bool[] ItemIconPulse
static bool[] OpenableBag
static bool[] IsFishingCrate
static bool[] DrawUnsafeIndicator
static readonly short Count
bool IsNotTheSameAs(Item compareItem)
bool Prefix(int prefixWeWant)
void OnCreated(ItemCreationContext context)
void TurnToAir(bool fullReset=false)
void SetDefaults(int Type=0)
static LocalizedText[] inter
static LocalizedText[] misc
static string GetTextValue(string key)
static bool drawingPlayerChat
static ItemShopSellbackHelper shopSellbackHelper
static CreativeUI CreativeMenu
static DrawAnimation[] itemAnimations
static int cursorOverride
static bool mouseLeftRelease
static double timeForVisualEffects
static Vector2 MouseScreen
static Microsoft.Xna.Framework.Color inventoryBack
static byte mouseTextColor
static float inventoryScale
static bool InReforgeMenu
static bool mouseRightRelease
static Microsoft.Xna.Framework.Input.Keys FavoriteKey
static KeyboardState keyState
static bool InGuideCraftMenu
static string hoverItemName
static bool playerInventory
static void GetItemDrawFrame(int item, out Texture2D itemTexture, out Microsoft.Xna.Framework.Rectangle itemFrame)
static Microsoft.Xna.Framework.Color hslToRgb(Vector3 hslVector)
static Player LocalPlayer
static int EquipPageSelected
static void SendData(int msgType, int remoteClient=-1, int ignoreClient=-1, NetworkText text=null, int number=0, float number2=0f, float number3=0f, float number4=0f, int number5=0, int number6=0, int number7=0)
void ChangeBinding(int itemSlot)
int GetDrawMode(int itemslot)
void OpenLockBox(int lockboxItemType)
void OpenShadowLockbox(int boxType)
bool SellItem(Item item, int stack=-1)
SelectionRadial DpadRadial
void OpenOyster(int sourceItemType)
void OpenHerbBag(int bagType)
SelectionRadial QuicksRadial
Item QuickMana_GetItemToUse()
bool HasItemInInventoryOrOpenVoidBag(int type)
void GetItemExpectedPrice(Item item, out long calcForSelling, out long calcForBuying)
bool ConsumeItem(int type, bool reverseOrder=false, bool includeVoidBag=false)
void OpenGoodieBag(int itemType)
ItemSpaceStatus ItemSpace(Item newItem)
bool BuyItem(long price, int customCurrency=-1)
bool[] hideVisibleAccessory
bool IsItemSlotUnlockedAndUsable(int slot)
Item QuickHeal_GetItemToUse()
void OpenPresent(int itemType)
void OpenCanofWorms(int sourceItemType)
void OpenLegacyPresent(int itemType)
bool CanDemonHeartAccessoryBeShown()
void OpenFishingCrate(int crateItemID)
void OpenBossBag(int type)
PlayerInteractionAnchor tileEntityAnchor
static void FindRecipes(bool canDelayCheck=false)
static bool AddChatText(DynamicSpriteFont font, string text, Vector2 baseScale)
static Vector2 DrawColorCodedStringWithShadow(SpriteBatch spriteBatch, DynamicSpriteFont font, TextSnippet[] snippets, Vector2 position, float rotation, Vector2 origin, Vector2 baseScale, out int hoveredSnippet, float maxWidth=-1f, float spread=2f)
static Vector2 GetStringSize(DynamicSpriteFont font, string text, Vector2 baseScale, float maxWidth=-1f)
static bool IsBlockedFromTransferIntoChest(Item item, Item[] container)
static void GetContainerUsageInfo(out bool sync, out Item[] chestinv)
static bool TryPlacingInChest(Item I, bool justCheck, int itemSlotContext)
static bool CREATIVE_ItemSlotShouldHighlightAsSelected
static int CRAFT_CurrentRecipeBig
static int CRAFT_CurrentRecipeSmall
static void SetPosition(int ID, Vector2 Position)
static void SuggestUsage(int PointID)
const int EquipAccessoryVanity
const int EquipArmorVanity
const int CreativeInfinite
const int CraftingMaterial
static readonly int Count
const int DisplayDollArmor
const int DisplayDollAccessory
const int CreativeSacrifice
static bool HighlightNewItems
static bool DisableLeftShiftTrashCan
static bool DisableQuickTrash
static Color[,] LoadoutSlotColors
static void Draw(SpriteBatch spriteBatch, ref Item inv, int context, Vector2 position, Color lightColor=default(Color))
static bool Equippable(Item[] inv, int context, int slot)
static Item DyeSwap(Item item, out bool success)
static float[] inventoryGlowHueChest
static float QuicksRadialOpacity
static bool OverrideLeftClick(Item[] inv, int context=0, int slot=0)
static bool isEquipLocked(int type)
static void SetGlow(int index, float hue, bool chest)
delegate void ItemTransferEvent(ItemTransferInfo info)
static void SellOrTrash(Item[] inv, int context, int slot)
static void HandleShopSlot(Item[] inv, int slot, bool rightClickIsValid, bool leftClickIsValid)
static Item EquipSwap(Item item, Item[] inv, int slot, out bool success)
static bool TryEnteringFastUseMode(Item[] inv, int context, int slot, Player player, ref string s)
static float CircularRadialOpacity
static ItemTransferEvent OnItemTransferred
static Color GetColorByLoadout(int slot, int context)
static void OverrideHover(ref Item inv, int context=0)
static void DrawRadialDpad(SpriteBatch sb, Vector2 position)
static int accSlotToSwapTo
static void OverrideHover(Item[] inv, int context=0, int slot=0)
static void DrawMoney(SpriteBatch sb, string text, float shopx, float shopy, int[] coinsArray, bool horizontal=false)
static bool forceClearGlowsOnChest
static float DrawItemIcon(Item item, int context, SpriteBatch spriteBatch, Vector2 screenPositionForItemCenter, float scale, float sizeLimit, Color environmentColor)
static void SwapEquip(ref Item inv, int context=0)
static int PickItemMovementAction(Item[] inv, int context, int slot, Item checkItem)
static bool ShiftForcedOn
static bool DisableTrashing()
static Color GetItemLight(ref Color currentColor, ref float scale, int type, bool outInTheWorld=false)
static void LeftClick(Item[] inv, int context=0, int slot=0)
static int[] inventoryGlowTime
static bool Equippable(ref Item inv, int context=0)
static bool NotUsingGamepad
static void PickupItemIntoMouse(Item[] inv, int context, int slot, Player player)
static void SwapVanityEquip(Item[] inv, int context, int slot, Player player)
static bool IsMiscEquipment(Item item)
static void DrawSavings(SpriteBatch sb, float shopx, float shopy, bool horizontal=false)
static void RightClick(ref Item inv, int context=0)
static string GetOverrideInstructions(Item[] inv, int context, int slot)
static void LeftClick(ref Item inv, int context=0)
static void AnnounceTransfer(ItemTransferInfo info)
static void TryPickupDyeToCursor(int context, Item[] inv, int slot, Player player)
static bool TryGetSlotColor(int loadoutIndex, int context, out Color color)
static void DrawRadialQuicks(SpriteBatch sb, Vector2 position)
static void DrawItem_GetColorAndScale(Item item, float scale, ref Color currentWhite, float sizeLimit, ref Rectangle frame, out Color itemLight, out float finalDrawScale)
static void GetItemLight(ref Color currentColor, int type, bool outInTheWorld=false)
static void Handle(Item[] inv, int context=0, int slot=0)
static void SelectEquipPage(Item item)
static Item[] singleSlotArray
static string GetGamepadInstructions(ref Item inv, int context=0)
static bool CanDoSimulatedClickAction()
static void MouseHover(ref Item inv, int context=0)
static Item ArmorSwap(Item item, out bool success)
static bool IsABuildingItem(Item item)
static string GetGamepadInstructions(Item[] inv, int context=0, int slot=0)
static void RightClick(Item[] inv, int context=0, int slot=0)
static void GetItemLight(ref Color currentColor, ref float scale, Item item, bool outInTheWorld=false)
static void UpdateInterface()
static void RefreshStackSplitCooldown()
static int[] inventoryGlowTimeChest
static Color GetLoadoutColor(int loadoutIndex)
static bool LeftClick_SellOrTrash(Item[] inv, int context, int slot)
static bool TryEnteringBuildingMode(Item[] inv, int context, int slot, Player player, ref string s)
static void GetItemLight(ref Color currentColor, Item item, bool outInTheWorld=false)
static bool DrawGoldBGForCraftingMaterial
static void AfterItemSwap(int oldType, int newType)
static int _customCurrencyForSavings
static void MouseHover(int context=0)
static bool AccCheck(Item[] itemCollection, Item item, int slot)
static bool CanExecuteCommand()
static double _lastTimeForVisualEffectsThatLoadoutWasChanged
static void SwapEquip(Item[] inv, int context, int slot)
static void TryItemSwap(Item item)
static float[] inventoryGlowHue
static bool[] canFavoriteAt
static void TryOpenContainer(Item item, Player player)
static int GetGamepadPointForSlot(Item[] inv, int context, int slot)
static void Draw(SpriteBatch spriteBatch, Item[] inv, int context, int slot, Vector2 position, Color lightColor=default(Color))
static void DrawRadialCircular(SpriteBatch sb, Vector2 position, Player.SelectionRadial radial, Item[] items)
static float ShiftHueByLoadout(float hue, int loadoutIndex)
static void Handle(ref Item inv, int context=0)
static void MouseHover(Item[] inv, int context=0, int slot=0)
static void RecordLoadoutChange()
static float Remap(float fromValue, float fromMin, float fromMax, float toMin, float toMax, bool clamped=true)
static int[] CoinsSplit(long count)
static void DrawBorderStringFourWay(SpriteBatch sb, DynamicSpriteFont font, string text, float x, float y, Color textColor, Color borderColor, Vector2 origin, float scale=1f)
static float GetLerpValue(float from, float to, float t, bool clamped=false)
static long CoinsCombineStacks(out bool overFlowing, params long[] coinCounts)
static long CoinsCount(out bool overFlowing, Item[] inv, params int[] ignoreSlots)
static Rectangle CenteredRectangle(Vector2 center, Vector2 size)
static Color Lerp(Color value1, Color value2, float amount)
TileEntity GetTileEntity()
static GetItemSettings InventoryEntityToPlayerInventorySettings
bool CanTakeItemToPersonalInventory
ItemTransferInfo(Item itemAfter, int fromContext, int toContext, int transferAmount=0)