Пример #1
0
 public void paint()
 {
     for (var i = 0; i < Components.ToArray().Length; i++)
     {
         ViewComponent C = Components.ToArray() [i];
         C.paint();
     }
 }
Пример #2
0
    public void addComponent(ViewComponent C) {
      if (C is RelativeViewComponent) {
        if (!((RelativeViewComponent)C).hasRelative ()) {
          Debug.LogError ("Relative View Component hasn't defined what it's relative to. Refusing to add to View.");
        }
      }

      Components.Add (C);
    }
Пример #3
0
        public void addComponent(ViewComponent C)
        {
            if (C is RelativeViewComponent)
            {
                if (!((RelativeViewComponent)C).hasRelative())
                {
                    Debug.LogError("Relative View Component hasn't defined what it's relative to. Refusing to add to View.");
                }
            }

            Components.Add(C);
        }
Пример #4
0
        public override void paint()
        {
            GUI.contentColor = color;

            int bottomX = 0;
            int bottomY = 0;

            for (var i = 0; i < Components.ToArray().Length; i++)
            {
                ViewComponent Component = Components.ToArray()[i];
                if (Component.getBottomRightX() > bottomX)
                {
                    bottomX = Component.getBottomRightX();
                }

                if (Component.getBottomRightY() > bottomY)
                {
                    bottomY = Component.getBottomRightY();
                }
            }

            ScrollVector = GUI.BeginScrollView(
                new Rect(this.getTopLeftX(), this.getTopLeftY(), this.getWidth(), this.getHeight()),
                ScrollVector,
                new Rect(0, 0, bottomX, bottomY),
                HighLogic.Skin.horizontalScrollbar,
                HighLogic.Skin.verticalScrollbar
                );

            for (var i = 0; i < Components.ToArray().Length; i++)
            {
                ViewComponent Component = Components.ToArray()[i];
                Component.paint();
            }

            GUI.EndScrollView();
        }
Пример #5
0
 public void setRelativeTo(ViewComponent VC)
 {
     this.Relative = VC;
 }
Пример #6
0
 public void setRelativeTo(ViewComponent VC)
 {
     this.Relative = VC;
 }