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);
              }
        }
        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);
              }
        }
        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 = "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 = "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);
      }
    }
Example #9
0
 // TODO: Fix this. It sucks
 public static void removeView(View V) {
   //ViewManager.Views.Remove (V);
   ViewManager.removeAll();
 }
Example #10
0
 public static void addView(View V) {
   ViewManager.Views.Add (V);
 }
    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);
      }
    }