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

◆ CreateUILinkPointGrid()

UILinkPoint[,] Terraria.GameContent.UI.States.UIGamepadHelper.CreateUILinkPointGrid ( ref int currentID,
List< SnapPoint > pointsForGrid,
int pointsPerLine,
UILinkPoint topLinkPoint,
UILinkPoint leftLinkPoint,
UILinkPoint rightLinkPoint,
UILinkPoint bottomLinkPoint )
inline

Definition at line 16 of file UIGamepadHelper.cs.

17 {
18 int num = (int)Math.Ceiling((float)pointsForGrid.Count / (float)pointsPerLine);
20 for (int i = 0; i < pointsForGrid.Count; i++)
21 {
22 int num2 = i % pointsPerLine;
23 int num3 = i / pointsPerLine;
25 }
26 for (int j = 0; j < array.GetLength(0); j++)
27 {
28 for (int k = 0; k < array.GetLength(1); k++)
29 {
31 if (uILinkPoint == null)
32 {
33 continue;
34 }
35 if (j < array.GetLength(0) - 1)
36 {
38 if (uILinkPoint2 != null)
39 {
41 }
42 }
43 if (k < array.GetLength(1) - 1)
44 {
46 if (uILinkPoint3 != null)
47 {
49 }
50 }
51 if (leftLinkPoint != null && j == 0)
52 {
53 uILinkPoint.Left = leftLinkPoint.ID;
54 }
55 if (topLinkPoint != null && k == 0)
56 {
57 uILinkPoint.Up = topLinkPoint.ID;
58 }
59 if (rightLinkPoint != null && j == pointsPerLine - 1)
60 {
61 uILinkPoint.Right = rightLinkPoint.ID;
62 }
63 if (bottomLinkPoint != null && k == num - 1)
64 {
65 uILinkPoint.Down = bottomLinkPoint.ID;
66 }
67 }
68 }
69 return array;
70 }
static double Ceiling(double a)
void PairLeftRight(UILinkPoint leftSide, UILinkPoint rightSide)
void PairUpDown(UILinkPoint upSide, UILinkPoint downSide)
UILinkPoint MakeLinkPointFromSnapPoint(int id, SnapPoint snap)

References System.array, System.Math.Ceiling(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, Terraria.GameContent.UI.States.UIGamepadHelper.MakeLinkPointFromSnapPoint(), Terraria.GameContent.UI.States.UIGamepadHelper.PairLeftRight(), and Terraria.GameContent.UI.States.UIGamepadHelper.PairUpDown().

Referenced by Terraria.GameContent.UI.States.AWorkshopPublishInfoState< TPublishedObjectType >.SetupGamepadPoints(), and Terraria.GameContent.UI.States.UICreativePowersMenu.SetupGamepadPoints().