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

◆ DrawItem_GetBasics()

void Terraria.Main.DrawItem_GetBasics ( Item item,
int slot,
out Texture2D texture,
out Microsoft::Xna::Framework::Rectangle frame,
out Microsoft::Xna::Framework::Rectangle glowmaskFrame )
inlineprivate

Definition at line 35184 of file Main.cs.

35185 {
35186 LoadItem(item.type);
35188 {
35189 DrawItem_AnimateSlot(slot, itemAnimations[item.type].TicksPerFrame, itemAnimations[item.type].FrameCount);
35190 texture = TextureAssets.Item[item.type].Value;
35191 }
35192 else if (ItemID.Sets.IsFood[item.type])
35193 {
35194 texture = TextureAssets.Item[item.type].Value;
35195 }
35196 else
35197 {
35198 switch (item.type)
35199 {
35200 case 5358:
35201 case 5359:
35202 case 5360:
35203 case 5361:
35204 LoadItem(5437);
35205 texture = TextureAssets.Item[5437].Value;
35206 break;
35207 case 71:
35208 case 72:
35209 case 73:
35210 case 74:
35211 {
35212 int num = item.type - 71;
35213 texture = TextureAssets.Coin[num].Value;
35215 frame = (glowmaskFrame = _coinOnWorldAnimation.GetFrame(texture, itemFrameCounter[slot]));
35216 return;
35217 }
35218 case 3858:
35219 texture = TextureAssets.Item[item.type].Value;
35221 frame = texture.Frame();
35222 glowmaskFrame = TextureAssets.GlowMask[233].Value.Frame(1, 3, 0, itemFrameCounter[slot] / 5);
35223 glowmaskFrame.Height -= 2;
35224 return;
35225 case 75:
35226 texture = TextureAssets.Item[item.type].Value;
35227 DrawItem_AnimateSlot(slot, itemAnimations[item.type].TicksPerFrame, itemAnimations[item.type].FrameCount * 2 - 1);
35228 break;
35229 default:
35230 texture = TextureAssets.Item[item.type].Value;
35231 break;
35232 }
35233 }
35234 if (itemAnimations[item.type] != null)
35235 {
35236 frame = (glowmaskFrame = itemAnimations[item.type].GetFrame(texture, itemFrameCounter[slot]));
35237 }
35238 else
35239 {
35240 frame = (glowmaskFrame = texture.Frame());
35241 }
35242 }
static Asset< Texture2D >[] GlowMask
static Asset< Texture2D >[] Item
static Asset< Texture2D >[] Coin
static bool[] AnimatesAsSoul
Definition ItemID.cs:1060
static bool[] NebulaPickup
Definition ItemID.cs:1058
static bool[] IsFood
Definition ItemID.cs:233
static DrawAnimation _coinOnWorldAnimation
Definition Main.cs:1709
static Item[] item
Definition Main.cs:1681
void DrawItem_AnimateSlot(int slot, int gameFramesPerSpriteFrame, int spriteFramesAmount)
Definition Main.cs:35244
void LoadItem(int i)
Definition Main.cs:56023
static DrawAnimation[] itemAnimations
Definition Main.cs:1707
static int[] itemFrameCounter
Definition Main.cs:1705

References Terraria.Main._coinOnWorldAnimation, Terraria.ID.ItemID.Sets.AnimatesAsSoul, Terraria.GameContent.TextureAssets.Coin, Terraria.Main.DrawItem_AnimateSlot(), Terraria.GameContent.TextureAssets.GlowMask, Terraria.ID.ItemID.Sets.IsFood, Terraria.GameContent.TextureAssets.Item, Terraria.Main.item, Terraria.Main.itemAnimations, Terraria.Main.itemFrameCounter, Terraria.Main.LoadItem(), and Terraria.ID.ItemID.Sets.NebulaPickup.

Referenced by Terraria.Main.DrawItem().