protected void drawBuildOptions()
        {
            GUILayout.BeginVertical();
            int        count = staticList.Count;
            ConfigNode staticNode;

            ConfigNode[] buildResources;
            ConfigNode   resourceNode;
            GUIStyle     style = new GUIStyle(HighLogic.Skin.textArea);

            style.active  = style.hover = style.normal;
            style.padding = new RectOffset(0, 0, 0, 0);


            for (int index = 0; index < count; index++)
            {
                staticNode = staticList[index];

                GUILayout.BeginVertical(style);

                //Title
                GUILayout.Label("<color=lightblue><b>" + staticNode.GetValue("title") + "</b></color>");

                //Resources required
                if (staticNode.HasNode(WBIBuildResource.kBuildNode))
                {
                    buildResources = staticNode.GetNodes(WBIBuildResource.kBuildNode);

                    GUILayout.Label("<color=white><b>Required Resources</b></color>");

                    for (int resourceIndex = 0; resourceIndex < buildResources.Length; resourceIndex++)
                    {
                        resourceNode = buildResources[resourceIndex];
                        GUILayout.Label("<color=white>" + WBIBuildResource.GetRequirements(resourceNode) + "</color>");
                    }
                }

                //Select project button
                if (GUILayout.Button("Select Project") && OnStaticSelected != null)
                {
                    string newStaticName = staticNode.GetValue("name");
                    currentStaticName = newStaticName;
                    currentStaticNode = staticNode;
                    OnStaticSelected(newStaticName, staticNode);
                }

                GUILayout.EndVertical();
            }

            GUILayout.EndVertical();
        }
Example #2
0
 protected void loadRequiredResources(ConfigNode node)
 {
     if (node.HasNode(WBIBuildResource.kBuildNode))
     {
         requiredResources.Clear();
         ConfigNode[]     requiredNodes = node.GetNodes(WBIBuildResource.kBuildNode);
         WBIBuildResource buildResource;
         for (int index = 0; index < requiredNodes.Length; index++)
         {
             buildResource      = new WBIBuildResource(requiredNodes[index]);
             buildResource.part = this.part;
             requiredResources.Add(buildResource);
         }
     }
 }