1824 {
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075 Player player = Main.player[Main.myPlayer];
2077 float inventoryScale = Main.inventoryScale;
2078 Color color = Color.White;
2079 if (lightColor != Color.Transparent)
2080 {
2081 color = lightColor;
2082 }
2087 {
2090 {
2092 }
2093 if (context == 0)
2094 {
2095 num = player.DpadRadial.GetDrawMode(
slot);
2097 {
2099 }
2100 }
2101 }
2103 Color
color2 = Main.inventoryBack;
2106 if (item.type > 0 && item.stack > 0 && item.favorited && context != 13 && context != 21 && context != 22 && context != 14)
2107 {
2109 if (context == 32)
2110 {
2112 }
2113 }
2114 else if (item.type > 0 && item.stack > 0 && Options.HighlightNewItems && item.newAndShiny && context != 13 && context != 21 && context != 14 && context != 22)
2115 {
2117 float num5 = (float)(
int)Main.mouseTextColor / 255
f;
2120 }
2121 else if (!
highlightThingsForMouse && item.type > 0 && item.stack > 0 &&
num != 0 && context != 13 && context != 21 && context != 22)
2122 {
2124 float num6 = (float)(
int)Main.mouseTextColor / 255
f;
2127 }
2128 else if (context == 0 &&
slot < 10)
2129 {
2131 }
2132 else
2133 {
2134 switch (context)
2135 {
2136 case 28:
2139 break;
2140 case 16:
2141 case 17:
2142 case 18:
2143 case 19:
2144 case 20:
2146 break;
2147 case 8:
2148 case 10:
2151 break;
2152 case 23:
2153 case 24:
2154 case 26:
2156 break;
2157 case 9:
2158 case 11:
2161 break;
2162 case 25:
2163 case 27:
2164 case 33:
2166 break;
2167 case 12:
2170 break;
2171 case -12:
2172 case -11:
2173 case -10:
2175 break;
2176 case 3:
2178 break;
2179 case 4:
2180 case 32:
2182 break;
2183 case 5:
2184 case 7:
2186 break;
2187 case 6:
2189 break;
2190 case 13:
2191 {
2193 if (
slot == Main.player[Main.myPlayer].selectedItem)
2194 {
2197 }
2199 break;
2200 }
2201 case 14:
2202 case 21:
2204 break;
2205 case 15:
2207 break;
2208 case 29:
2211 break;
2212 case 30:
2214 break;
2215 case 22:
2218 {
2224 }
2225 break;
2226 }
2227 }
2229 {
2230 float num8 = Main.invAlpha / 255
f;
2231 Color
val =
new Color(63, 65, 151, 255) *
num8;
2237 }
2239 {
2240 float num10 = Main.invAlpha / 255
f;
2241 Color
value5 =
new Color(130, 62, 102, 255) *
num10;
2242 if (context == 3)
2243 {
2245 }
2251 }
2253 {
2256 if (item.favorited)
2257 {
2259 }
2260 }
2261 if (context == 28 && Main.MouseScreen.Between(position, position + value.Size() * inventoryScale) && !player.mouseInterface)
2262 {
2265 }
2267 {
2268 spriteBatch.Draw(value, position, (Rectangle?)
null,
color2, 0
f,
default(Vector2), inventoryScale, (SpriteEffects)0, 0
f);
2269 }
2271 switch (context)
2272 {
2273 case 8:
2274 case 23:
2276 {
2278 }
2280 {
2282 }
2284 {
2286 }
2287 break;
2288 case 26:
2290 break;
2291 case 9:
2293 {
2295 }
2297 {
2299 }
2301 {
2303 }
2304 break;
2305 case 10:
2306 case 24:
2308 break;
2309 case 11:
2311 break;
2312 case 12:
2313 case 25:
2314 case 27:
2315 case 33:
2317 break;
2318 case -10:
2320 break;
2321 case -11:
2323 break;
2324 case -12:
2326 break;
2327 case 16:
2329 break;
2330 case 17:
2332 break;
2333 case 19:
2335 break;
2336 case 18:
2338 break;
2339 case 20:
2341 break;
2342 }
2343 if ((item.type <= 0 || item.stack <= 0) &&
num12 != -1)
2344 {
2347 rectangle.Width -= 2;
2348 rectangle.Height -= 2;
2349 if (context == -10 || context == -11 || context == -12)
2350 {
2351 LoaderManager.Get<
AccessorySlotLoader>().DrawSlotTexture(
value7, position + value.Size() / 2
f * inventoryScale,
rectangle, Color.White * 0.35f, 0
f,
rectangle.Size() / 2
f, inventoryScale, (SpriteEffects)0, 0
f,
slot, context);
2352 }
2353 else
2354 {
2355 spriteBatch.Draw(
value7, position + value.Size() / 2
f * inventoryScale, (Rectangle?)
rectangle, Color.White * 0.35f, 0
f,
rectangle.Size() / 2
f, inventoryScale, (SpriteEffects)0, 0
f);
2356 }
2357 }
2358 Vector2
vector = value.Size() * inventoryScale;
2359 if (item.type > 0 && item.stack > 0)
2360 {
2361 float scale =
DrawItemIcon(item, context, spriteBatch, position +
vector / 2
f, inventoryScale, 32
f, color);
2363 {
2364 spriteBatch.Draw(
TextureAssets.
Wire.Value, position +
new Vector2(40
f, 40
f) * inventoryScale, (Rectangle?)
new Rectangle(4, 58, 8, 8), color, 0
f,
new Vector2(4
f), 1
f, (SpriteEffects)0, 0
f);
2365 }
2367 {
2368 Vector2
vector2 =
new Vector2(-4
f, -4
f) * inventoryScale;
2372 }
2373 if (item.type == 5324 || item.type == 5329 || item.type == 5330)
2374 {
2375 Vector2
vector3 =
new Vector2(2
f, -6
f) * inventoryScale;
2376 switch (item.type)
2377 {
2378 case 5324:
2379 {
2383 break;
2384 }
2385 case 5329:
2386 {
2390 break;
2391 }
2392 case 5330:
2393 {
2397 break;
2398 }
2399 }
2400 }
2401 if (item.stack > 1)
2402 {
2403 ChatManager.
DrawColorCodedStringWithShadow(spriteBatch,
FontAssets.
ItemStack.Value, item.stack.ToString(), position +
new Vector2(10
f, 26
f) * inventoryScale, color, 0
f, Vector2.Zero,
new Vector2(inventoryScale), -1
f, inventoryScale);
2404 }
2406 if (context == 13)
2407 {
2408 if (item.DD2Summon)
2409 {
2410 for (int i = 0; i < 58; i++)
2411 {
2412 if (
inv[i].type == 3822)
2413 {
2415 }
2416 }
2418 {
2420 }
2421 }
2422 if (item.useAmmo > 0)
2423 {
2426 for (
int j = 0;
j < 58;
j++)
2427 {
2429 {
2431 }
2432 }
2433 }
2434 if (item.fishingPole > 0)
2435 {
2437 for (
int k = 0;
k < 58;
k++)
2438 {
2439 if (
inv[
k].bait > 0)
2440 {
2442 }
2443 }
2444 }
2445 if (item.tileWand > 0)
2446 {
2447 int tileWand = item.tileWand;
2449 for (
int l = 0;
l < 58;
l++)
2450 {
2451 if (
inv[
l].type == tileWand)
2452 {
2454 }
2455 }
2456 }
2457 if (item.type == 509 || item.type == 851 || item.type == 850 || item.type == 3612 || item.type == 3625 || item.type == 3611)
2458 {
2460 for (
int m = 0;
m < 58;
m++)
2461 {
2462 if (
inv[
m].type == 530)
2463 {
2465 }
2466 }
2467 }
2468 }
2470 {
2471 ChatManager.
DrawColorCodedStringWithShadow(spriteBatch,
FontAssets.
ItemStack.Value,
num2.ToString(), position +
new Vector2(8
f, 30
f) * inventoryScale, color, 0
f, Vector2.Zero,
new Vector2(inventoryScale * 0.8
f), -1
f, inventoryScale);
2472 }
2473 if (context == 13)
2474 {
2475 string text =
string.Concat(
slot + 1);
2476 if (text == "10")
2477 {
2478 text = "0";
2479 }
2480 ChatManager.
DrawColorCodedStringWithShadow(spriteBatch,
FontAssets.
ItemStack.Value, text, position +
new Vector2(8
f, 4
f) * inventoryScale, color, 0
f, Vector2.Zero,
new Vector2(inventoryScale), -1
f, inventoryScale);
2481 }
2482 if (context == 13 && item.potion)
2483 {
2485 Color
color3 = item.GetAlpha(color) * ((float)player.potionDelay / (
float)player.potionDelayTime);
2487 }
2488 if ((
Math.Abs(context) == 10 || context == 18) && ((item.expertOnly && !Main.expertMode) || (item.masterOnly && !Main.masterMode)))
2489 {
2491 Color
white = Color.White;
2493 }
2494 }
2495 else if (context == 6)
2496 {
2498 Vector2
position4 = position + value.Size() * inventoryScale / 2
f -
value3.Size() * inventoryScale / 2
f;
2499 spriteBatch.Draw(
value3,
position4, (Rectangle?)
null,
new Color(100, 100, 100, 100), 0
f,
default(Vector2), inventoryScale, (SpriteEffects)0, 0
f);
2500 }
2501 if (context == 0 &&
slot < 10)
2502 {
2503 float num3 = inventoryScale;
2506 {
2508 }
2511 if (Main.player[Main.myPlayer].selectedItem ==
slot)
2512 {
2517 }
2518 ChatManager.
DrawColorCodedStringWithShadow(spriteBatch,
FontAssets.
ItemStack.Value,
text2, position +
new Vector2(6
f, (
float)(4 +
num4)) * inventoryScale,
baseColor, 0
f, Vector2.Zero,
new Vector2(inventoryScale), -1
f, inventoryScale);
2519 }
2521 {
2523 }
2524 }
static Asset< DynamicSpriteFont > ItemStack
static Asset< Texture2D > InventoryBack13
static Asset< Texture2D > InventoryBack7
static Asset< Texture2D > InventoryBack8
static Asset< Texture2D > InventoryBack9
static Asset< Texture2D > InventoryBack
static Asset< Texture2D > Cd
static Asset< Texture2D > InventoryBack5
static Asset< Texture2D > Trash
static Asset< Texture2D > InventoryBack4
static Asset< Texture2D > InventoryBack14
static Asset< Texture2D > InventoryBack6
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 bool[] TrapSigned
If true for a given item type (F:Terraria.Item.type), then that item will have a small wire icon (F:T...
static bool[] DrawUnsafeIndicator
If true for a given item type (F:Terraria.Item.type), then that item will have a small skull icon (F:...
This serves as a central place to store equipment slots and their corresponding textures....
static bool CanChooseAmmo(Item weapon, Item ammo, Player player)
Calls each M:Terraria.ModLoader.GlobalItem.CanChooseAmmo(Terraria.Item,Terraria.Item,...
This serves as the central class from which item-related functions are carried out....
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 void SetPosition(int ID, Vector2 Position)
static float[] inventoryGlowHueChest
static Color GetColorByLoadout(int slot, int context)
static float DrawItemIcon(Item item, int context, SpriteBatch spriteBatch, Vector2 screenPositionForItemCenter, float scale, float sizeLimit, Color environmentColor)
static int[] inventoryGlowTime
static int[] inventoryGlowTimeChest
static bool DrawGoldBGForCraftingMaterial
static float[] inventoryGlowHue
static int GetGamepadPointForSlot(Item[] inv, int context, int slot)