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

◆ DrawScrollbar()

void Terraria.ModLoader.AccessorySlotLoader.DrawScrollbar ( int accessoryPerColumn,
int slotsToRender,
int scrollIncrement )
inlinepackage

Definition at line 162 of file AccessorySlotLoader.cs.

163 {
164 //IL_006b: Unknown result type (might be due to invalid IL or missing references)
165 //IL_006c: Unknown result type (might be due to invalid IL or missing references)
166 //IL_00bc: Unknown result type (might be due to invalid IL or missing references)
167 //IL_00bd: Unknown result type (might be due to invalid IL or missing references)
168 //IL_00e7: Unknown result type (might be due to invalid IL or missing references)
169 int xLoc = Main.screenWidth - 64 - 28;
170 int chkMax = (int)((float)DrawVerticalAlignment + (float)((accessoryPerColumn + 3) * 56) * Main.inventoryScale) + 4;
171 int chkMin = (int)((float)DrawVerticalAlignment + 168f * Main.inventoryScale) + 4;
172 UIScrollbar uIScrollbar = new UIScrollbar();
173 Rectangle rectangle = default(Rectangle);
174 ((Rectangle)(ref rectangle))._002Ector(xLoc + 47 + 6, chkMin, 5, chkMax - chkMin);
175 uIScrollbar.DrawBar(Main.spriteBatch, Main.Assets.Request<Texture2D>("Images/UI/Scrollbar").Value, rectangle, Color.White);
176 int barSize = (chkMax - chkMin) / (scrollIncrement + 1);
177 ((Rectangle)(ref rectangle))._002Ector(xLoc + 47 + 5, chkMin + ModSlotPlayer(Player).scrollbarSlotPosition * barSize, 3, barSize);
178 uIScrollbar.DrawBar(Main.spriteBatch, Main.Assets.Request<Texture2D>("Images/UI/ScrollbarInner").Value, rectangle, Color.White);
179 ((Rectangle)(ref rectangle))._002Ector(xLoc - 94, chkMin, 141, chkMax - chkMin);
180 if (((Rectangle)(ref rectangle)).Contains(new Point(Main.mouseX, Main.mouseY)) && !PlayerInput.IgnoreMouseInterface)
181 {
182 PlayerInput.LockVanillaMouseScroll("ModLoader/Acc");
183 int scrollDelta = ModSlotPlayer(Player).scrollbarSlotPosition + PlayerInput.ScrollWheelDelta / 120;
185 scrollDelta = Math.Max(scrollDelta, 0);
186 ModSlotPlayer(Player).scrollbarSlotPosition = scrollDelta;
187 PlayerInput.ScrollWheelDelta = 0;
188 }
189 }
void DrawBar(SpriteBatch spriteBatch, Texture2D texture, Rectangle dimensions, Color color)
static void LockVanillaMouseScroll(string myUI)
Locks the vanilla scrollbar for the upcoming cycle when called. Autoclears in Player....
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.Main.Assets, Terraria.GameContent.UI.Elements.UIScrollbar.DrawBar(), Terraria.ModLoader.AccessorySlotLoader.DrawVerticalAlignment, Terraria.GameInput.PlayerInput.IgnoreMouseInterface, Terraria.Main.inventoryScale, Terraria.GameInput.PlayerInput.LockVanillaMouseScroll(), Terraria.ModLoader.AccessorySlotLoader.ModSlotPlayer(), Terraria.Main.mouseX, Terraria.Main.mouseY, and Terraria.Main.spriteBatch.

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

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