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

◆ SetDrawLocation()

bool Terraria.ModLoader.AccessorySlotLoader.SetDrawLocation ( int trueSlot,
int skip,
ref int xLoc,
ref int yLoc )
inlinepackage

Applies Xloc and Yloc data for the slot, based on ModAccessorySlotPlayer.scrollSlots.

Definition at line 308 of file AccessorySlotLoader.cs.

309 {
313 if (ModSlotPlayer(Player).scrollSlots)
314 {
315 int row = yRow + xColumn * accessoryPerColumn - ModSlotPlayer(Player).scrollbarSlotPosition - skip;
316 yLoc = (int)((float)DrawVerticalAlignment + (float)((row + 3) * 56) * Main.inventoryScale) + 4;
317 int chkMin = (int)((float)DrawVerticalAlignment + 168f * Main.inventoryScale) + 4;
318 int chkMax = (int)((float)DrawVerticalAlignment + (float)((accessoryPerColumn - 1 + 3) * 56) * Main.inventoryScale) + 4;
319 if (yLoc > chkMax || yLoc < chkMin)
320 {
321 return false;
322 }
323 xLoc = Main.screenWidth - 64 - 28;
324 }
325 else
326 {
327 int row2 = yRow;
328 int tempSlot = trueSlot;
329 int col = xColumn;
330 if (skip > 0)
331 {
332 tempSlot -= skip;
335 }
336 yLoc = (int)((float)DrawVerticalAlignment + (float)((row2 + 3) * 56) * Main.inventoryScale) + 4;
337 if (col > 0)
338 {
339 xLoc = Main.screenWidth - 64 - 28 - 141 * col - 50;
340 }
341 else
342 {
343 xLoc = Main.screenWidth - 64 - 28 - 141 * col;
344 }
345 }
346 return true;
347 }
static ModAccessorySlotPlayer ModSlotPlayer(Player player)
static int DrawVerticalAlignment
The variable known as num20 used to align all equipment slot drawing in Main. Represents the y positi...

References Terraria.ModLoader.AccessorySlotLoader.DrawVerticalAlignment, Terraria.ModLoader.AccessorySlotLoader.GetAccessorySlotPerColumn(), Terraria.Main.inventoryScale, and Terraria.ModLoader.AccessorySlotLoader.ModSlotPlayer().

Referenced by Terraria.ModLoader.AccessorySlotLoader.Draw().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: