4using Microsoft.Xna.Framework.Input;
35 public static readonly
int Count = 7;
76 Main.inventoryScale = 0.755f;
98 string text =
string.Empty;
107 Main.instance.textBlinkerState = 1;
111 Main.instance.textBlinkerState = 0;
113 Main.instance.textBlinkerCount = 0;
121 else if (player.
chest > -1)
128 if (chest.
name !=
"")
139 else if (tile.
type == 467 && tile.
frameX / 36 == 4)
143 else if (tile.
type == 467)
147 else if (tile.
type == 88)
153 else if (player.
chest == -2)
157 else if (player.
chest == -3)
161 else if (player.
chest == -4)
165 else if (player.
chest == -5)
171 color.A =
byte.MaxValue;
176 ChatManager.
DrawColorCodedStringWithShadow(
spritebatch,
FontAssets.
MouseText.Value, text,
new Vector2(504f,
Main.
instance.invBottom + i * 26), color, 0f,
Vector2.
Zero,
Vector2.
One, -1f, 1.5f);
196 if (ID == 7 && player.
chest != -5)
224 text =
Lang.
inter[Main.editChest ? 47 : 61].Value;
238 color = Color.White * 0.97f * (1f - (255f - (float)(
int)
Main.
mouseTextColor) / 255f * 0.5f);
239 color.A =
byte.MaxValue;
250 ChatManager.
DrawColorCodedStringWithShadow(spriteBatch,
FontAssets.
MouseText.Value, text,
new Vector2(X, Y), color, 0f,
vector / 2f,
new Vector2(
num2), -1f, 1.5f);
289 player.mouseInterface =
true;
326 obj.IsVoidVaultEnabled = !obj.IsVoidVaultEnabled;
334 if (player.
chest > -1)
339 if (player.
chest == -2)
344 if (player.
chest == -3)
349 if (player.
chest == -4)
354 if (player.
chest == -5)
359 Main.inventoryScale = 0.755f;
362 player.mouseInterface =
true;
364 for (
int i = 0; i < 10; i++)
366 for (
int j = 0;
j < 4;
j++)
370 int slot = i +
j * 10;
371 new Color(100, 100, 100, 100);
374 player.mouseInterface =
true;
386 if (player.
chest > -1)
390 for (
int i = 0; i < 40; i++)
404 if (player.
chest == -3)
406 for (
int j = 0;
j < 40;
j++)
416 if (player.
chest == -4)
418 for (
int k = 0;
k < 40;
k++)
428 if (player.
chest == -5)
430 for (
int l = 0;
l < 40;
l++)
440 for (
int m = 0;
m < 40;
m++)
453 if (player.
chest > -1)
457 else if (player.
chest == -3)
461 else if (player.
chest == -4)
465 else if (player.
chest == -5)
473 for (
int num = 49; num >= 10; num--)
479 for (
int i = 0; i < 40; i++)
481 if (player.
chest > -1)
515 else if (player.
chest == -3)
539 else if (player.
chest == -4)
563 else if (player.
chest == -5)
612 if (player.
chest > -1)
614 for (
int j = 0;
j < 40;
j++)
629 else if (player.
chest == -3)
631 for (
int k = 0;
k < 40;
k++)
642 else if (player.
chest == -4)
644 for (
int l = 0;
l < 40;
l++)
655 else if (player.
chest == -5)
657 for (
int m = 0;
m < 40;
m++)
670 for (
int n = 0;
n < 40;
n++)
705 else if (player.
chest == -4)
713 else if (player.
chest == -3)
721 else if (player.
chest == -2)
730 if (player.
chest > -1)
734 else if (player.
chest == -2)
738 else if (player.
chest == -3)
742 else if (player.
chest == -4)
755 bool[]
array2 =
new bool[item.Length];
756 for (
int i = 0; i < 40; i++)
758 if (item[i].type > 0 && item[i].stack > 0 && (item[i].type < 71 || item[i].type > 74))
761 list.Add(item[i].netID);
763 if (item[i].type == 0 || item[i].stack <= 0)
770 if (player.
chest <= -2)
779 for (
int j =
num2;
j < num;
j++)
781 if (list.Contains(array[
j].netID) && !array[
j].favorited)
783 dictionary.Add(
j, array[
j].netID);
789 int netID = item[
num3].netID;
792 if (
item2.Value == netID && array[
item2.Key].netID == netID)
811 if (array[
item2.Key].stack == 0)
813 array[
item2.Key].SetDefaults();
821 if (array[
item3.Key].stack == 0)
828 dictionary.Remove(
item4);
874 if (array[
item5.Key].stack == 0)
913 Main.editChest =
false;
914 int chest = player.
chest;
921 Main.npcChatText =
"";
928 player.editedChestName =
true;
936 Main.editChest =
false;
937 Main.npcChatText =
string.Empty;
938 Main.blockKey = Keys.Escape.ToString();
946 if (player.
chest > -1)
950 else if (player.
chest == -2)
954 else if (player.
chest == -3)
958 else if (player.
chest == -4)
962 else if (player.
chest == -5)
969 for (
int num = 57; num >= 0; num--)
971 if ((
num < 50 || num >= 54) && (inventory[num].type < 71 || inventory[num].type > 74))
973 if (inventory[num].stack > 0 && inventory[num].maxStack > 1 && inventory[num].prefix == 0)
976 if (inventory[num].stack < inventory[num].maxStack)
981 else if (inventory[num].stack == 0 || inventory[num].netID == 0 || inventory[num].type == 0)
988 for (
int i = 0; i < item.Length; i++)
990 if (item[i].stack < 1 || item[i].prefix != 0 || !
hashSet.
Contains(item[i].netID))
995 for (
int j = 0;
j < list.Count;
j++)
1007 int num3 = item[i].stack;
1008 if (inventory[
num2].maxStack - inventory[
num2].stack <
num3)
1013 item[i].stack -=
num3;
1015 if (inventory[
num2].stack == inventory[
num2].maxStack)
1024 if (item[i].stack == 0)
1026 item[i] =
new Item();
1069 int[] array =
new int[4];
1073 int[]
array2 =
new int[40];
1076 for (
int i = 0; i < cInv.Length; i++)
1079 if (cInv[i].stack < 1 || cInv[i].type < 1)
1082 cInv[i] =
new Item();
1084 if (cInv[i] !=
null && cInv[i].stack > 0)
1087 if (cInv[i].type == 71)
1091 if (cInv[i].type == 72)
1095 if (cInv[i].type == 73)
1099 if (cInv[i].type == 74)
1108 cInv[i] =
new Item();
1117 for (
int j = 0;
j <
pInv.Length;
j++)
1122 if (
pInv[
j].type == 71)
1126 if (
pInv[
j].type == 72)
1130 if (
pInv[
j].type == 73)
1134 if (
pInv[
j].type == 74)
1147 for (
int k = 0;
k < 3;
k++)
1149 while (array[
k] >= 100)
1155 for (
int l = 0;
l < 40;
l++)
1157 if (
array2[
l] < 0 || cInv[
l].type != 0)
1163 if (array[
num5] > 0)
1167 if (cInv[
num4].stack > cInv[
num4].maxStack)
1180 for (
int m = 0;
m < 40;
m++)
1182 if (
array2[
m] < 0 || cInv[
m].type != 0)
1190 if (array[
num7] > 0)
1194 if (cInv[
num6].stack > cInv[
num6].maxStack)
1202 if (array[
num7] == 0)
1219 if (array[
num9] > 0)
1223 if (cInv[
num8].stack > cInv[
num8].maxStack)
1230 if (array[
num9] == 0)
1242 while (
num10 >= 0 && list.Count > 0)
1244 int num11 = list[0];
1245 if (array[
num10] > 0)
1257 if (array[
num10] == 0)
1286 for (
int i = 0; i < 40; i++)
1299 flag = flag || num > 0;
1327 for (
int j = 0;
j < 40;
j++)
1357 if (player.
chest > -1)
1360 sync = Main.netMode == 1;
1362 else if (player.
chest == -2)
1366 else if (player.
chest == -3)
1370 else if (player.
chest == -4)
1374 else if (player.
chest == -5)
1382 if (item.type == 3213 && item.favorited && container ==
Main.
LocalPlayer.bank.item)
1386 if ((item.type == 4131 || item.type == 5325) && item.favorited && container ==
Main.
LocalPlayer.bank4.item)
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
static void PlaySound(int type, Vector2 position, int style=1)
static void VisualizeChestTransfer_CoinsBatch(Vector2 position, Vector2 chestPosition, long coinsMoved)
static void VisualizeChestTransfer(Vector2 position, Vector2 chestPosition, Item item, int amountMoved)
static Asset< DynamicSpriteFont > MouseText
static Asset< Texture2D > InventoryBack
bool IsTheSameAs(Item compareItem)
void SetDefaults(int Type=0)
static LocalizedText[] inter
static LocalizedText[] dresserType
static LocalizedText[] chestType2
static LocalizedText[] chestType
static string GetItemNameValue(int id)
static string GetTextValue(string key)
static string npcChatText
static bool mouseLeftRelease
static byte mouseTextColor
static Microsoft.Xna.Framework.Color OurFavoriteColor
static float inventoryScale
static string defaultChestName
static Player LocalPlayer
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)
Item GetItem(int plr, Item newItem, GetItemSettings settings)
static void FindRecipes(bool canDelayCheck=false)
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 float[] ButtonScale
static bool[] ButtonHovered
static void DepositAll(ContainerTransferContext context)
const float buttonScaleMaximum
static void DrawButtons(SpriteBatch spritebatch)
static void RenameChestCancel()
const float buttonScaleMinimum
static bool IsBlockedFromTransferIntoChest(Item item, Item[] container)
static void DrawName(SpriteBatch spritebatch)
static void RenameChestSubmit(Player player)
static long MoveCoins(Item[] pInv, Item[] cInv, ContainerTransferContext context)
static void Draw(SpriteBatch spritebatch)
static void DrawButton(SpriteBatch spriteBatch, int ID, int X, int Y)
static void QuickStack(ContainerTransferContext context, bool voidStack=false)
static void GetContainerUsageInfo(out bool sync, out Item[] chestinv)
static void RenameChest()
static bool TryPlacingInChest(Item I, bool justCheck, int itemSlotContext)
static void ToggleVacuum()
static void DrawSlots(SpriteBatch spriteBatch)
static void UpdateHover(int ID, bool hovering)
static void SetPosition(int ID, Vector2 Position)
static void OpenVirtualKeyboard(int keyboardContext)
static void Draw(SpriteBatch spriteBatch, ref Item inv, int context, Vector2 position, Color lightColor=default(Color))
static int PickItemMovementAction(Item[] inv, int context, int slot, Item checkItem)
static void AnnounceTransfer(ItemTransferInfo info)
static void Handle(ref Item inv, int context=0)
static string[] WordwrapString(string text, DynamicSpriteFont font, int maxWidth, int maxLines, out int lineAmount)
static bool FloatIntersect(float r1StartX, float r1StartY, float r1Width, float r1Height, float r2StartX, float r2StartY, float r2Width, float r2Height)
static long CoinsCount(out bool overFlowing, Item[] inv, params int[] ignoreSlots)
static ContainerTransferContext FromUnknown(Player player)
bool CanVisualizeTransfers
Vector2 GetContainerWorldPosition()
static GetItemSettings LootAllSettings
static GetItemSettings LootAllSettingsRegularChest