Example #1
0
        public void UpdateWaypointList()
        {
            scrollView.ClearContent();
            float yPos = spacing;

            for (int i = 0; i < Waypoints.points.Count; i++)
            {
                UILabel label = new UILabel(Waypoints.points[i].name);
                label.Scale        = .5f;
                label.X            = spacing;
                label.Y            = yPos;
                label.Tag          = i;
                label.onLeftClick += label_onLeftClick;
                yPos += label.Height;
                scrollView.AddChild(label);

                UIImage image = new UIImage(closeTexture);
                image.ForegroundColor = Color.Red;
                image.Anchor          = AnchorPosition.Right;
                image.Position        = new Vector2(scrollView.Width - 10 - spacing, label.Position.Y + label.Height / 2);
                image.Tag             = i;
                image.onLeftClick    += image_onLeftClick;

                scrollView.AddChild(image);
            }
            scrollView.ContentHeight = scrollView.GetLastChild().Y + scrollView.GetLastChild().Height + spacing;
        }
Example #2
0
 public void RefreshGroupPermissions()
 {
     checkboxContainer.ClearContent();
     for (int i = 0; i < HEROsModNetwork.Group.PermissionList.Count; i++)
     {
         UICheckbox cb = new UICheckbox(HEROsModNetwork.Group.PermissionList[i].Description);
         cb.Selected = HEROsModNetwork.Network.Groups[dropdown.SelectedItem].HasPermission(HEROsModNetwork.Group.PermissionList[i].Key);
         checkboxContainer.AddChild(cb);
         int index = i;
         cb.X = spacing + index % 2 * (Width / 2);
         cb.Y = index / 2 * (cb.Height) + spacing;
     }
     if (checkboxContainer.ChildCount > 0)
     {
         checkboxContainer.ContentHeight = checkboxContainer.GetLastChild().Y + checkboxContainer.GetLastChild().Height + spacing;
     }
 }