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

◆ GetSnapPoints()

override List< SnapPoint > Terraria.GameContent.UI.Elements.UIDynamicItemCollection.GetSnapPoints ( )
inlinevirtual

Reimplemented from Terraria.UI.UIElement.

Definition at line 139 of file UIDynamicItemCollection.cs.

140 {
144 Rectangle viewCullingArea = base.Parent.GetViewCullingArea();
145 int num = endItemIndex - startItemIndex;
146 while (_dummySnapPoints.Count < num)
147 {
148 _dummySnapPoints.Add(new SnapPoint("CreativeInfinitesSlot", 0, Vector2.Zero, Vector2.Zero));
149 }
150 int num2 = 0;
152 for (int i = startItemIndex; i < endItemIndex; i++)
153 {
156 {
158 snapPoint.ThisIsAHackThatChangesTheSnapPointsInfo(Vector2.Zero, center.ToVector2() - vector, num2);
159 snapPoint.Calculate(this);
160 num2++;
162 }
163 }
164 foreach (UIElement element in Elements)
165 {
166 list.AddRange(element.GetSnapPoints());
167 }
168 return list;
169 }
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void AddRange(IEnumerable< KeyValuePair< TKey, TValue > > collection)
void Add(TKey key, TValue value)
Rectangle GetItemSlotHitbox(int startX, int startY, int startItemIndex, int i)
void GetGridParameters(out int startX, out int startY, out int startItemIndex, out int endItemIndex)
CalculatedStyle GetDimensions()
Definition UIElement.cs:382
virtual List< SnapPoint > GetSnapPoints()
Definition UIElement.cs:267

References Terraria.GameContent.UI.Elements.UIDynamicItemCollection._dummySnapPoints, Terraria.GameContent.UI.Elements.UIDynamicItemCollection._itemsPerLine, System.Collections.Generic.List< T >.Add(), System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Collections.Generic.Dictionary< TKey, TValue >.AddRange(), Microsoft.Xna.Framework.Rectangle.Center, System.Collections.Generic.Dictionary< TKey, TValue >.Contains(), System.Collections.Generic.List< T >.Count, Terraria.UI.UIElement.GetDimensions(), Terraria.GameContent.UI.Elements.UIDynamicItemCollection.GetGridParameters(), Terraria.GameContent.UI.Elements.UIDynamicItemCollection.GetItemSlotHitbox(), Terraria.UI.UIElement.GetSnapPoints(), System.list, Terraria.UI.CalculatedStyle.Position(), and Microsoft.Xna.Framework.Vector2.Zero.