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

◆ SetupGamepadPoints()

void Terraria.GameContent.UI.States.UICharacterCreation.SetupGamepadPoints ( SpriteBatch spriteBatch)
inlineprivate

Definition at line 1397 of file UICharacterCreation.cs.

1398 {
1399 UILinkPointNavigator.Shortcuts.BackButtonCommand = 1;
1400 int num = 3000;
1401 int num2 = num + 20;
1402 int num3 = num;
1404 SnapPoint snapPoint = snapPoints.First((SnapPoint a) => a.Name == "Back");
1405 SnapPoint snapPoint2 = snapPoints.First((SnapPoint a) => a.Name == "Create");
1407 uILinkPoint.Unlink();
1409 num3++;
1411 uILinkPoint2.Unlink();
1413 num3++;
1414 uILinkPoint.Right = uILinkPoint2.ID;
1415 uILinkPoint2.Left = uILinkPoint.ID;
1419 List<SnapPoint> list = snapPoints.Where((SnapPoint a) => a.Name == "Top").ToList();
1420 list.Sort(SortPoints);
1421 for (int i = 0; i < list.Count; i++)
1422 {
1424 uILinkPoint3.Unlink();
1426 uILinkPoint3.Left = num3 - 1;
1427 uILinkPoint3.Right = num3 + 1;
1428 uILinkPoint3.Down = num2;
1429 if (i == 0)
1430 {
1431 uILinkPoint3.Left = -3;
1432 }
1433 if (i == list.Count - 1)
1434 {
1435 uILinkPoint3.Right = -4;
1436 }
1437 if (_selectedPicker == CategoryId.HairStyle || _selectedPicker == CategoryId.Clothing)
1438 {
1439 uILinkPoint3.Down = num2 + i;
1440 }
1442 num3++;
1443 }
1444 List<SnapPoint> list2 = snapPoints.Where((SnapPoint a) => a.Name == "Middle").ToList();
1445 list2.Sort(SortPoints);
1446 num3 = num2;
1447 switch (_selectedPicker)
1448 {
1449 case CategoryId.CharInfo:
1450 {
1451 for (int l = 0; l < list2.Count; l++)
1452 {
1454 andSet3.Up = andSet3.ID - 1;
1455 andSet3.Down = andSet3.ID + 1;
1456 if (l == 0)
1457 {
1458 andSet3.Up = num + 2;
1459 }
1460 if (l == list2.Count - 1)
1461 {
1462 andSet3.Down = uILinkPoint.ID;
1463 uILinkPoint.Up = andSet3.ID;
1464 uILinkPoint2.Up = andSet3.ID;
1465 }
1467 num3++;
1468 }
1469 break;
1470 }
1471 case CategoryId.HairStyle:
1472 {
1473 if (list2.Count == 0)
1474 {
1475 break;
1476 }
1478 SnapPoint snapPoint3 = list2[list2.Count - 1];
1479 _ = snapPoint3.Id / 10;
1480 _ = snapPoint3.Id % 10;
1481 int count = Main.Hairstyles.AvailableHairstyles.Count;
1482 for (int m = 0; m < list2.Count; m++)
1483 {
1486 andSet4.Left = andSet4.ID - 1;
1487 if (snapPoint4.Id == 0)
1488 {
1489 andSet4.Left = -3;
1490 }
1491 andSet4.Right = andSet4.ID + 1;
1492 if (snapPoint4.Id == count - 1)
1493 {
1494 andSet4.Right = -4;
1495 }
1496 andSet4.Up = andSet4.ID - 10;
1497 if (m < 10)
1498 {
1499 andSet4.Up = num + 2 + m;
1500 }
1501 andSet4.Down = andSet4.ID + 10;
1502 if (snapPoint4.Id + 10 > snapPoint3.Id)
1503 {
1504 if (snapPoint4.Id % 10 < 5)
1505 {
1506 andSet4.Down = uILinkPoint.ID;
1507 }
1508 else
1509 {
1510 andSet4.Down = uILinkPoint2.ID;
1511 }
1512 }
1513 if (m == list2.Count - 1)
1514 {
1515 uILinkPoint.Up = andSet4.ID;
1516 uILinkPoint2.Up = andSet4.ID;
1517 }
1519 num3++;
1520 }
1521 break;
1522 }
1523 default:
1524 {
1525 List<SnapPoint> list4 = snapPoints.Where((SnapPoint a) => a.Name == "Low").ToList();
1526 list4.Sort(SortPoints);
1527 num3 = num2 + 20;
1528 for (int n = 0; n < list4.Count; n++)
1529 {
1531 andSet5.Up = num2 + 2;
1532 andSet5.Down = uILinkPoint.ID;
1533 andSet5.Left = andSet5.ID - 1;
1534 andSet5.Right = andSet5.ID + 1;
1535 if (n == 0)
1536 {
1537 andSet5.Left = andSet5.ID + 2;
1538 uILinkPoint.Up = andSet5.ID;
1539 }
1540 if (n == list4.Count - 1)
1541 {
1542 andSet5.Right = andSet5.ID - 2;
1543 uILinkPoint2.Up = andSet5.ID;
1544 }
1546 num3++;
1547 }
1548 num3 = num2;
1549 for (int num4 = 0; num4 < list2.Count; num4++)
1550 {
1552 andSet6.Up = andSet6.ID - 1;
1553 andSet6.Down = andSet6.ID + 1;
1554 if (num4 == 0)
1555 {
1556 andSet6.Up = num + 2 + 5;
1557 }
1558 if (num4 == list2.Count - 1)
1559 {
1560 andSet6.Down = num2 + 20 + 2;
1561 }
1563 num3++;
1564 }
1565 break;
1566 }
1567 case CategoryId.Clothing:
1568 {
1569 List<SnapPoint> list3 = snapPoints.Where((SnapPoint a) => a.Name == "Low").ToList();
1570 list3.Sort(SortPoints);
1571 int down = -2;
1572 int down2 = -2;
1573 num3 = num2 + 20;
1574 for (int j = 0; j < list3.Count; j++)
1575 {
1577 andSet.Up = num2 + j + 2;
1578 andSet.Down = uILinkPoint.ID;
1579 if (j >= 3)
1580 {
1581 andSet.Up++;
1582 andSet.Down = uILinkPoint2.ID;
1583 }
1584 andSet.Left = andSet.ID - 1;
1585 andSet.Right = andSet.ID + 1;
1586 if (j == 0)
1587 {
1588 down = andSet.ID;
1589 andSet.Left = andSet.ID + 4;
1590 uILinkPoint.Up = andSet.ID;
1591 }
1592 if (j == list3.Count - 1)
1593 {
1594 down2 = andSet.ID;
1595 andSet.Right = andSet.ID - 4;
1596 uILinkPoint2.Up = andSet.ID;
1597 }
1599 num3++;
1600 }
1601 num3 = num2;
1602 for (int k = 0; k < list2.Count; k++)
1603 {
1605 andSet2.Up = num + 2 + k;
1606 andSet2.Left = andSet2.ID - 1;
1607 andSet2.Right = andSet2.ID + 1;
1608 if (k == 0)
1609 {
1610 andSet2.Left = andSet2.ID + 9;
1611 }
1612 if (k == list2.Count - 1)
1613 {
1614 andSet2.Right = andSet2.ID - 9;
1615 }
1616 andSet2.Down = down;
1617 if (k >= 5)
1618 {
1619 andSet2.Down = down2;
1620 }
1622 num3++;
1623 }
1624 break;
1625 }
1626 }
1628 {
1630 }
1631 }
UILinkPoint GetAndSet(int ptid, SnapPoint snap)
static Dictionary< int, UILinkPoint > Points
static void SetPosition(int ID, Vector2 Position)
virtual List< SnapPoint > GetSnapPoints()
Definition UIElement.cs:267
void CullPointsOutOfElementArea(SpriteBatch spriteBatch, List< SnapPoint > pointsAtMiddle, UIElement container)

References Terraria.GameContent.UI.States.UICharacterCreation._foundPoints, Terraria.GameContent.UI.States.UICharacterCreation._hairstylesContainer, Terraria.GameContent.UI.States.UICharacterCreation._helper, Terraria.GameContent.UI.States.UICharacterCreation._selectedPicker, System.Collections.Generic.List< T >.Add(), System.Collections.Generic.List< T >.Clear(), System.Collections.Generic.List< T >.Contains(), System.Linq.count, System.Collections.Generic.Dictionary< TKey, TValue >.Count, Terraria.GameContent.UI.States.UIGamepadHelper.CullPointsOutOfElementArea(), Terraria.UI.Gamepad.UILinkPointNavigator.CurrentPoint, Terraria.GameContent.UI.States.UICharacterCreation.GetAndSet(), Terraria.UI.UIElement.GetSnapPoints(), Terraria.Main.Hairstyles, Terraria.GameContent.UI.States.UICharacterCreation.MoveToVisuallyClosestPoint(), Terraria.UI.Gamepad.UILinkPointNavigator.Points, Terraria.UI.Gamepad.UILinkPointNavigator.SetPosition(), Terraria.GameContent.UI.States.UICharacterCreation.SortPoints(), and Terraria.GameInput.PlayerInput.UsingGamepadUI.

Referenced by Terraria.GameContent.UI.States.UICharacterCreation.Draw().