protected override List <DialogGUIBase> drawContentComponents() { List <DialogGUIBase> listComponments = new List <DialogGUIBase>(); listComponments.Add(new DialogGUILabel(Localizer.Format("#CNC_ConstellationControl_listComponments"), false, false));//"Manage communication networks of ground, air and space vessels." float btnWidth = (600 - 50) / 3; float btnHeight = 32; DialogGUIButton constellationBtn = new DialogGUIButton(Localizer.Format("#CNC_ConstellationControl_ConstellationBtn"), delegate { displayContentLayout(ContentType.CONSTELLATIONS); }, btnWidth, btnHeight, false); //"Constellations" DialogGUIButton groundstationBtn = new DialogGUIButton(Localizer.Format("#CNC_ConstellationControl_GroundstationBtn"), delegate { displayContentLayout(ContentType.GROUNDSTATIONS); }, btnWidth, btnHeight, false); //"Ground Stations" DialogGUIButton vesselBtn = new DialogGUIButton(Localizer.Format("#CNC_ConstellationControl_VesselBtn"), delegate { displayContentLayout(ContentType.VESSELS); }, btnWidth, btnHeight, false); //"CommNet Vessels" listComponments.Add(new DialogGUIHorizontalLayout(true, false, 0, new RectOffset(), TextAnchor.MiddleLeft, new DialogGUIBase[] { constellationBtn, groundstationBtn, vesselBtn })); contentLayout = new DialogGUIVerticalLayout(true, false, 4, new RectOffset(5, 25, 5, 5), TextAnchor.UpperLeft, new DialogGUIBase[] { new DialogGUIContentSizer(ContentSizeFitter.FitMode.Unconstrained, ContentSizeFitter.FitMode.PreferredSize, true) }); contentLayout.AddChildren(getVesselContentLayout().ToArray()); this.currentContentType = ContentType.VESSELS; scrollArea = new CustomDialogGUIScrollList(new Vector2(550, 250), false, true, contentLayout); listComponments.Add(scrollArea); sortVesselBtnLayout = new DialogGUIHorizontalLayout(true, false, 0, new RectOffset(), TextAnchor.MiddleLeft, getVesselSortLayout()); listComponments.Add(sortVesselBtnLayout); return(listComponments); }
public List <DialogGUIBase> getLayoutContents() { List <DialogGUIBase> layout = new List <DialogGUIBase>(); layout.Add(new DialogGUILabel("<b>Management tools</b>", false, false)); DialogGUIBase[] buttons = new DialogGUIBase[this.tools.Count]; for (int i = 0; i < this.tools.Count; i++) { AbstractMgtTool thisTool = this.tools[i]; buttons[i] = new DialogGUIButton(thisTool.toolName, delegate { selectTool(thisTool.codename); }, 50, 32, false); } layout.Add(new DialogGUIHorizontalLayout(true, false, 0, new RectOffset(), TextAnchor.MiddleLeft, buttons)); //Tool content this.toolContentLayout = new DialogGUIVerticalLayout(10, 100, 4, new RectOffset(5, 25, 5, 5), TextAnchor.UpperLeft, new DialogGUIBase[] { new DialogGUIContentSizer(ContentSizeFitter.FitMode.Unconstrained, ContentSizeFitter.FitMode.PreferredSize, true) }); scrollArea = new CustomDialogGUIScrollList(new Vector2(this.width, this.height), false, true, this.toolContentLayout); layout.Add(scrollArea); return(layout); }
protected override List <DialogGUIBase> drawContentComponents() { List <DialogGUIBase> listComponments = new List <DialogGUIBase>(); CNCCommNetVessel cncVessel = (CNCCommNetVessel)this.hostVessel.Connection; List <short> vesselFrequencyList = cncVessel.getFrequencyList(); vesselFrequencyList.Sort(); listComponments.Add(new DialogGUIHorizontalLayout(true, false, 0, new RectOffset(), TextAnchor.UpperCenter, new DialogGUIBase[] { new DialogGUILabel(this.description + "\n\n", false, false) })); //frequency list listComponments.Add(new DialogGUILabel("<b>Active frequencies</b>", false, false)); DialogGUIBase[] frequencyRows; if (vesselFrequencyList.Count == 0) { frequencyRows = new DialogGUIBase[2]; frequencyRows[0] = new DialogGUIContentSizer(ContentSizeFitter.FitMode.Unconstrained, ContentSizeFitter.FitMode.PreferredSize, true); frequencyRows[1] = new DialogGUILabel(nofreqMessage, nofreqMessageStyle, true, false); } else { frequencyRows = new DialogGUIBase[vesselFrequencyList.Count + 1]; frequencyRows[0] = new DialogGUIContentSizer(ContentSizeFitter.FitMode.Unconstrained, ContentSizeFitter.FitMode.PreferredSize, true); for (int i = 0; i < vesselFrequencyList.Count; i++) { frequencyRows[i + 1] = createFrequencyRow(vesselFrequencyList[i]); } } frequencyRowLayout = new DialogGUIVerticalLayout(10, 100, 4, new RectOffset(5, 25, 5, 5), TextAnchor.UpperLeft, frequencyRows); scrollArea = new CustomDialogGUIScrollList(new Vector2(450, 100), false, true, frequencyRowLayout); listComponments.Add(scrollArea); //tools listComponments.AddRange(this.toolMgt.getLayoutContents()); return(listComponments); }