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

◆ DrawSavings()

static void Terraria.GameContent.UI.CustomCurrencyManager.DrawSavings ( SpriteBatch sb,
int currencyIndex,
float shopx,
float shopy,
bool horizontal = false )
inlinestatic

Definition at line 28 of file CustomCurrencyManager.cs.

29 {
30 CustomCurrencySystem customCurrencySystem = _currencies[currencyIndex];
31 Player player = Main.player[Main.myPlayer];
32 bool overFlowing;
33 long num = customCurrencySystem.CountCurrency(out overFlowing, player.bank.item);
34 long num2 = customCurrencySystem.CountCurrency(out overFlowing, player.bank2.item);
35 long num3 = customCurrencySystem.CountCurrency(out overFlowing, player.bank3.item);
36 long num4 = customCurrencySystem.CountCurrency(out overFlowing, player.bank4.item);
37 long num5 = customCurrencySystem.CombineStacks(out overFlowing, num, num2, num3, num4);
38 if (num5 > 0)
39 {
40 Main.GetItemDrawFrame(4076, out var itemTexture, out var itemFrame);
41 Main.GetItemDrawFrame(3813, out var itemTexture2, out var itemFrame2);
42 Main.GetItemDrawFrame(346, out var itemTexture3, out var itemFrame3);
43 Main.GetItemDrawFrame(87, out var itemTexture4, out var itemFrame4);
44 if (num4 > 0)
45 {
46 sb.Draw(itemTexture, Utils.CenteredRectangle(new Vector2(shopx + 96f, shopy + 50f), itemFrame.Size() * 0.65f), null, Color.White);
47 }
48 if (num3 > 0)
49 {
50 sb.Draw(itemTexture2, Utils.CenteredRectangle(new Vector2(shopx + 80f, shopy + 50f), itemFrame2.Size() * 0.65f), null, Color.White);
51 }
52 if (num2 > 0)
53 {
54 sb.Draw(itemTexture3, Utils.CenteredRectangle(new Vector2(shopx + 80f, shopy + 50f), itemFrame3.Size() * 0.65f), null, Color.White);
55 }
56 if (num > 0)
57 {
58 sb.Draw(itemTexture4, Utils.CenteredRectangle(new Vector2(shopx + 70f, shopy + 60f), itemFrame4.Size() * 0.65f), null, Color.White);
59 }
60 Utils.DrawBorderStringFourWay(sb, FontAssets.MouseText.Value, Lang.inter[66].Value, shopx, shopy + 40f, Color.White * ((float)(int)Main.mouseTextColor / 255f), Color.Black, Vector2.Zero);
61 customCurrencySystem.DrawSavingsMoney(sb, Lang.inter[66].Value, shopx, shopy, num5, horizontal);
62 }
63 }
void Draw(Texture2D texture, Vector2 position, Color color)
static Dictionary< int, CustomCurrencySystem > _currencies

References Terraria.GameContent.UI.CustomCurrencyManager._currencies, Terraria.Player.bank, Terraria.Player.bank2, Terraria.Player.bank3, Terraria.Player.bank4, Microsoft.Xna.Framework.Color.Black, Terraria.Utils.CenteredRectangle(), Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw(), Terraria.Utils.DrawBorderStringFourWay(), Terraria.Main.GetItemDrawFrame(), Terraria.Lang.inter, Terraria.Chest.item, Terraria.GameContent.FontAssets.MouseText, Terraria.Main.mouseTextColor, Terraria.Main.myPlayer, Terraria.Main.player, Microsoft.Xna.Framework.Color.White, and Microsoft.Xna.Framework.Vector2.Zero.

Referenced by Terraria.UI.ItemSlot.DrawSavings().