public static void drawItem(SpaceStationReport Station, ViewScroll parent, int offset) { int boxHeight = 110; ViewBox Box = new ViewBox(); Box.setRelativeTo(parent); Box.setWidth(parent.getWidth() - 20); Box.setHeight(boxHeight); Box.setLeft(0); Box.setTop((boxHeight + 10) * offset); Box.setColor(Color.white); parent.Components.Add(Box); string label = "[" + Station.name + " is Orbiting " + Station.entity + "]"; ViewLabel StationLabel = new ViewLabel(label); StationLabel.setRelativeTo(Box); StationLabel.setTop(5); StationLabel.setLeft(5); StationLabel.setHeight(15); StationLabel.setPercentWidth(100); StationLabel.setColor(Color.green); parent.Components.Add(StationLabel); ViewLabel FuelLabel = new ViewLabel("Fuel: " + Station.fuel); FuelLabel.setRelativeTo(Box); FuelLabel.setTop(25); FuelLabel.setLeft(5); FuelLabel.setHeight(15); FuelLabel.setWidth(150); FuelLabel.setColor(Color.white); parent.Components.Add(FuelLabel); ViewLabel OreLabel = new ViewLabel("Ore: " + Station.ore); OreLabel.setRelativeTo(Box); OreLabel.setTop(45); OreLabel.setLeft(5); OreLabel.setHeight(20); OreLabel.setWidth(150); OreLabel.setColor(Color.white); parent.Components.Add(OreLabel); ViewLabel CrewLabel = new ViewLabel("Crew: " + Station.crew); CrewLabel.setRelativeTo(Box); CrewLabel.setTop(65); CrewLabel.setLeft(5); CrewLabel.setHeight(20); CrewLabel.setWidth(150); CrewLabel.setColor(Color.white); parent.Components.Add(CrewLabel); ViewLabel CrewCapacityLabel = new ViewLabel("Crew Capacity: " + Station.crewCapacity); CrewCapacityLabel.setRelativeTo(Box); CrewCapacityLabel.setTop(85); CrewCapacityLabel.setLeft(5); CrewCapacityLabel.setHeight(20); CrewCapacityLabel.setWidth(150); CrewCapacityLabel.setColor(Color.white); parent.Components.Add(CrewCapacityLabel); ViewLabel DockingPortsLabel = new ViewLabel("Docking Ports: " + Station.dockingPorts); DockingPortsLabel.setRelativeTo(Box); DockingPortsLabel.setTop(25); DockingPortsLabel.setLeft(155); DockingPortsLabel.setHeight(15); DockingPortsLabel.setWidth(150); DockingPortsLabel.setColor(Color.white); parent.Components.Add(DockingPortsLabel); ViewLabel DockedVesselsLabel = new ViewLabel("Docked Vessels: " + Station.dockedVessels); DockedVesselsLabel.setRelativeTo(Box); DockedVesselsLabel.setTop(45); DockedVesselsLabel.setLeft(155); DockedVesselsLabel.setHeight(15); DockedVesselsLabel.setWidth(150); DockedVesselsLabel.setColor(Color.white); parent.Components.Add(DockedVesselsLabel); ViewLabel ScienceLabLabel = new ViewLabel("Science Lab: " + Station.scienceLab); ScienceLabLabel.setRelativeTo(Box); ScienceLabLabel.setTop(65); ScienceLabLabel.setLeft(155); ScienceLabLabel.setHeight(15); ScienceLabLabel.setWidth(150); ScienceLabLabel.setColor(Color.white); parent.Components.Add(ScienceLabLabel); ViewLabel HasDrillLabel = new ViewLabel("Has Drill: " + Station.drill); HasDrillLabel.setRelativeTo(Box); HasDrillLabel.setTop(85); HasDrillLabel.setLeft(155); HasDrillLabel.setHeight(15); HasDrillLabel.setWidth(150); HasDrillLabel.setColor(Color.white); parent.Components.Add(HasDrillLabel); ViewLabel AsteroidLabel = new ViewLabel("On Asteroid: " + Station.onAsteroid); AsteroidLabel.setRelativeTo(Box); AsteroidLabel.setTop(25); AsteroidLabel.setLeft(310); AsteroidLabel.setHeight(15); AsteroidLabel.setWidth(150); AsteroidLabel.setColor(Color.white); parent.Components.Add(AsteroidLabel); ViewLabel SCLabel = new ViewLabel("PO: " + Station.po); SCLabel.setRelativeTo(Box); SCLabel.setTop(45); SCLabel.setLeft(310); SCLabel.setHeight(15); SCLabel.setWidth(150); SCLabel.setColor(Color.white); parent.Components.Add(SCLabel); ViewLabel POLabel = new ViewLabel("SC: " + Station.sc); POLabel.setRelativeTo(Box); POLabel.setTop(65); POLabel.setLeft(310); POLabel.setHeight(15); POLabel.setWidth(150); POLabel.setColor(Color.white); parent.Components.Add(POLabel); }
public static void drawItem(SpaceStationReport Station, ViewScroll parent, int offset) { int boxHeight = 110; ViewBox Box = new ViewBox (); Box.setRelativeTo (parent); Box.setWidth (parent.getWidth () - 20); Box.setHeight (boxHeight); Box.setLeft (0); Box.setTop ((boxHeight + 10) * offset); Box.setColor (Color.white); parent.Components.Add (Box); string label = "[" + Station.name + " is Orbiting " + Station.entity + "]"; ViewLabel StationLabel = new ViewLabel (label); StationLabel.setRelativeTo (Box); StationLabel.setTop (5); StationLabel.setLeft (5); StationLabel.setHeight (15); StationLabel.setPercentWidth (100); StationLabel.setColor (Color.green); parent.Components.Add (StationLabel); ViewLabel FuelLabel = new ViewLabel ("Fuel: " + Station.fuel); FuelLabel.setRelativeTo (Box); FuelLabel.setTop (25); FuelLabel.setLeft (5); FuelLabel.setHeight (15); FuelLabel.setWidth (150); FuelLabel.setColor (Color.white); parent.Components.Add (FuelLabel); ViewLabel OreLabel = new ViewLabel ("Ore: " + Station.ore); OreLabel.setRelativeTo (Box); OreLabel.setTop (45); OreLabel.setLeft (5); OreLabel.setHeight (20); OreLabel.setWidth (150); OreLabel.setColor (Color.white); parent.Components.Add (OreLabel); ViewLabel CrewLabel = new ViewLabel ("Crew: " + Station.crew); CrewLabel.setRelativeTo (Box); CrewLabel.setTop (65); CrewLabel.setLeft (5); CrewLabel.setHeight (20); CrewLabel.setWidth (150); CrewLabel.setColor (Color.white); parent.Components.Add (CrewLabel); ViewLabel CrewCapacityLabel = new ViewLabel ("Crew Capacity: " + Station.crewCapacity); CrewCapacityLabel.setRelativeTo (Box); CrewCapacityLabel.setTop (85); CrewCapacityLabel.setLeft (5); CrewCapacityLabel.setHeight (20); CrewCapacityLabel.setWidth (150); CrewCapacityLabel.setColor (Color.white); parent.Components.Add (CrewCapacityLabel); ViewLabel DockingPortsLabel = new ViewLabel ("Docking Ports: " + Station.dockingPorts); DockingPortsLabel.setRelativeTo (Box); DockingPortsLabel.setTop (25); DockingPortsLabel.setLeft (155); DockingPortsLabel.setHeight (15); DockingPortsLabel.setWidth (150); DockingPortsLabel.setColor (Color.white); parent.Components.Add (DockingPortsLabel); ViewLabel DockedVesselsLabel = new ViewLabel ("Docked Vessels: " + Station.dockedVessels); DockedVesselsLabel.setRelativeTo (Box); DockedVesselsLabel.setTop (45); DockedVesselsLabel.setLeft (155); DockedVesselsLabel.setHeight (15); DockedVesselsLabel.setWidth (150); DockedVesselsLabel.setColor (Color.white); parent.Components.Add (DockedVesselsLabel); ViewLabel ScienceLabLabel = new ViewLabel ("Science Lab: " + Station.scienceLab); ScienceLabLabel.setRelativeTo (Box); ScienceLabLabel.setTop (65); ScienceLabLabel.setLeft (155); ScienceLabLabel.setHeight (15); ScienceLabLabel.setWidth (150); ScienceLabLabel.setColor (Color.white); parent.Components.Add (ScienceLabLabel); ViewLabel HasDrillLabel = new ViewLabel ("Has Drill: " + Station.drill); HasDrillLabel.setRelativeTo (Box); HasDrillLabel.setTop (85); HasDrillLabel.setLeft (155); HasDrillLabel.setHeight (15); HasDrillLabel.setWidth (150); HasDrillLabel.setColor (Color.white); parent.Components.Add (HasDrillLabel); ViewLabel AstroidLabel = new ViewLabel ("On Astroid: " + Station.onAstroid); AstroidLabel.setRelativeTo (Box); AstroidLabel.setTop (25); AstroidLabel.setLeft (310); AstroidLabel.setHeight (15); AstroidLabel.setWidth (150); AstroidLabel.setColor (Color.white); parent.Components.Add (AstroidLabel); ViewLabel SCLabel = new ViewLabel ("PO: " + Station.po); SCLabel.setRelativeTo (Box); SCLabel.setTop (45); SCLabel.setLeft (310); SCLabel.setHeight (15); SCLabel.setWidth (150); SCLabel.setColor (Color.white); parent.Components.Add (SCLabel); ViewLabel POLabel = new ViewLabel ("SC: " + Station.sc); POLabel.setRelativeTo (Box); POLabel.setTop (65); POLabel.setLeft (310); POLabel.setHeight (15); POLabel.setWidth (150); POLabel.setColor (Color.white); parent.Components.Add (POLabel); }
public string GetText() { Instance Inst = StateFundingGlobal.fetch.GameInstance; string returnText = "# Review for Quarter: " + year + "\n\n" + "Funding: " + funds + "\n\n" + "Public Opinion: " + po + "\n" + "State Confidence: " + sc + "\n" + "Public Opinion After Modifiers & Decay: " + finalPO + "\n" + "State Confidence After Modifiers & Decay: " + finalSC + "\n\n" + "Active Kerbals: " + activeKerbals + "\n" + "Satellite Coverage: " + Math.Round(satelliteCoverage * 100) + "%\n" + "Active Mining Rigs: " + miningRigs + "\n" + "Rovers: " + rovers + "\n" + "Obital Science Stations: " + orbitalScienceStations + "\n" + "Planetary Science Stations: " + planetaryScienceStations + "\n" + "Govt. Contracts Completed: " + contractsCompleted + "\n" + "Govt. Contracts Failed: " + contractsFailed + "\n" + "Kerbal \"Accidents\": " + kerbalDeaths + "\n" + "Stranded Kerbals: " + strandedKerbals + "\n" + "Vessels Destroyed: " + vesselsDestroyed; if (SpaceStations.Length > 0) { returnText += "\n\n== Space Stations ==\n\n"; for (int i = 0; i < SpaceStations.Length; i++) { SpaceStationReport StationReport = SpaceStations [i]; returnText += "[" + StationReport.name + " Orbiting " + StationReport.entity + "]\n"; returnText += "Fuel: " + StationReport.fuel + "\n"; returnText += "Ore: " + StationReport.ore + "\n"; returnText += "Crew: " + StationReport.crew + "\n"; returnText += "Crew Capacity: " + StationReport.crewCapacity + "\n"; returnText += "Docked Vessels: " + StationReport.dockedVessels + "\n"; returnText += "Docking Ports: " + StationReport.dockingPorts + "\n"; returnText += "Has Drill: " + StationReport.drill + "\n"; returnText += "Science Lab: " + StationReport.scienceLab + "\n"; returnText += "On Astroid: " + StationReport.onAstroid + "\n"; returnText += "PO: " + StationReport.po + "\n"; returnText += "SC: " + StationReport.sc + "\n\n"; } } if (Bases.Length > 0) { returnText += "\n\n== Bases ==\n\n"; for (int i = 0; i < Bases.Length; i++) { BaseReport Base = Bases [i]; returnText += "[" + Base.name + " Landed At " + Base.entity + "]\n"; returnText += "Fuel: " + Base.fuel + "\n"; returnText += "Ore: " + Base.ore + "\n"; returnText += "Crew: " + Base.crew + "\n"; returnText += "Crew Capacity: " + Base.crewCapacity + "\n"; returnText += "Docked Vessels: " + Base.dockedVessels + "\n"; returnText += "Docking Ports: " + Base.dockingPorts + "\n"; returnText += "Has Drill: " + Base.drill + "\n"; returnText += "Science Lab: " + Base.scienceLab + "\n"; returnText += "PO: " + Base.po + "\n"; returnText += "SC: " + Base.sc + "\n\n"; } } return(returnText); }
private void UpdateSpaceStations() { Debug.Log ("Updating Space Stations"); InstanceData GameInstance = StateFundingGlobal.fetch.GameInstance; Vessel[] SpcStations = VesselHelper.GetSpaceStations (); SpaceStations = new SpaceStationReport[SpcStations.Length]; for (int i = 0; i < SpcStations.Length; i++) { Vessel SpcStation = SpcStations [i]; SpaceStationReport SpcStationReport = new SpaceStationReport (); SpcStationReport.name = SpcStation.vesselName; SpcStationReport.crew = VesselHelper.GetCrew (SpcStation).Length; SpcStationReport.crewCapacity = VesselHelper.GetCrewCapactiy (SpcStation); SpcStationReport.dockedVessels = VesselHelper.GetDockedVesselsCount (SpcStation); SpcStationReport.dockingPorts = VesselHelper.GetDockingPorts (SpcStation).Length; SpcStationReport.drill = VesselHelper.VesselHasModuleAlias (SpcStation, "Drill"); SpcStationReport.scienceLab = VesselHelper.VesselHasModuleAlias (SpcStation, "ScienceLab"); SpcStationReport.fuel = VesselHelper.GetResourceCount (SpcStation, "LiquidFuel"); SpcStationReport.ore = VesselHelper.GetResourceCount (SpcStation, "Ore"); SpcStationReport.onAstroid = VesselHelper.OnAstroid (SpcStation); if (SpcStation.Landed) { SpcStationReport.entity = SpcStation.landedAt; } else { SpcStationReport.entity = SpcStation.GetOrbit ().referenceBody.GetName (); } SpcStationReport.po = 0; SpcStationReport.sc = 0; SpcStationReport.po += (int)(5 * SpcStationReport.crew * GameInstance.Gov.poModifier); SpcStationReport.po += (int)(5 * SpcStationReport.dockedVessels * GameInstance.Gov.poModifier); if (SpcStationReport.onAstroid) { SpcStationReport.po += (int)(30 * GameInstance.Gov.poModifier); if (SpcStationReport.drill) { SpcStationReport.po += (int)(10 * GameInstance.Gov.poModifier); SpcStationReport.sc += (int)(10 * GameInstance.Gov.poModifier); } } SpcStationReport.sc += (int)(2 * SpcStationReport.crewCapacity * GameInstance.Gov.scModifier); SpcStationReport.sc += (int)(SpcStationReport.fuel / 200f * GameInstance.Gov.scModifier); SpcStationReport.sc += (int)(SpcStationReport.ore / 200f * GameInstance.Gov.scModifier); SpcStationReport.sc += (int)(2 * SpcStationReport.dockingPorts * GameInstance.Gov.scModifier); SpcStationReport.sc += (int)(2 * SpcStationReport.crewCapacity * GameInstance.Gov.scModifier); if (SpcStationReport.scienceLab) { SpcStationReport.po += (int)(10 * GameInstance.Gov.poModifier); SpcStationReport.sc += (int)(10 * GameInstance.Gov.poModifier); } SpaceStations [i] = SpcStationReport; } }
private void UpdateSpaceStations() { Debug.Log("Updating Space Stations"); Instance GameInstance = StateFundingGlobal.fetch.GameInstance; Vessel[] SpcStations = VesselHelper.GetSpaceStations(); SpaceStations = new SpaceStationReport[SpcStations.Length]; for (int i = 0; i < SpcStations.Length; i++) { Vessel SpcStation = SpcStations [i]; SpaceStationReport SpcStationReport = new SpaceStationReport(); SpcStationReport.name = SpcStation.vesselName; SpcStationReport.crew = VesselHelper.GetCrew(SpcStation).Length; SpcStationReport.crewCapacity = VesselHelper.GetCrewCapactiy(SpcStation); SpcStationReport.dockedVessels = VesselHelper.GetDockedVesselsCount(SpcStation); SpcStationReport.dockingPorts = VesselHelper.GetDockingPorts(SpcStation).Length; SpcStationReport.drill = VesselHelper.VesselHasModuleAlias(SpcStation, "Drill"); SpcStationReport.scienceLab = VesselHelper.VesselHasModuleAlias(SpcStation, "ScienceLab"); SpcStationReport.fuel = VesselHelper.GetResourceCount(SpcStation, "LiquidFuel"); SpcStationReport.ore = VesselHelper.GetResourceCount(SpcStation, "Ore"); SpcStationReport.onAstroid = VesselHelper.OnAstroid(SpcStation); if (SpcStation.Landed) { SpcStationReport.entity = SpcStation.landedAt; } else { SpcStationReport.entity = SpcStation.GetOrbit().referenceBody.GetName(); } SpcStationReport.po = 0; SpcStationReport.sc = 0; SpcStationReport.po += (int)(5 * SpcStationReport.crew * GameInstance.Gov.poModifier); SpcStationReport.po += (int)(5 * SpcStationReport.dockedVessels * GameInstance.Gov.poModifier); if (SpcStationReport.onAstroid) { SpcStationReport.po += (int)(30 * GameInstance.Gov.poModifier); if (SpcStationReport.drill) { SpcStationReport.po += (int)(10 * GameInstance.Gov.poModifier); SpcStationReport.sc += (int)(10 * GameInstance.Gov.poModifier); } } SpcStationReport.sc += (int)(2 * SpcStationReport.crewCapacity * GameInstance.Gov.scModifier); SpcStationReport.sc += (int)(SpcStationReport.fuel / 200f * GameInstance.Gov.scModifier); SpcStationReport.sc += (int)(SpcStationReport.ore / 200f * GameInstance.Gov.scModifier); SpcStationReport.sc += (int)(2 * SpcStationReport.dockingPorts * GameInstance.Gov.scModifier); SpcStationReport.sc += (int)(2 * SpcStationReport.crewCapacity * GameInstance.Gov.scModifier); if (SpcStationReport.scienceLab) { SpcStationReport.po += (int)(10 * GameInstance.Gov.poModifier); SpcStationReport.sc += (int)(10 * GameInstance.Gov.poModifier); } SpaceStations [i] = SpcStationReport; } }