private void reloadBase() { this.removeAll (); SideMenu = new ArrayList (); Window = new ViewWindow (""); Window.setWidth (800); Window.setHeight (Screen.height - 200); Window.setLeft ((Screen.width-800)/2); Window.setTop (100); this.addComponent (Window); SideMenu.Add(new ViewButton("Current State", LoadCurrentState)); SideMenu.Add(new ViewButton("Space Stations", LoadSpaceStations)); SideMenu.Add(new ViewButton("Bases", LoadBases)); SideMenu.Add(new ViewButton("Sat Coverage", LoadSatelliteCoverage)); SideMenu.Add(new ViewButton("Science Stations", LoadScienceStations)); SideMenu.Add(new ViewButton("Mining Rigs", LoadMiningRigs)); SideMenu.Add(new ViewButton("Rovers", LoadRovers)); SideMenu.Add(new ViewButton("Kerbals", LoadKerbals)); SideMenu.Add(new ViewButton("Past Reviews", LoadPastReviews)); for (var i = 0; i < SideMenu.ToArray ().Length; i++) { ViewButton Btn = (ViewButton)SideMenu.ToArray () [i]; Btn.setRelativeTo (Window); Btn.setLeft (10); Btn.setTop (10 + i * 45); Btn.setWidth (120); Btn.setHeight (35); this.addComponent (Btn); } }
private void createWindow() { Toast = new ViewWindow (""); Toast.setWidth (300); Toast.setHeight (100); Toast.setBottom (10); Toast.setRight (10); ToastLabel = new ViewLabel ("New Review Report Avaialble"); ToastLabel.setRelativeTo (Toast); ToastLabel.setWidth (290); ToastLabel.setHeight (90); ToastLabel.setLeft (10); ToastLabel.setTop (10); ToastLabel.setColor (Color.white); OpenReview = new ViewButton ("View Review", OnOpenReview); OpenReview.setRelativeTo (Toast); OpenReview.setWidth (90); OpenReview.setHeight (40); OpenReview.setRight (10); OpenReview.setTop (10); Dismiss = new ViewButton ("Dismiss", OnDismiss); Dismiss.setRelativeTo (Toast); Dismiss.setWidth (90); Dismiss.setHeight (40); Dismiss.setRight (10); Dismiss.setBottom (10); this.addComponent (Toast); this.addComponent (ToastLabel); this.addComponent (OpenReview); this.addComponent (Dismiss); }
public static void draw(View Vw, ViewWindow Window) { Window.title = "Mining Rigs"; InstanceData GameInstance = StateFundingGlobal.fetch.GameInstance; Review Rev = GameInstance.ActiveReview; Rev.touch (); string Description = "Below is a list of existing Mining Rigs. Having more Mining Rigs increases State " + "Confidence. To have a qualified Mining Rig is must have an antenna, drill, be able to generate power, " + "and be Landed on a body other than Kerbin."; ViewLabel DescriptionLabel = new ViewLabel (Description); DescriptionLabel.setRelativeTo (Window); DescriptionLabel.setLeft (140); DescriptionLabel.setTop (20); DescriptionLabel.setColor (Color.white); DescriptionLabel.setHeight (100); DescriptionLabel.setWidth (Window.getWidth () - 140); Vw.addComponent (DescriptionLabel); ViewLabel TotalCoverage = new ViewLabel ("Mining Rigs: " + Rev.miningRigs); TotalCoverage.setRelativeTo (Window); TotalCoverage.setLeft (140); TotalCoverage.setTop (130); TotalCoverage.setColor (Color.white); TotalCoverage.setHeight (30); TotalCoverage.setWidth (Window.getWidth () - 140); Vw.addComponent (TotalCoverage); ViewScroll RigsScroll = new ViewScroll (); RigsScroll.setRelativeTo (Window); RigsScroll.setWidth (Window.getWidth () - 140); RigsScroll.setHeight (Window.getHeight () - 160); RigsScroll.setLeft (140); RigsScroll.setTop (150); Vw.addComponent (RigsScroll); Vessel[] MiningRigs = VesselHelper.GetMiningRigs (); int labelHeight = 20; for (int i = 0; i < MiningRigs.Length; i++) { Vessel MiningRig = MiningRigs [i]; string label = MiningRig.GetName () + " is Landed At " + MiningRig.mainBody.GetName ();; ViewLabel MiningLabel = new ViewLabel (label); MiningLabel.setRelativeTo (RigsScroll); MiningLabel.setTop (labelHeight + (labelHeight + 5) * i); MiningLabel.setLeft (0); MiningLabel.setHeight (labelHeight); MiningLabel.setWidth (RigsScroll.getWidth () - 20); MiningLabel.setColor (Color.white); RigsScroll.Components.Add (MiningLabel); } }
private void createWindow() { Window = new ViewWindow ("State Funding"); Window.setMargins (300, 100); Image = new ViewImage ("assets/kerbalgovernment.jpg"); Image.setRelativeTo (Window); Image.setPercentWidth (100); Label = new ViewLabel ( "We've been told it was in the best interest of our government to have a space program for some reason. " + "We're not rocket scientists, but you are. We will provide funding, make our wildest dreams come true. " + "Or at least just help us keep our jobs." ); Label.setRelativeTo (Image); Label.setPercentWidth (80); Label.setPercentHeight (20); Label.setPercentLeft (10); Label.setPercentTop (80); Label.setFontSize (18); Label.setColor (Color.white); GovernmentDescription = new ViewLabel (""); GovernmentDescription.setRelativeTo (Image); GovernmentDescription.setWidth (300); GovernmentDescription.setHeight (Window.getHeight () - Image.getHeight () - 20); GovernmentDescription.setTop (Image.getHeight () + 10); GovernmentDescription.setLeft (120); GovernmentDescription.setColor (Color.white); GovernmentDescription.setFontSize (14); GovernmentGameplayDescription = new ViewLabel (""); GovernmentGameplayDescription.setRelativeTo (Image); GovernmentGameplayDescription.setWidth (300); GovernmentGameplayDescription.setHeight (Window.getHeight () - Image.getHeight () - 20); GovernmentGameplayDescription.setTop (Image.getHeight () + 10); GovernmentGameplayDescription.setLeft (440); GovernmentGameplayDescription.setColor (Color.white); GovernmentGameplayDescription.setFontSize (14); Confirm = new ViewButton ("Ok!", OnConfirm); Confirm.setRelativeTo (Window); Confirm.setWidth (100); Confirm.setHeight (30); Confirm.setRight (5); Confirm.setBottom (5); this.addComponent (Window); this.addComponent (Image); this.addComponent (Label); this.addComponent (GovernmentDescription); this.addComponent (GovernmentGameplayDescription); this.addComponent (Confirm); }
public static void draw(View Vw, ViewWindow Window) { Window.title = "Space Stations"; InstanceData GameInstance = StateFundingGlobal.fetch.GameInstance; Review Rev = GameInstance.ActiveReview; Rev.touch (); string Description = "Below is a list of existing Space Stations. Vessels that are Space Stations should be labeled as " + "such, be in orbit, and must be able to generate their own power. Space Stations increase State Confidence as well as Public Opinion." + "Space Stations are scored by the following criteria: Total Fuel (SC), Total Ore (SC), Crew (PO), Crew Capacity (SC), Docking " + "Port Count (SC), Docked Vessels (PO) and if it has a science lab (SC/PO). If the Station is landed on an astroid it will also " + "get a bonus (PO). If you are on an astroid you will also get a bonus for having a drill (SC/PO)."; ViewLabel DescriptionLabel = new ViewLabel (Description); DescriptionLabel.setRelativeTo (Window); DescriptionLabel.setLeft (140); DescriptionLabel.setTop (20); DescriptionLabel.setColor (Color.white); DescriptionLabel.setHeight (100); DescriptionLabel.setWidth (Window.getWidth () - 140); Vw.addComponent (DescriptionLabel); ViewLabel TotalStations = new ViewLabel ("Total Stations: " + Rev.SpaceStations.Length); TotalStations.setRelativeTo (Window); TotalStations.setLeft (140); TotalStations.setTop (130); TotalStations.setColor (Color.white); TotalStations.setHeight (30); TotalStations.setWidth (Window.getWidth () - 140); Vw.addComponent (TotalStations); ViewScroll StationsScroll = new ViewScroll (); StationsScroll.setRelativeTo (Window); StationsScroll.setWidth (Window.getWidth () - 140); StationsScroll.setHeight (Window.getHeight () - 160); StationsScroll.setLeft (140); StationsScroll.setTop (150); Vw.addComponent(StationsScroll); SpaceStationReport[] Stations = Rev.SpaceStations; for (int i = 0; i < Stations.Length; i++) { drawItem (Stations [i], StationsScroll, i); } }
public static void draw (View Vw, ViewWindow Window) { Window.title = "Current State"; Instance GameInstance = StateFundingGlobal.fetch.GameInstance; Review Rev = GameInstance.ActiveReview; Rev.touch (); ViewTextArea TextArea = new ViewTextArea (GameInstance.ActiveReview.GetText()); 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); }
public static void draw(View Vw, ViewWindow Window) { Window.title = "Bases"; InstanceData GameInstance = StateFundingGlobal.fetch.GameInstance; Review Rev = GameInstance.ActiveReview; Rev.touch (); string Description = "Below is a list of existing Bases. Vessels that are Bases should be labeled as " + "such, be landed on a body other than the home planet, and be able to generate power. Bases increase State Confidence " + "as well as Public Opinion. Bases are scored by the following criteria: Total Fuel (SC), Total Ore (SC), Crew (PO), Crew Capacity " + "(SC), Docking Port Count (SC), Docked Vessels (PO), if it has a science lab (SC/PO), and if it has a drill (SC/PO)."; ViewLabel DescriptionLabel = new ViewLabel (Description); DescriptionLabel.setRelativeTo (Window); DescriptionLabel.setLeft (140); DescriptionLabel.setTop (20); DescriptionLabel.setColor (Color.white); DescriptionLabel.setHeight (100); DescriptionLabel.setWidth (Window.getWidth () - 140); Vw.addComponent (DescriptionLabel); ViewLabel TotalBases = new ViewLabel ("Total Bases: " + Rev.Bases.Length); TotalBases.setRelativeTo (Window); TotalBases.setLeft (140); TotalBases.setTop (130); TotalBases.setColor (Color.white); TotalBases.setHeight (30); TotalBases.setWidth (Window.getWidth () - 140); Vw.addComponent (TotalBases); ViewScroll BasesScroll = new ViewScroll (); BasesScroll.setRelativeTo (Window); BasesScroll.setWidth (Window.getWidth () - 140); BasesScroll.setHeight (Window.getHeight () - 160); BasesScroll.setLeft (140); BasesScroll.setTop (150); Vw.addComponent(BasesScroll); BaseReport[] Bases = Rev.Bases; for (int i = 0; i < Bases.Length; i++) { drawItem (Bases [i], BasesScroll, i); } }
public static void draw(View Vw, ViewWindow Window) { Window.title = "Past Reviews"; InstanceData GameInstance = StateFundingGlobal.fetch.GameInstance; curView = Vw; curWindow = Window; int buttonWidth = 180; int buttonHeight = 30; int buttonMargin = 10; int xOffset = 0; int yOffset = 0; ViewScroll PastReviewsScroll = new ViewScroll (); PastReviewsScroll.setRelativeTo (Window); PastReviewsScroll.setWidth (Window.getWidth () - 140); PastReviewsScroll.setHeight (Window.getHeight () - 50); PastReviewsScroll.setLeft (140); PastReviewsScroll.setTop (40); Vw.addComponent (PastReviewsScroll); for (int i = GameInstance.getReviews ().Length - 1; i >= 0; i--) { Review Rev = GameInstance.Reviews[i]; ViewReviewButton Btn = new ViewReviewButton (Rev, OnReviewClick); Btn.setRelativeTo (PastReviewsScroll); int left = 0; int top = yOffset * buttonMargin + yOffset * buttonHeight; Btn.setLeft (left); Btn.setTop (top); Btn.setWidth (buttonWidth); Btn.setHeight (buttonHeight); Btn.setColor (Color.white); yOffset++; PastReviewsScroll.Components.Add (Btn); } }
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.GetText()); 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); }
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); } }
private void createWindow() { Log.Info("StateFunding: NewInstanceConfigView: creating window"); Window = new ViewWindow("State Funding"); Window.setMargins(300, 100); Image = new ViewImage("assets/kerbalgovernment.jpg"); Image.setRelativeTo(Window); Image.setPercentWidth(100); Label = new ViewLabel( "We've been told it was in the best interest of our government to have a space program for some reason. " + "We're not rocket scientists, but you are. We will provide funding, make our wildest dreams come true.... " + "Or at least just help us keep our jobs." ); 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(150); Confirm.setHeight(30); Confirm.setRight(5); Confirm.setBottom(5); this.addComponent(Window); this.addComponent(Image); this.addComponent(Label); this.addComponent(Confirm); }
public void draw(View Vw, ViewWindow Window, Review review) { Window.title = "Rovers"; InstanceData GameInstance = StateFundingGlobal.fetch.GameInstance; if (GameInstance == null) { Log.Error("StateFundingHubRoversView.draw, Inst is null"); return; } string Description = "Below is a list of existing Rovers. Having more Rovers increases Public Opinion." + "Vessels that are rovers should be labeled as a Rover. They should have at least 4 wheels but can have more." + "If any wheels on the rover are broken they must be repaired. Rovers must has energy and be landed on a body other " + "than the home planet (Kerbin in most cases) to count."; ViewLabel DescriptionLabel = new ViewLabel(Description); DescriptionLabel.setRelativeTo(Window); DescriptionLabel.setLeft(140); DescriptionLabel.setTop(20); DescriptionLabel.setColor(Color.white); DescriptionLabel.setHeight(100); DescriptionLabel.setWidth(Window.getWidth() - 140); Vw.addComponent(DescriptionLabel); ViewLabel TotalRovers = new ViewLabel("Total Rovers: " + review.variables.rovers); TotalRovers.setRelativeTo(Window); TotalRovers.setLeft(140); TotalRovers.setTop(130); TotalRovers.setColor(Color.white); TotalRovers.setHeight(30); TotalRovers.setWidth(Window.getWidth() - 140); Vw.addComponent(TotalRovers); ViewScroll RoversScroll = new ViewScroll(); RoversScroll.setRelativeTo(Window); RoversScroll.setWidth(Window.getWidth() - 140); RoversScroll.setHeight(Window.getHeight() - 160); RoversScroll.setLeft(140); RoversScroll.setTop(150); Vw.addComponent(RoversScroll); Vessel[] Rovers = VesselHelper.GetRovers(); int labelHeight = 20; for (int i = 0; i < Rovers.Length; i++) { Vessel Rover = Rovers[i]; //string target; string label = Rover.GetName() + " is Landed at " + Rover.mainBody.GetName(); ViewLabel RoverLabel = new ViewLabel(label); RoverLabel.setRelativeTo(RoversScroll); RoverLabel.setTop(labelHeight + (labelHeight + 5) * i); RoverLabel.setLeft(0); RoverLabel.setHeight(labelHeight); RoverLabel.setWidth(RoversScroll.getWidth() - 20); RoverLabel.setColor(Color.white); RoversScroll.Components.Add(RoverLabel); } }
public static void draw(View Vw, ViewWindow Window) { Window.title = "Kerbals"; InstanceData GameInstance = StateFundingGlobal.fetch.GameInstance; Review Rev = GameInstance.ActiveReview; Rev.touch (); string Description = "You Love Kerbals, I Love Kerbals, Kerbals Love Kerbals. Just one of those facts of life. " + "So it goes without saying, having Kerbals actively on missions increases Public Opinion. " + "The more Kerbals you have in flight the more Public Opinion you will garner, but be careful, " + "a stranded Kerbal is as bad as a dead Kerbal and will hurt public opinion until they are " + "rescued. A qualified \"Stranded Kerbal\" is one that is in a vessel without fuel/energy, a science lab, " + "or a mining rig. They are floating without reason to be there. A kerbal will not be considered stranded unless it's " + "been on the current mission for at least 2 years."; ViewLabel DescriptionLabel = new ViewLabel (Description); DescriptionLabel.setRelativeTo (Window); DescriptionLabel.setLeft (140); DescriptionLabel.setTop (20); DescriptionLabel.setColor (Color.white); DescriptionLabel.setHeight (100); DescriptionLabel.setWidth (Window.getWidth () - 140); Vw.addComponent (DescriptionLabel); ViewLabel ActiveKerbals = new ViewLabel ("Active Kerbals: " + Rev.activeKerbals + ". Stranded Kerbals: " + Rev.strandedKerbals + "."); ActiveKerbals.setRelativeTo (Window); ActiveKerbals.setLeft (140); ActiveKerbals.setTop (130); ActiveKerbals.setColor (Color.white); ActiveKerbals.setHeight (30); ActiveKerbals.setWidth (Window.getWidth () - 140); Vw.addComponent (ActiveKerbals); ViewScroll KerbalsScroll = new ViewScroll (); KerbalsScroll.setRelativeTo (Window); KerbalsScroll.setWidth (Window.getWidth () - 140); KerbalsScroll.setHeight (Window.getHeight () - 160); KerbalsScroll.setLeft (140); KerbalsScroll.setTop (150); Vw.addComponent (KerbalsScroll); ProtoCrewMember[] Kerbals = KerbalHelper.GetKerbals (); int labelHeight = 20; for (int i = 0; i < Kerbals.Length; i++) { ProtoCrewMember Kerb = Kerbals [i]; string state = "Active"; Color color = Color.green; if (KerbalHelper.IsStranded (Kerb)) { state = "Stranded"; color = Color.white; } else if (KerbalHelper.QualifiedStranded(Kerb)) { state = "Active [Will be Stranded In " + KerbalHelper.TimeToStranded (Kerb) + " Days!]"; color = Color.yellow; } string label = Kerb.name + " (" + state + ")"; ViewLabel KerbalLabel = new ViewLabel (label); KerbalLabel.setRelativeTo (KerbalsScroll); KerbalLabel.setTop (labelHeight + (labelHeight + 5) * i); KerbalLabel.setLeft (0); KerbalLabel.setHeight (labelHeight); KerbalLabel.setWidth (KerbalsScroll.getWidth() - 20); KerbalLabel.setColor (color); KerbalsScroll.Components.Add (KerbalLabel); } }
public static void draw (View Vw, ViewWindow Window) { Window.title = "Science Stations"; Instance GameInstance = StateFundingGlobal.fetch.GameInstance; Review Rev = GameInstance.ActiveReview; Rev.touch (); string Description = "Below is a list of existing Science Sations. Having more Science Stations increases State " + "Confidence. Landed stations on other Celestial Bodies counts higher than Orbiting Stations. " + "To have a qualified Science Station you must have an antenna, a science lab, be able to generate " + "power, and have at least one Kerbal on board."; ViewLabel DescriptionLabel = new ViewLabel (Description); DescriptionLabel.setRelativeTo (Window); DescriptionLabel.setLeft (140); DescriptionLabel.setTop (20); DescriptionLabel.setColor (Color.white); DescriptionLabel.setHeight (100); DescriptionLabel.setWidth (Window.getWidth () - 140); Vw.addComponent (DescriptionLabel); ViewLabel TotalCoverage = new ViewLabel ("Orbiting Stations: " + Rev.orbitalScienceStations + ". " + "Landed Stations: " + Rev.planetaryScienceStations + "."); TotalCoverage.setRelativeTo (Window); TotalCoverage.setLeft (140); TotalCoverage.setTop (130); TotalCoverage.setColor (Color.white); TotalCoverage.setHeight (30); TotalCoverage.setWidth (Window.getWidth () - 140); Vw.addComponent (TotalCoverage); ViewScroll StationsScroll = new ViewScroll (); StationsScroll.setRelativeTo (Window); StationsScroll.setWidth (Window.getWidth () - 140); StationsScroll.setHeight (Window.getHeight () - 160); StationsScroll.setLeft (140); StationsScroll.setTop (150); Vw.addComponent(StationsScroll); Vessel[] ScienceStations = VesselHelper.GetScienceStations (); int labelHeight = 20; for (int i = 0; i < ScienceStations.Length; i++) { Vessel ScienceStation = ScienceStations [i]; string action; string target; if (ScienceStation.Landed) { action = "Landed At"; target = ScienceStation.mainBody.GetName (); } else { action = "Orbiting"; target = ScienceStation.GetOrbit ().referenceBody.GetName(); } string label = ScienceStation.GetName () + " is " + action + " " + target; ViewLabel StationLabel = new ViewLabel (label); StationLabel.setRelativeTo (StationsScroll); StationLabel.setTop (labelHeight + (labelHeight + 5) * i); StationLabel.setLeft (0); StationLabel.setHeight (labelHeight); StationLabel.setWidth (StationsScroll.getWidth () - 20); StationLabel.setColor (Color.white); StationsScroll.Components.Add (StationLabel); } }
public static void draw (View Vw, ViewWindow Window) { Window.title = "Satellite Coverage"; Instance GameInstance = StateFundingGlobal.fetch.GameInstance; Review Rev = GameInstance.ActiveReview; Rev.touch (); string Description = "Below is your space programs satellite coverage. Satellite coverage increases State Confidence. " + "The number of satellites needed to provide full coverage veries depending on the size of the " + "celestial body. Kerbin needs 10 satelites to be fully covered while a small moon like Pol only " + "needs 1 and the massive Jool needs 100. Your total coverage is calculated on the coverage provided " + "to all celestial bodies. So even though Jool needs so many you can still get a high coverage " + "rating by covering the smaller bodies. So start with Kerbin, moons, and the near planets. To have " + "a qualified \"Surveyor Satellite\" it must have an antenna, an autonomous control system, and be " + "able to generate power."; ViewLabel DescriptionLabel = new ViewLabel (Description); DescriptionLabel.setRelativeTo (Window); DescriptionLabel.setLeft (140); DescriptionLabel.setTop (20); DescriptionLabel.setColor (Color.white); DescriptionLabel.setHeight (100); DescriptionLabel.setWidth (Window.getWidth () - 140); Vw.addComponent (DescriptionLabel); ViewLabel TotalCoverage = new ViewLabel ("Total Coverage: " + Math.Round ((double)Rev.satelliteCoverage * 100) + "%"); TotalCoverage.setRelativeTo (Window); TotalCoverage.setLeft (140); TotalCoverage.setTop (130); TotalCoverage.setColor (Color.white); TotalCoverage.setHeight (30); TotalCoverage.setWidth (Window.getWidth () - 140); Vw.addComponent (TotalCoverage); ViewScroll CoverageScroll = new ViewScroll (); CoverageScroll.setRelativeTo (Window); CoverageScroll.setWidth (Window.getWidth () - 140); CoverageScroll.setHeight (Window.getHeight () - 160); CoverageScroll.setLeft (140); CoverageScroll.setTop (150); Vw.addComponent (CoverageScroll); CoverageReport[] Coverages = Rev.Coverages; int labelHeight = 20; for (int i = 0; i < Coverages.Length; i++) { CoverageReport Coverage = Coverages [i]; string label = Coverage.entity + " : (" + Coverage.satCount + "/" + Coverage.satCountForFullCoverage + ") " + Math.Round (Coverage.coverage * 100) + "%"; ViewLabel CoverageLabel = new ViewLabel (label); CoverageLabel.setRelativeTo (CoverageScroll); CoverageLabel.setTop (labelHeight + (labelHeight + 5) * i); CoverageLabel.setLeft (0); CoverageLabel.setHeight (labelHeight); CoverageLabel.setWidth (CoverageScroll.getWidth () - 20); if (Coverage.coverage <= 0.25) { CoverageLabel.setColor (Color.white); } else if (Coverage.coverage <= .75) { CoverageLabel.setColor (Color.yellow); } else { CoverageLabel.setColor (Color.green); } CoverageScroll.Components.Add (CoverageLabel); } }
public void draw(View Vw, ViewWindow Window, Review review) { Window.title = "Science Stations"; InstanceData GameInstance = StateFundingGlobal.fetch.GameInstance; if (GameInstance == null) { Log.Error("StateFundingHubLabView.draw, Inst is null"); return; } string Description = "Below is a list of existing Science Sations. Having more Science Stations increases State " + "Confidence. Landed stations on other Celestial Bodies counts higher than Orbiting Stations. " + "To have a qualified Science Station you must have an antenna, a science lab, be able to generate " + "power, and have at least one Kerbal on board."; ViewLabel DescriptionLabel = new ViewLabel(Description); DescriptionLabel.setRelativeTo(Window); DescriptionLabel.setLeft(140); DescriptionLabel.setTop(20); DescriptionLabel.setColor(Color.white); DescriptionLabel.setHeight(100); DescriptionLabel.setWidth(Window.getWidth() - 140); Vw.addComponent(DescriptionLabel); ViewLabel TotalCoverage = new ViewLabel("Orbiting Stations: " + (int)review.variables.orbitalScienceStations + ". " + "Landed Stations: " + (int)review.variables.planetaryScienceStations + "."); TotalCoverage.setRelativeTo(Window); TotalCoverage.setLeft(140); TotalCoverage.setTop(130); TotalCoverage.setColor(Color.white); TotalCoverage.setHeight(30); TotalCoverage.setWidth(Window.getWidth() - 140); Vw.addComponent(TotalCoverage); ViewScroll StationsScroll = new ViewScroll(); StationsScroll.setRelativeTo(Window); StationsScroll.setWidth(Window.getWidth() - 140); StationsScroll.setHeight(Window.getHeight() - 160); StationsScroll.setLeft(140); StationsScroll.setTop(150); Vw.addComponent(StationsScroll); Vessel[] ScienceStations = VesselHelper.GetScienceStations(); int labelHeight = 20; for (int i = 0; i < ScienceStations.Length; i++) { Vessel ScienceStation = ScienceStations[i]; string action; string target; if (ScienceStation.Landed) { action = "Landed At"; target = ScienceStation.mainBody.GetName(); } else { action = "Orbiting"; target = ScienceStation.GetOrbit().referenceBody.GetName(); } string label = ScienceStation.GetName() + " is " + action + " " + target; ViewLabel StationLabel = new ViewLabel(label); StationLabel.setRelativeTo(StationsScroll); StationLabel.setTop(labelHeight + (labelHeight + 5) * i); StationLabel.setLeft(0); StationLabel.setHeight(labelHeight); StationLabel.setWidth(StationsScroll.getWidth() - 20); StationLabel.setColor(Color.white); StationsScroll.Components.Add(StationLabel); } }
public void draw(View Vw, ViewWindow Window, Review review) { Window.title = "Mining Rigs"; InstanceData GameInstance = StateFundingGlobal.fetch.GameInstance; if (GameInstance == null) { Log.Error("StateFundingHubMiningView.draw, Inst is null"); return; } string Description = "Below is a list of existing Mining Rigs. Having more Mining Rigs increases State " + "Confidence. To have a qualified Mining Rig is must have an antenna, drill, be able to generate power, " + "and be Landed on a body other than Kerbin."; ViewLabel DescriptionLabel = new ViewLabel(Description); DescriptionLabel.setRelativeTo(Window); DescriptionLabel.setLeft(140); DescriptionLabel.setTop(20); DescriptionLabel.setColor(Color.white); DescriptionLabel.setHeight(100); DescriptionLabel.setWidth(Window.getWidth() - 140); Vw.addComponent(DescriptionLabel); ViewLabel TotalCoverage = new ViewLabel("Mining Rigs: " + review.variables.miningRigs); TotalCoverage.setRelativeTo(Window); TotalCoverage.setLeft(140); TotalCoverage.setTop(130); TotalCoverage.setColor(Color.white); TotalCoverage.setHeight(30); TotalCoverage.setWidth(Window.getWidth() - 140); Vw.addComponent(TotalCoverage); ViewScroll RigsScroll = new ViewScroll(); RigsScroll.setRelativeTo(Window); RigsScroll.setWidth(Window.getWidth() - 140); RigsScroll.setHeight(Window.getHeight() - 160); RigsScroll.setLeft(140); RigsScroll.setTop(150); Vw.addComponent(RigsScroll); Vessel[] MiningRigs = VesselHelper.GetMiningRigs(); int labelHeight = 20; for (int i = 0; i < MiningRigs.Length; i++) { Vessel MiningRig = MiningRigs[i]; string label = MiningRig.GetName() + " is Landed At " + MiningRig.mainBody.GetName();; ViewLabel MiningLabel = new ViewLabel(label); MiningLabel.setRelativeTo(RigsScroll); MiningLabel.setTop(labelHeight + (labelHeight + 5) * i); MiningLabel.setLeft(0); MiningLabel.setHeight(labelHeight); MiningLabel.setWidth(RigsScroll.getWidth() - 20); MiningLabel.setColor(Color.white); RigsScroll.Components.Add(MiningLabel); } }
public static void draw(View Vw, ViewWindow Window) { Window.title = "Satellite Coverage"; Instance GameInstance = StateFundingGlobal.fetch.GameInstance; Review Rev = GameInstance.ActiveReview; Rev.touch(); string Description = "Below is your space programs satellite coverage. Satellite coverage increases State Confidence. " + "The number of satellites needed to provide full coverage veries depending on the size of the " + "celestial body. Kerbin needs 10 satelites to be fully covered while a small moon like Pol only " + "needs 1 and the massive Jool needs 100. Your total coverage is calculated on the coverage provided " + "to all celestial bodies. So even though Jool needs so many you can still get a high coverage " + "rating by covering the smaller bodies. So start with Kerbin, moons, and the near planets. To have " + "a qualified \"Surveyor Satellite\" it must have an antenna, an autonomous control system, and be " + "able to generate power."; ViewLabel DescriptionLabel = new ViewLabel(Description); DescriptionLabel.setRelativeTo(Window); DescriptionLabel.setLeft(140); DescriptionLabel.setTop(20); DescriptionLabel.setColor(Color.white); DescriptionLabel.setHeight(100); DescriptionLabel.setWidth(Window.getWidth() - 140); Vw.addComponent(DescriptionLabel); ViewLabel TotalCoverage = new ViewLabel("Total Coverage: " + Math.Round((double)Rev.satelliteCoverage * 100) + "%"); TotalCoverage.setRelativeTo(Window); TotalCoverage.setLeft(140); TotalCoverage.setTop(130); TotalCoverage.setColor(Color.white); TotalCoverage.setHeight(30); TotalCoverage.setWidth(Window.getWidth() - 140); Vw.addComponent(TotalCoverage); ViewScroll CoverageScroll = new ViewScroll(); CoverageScroll.setRelativeTo(Window); CoverageScroll.setWidth(Window.getWidth() - 140); CoverageScroll.setHeight(Window.getHeight() - 160); CoverageScroll.setLeft(140); CoverageScroll.setTop(150); Vw.addComponent(CoverageScroll); CoverageReport[] Coverages = Rev.Coverages; int labelHeight = 20; for (int i = 0; i < Coverages.Length; i++) { CoverageReport Coverage = Coverages [i]; string label = Coverage.entity + " : (" + Coverage.satCount + "/" + Coverage.satCountForFullCoverage + ") " + Math.Round(Coverage.coverage * 100) + "%"; ViewLabel CoverageLabel = new ViewLabel(label); CoverageLabel.setRelativeTo(CoverageScroll); CoverageLabel.setTop(labelHeight + (labelHeight + 5) * i); CoverageLabel.setLeft(0); CoverageLabel.setHeight(labelHeight); CoverageLabel.setWidth(CoverageScroll.getWidth() - 20); if (Coverage.coverage <= 0.25) { CoverageLabel.setColor(Color.white); } else if (Coverage.coverage <= .75) { CoverageLabel.setColor(Color.yellow); } else { CoverageLabel.setColor(Color.green); } CoverageScroll.Components.Add(CoverageLabel); } }
public static void draw (View Vw, ViewWindow Window) { Window.title = "Rovers"; Instance GameInstance = StateFundingGlobal.fetch.GameInstance; Review Rev = GameInstance.ActiveReview; Rev.touch (); string Description = "Below is a list of existing Rovers. Having more Rovers increases Public Opinion." + "Vessels that are rovers should be labeled as a Rover. They should have at least 4 wheels but can have more." + "If any wheels on the rover are broken they must be repaired. Rovers must has energy and be landed on a body other " + "than the home planet (Kerbin in most cases) to count."; ViewLabel DescriptionLabel = new ViewLabel (Description); DescriptionLabel.setRelativeTo (Window); DescriptionLabel.setLeft (140); DescriptionLabel.setTop (20); DescriptionLabel.setColor (Color.white); DescriptionLabel.setHeight (100); DescriptionLabel.setWidth (Window.getWidth () - 140); Vw.addComponent (DescriptionLabel); ViewLabel TotalRovers = new ViewLabel ("Total Rovers: " + Rev.rovers); TotalRovers.setRelativeTo (Window); TotalRovers.setLeft (140); TotalRovers.setTop (130); TotalRovers.setColor (Color.white); TotalRovers.setHeight (30); TotalRovers.setWidth (Window.getWidth () - 140); Vw.addComponent (TotalRovers); ViewScroll RoversScroll = new ViewScroll (); RoversScroll.setRelativeTo (Window); RoversScroll.setWidth (Window.getWidth () - 140); RoversScroll.setHeight (Window.getHeight () - 160); RoversScroll.setLeft (140); RoversScroll.setTop (150); Vw.addComponent(RoversScroll); Vessel[] Rovers = VesselHelper.GetRovers (); int labelHeight = 20; for (int i = 0; i < Rovers.Length; i++) { Vessel Rover = Rovers [i]; string target; string label = Rover.GetName () + " is Landed at " + Rover.mainBody.GetName (); ViewLabel RoverLabel = new ViewLabel (label); RoverLabel.setRelativeTo (RoversScroll); RoverLabel.setTop (labelHeight + (labelHeight + 5) * i); RoverLabel.setLeft (0); RoverLabel.setHeight (labelHeight); RoverLabel.setWidth (RoversScroll.getWidth () - 20); RoverLabel.setColor (Color.white); RoversScroll.Components.Add (RoverLabel); } }
public static void draw(View Vw, ViewWindow Window) { Window.title = "Kerbals"; Instance GameInstance = StateFundingGlobal.fetch.GameInstance; Review Rev = GameInstance.ActiveReview; Rev.touch(); string Description = "You Love Kerbals, I Love Kerbals, Kerbals Love Kerbals. Just one of those facts of life. " + "So it goes without saying, having Kerbals actively on missions increases Public Opinion. " + "The more Kerbals you have in flight the more Public Opinion you will garner, but be careful, " + "a stranded Kerbal is as bad as a dead Kerbal and will hurt public opinion until they are " + "rescued. A qualified \"Stranded Kerbal\" is one that is in a vessel without fuel/energy, a science lab, " + "or a mining rig. They are floating without reason to be there. A kerbal will not be considered stranded unless it's " + "been on the current mission for at least 2 years."; ViewLabel DescriptionLabel = new ViewLabel(Description); DescriptionLabel.setRelativeTo(Window); DescriptionLabel.setLeft(140); DescriptionLabel.setTop(20); DescriptionLabel.setColor(Color.white); DescriptionLabel.setHeight(100); DescriptionLabel.setWidth(Window.getWidth() - 140); Vw.addComponent(DescriptionLabel); ViewLabel ActiveKerbals = new ViewLabel("Active Kerbals: " + Rev.activeKerbals + ". Stranded Kerbals: " + Rev.strandedKerbals + "."); ActiveKerbals.setRelativeTo(Window); ActiveKerbals.setLeft(140); ActiveKerbals.setTop(130); ActiveKerbals.setColor(Color.white); ActiveKerbals.setHeight(30); ActiveKerbals.setWidth(Window.getWidth() - 140); Vw.addComponent(ActiveKerbals); ViewScroll KerbalsScroll = new ViewScroll(); KerbalsScroll.setRelativeTo(Window); KerbalsScroll.setWidth(Window.getWidth() - 140); KerbalsScroll.setHeight(Window.getHeight() - 160); KerbalsScroll.setLeft(140); KerbalsScroll.setTop(150); Vw.addComponent(KerbalsScroll); ProtoCrewMember[] Kerbals = KerbalHelper.GetKerbals(); int labelHeight = 20; for (int i = 0; i < Kerbals.Length; i++) { ProtoCrewMember Kerb = Kerbals [i]; string state = "Active"; Color color = Color.green; if (KerbalHelper.IsStranded(Kerb)) { state = "Stranded"; color = Color.white; } else if (KerbalHelper.QualifiedStranded(Kerb)) { state = "Active [Will be Stranded In " + KerbalHelper.TimeToStranded(Kerb) + " Days!]"; color = Color.yellow; } string label = Kerb.name + " (" + state + ")"; ViewLabel KerbalLabel = new ViewLabel(label); KerbalLabel.setRelativeTo(KerbalsScroll); KerbalLabel.setTop(labelHeight + (labelHeight + 5) * i); KerbalLabel.setLeft(0); KerbalLabel.setHeight(labelHeight); KerbalLabel.setWidth(KerbalsScroll.getWidth() - 20); KerbalLabel.setColor(color); KerbalsScroll.Components.Add(KerbalLabel); } }