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

◆ Draw() [1/2]

static void Terraria.UI.ItemSlot.Draw ( SpriteBatch spriteBatch,
Item[] inv,
int context,
int slot,
Vector2 position,
Color lightColor = default(Color) )
inlinestatic

Definition at line 1823 of file ItemSlot.cs.

1824 {
1825 //IL_0016: Unknown result type (might be due to invalid IL or missing references)
1826 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
1827 //IL_001c: Unknown result type (might be due to invalid IL or missing references)
1828 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
1829 //IL_002a: Unknown result type (might be due to invalid IL or missing references)
1830 //IL_002c: Unknown result type (might be due to invalid IL or missing references)
1831 //IL_008a: Unknown result type (might be due to invalid IL or missing references)
1832 //IL_008f: Unknown result type (might be due to invalid IL or missing references)
1833 //IL_0325: Unknown result type (might be due to invalid IL or missing references)
1834 //IL_032a: Unknown result type (might be due to invalid IL or missing references)
1835 //IL_0350: Unknown result type (might be due to invalid IL or missing references)
1836 //IL_0355: Unknown result type (might be due to invalid IL or missing references)
1837 //IL_037b: Unknown result type (might be due to invalid IL or missing references)
1838 //IL_0380: Unknown result type (might be due to invalid IL or missing references)
1839 //IL_02fa: Unknown result type (might be due to invalid IL or missing references)
1840 //IL_02ff: Unknown result type (might be due to invalid IL or missing references)
1841 //IL_04ba: Unknown result type (might be due to invalid IL or missing references)
1842 //IL_04c1: Unknown result type (might be due to invalid IL or missing references)
1843 //IL_04c6: Unknown result type (might be due to invalid IL or missing references)
1844 //IL_0511: Unknown result type (might be due to invalid IL or missing references)
1845 //IL_0518: Unknown result type (might be due to invalid IL or missing references)
1846 //IL_0533: Unknown result type (might be due to invalid IL or missing references)
1847 //IL_053a: Unknown result type (might be due to invalid IL or missing references)
1848 //IL_053f: Unknown result type (might be due to invalid IL or missing references)
1849 //IL_0558: Unknown result type (might be due to invalid IL or missing references)
1850 //IL_0562: Unknown result type (might be due to invalid IL or missing references)
1851 //IL_0567: Unknown result type (might be due to invalid IL or missing references)
1852 //IL_014d: Unknown result type (might be due to invalid IL or missing references)
1853 //IL_0155: Unknown result type (might be due to invalid IL or missing references)
1854 //IL_015a: Unknown result type (might be due to invalid IL or missing references)
1855 //IL_015f: Unknown result type (might be due to invalid IL or missing references)
1856 //IL_065c: Unknown result type (might be due to invalid IL or missing references)
1857 //IL_0661: Unknown result type (might be due to invalid IL or missing references)
1858 //IL_01ea: Unknown result type (might be due to invalid IL or missing references)
1859 //IL_01fe: Unknown result type (might be due to invalid IL or missing references)
1860 //IL_0203: Unknown result type (might be due to invalid IL or missing references)
1861 //IL_01ca: Unknown result type (might be due to invalid IL or missing references)
1862 //IL_01de: Unknown result type (might be due to invalid IL or missing references)
1863 //IL_01e3: Unknown result type (might be due to invalid IL or missing references)
1864 //IL_067c: Unknown result type (might be due to invalid IL or missing references)
1865 //IL_0681: Unknown result type (might be due to invalid IL or missing references)
1866 //IL_0683: Unknown result type (might be due to invalid IL or missing references)
1867 //IL_0687: Unknown result type (might be due to invalid IL or missing references)
1868 //IL_068d: Unknown result type (might be due to invalid IL or missing references)
1869 //IL_0692: Unknown result type (might be due to invalid IL or missing references)
1870 //IL_05c7: Unknown result type (might be due to invalid IL or missing references)
1871 //IL_05ce: Unknown result type (might be due to invalid IL or missing references)
1872 //IL_05d3: Unknown result type (might be due to invalid IL or missing references)
1873 //IL_0208: Unknown result type (might be due to invalid IL or missing references)
1874 //IL_06c0: Unknown result type (might be due to invalid IL or missing references)
1875 //IL_06cc: Unknown result type (might be due to invalid IL or missing references)
1876 //IL_06d5: Unknown result type (might be due to invalid IL or missing references)
1877 //IL_06db: Unknown result type (might be due to invalid IL or missing references)
1878 //IL_0608: Unknown result type (might be due to invalid IL or missing references)
1879 //IL_060f: Unknown result type (might be due to invalid IL or missing references)
1880 //IL_0614: Unknown result type (might be due to invalid IL or missing references)
1881 //IL_062d: Unknown result type (might be due to invalid IL or missing references)
1882 //IL_062f: Unknown result type (might be due to invalid IL or missing references)
1883 //IL_0639: Unknown result type (might be due to invalid IL or missing references)
1884 //IL_063e: Unknown result type (might be due to invalid IL or missing references)
1885 //IL_05e4: Unknown result type (might be due to invalid IL or missing references)
1886 //IL_05eb: Unknown result type (might be due to invalid IL or missing references)
1887 //IL_05f0: Unknown result type (might be due to invalid IL or missing references)
1888 //IL_06b2: Unknown result type (might be due to invalid IL or missing references)
1889 //IL_06b7: Unknown result type (might be due to invalid IL or missing references)
1890 //IL_0904: Unknown result type (might be due to invalid IL or missing references)
1891 //IL_090a: Unknown result type (might be due to invalid IL or missing references)
1892 //IL_090f: Unknown result type (might be due to invalid IL or missing references)
1893 //IL_081f: Unknown result type (might be due to invalid IL or missing references)
1894 //IL_0824: Unknown result type (might be due to invalid IL or missing references)
1895 //IL_0854: Unknown result type (might be due to invalid IL or missing references)
1896 //IL_0858: Unknown result type (might be due to invalid IL or missing references)
1897 //IL_0862: Unknown result type (might be due to invalid IL or missing references)
1898 //IL_0868: Unknown result type (might be due to invalid IL or missing references)
1899 //IL_086d: Unknown result type (might be due to invalid IL or missing references)
1900 //IL_0872: Unknown result type (might be due to invalid IL or missing references)
1901 //IL_0874: Unknown result type (might be due to invalid IL or missing references)
1902 //IL_087e: Unknown result type (might be due to invalid IL or missing references)
1903 //IL_0888: Unknown result type (might be due to invalid IL or missing references)
1904 //IL_088a: Unknown result type (might be due to invalid IL or missing references)
1905 //IL_0894: Unknown result type (might be due to invalid IL or missing references)
1906 //IL_1043: Unknown result type (might be due to invalid IL or missing references)
1907 //IL_1047: Unknown result type (might be due to invalid IL or missing references)
1908 //IL_104d: Unknown result type (might be due to invalid IL or missing references)
1909 //IL_1057: Unknown result type (might be due to invalid IL or missing references)
1910 //IL_105c: Unknown result type (might be due to invalid IL or missing references)
1911 //IL_1063: Unknown result type (might be due to invalid IL or missing references)
1912 //IL_1069: Unknown result type (might be due to invalid IL or missing references)
1913 //IL_1073: Unknown result type (might be due to invalid IL or missing references)
1914 //IL_1078: Unknown result type (might be due to invalid IL or missing references)
1915 //IL_107d: Unknown result type (might be due to invalid IL or missing references)
1916 //IL_1082: Unknown result type (might be due to invalid IL or missing references)
1917 //IL_1096: Unknown result type (might be due to invalid IL or missing references)
1918 //IL_10a2: Unknown result type (might be due to invalid IL or missing references)
1919 //IL_10a8: Unknown result type (might be due to invalid IL or missing references)
1920 //IL_092c: Unknown result type (might be due to invalid IL or missing references)
1921 //IL_092e: Unknown result type (might be due to invalid IL or missing references)
1922 //IL_0935: Unknown result type (might be due to invalid IL or missing references)
1923 //IL_093a: Unknown result type (might be due to invalid IL or missing references)
1924 //IL_0945: Unknown result type (might be due to invalid IL or missing references)
1925 //IL_0966: Unknown result type (might be due to invalid IL or missing references)
1926 //IL_0972: Unknown result type (might be due to invalid IL or missing references)
1927 //IL_0978: Unknown result type (might be due to invalid IL or missing references)
1928 //IL_097d: Unknown result type (might be due to invalid IL or missing references)
1929 //IL_0987: Unknown result type (might be due to invalid IL or missing references)
1930 //IL_0991: Unknown result type (might be due to invalid IL or missing references)
1931 //IL_099c: Unknown result type (might be due to invalid IL or missing references)
1932 //IL_08ac: Unknown result type (might be due to invalid IL or missing references)
1933 //IL_08b0: Unknown result type (might be due to invalid IL or missing references)
1934 //IL_08ba: Unknown result type (might be due to invalid IL or missing references)
1935 //IL_08c0: Unknown result type (might be due to invalid IL or missing references)
1936 //IL_08c5: Unknown result type (might be due to invalid IL or missing references)
1937 //IL_08ca: Unknown result type (might be due to invalid IL or missing references)
1938 //IL_08d1: Unknown result type (might be due to invalid IL or missing references)
1939 //IL_08db: Unknown result type (might be due to invalid IL or missing references)
1940 //IL_08e5: Unknown result type (might be due to invalid IL or missing references)
1941 //IL_08e7: Unknown result type (might be due to invalid IL or missing references)
1942 //IL_08f1: Unknown result type (might be due to invalid IL or missing references)
1943 //IL_1179: Unknown result type (might be due to invalid IL or missing references)
1944 //IL_117b: Unknown result type (might be due to invalid IL or missing references)
1945 //IL_1182: Unknown result type (might be due to invalid IL or missing references)
1946 //IL_1187: Unknown result type (might be due to invalid IL or missing references)
1947 //IL_09cc: Unknown result type (might be due to invalid IL or missing references)
1948 //IL_09d2: Unknown result type (might be due to invalid IL or missing references)
1949 //IL_09d7: Unknown result type (might be due to invalid IL or missing references)
1950 //IL_09f3: Unknown result type (might be due to invalid IL or missing references)
1951 //IL_09f8: Unknown result type (might be due to invalid IL or missing references)
1952 //IL_09fd: Unknown result type (might be due to invalid IL or missing references)
1953 //IL_09ff: Unknown result type (might be due to invalid IL or missing references)
1954 //IL_0a01: Unknown result type (might be due to invalid IL or missing references)
1955 //IL_0a10: Unknown result type (might be due to invalid IL or missing references)
1956 //IL_0a16: Unknown result type (might be due to invalid IL or missing references)
1957 //IL_0a1b: Unknown result type (might be due to invalid IL or missing references)
1958 //IL_0a20: Unknown result type (might be due to invalid IL or missing references)
1959 //IL_0a27: Unknown result type (might be due to invalid IL or missing references)
1960 //IL_0a2d: Unknown result type (might be due to invalid IL or missing references)
1961 //IL_0a2f: Unknown result type (might be due to invalid IL or missing references)
1962 //IL_0a39: Unknown result type (might be due to invalid IL or missing references)
1963 //IL_10eb: Unknown result type (might be due to invalid IL or missing references)
1964 //IL_10f0: Unknown result type (might be due to invalid IL or missing references)
1965 //IL_0a82: Unknown result type (might be due to invalid IL or missing references)
1966 //IL_0a88: Unknown result type (might be due to invalid IL or missing references)
1967 //IL_0a8d: Unknown result type (might be due to invalid IL or missing references)
1968 //IL_1138: Unknown result type (might be due to invalid IL or missing references)
1969 //IL_1144: Unknown result type (might be due to invalid IL or missing references)
1970 //IL_114a: Unknown result type (might be due to invalid IL or missing references)
1971 //IL_114f: Unknown result type (might be due to invalid IL or missing references)
1972 //IL_1154: Unknown result type (might be due to invalid IL or missing references)
1973 //IL_115b: Unknown result type (might be due to invalid IL or missing references)
1974 //IL_1161: Unknown result type (might be due to invalid IL or missing references)
1975 //IL_116c: Unknown result type (might be due to invalid IL or missing references)
1976 //IL_1108: Unknown result type (might be due to invalid IL or missing references)
1977 //IL_110d: Unknown result type (might be due to invalid IL or missing references)
1978 //IL_0ad7: Unknown result type (might be due to invalid IL or missing references)
1979 //IL_0adc: Unknown result type (might be due to invalid IL or missing references)
1980 //IL_0ae1: Unknown result type (might be due to invalid IL or missing references)
1981 //IL_0ae3: Unknown result type (might be due to invalid IL or missing references)
1982 //IL_0ae5: Unknown result type (might be due to invalid IL or missing references)
1983 //IL_0af4: Unknown result type (might be due to invalid IL or missing references)
1984 //IL_0afa: Unknown result type (might be due to invalid IL or missing references)
1985 //IL_0aff: Unknown result type (might be due to invalid IL or missing references)
1986 //IL_0b04: Unknown result type (might be due to invalid IL or missing references)
1987 //IL_0b0b: Unknown result type (might be due to invalid IL or missing references)
1988 //IL_0b11: Unknown result type (might be due to invalid IL or missing references)
1989 //IL_0b13: Unknown result type (might be due to invalid IL or missing references)
1990 //IL_0b1d: Unknown result type (might be due to invalid IL or missing references)
1991 //IL_0b51: Unknown result type (might be due to invalid IL or missing references)
1992 //IL_0b56: Unknown result type (might be due to invalid IL or missing references)
1993 //IL_0b5b: Unknown result type (might be due to invalid IL or missing references)
1994 //IL_0b5d: Unknown result type (might be due to invalid IL or missing references)
1995 //IL_0b5f: Unknown result type (might be due to invalid IL or missing references)
1996 //IL_0b6e: Unknown result type (might be due to invalid IL or missing references)
1997 //IL_0b74: Unknown result type (might be due to invalid IL or missing references)
1998 //IL_0b79: Unknown result type (might be due to invalid IL or missing references)
1999 //IL_0b7e: Unknown result type (might be due to invalid IL or missing references)
2000 //IL_0b85: Unknown result type (might be due to invalid IL or missing references)
2001 //IL_0b8b: Unknown result type (might be due to invalid IL or missing references)
2002 //IL_0b8d: Unknown result type (might be due to invalid IL or missing references)
2003 //IL_0b97: Unknown result type (might be due to invalid IL or missing references)
2004 //IL_0c42: Unknown result type (might be due to invalid IL or missing references)
2005 //IL_0c4e: Unknown result type (might be due to invalid IL or missing references)
2006 //IL_0c54: Unknown result type (might be due to invalid IL or missing references)
2007 //IL_0c59: Unknown result type (might be due to invalid IL or missing references)
2008 //IL_0c5e: Unknown result type (might be due to invalid IL or missing references)
2009 //IL_0c64: Unknown result type (might be due to invalid IL or missing references)
2010 //IL_0c6a: Unknown result type (might be due to invalid IL or missing references)
2011 //IL_0c75: Unknown result type (might be due to invalid IL or missing references)
2012 //IL_0bc8: Unknown result type (might be due to invalid IL or missing references)
2013 //IL_0bcd: Unknown result type (might be due to invalid IL or missing references)
2014 //IL_0bd2: Unknown result type (might be due to invalid IL or missing references)
2015 //IL_0bd4: Unknown result type (might be due to invalid IL or missing references)
2016 //IL_0bd6: Unknown result type (might be due to invalid IL or missing references)
2017 //IL_0be5: Unknown result type (might be due to invalid IL or missing references)
2018 //IL_0beb: Unknown result type (might be due to invalid IL or missing references)
2019 //IL_0bf0: Unknown result type (might be due to invalid IL or missing references)
2020 //IL_0bf5: Unknown result type (might be due to invalid IL or missing references)
2021 //IL_0bfc: Unknown result type (might be due to invalid IL or missing references)
2022 //IL_0c02: Unknown result type (might be due to invalid IL or missing references)
2023 //IL_0c04: Unknown result type (might be due to invalid IL or missing references)
2024 //IL_0c0e: Unknown result type (might be due to invalid IL or missing references)
2025 //IL_0e21: Unknown result type (might be due to invalid IL or missing references)
2026 //IL_0e2d: Unknown result type (might be due to invalid IL or missing references)
2027 //IL_0e33: Unknown result type (might be due to invalid IL or missing references)
2028 //IL_0e38: Unknown result type (might be due to invalid IL or missing references)
2029 //IL_0e3d: Unknown result type (might be due to invalid IL or missing references)
2030 //IL_0e43: Unknown result type (might be due to invalid IL or missing references)
2031 //IL_0e4f: Unknown result type (might be due to invalid IL or missing references)
2032 //IL_0e5a: Unknown result type (might be due to invalid IL or missing references)
2033 //IL_0e96: Unknown result type (might be due to invalid IL or missing references)
2034 //IL_0ea2: Unknown result type (might be due to invalid IL or missing references)
2035 //IL_0ea8: Unknown result type (might be due to invalid IL or missing references)
2036 //IL_0ead: Unknown result type (might be due to invalid IL or missing references)
2037 //IL_0eb2: Unknown result type (might be due to invalid IL or missing references)
2038 //IL_0eb8: Unknown result type (might be due to invalid IL or missing references)
2039 //IL_0ebe: Unknown result type (might be due to invalid IL or missing references)
2040 //IL_0ec9: Unknown result type (might be due to invalid IL or missing references)
2041 //IL_0ee2: Unknown result type (might be due to invalid IL or missing references)
2042 //IL_0ee6: Unknown result type (might be due to invalid IL or missing references)
2043 //IL_0eec: Unknown result type (might be due to invalid IL or missing references)
2044 //IL_0ef6: Unknown result type (might be due to invalid IL or missing references)
2045 //IL_0efb: Unknown result type (might be due to invalid IL or missing references)
2046 //IL_0f0a: Unknown result type (might be due to invalid IL or missing references)
2047 //IL_0f10: Unknown result type (might be due to invalid IL or missing references)
2048 //IL_0f1a: Unknown result type (might be due to invalid IL or missing references)
2049 //IL_0f1f: Unknown result type (might be due to invalid IL or missing references)
2050 //IL_0f24: Unknown result type (might be due to invalid IL or missing references)
2051 //IL_0f27: Unknown result type (might be due to invalid IL or missing references)
2052 //IL_0f28: Unknown result type (might be due to invalid IL or missing references)
2053 //IL_0f3c: Unknown result type (might be due to invalid IL or missing references)
2054 //IL_0f41: Unknown result type (might be due to invalid IL or missing references)
2055 //IL_0f4e: Unknown result type (might be due to invalid IL or missing references)
2056 //IL_0f5a: Unknown result type (might be due to invalid IL or missing references)
2057 //IL_0f63: Unknown result type (might be due to invalid IL or missing references)
2058 //IL_0f69: Unknown result type (might be due to invalid IL or missing references)
2059 //IL_0fae: Unknown result type (might be due to invalid IL or missing references)
2060 //IL_0fb2: Unknown result type (might be due to invalid IL or missing references)
2061 //IL_0fb8: Unknown result type (might be due to invalid IL or missing references)
2062 //IL_0fc2: Unknown result type (might be due to invalid IL or missing references)
2063 //IL_0fc7: Unknown result type (might be due to invalid IL or missing references)
2064 //IL_0fd6: Unknown result type (might be due to invalid IL or missing references)
2065 //IL_0fdc: Unknown result type (might be due to invalid IL or missing references)
2066 //IL_0fe6: Unknown result type (might be due to invalid IL or missing references)
2067 //IL_0feb: Unknown result type (might be due to invalid IL or missing references)
2068 //IL_0ff0: Unknown result type (might be due to invalid IL or missing references)
2069 //IL_0ff2: Unknown result type (might be due to invalid IL or missing references)
2070 //IL_0ff7: Unknown result type (might be due to invalid IL or missing references)
2071 //IL_1004: Unknown result type (might be due to invalid IL or missing references)
2072 //IL_1010: Unknown result type (might be due to invalid IL or missing references)
2073 //IL_1019: Unknown result type (might be due to invalid IL or missing references)
2074 //IL_101f: Unknown result type (might be due to invalid IL or missing references)
2075 Player player = Main.player[Main.myPlayer];
2076 Item item = inv[slot];
2077 float inventoryScale = Main.inventoryScale;
2078 Color color = Color.White;
2079 if (lightColor != Color.Transparent)
2080 {
2081 color = lightColor;
2082 }
2083 bool flag = false;
2084 int num = 0;
2087 {
2088 flag = UILinkPointNavigator.CurrentPoint == gamepadPointForSlot;
2090 {
2091 flag = false;
2092 }
2093 if (context == 0)
2094 {
2095 num = player.DpadRadial.GetDrawMode(slot);
2096 if (num > 0 && !PlayerInput.CurrentProfile.UsingDpadHotbar())
2097 {
2098 num = 0;
2099 }
2100 }
2101 }
2102 Texture2D value = TextureAssets.InventoryBack.Value;
2103 Color color2 = Main.inventoryBack;
2104 bool flag2 = false;
2106 if (item.type > 0 && item.stack > 0 && item.favorited && context != 13 && context != 21 && context != 22 && context != 14)
2107 {
2108 value = TextureAssets.InventoryBack10.Value;
2109 if (context == 32)
2110 {
2111 value = TextureAssets.InventoryBack19.Value;
2112 }
2113 }
2114 else if (item.type > 0 && item.stack > 0 && Options.HighlightNewItems && item.newAndShiny && context != 13 && context != 21 && context != 14 && context != 22)
2115 {
2116 value = TextureAssets.InventoryBack15.Value;
2117 float num5 = (float)(int)Main.mouseTextColor / 255f;
2118 num5 = num5 * 0.2f + 0.8f;
2119 color2 = color2.MultiplyRGBA(new Color(num5, num5, num5));
2120 }
2121 else if (!highlightThingsForMouse && item.type > 0 && item.stack > 0 && num != 0 && context != 13 && context != 21 && context != 22)
2122 {
2123 value = TextureAssets.InventoryBack15.Value;
2124 float num6 = (float)(int)Main.mouseTextColor / 255f;
2125 num6 = num6 * 0.2f + 0.8f;
2126 color2 = ((num != 1) ? color2.MultiplyRGBA(new Color(num6 / 2f, num6, num6 / 2f)) : color2.MultiplyRGBA(new Color(num6, num6 / 2f, num6 / 2f)));
2127 }
2128 else if (context == 0 && slot < 10)
2129 {
2130 value = TextureAssets.InventoryBack9.Value;
2131 }
2132 else
2133 {
2134 switch (context)
2135 {
2136 case 28:
2137 value = TextureAssets.InventoryBack7.Value;
2138 color2 = Color.White;
2139 break;
2140 case 16:
2141 case 17:
2142 case 18:
2143 case 19:
2144 case 20:
2145 value = TextureAssets.InventoryBack3.Value;
2146 break;
2147 case 8:
2148 case 10:
2149 value = TextureAssets.InventoryBack13.Value;
2150 color2 = GetColorByLoadout(slot, context);
2151 break;
2152 case 23:
2153 case 24:
2154 case 26:
2155 value = TextureAssets.InventoryBack8.Value;
2156 break;
2157 case 9:
2158 case 11:
2159 value = TextureAssets.InventoryBack13.Value;
2160 color2 = GetColorByLoadout(slot, context);
2161 break;
2162 case 25:
2163 case 27:
2164 case 33:
2165 value = TextureAssets.InventoryBack12.Value;
2166 break;
2167 case 12:
2168 value = TextureAssets.InventoryBack13.Value;
2169 color2 = GetColorByLoadout(slot, context);
2170 break;
2171 case -12:
2172 case -11:
2173 case -10:
2174 value = LoaderManager.Get<AccessorySlotLoader>().GetBackgroundTexture(slot, context);
2175 break;
2176 case 3:
2177 value = TextureAssets.InventoryBack5.Value;
2178 break;
2179 case 4:
2180 case 32:
2181 value = TextureAssets.InventoryBack2.Value;
2182 break;
2183 case 5:
2184 case 7:
2185 value = TextureAssets.InventoryBack4.Value;
2186 break;
2187 case 6:
2188 value = TextureAssets.InventoryBack7.Value;
2189 break;
2190 case 13:
2191 {
2192 byte b = 200;
2193 if (slot == Main.player[Main.myPlayer].selectedItem)
2194 {
2195 value = TextureAssets.InventoryBack14.Value;
2196 b = byte.MaxValue;
2197 }
2198 ((Color)(ref color2))._002Ector((int)b, (int)b, (int)b, (int)b);
2199 break;
2200 }
2201 case 14:
2202 case 21:
2203 flag2 = true;
2204 break;
2205 case 15:
2206 value = TextureAssets.InventoryBack6.Value;
2207 break;
2208 case 29:
2209 ((Color)(ref color2))._002Ector(53, 69, 127, 255);
2210 value = TextureAssets.InventoryBack18.Value;
2211 break;
2212 case 30:
2213 flag2 = !flag;
2214 break;
2215 case 22:
2216 value = TextureAssets.InventoryBack4.Value;
2218 {
2220 value = TextureAssets.InventoryBack14.Value;
2221 float num7 = (float)(int)((Color)(ref color2)).A / 255f;
2222 num7 = ((!(num7 < 0.7f)) ? 1f : Utils.GetLerpValue(0f, 0.7f, num7, clamped: true));
2223 color2 = Color.White * num7;
2224 }
2225 break;
2226 }
2227 }
2228 if ((context == 0 || context == 2) && inventoryGlowTime[slot] > 0 && !inv[slot].favorited && !inv[slot].IsAir)
2229 {
2230 float num8 = Main.invAlpha / 255f;
2231 Color val = new Color(63, 65, 151, 255) * num8;
2232 Color value4 = Main.hslToRgb(inventoryGlowHue[slot], 1f, 0.5f) * num8;
2233 float num9 = (float)inventoryGlowTime[slot] / 300f;
2234 num9 *= num9;
2235 color2 = Color.Lerp(val, value4, num9 / 2f);
2236 value = TextureAssets.InventoryBack13.Value;
2237 }
2238 if ((context == 4 || context == 32 || context == 3) && inventoryGlowTimeChest[slot] > 0 && !inv[slot].favorited && !inv[slot].IsAir)
2239 {
2240 float num10 = Main.invAlpha / 255f;
2241 Color value5 = new Color(130, 62, 102, 255) * num10;
2242 if (context == 3)
2243 {
2244 value5 = new Color(104, 52, 52, 255) * num10;
2245 }
2246 Color value6 = Main.hslToRgb(inventoryGlowHueChest[slot], 1f, 0.5f) * num10;
2247 float num11 = (float)inventoryGlowTimeChest[slot] / 300f;
2248 num11 *= num11;
2249 color2 = Color.Lerp(value5, value6, num11 / 2f);
2250 value = TextureAssets.InventoryBack13.Value;
2251 }
2252 if (flag)
2253 {
2254 value = TextureAssets.InventoryBack14.Value;
2255 color2 = Color.White;
2256 if (item.favorited)
2257 {
2258 value = TextureAssets.InventoryBack17.Value;
2259 }
2260 }
2261 if (context == 28 && Main.MouseScreen.Between(position, position + value.Size() * inventoryScale) && !player.mouseInterface)
2262 {
2263 value = TextureAssets.InventoryBack14.Value;
2264 color2 = Color.White;
2265 }
2266 if (!flag2)
2267 {
2268 spriteBatch.Draw(value, position, (Rectangle?)null, color2, 0f, default(Vector2), inventoryScale, (SpriteEffects)0, 0f);
2269 }
2270 int num12 = -1;
2271 switch (context)
2272 {
2273 case 8:
2274 case 23:
2275 if (slot == 0)
2276 {
2277 num12 = 0;
2278 }
2279 if (slot == 1)
2280 {
2281 num12 = 6;
2282 }
2283 if (slot == 2)
2284 {
2285 num12 = 12;
2286 }
2287 break;
2288 case 26:
2289 num12 = 0;
2290 break;
2291 case 9:
2292 if (slot == 10)
2293 {
2294 num12 = 3;
2295 }
2296 if (slot == 11)
2297 {
2298 num12 = 9;
2299 }
2300 if (slot == 12)
2301 {
2302 num12 = 15;
2303 }
2304 break;
2305 case 10:
2306 case 24:
2307 num12 = 11;
2308 break;
2309 case 11:
2310 num12 = 2;
2311 break;
2312 case 12:
2313 case 25:
2314 case 27:
2315 case 33:
2316 num12 = 1;
2317 break;
2318 case -10:
2319 num12 = 11;
2320 break;
2321 case -11:
2322 num12 = 2;
2323 break;
2324 case -12:
2325 num12 = 1;
2326 break;
2327 case 16:
2328 num12 = 4;
2329 break;
2330 case 17:
2331 num12 = 13;
2332 break;
2333 case 19:
2334 num12 = 10;
2335 break;
2336 case 18:
2337 num12 = 7;
2338 break;
2339 case 20:
2340 num12 = 17;
2341 break;
2342 }
2343 if ((item.type <= 0 || item.stack <= 0) && num12 != -1)
2344 {
2345 Texture2D value7 = TextureAssets.Extra[54].Value;
2346 Rectangle rectangle = value7.Frame(3, 6, num12 % 3, num12 / 3);
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() / 2f * inventoryScale, rectangle, Color.White * 0.35f, 0f, rectangle.Size() / 2f, inventoryScale, (SpriteEffects)0, 0f, slot, context);
2352 }
2353 else
2354 {
2355 spriteBatch.Draw(value7, position + value.Size() / 2f * inventoryScale, (Rectangle?)rectangle, Color.White * 0.35f, 0f, rectangle.Size() / 2f, inventoryScale, (SpriteEffects)0, 0f);
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 / 2f, inventoryScale, 32f, color);
2362 if (ItemID.Sets.TrapSigned[item.type])
2363 {
2364 spriteBatch.Draw(TextureAssets.Wire.Value, position + new Vector2(40f, 40f) * inventoryScale, (Rectangle?)new Rectangle(4, 58, 8, 8), color, 0f, new Vector2(4f), 1f, (SpriteEffects)0, 0f);
2365 }
2366 if (ItemID.Sets.DrawUnsafeIndicator[item.type])
2367 {
2368 Vector2 vector2 = new Vector2(-4f, -4f) * inventoryScale;
2369 Texture2D value8 = TextureAssets.Extra[258].Value;
2370 Rectangle rectangle2 = value8.Frame();
2371 spriteBatch.Draw(value8, position + vector2 + new Vector2(40f, 40f) * inventoryScale, (Rectangle?)rectangle2, color, 0f, rectangle2.Size() / 2f, 1f, (SpriteEffects)0, 0f);
2372 }
2373 if (item.type == 5324 || item.type == 5329 || item.type == 5330)
2374 {
2375 Vector2 vector3 = new Vector2(2f, -6f) * inventoryScale;
2376 switch (item.type)
2377 {
2378 case 5324:
2379 {
2380 Texture2D value2 = TextureAssets.Extra[257].Value;
2381 Rectangle rectangle5 = value2.Frame(3, 1, 2);
2382 spriteBatch.Draw(value2, position + vector3 + new Vector2(40f, 40f) * inventoryScale, (Rectangle?)rectangle5, color, 0f, rectangle5.Size() / 2f, 1f, (SpriteEffects)0, 0f);
2383 break;
2384 }
2385 case 5329:
2386 {
2387 Texture2D value10 = TextureAssets.Extra[257].Value;
2388 Rectangle rectangle4 = value10.Frame(3, 1, 1);
2389 spriteBatch.Draw(value10, position + vector3 + new Vector2(40f, 40f) * inventoryScale, (Rectangle?)rectangle4, color, 0f, rectangle4.Size() / 2f, 1f, (SpriteEffects)0, 0f);
2390 break;
2391 }
2392 case 5330:
2393 {
2394 Texture2D value9 = TextureAssets.Extra[257].Value;
2395 Rectangle rectangle3 = value9.Frame(3);
2396 spriteBatch.Draw(value9, position + vector3 + new Vector2(40f, 40f) * inventoryScale, (Rectangle?)rectangle3, color, 0f, rectangle3.Size() / 2f, 1f, (SpriteEffects)0, 0f);
2397 break;
2398 }
2399 }
2400 }
2401 if (item.stack > 1)
2402 {
2403 ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.ItemStack.Value, item.stack.ToString(), position + new Vector2(10f, 26f) * inventoryScale, color, 0f, Vector2.Zero, new Vector2(inventoryScale), -1f, inventoryScale);
2404 }
2405 int num2 = -1;
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 {
2414 num2 += inv[i].stack;
2415 }
2416 }
2417 if (num2 >= 0)
2418 {
2419 num2++;
2420 }
2421 }
2422 if (item.useAmmo > 0)
2423 {
2424 _ = item.useAmmo;
2425 num2 = 0;
2426 for (int j = 0; j < 58; j++)
2427 {
2428 if (inv[j].stack > 0 && ItemLoader.CanChooseAmmo(item, inv[j], player))
2429 {
2430 num2 += inv[j].stack;
2431 }
2432 }
2433 }
2434 if (item.fishingPole > 0)
2435 {
2436 num2 = 0;
2437 for (int k = 0; k < 58; k++)
2438 {
2439 if (inv[k].bait > 0)
2440 {
2441 num2 += inv[k].stack;
2442 }
2443 }
2444 }
2445 if (item.tileWand > 0)
2446 {
2447 int tileWand = item.tileWand;
2448 num2 = 0;
2449 for (int l = 0; l < 58; l++)
2450 {
2451 if (inv[l].type == tileWand)
2452 {
2453 num2 += inv[l].stack;
2454 }
2455 }
2456 }
2457 if (item.type == 509 || item.type == 851 || item.type == 850 || item.type == 3612 || item.type == 3625 || item.type == 3611)
2458 {
2459 num2 = 0;
2460 for (int m = 0; m < 58; m++)
2461 {
2462 if (inv[m].type == 530)
2463 {
2464 num2 += inv[m].stack;
2465 }
2466 }
2467 }
2468 }
2469 if (num2 != -1)
2470 {
2471 ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.ItemStack.Value, num2.ToString(), position + new Vector2(8f, 30f) * inventoryScale, color, 0f, Vector2.Zero, new Vector2(inventoryScale * 0.8f), -1f, 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(8f, 4f) * inventoryScale, color, 0f, Vector2.Zero, new Vector2(inventoryScale), -1f, inventoryScale);
2481 }
2482 if (context == 13 && item.potion)
2483 {
2484 Vector2 position2 = position + value.Size() * inventoryScale / 2f - TextureAssets.Cd.Value.Size() * inventoryScale / 2f;
2485 Color color3 = item.GetAlpha(color) * ((float)player.potionDelay / (float)player.potionDelayTime);
2486 spriteBatch.Draw(TextureAssets.Cd.Value, position2, (Rectangle?)null, color3, 0f, default(Vector2), scale, (SpriteEffects)0, 0f);
2487 }
2488 if ((Math.Abs(context) == 10 || context == 18) && ((item.expertOnly && !Main.expertMode) || (item.masterOnly && !Main.masterMode)))
2489 {
2490 Vector2 position3 = position + value.Size() * inventoryScale / 2f - TextureAssets.Cd.Value.Size() * inventoryScale / 2f;
2491 Color white = Color.White;
2492 spriteBatch.Draw(TextureAssets.Cd.Value, position3, (Rectangle?)null, white, 0f, default(Vector2), scale, (SpriteEffects)0, 0f);
2493 }
2494 }
2495 else if (context == 6)
2496 {
2497 Texture2D value3 = TextureAssets.Trash.Value;
2498 Vector2 position4 = position + value.Size() * inventoryScale / 2f - value3.Size() * inventoryScale / 2f;
2499 spriteBatch.Draw(value3, position4, (Rectangle?)null, new Color(100, 100, 100, 100), 0f, default(Vector2), inventoryScale, (SpriteEffects)0, 0f);
2500 }
2501 if (context == 0 && slot < 10)
2502 {
2503 float num3 = inventoryScale;
2504 string text2 = string.Concat(slot + 1);
2505 if (text2 == "10")
2506 {
2507 text2 = "0";
2508 }
2509 Color baseColor = Main.inventoryBack;
2510 int num4 = 0;
2511 if (Main.player[Main.myPlayer].selectedItem == slot)
2512 {
2513 baseColor = Color.White;
2514 ((Color)(ref baseColor)).A = 200;
2515 num4 -= 2;
2516 num3 *= 1.4f;
2517 }
2518 ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.ItemStack.Value, text2, position + new Vector2(6f, (float)(4 + num4)) * inventoryScale, baseColor, 0f, Vector2.Zero, new Vector2(inventoryScale), -1f, inventoryScale);
2519 }
2520 if (gamepadPointForSlot != -1)
2521 {
2523 }
2524 }
static Asset< DynamicSpriteFont > ItemStack
Definition FontAssets.cs:8
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 PlayerInputProfile CurrentProfile
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...
Definition ItemID.cs:1313
static bool[] DrawUnsafeIndicator
If true for a given item type (F:Terraria.Item.type), then that item will have a small skull icon (F:...
Definition ItemID.cs:123
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....
Definition ItemLoader.cs:26
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
Definition ItemSlot.cs:151
static Color GetColorByLoadout(int slot, int context)
Definition ItemSlot.cs:2526
static float DrawItemIcon(Item item, int context, SpriteBatch spriteBatch, Vector2 screenPositionForItemCenter, float scale, float sizeLimit, Color environmentColor)
Definition ItemSlot.cs:2597
static int[] inventoryGlowTime
Definition ItemSlot.cs:149
static int[] inventoryGlowTimeChest
Definition ItemSlot.cs:153
static bool DrawGoldBGForCraftingMaterial
Definition ItemSlot.cs:137
static float[] inventoryGlowHue
Definition ItemSlot.cs:147
static int GetGamepadPointForSlot(Item[] inv, int context, int slot)
Definition ItemSlot.cs:2715

References Terraria.ModLoader.ItemLoader.CanChooseAmmo(), Terraria.GameContent.TextureAssets.Cd, Terraria.GameInput.PlayerInput.CurrentProfile, Terraria.Item.DD2Summon, Terraria.Player.DpadRadial, Terraria.UI.Chat.ChatManager.DrawColorCodedStringWithShadow(), Terraria.UI.ItemSlot.DrawGoldBGForCraftingMaterial, Terraria.UI.ItemSlot.DrawItemIcon(), Terraria.ID.ItemID.Sets.DrawUnsafeIndicator, Terraria.Main.expertMode, Terraria.Item.expertOnly, Terraria.GameContent.TextureAssets.Extra, Terraria.Item.favorited, Terraria.Item.fishingPole, Terraria.Item.GetAlpha(), Terraria.UI.ItemSlot.GetColorByLoadout(), Terraria.Player.SelectionRadial.GetDrawMode(), Terraria.UI.ItemSlot.GetGamepadPointForSlot(), Terraria.Utils.GetLerpValue(), Terraria.UI.ItemSlot.Options.HighlightNewItems, Terraria.GameInput.PlayerInput.SettingsForUI.HighlightThingsForMouse, Terraria.Main.hslToRgb(), Terraria.GameContent.TextureAssets.InventoryBack, Terraria.Main.inventoryBack, Terraria.GameContent.TextureAssets.InventoryBack10, Terraria.GameContent.TextureAssets.InventoryBack12, Terraria.GameContent.TextureAssets.InventoryBack13, Terraria.GameContent.TextureAssets.InventoryBack14, Terraria.GameContent.TextureAssets.InventoryBack15, Terraria.GameContent.TextureAssets.InventoryBack17, Terraria.GameContent.TextureAssets.InventoryBack18, Terraria.GameContent.TextureAssets.InventoryBack19, Terraria.GameContent.TextureAssets.InventoryBack2, Terraria.GameContent.TextureAssets.InventoryBack3, Terraria.GameContent.TextureAssets.InventoryBack4, Terraria.GameContent.TextureAssets.InventoryBack5, Terraria.GameContent.TextureAssets.InventoryBack6, Terraria.GameContent.TextureAssets.InventoryBack7, Terraria.GameContent.TextureAssets.InventoryBack8, Terraria.GameContent.TextureAssets.InventoryBack9, Terraria.UI.ItemSlot.inventoryGlowHue, Terraria.UI.ItemSlot.inventoryGlowHueChest, Terraria.UI.ItemSlot.inventoryGlowTime, Terraria.UI.ItemSlot.inventoryGlowTimeChest, Terraria.Main.inventoryScale, Terraria.GameContent.FontAssets.ItemStack, Terraria.Main.masterMode, Terraria.Player.mouseInterface, Terraria.Main.MouseScreen, Terraria.Main.myPlayer, Terraria.Item.newAndShiny, Terraria.Main.player, Terraria.Item.potion, Terraria.Player.potionDelay, Terraria.Player.potionDelayTime, Terraria.GameInput.PlayerInput.SettingsForUI.PreventHighlightsForGamepad, Terraria.UI.Gamepad.UILinkPointNavigator.SetPosition(), Terraria.Item.stack, Terraria.Item.tileWand, Terraria.ID.ItemID.Sets.TrapSigned, Terraria.GameContent.TextureAssets.Trash, Terraria.Item.type, Terraria.Item.useAmmo, Terraria.GameInput.PlayerInput.UsingGamepadUI, and Terraria.GameContent.TextureAssets.Wire.

+ Here is the call graph for this function: