Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ GetInfoAccIconPosition()

static void Terraria.Main.GetInfoAccIconPosition ( int drawnCount,
int StartX,
out int X,
out int Y )
inlinestaticprivate

Definition at line 44234 of file Main.cs.

44235 {
44236 if (!playerInventory)
44237 {
44238 X = screenWidth - 280;
44239 Y = -32;
44240 if (mapStyle == 1 && mapEnabled)
44241 {
44242 Y += 261;
44243 }
44244 }
44246 {
44247 X = screenWidth - 280 + 20 * drawnCount - 10;
44248 Y = 94;
44249 if (mapStyle == 1 && mapEnabled)
44250 {
44251 Y += 261;
44252 }
44253 }
44254 else
44255 {
44256 int num = (int)(52f * inventoryScale);
44257 float num2 = 0.85f;
44258 int num3 = (int)(52f * num2);
44261 int num4 = (int)Math.Ceiling((float)nPCS_IconsTotal / (float)nPCS_IconsPerColumn);
44264 int num7 = Math.Max(0, num4 - 4);
44265 if (num4 >= 4 && num6 < 5)
44266 {
44267 num7++;
44268 }
44269 int num8 = num7 * (num3 + 4);
44270 if (EquipPage != 1)
44271 {
44272 num8 = 0;
44273 }
44274 X = 697 - num * 4 + screenWidth - 800 + 20 * (drawnCount % 2) - num8;
44275 Y = 114 + mH + num * 7 + num / 2 + 20 * (drawnCount / 2) + 8 * (drawnCount / 4) - 20;
44276 if (EquipPage == 2)
44277 {
44278 X += num + num / 2;
44279 Y -= num;
44280 }
44281 }
44282 X += StartX;
44283 }
static double Ceiling(double a)
static byte Max(byte val1, byte val2)
Definition Math.cs:738
static bool ShouldDrawInfoIconsHorizontally
Definition Main.cs:2890
static int mapStyle
Definition Main.cs:908
static float inventoryScale
Definition Main.cs:1779
static bool mapEnabled
Definition Main.cs:906
static bool playerInventory
Definition Main.cs:1759
static int screenWidth
Definition Main.cs:1719
static int mH
Definition Main.cs:2455
static int EquipPage
Definition Main.cs:820

References System.Math.Ceiling(), Terraria.Main.EquipPage, Terraria.Main.inventoryScale, Terraria.Main.mapEnabled, Terraria.Main.mapStyle, System.Math.Max(), Terraria.Main.mH, Terraria.UI.Gamepad.UILinkPointNavigator.Shortcuts.NPCS_IconsPerColumn, Terraria.UI.Gamepad.UILinkPointNavigator.Shortcuts.NPCS_IconsTotal, Terraria.Main.playerInventory, Terraria.Main.screenWidth, Terraria.Main.ShouldDrawInfoIconsHorizontally, System.X, and System.Y.

Referenced by Terraria.Main.DrawInfoAccs().