private void createWindow() { Window = new ViewWindow("Review"); Window.setMargins(300, 100); Image = new ViewImage("assets/kerbalfunding.jpg"); Image.setRelativeTo(Window); Image.setPercentWidth(100); Label = new ViewLabel("Could be worse."); Label.setRelativeTo(Image); Label.setPercentWidth(80); Label.setPercentHeight(20); Label.setPercentLeft(10); Label.setPercentTop(80); Label.setFontSize(18); Label.setColor(Color.white); Confirm = new ViewButton("Ok", OnConfirm); Confirm.setRelativeTo(Window); Confirm.setWidth(100); Confirm.setHeight(30); Confirm.setRight(5); Confirm.setBottom(5); if (!Rev.pastReview) { Rev.touch(); } ReviewText = new ViewTextArea(Rev.GetSummaryText()); ReviewText.setRelativeTo(Image); ReviewText.setPercentWidth(100); ReviewText.setTop(Image.getHeight() + 10); ReviewText.setHeight(Window.getHeight() - Image.getHeight() - Confirm.getHeight() - 20); ReviewText.setColor(Color.white); this.addComponent(Window); this.addComponent(Image); this.addComponent(Label); this.addComponent(Confirm); this.addComponent(ReviewText); List <ViewSummaryRow> summaryRows = Rev.GetText(); for (int i = 0; i < summaryRows.Count; i++) { ViewSummaryRow row = summaryRows[i]; row.setRelativeTo(ReviewText); row.setHeight(30); row.setPercentWidth(100); row.setTop(15 * i + 10); row.setLeft(300); row.setColor(Color.white); this.addComponent(row); } }
public static void draw(View Vw, ViewWindow Window) { Window.title = "Current State"; InstanceData GameInstance = StateFundingGlobal.fetch.GameInstance; if (GameInstance == null) { Log.Error("StateFundingHubCurrentView.draw, Inst is null"); return; } Review Rev = GameInstance.ActiveReview; Rev.touch(); ViewTextArea TextArea = new ViewTextArea(GameInstance.ActiveReview.GetSummaryText()); TextArea.setRelativeTo(Window); TextArea.setTop(40); TextArea.setLeft(130); TextArea.setWidth(Window.getWidth() - 140); TextArea.setHeight(Window.getHeight() - 40); TextArea.setColor(Color.white); Vw.addComponent(TextArea); List <ViewSummaryRow> summaryRows = Rev.GetText(); for (int i = 0; i < summaryRows.Count; i++) { ViewSummaryRow row = summaryRows[i]; row.setRelativeTo(TextArea); row.setHeight(30); row.setPercentWidth(100); row.setTop(200 + 20 * i + 10); row.setColor(Color.white); Vw.addComponent(row); } }