예제 #1
0
    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()
        {
            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);
        }
예제 #4
0
        private void LoadMiningRigs()
        {
            reloadBase();

            Window.title = "Mining Rigs";
            Instance 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);

            this.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);

            this.addComponent(TotalCoverage);

            Vessel[] MiningRigs = VesselHelper.GetMiningRigs();

            int offsetY     = 150;
            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(Window);
                MiningLabel.setTop(offsetY + labelHeight + (labelHeight + 5) * i);
                MiningLabel.setLeft(140);
                MiningLabel.setHeight(labelHeight);
                MiningLabel.setWidth(Window.getWidth() - 140);
                MiningLabel.setColor(Color.white);

                this.addComponent(MiningLabel);
            }
        }
예제 #5
0
        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);
            }
        }
        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 void draw(View Vw, ViewWindow Window, Review review)
        {
            Window.title = "Space Stations";

            InstanceData GameInstance = StateFundingGlobal.fetch.GameInstance;
            if (GameInstance == null)
            {
                Log.Error("StateFundingHubStationsView.draw, Inst is null");
                return;
            }

            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 asteroid it will also " +
              "get a bonus (PO). If you are on an asteroid 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: " + review.variables.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 = review.variables.SpaceStations;

            for (int i = 0; i < Stations.Length; i++)
            {
                drawItem(Stations[i], StationsScroll, i);
            }

        }
        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 = "Bases";
            Instance 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 = "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 = "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);
              }
        }
        void CreateGovernmentView()
        {
            int GvtDescrLeft     = 120;
            int GvtGameplayWidth = 250;
            int Availablewidth   = Window.getWidth() - GvtDescrLeft - GvtGameplayWidth - 40;

            int GvtDescrWidth   = Availablewidth;                       // 500;
            int GvtGameplayLeft = Window.getWidth() - GvtGameplayWidth; // 640;


            GvtDescrLeft    += GvtMenuAdjust;
            GvtGameplayLeft += GvtMenuAdjust;

            Log.Info("GvtMenuAdjust: " + GvtMenuAdjust);
            Log.Info("GvtDescrLeft: " + GvtDescrLeft);
            Log.Info("GvtGameplayWidth: " + GvtGameplayWidth);
            Log.Info("GvtDescrWidth: " + GvtDescrWidth);
            Log.Info("GvtGameplayLeft: " + GvtGameplayLeft);


            GovernmentDescription = new ViewLabel("");
            GovernmentDescription.setRelativeTo(Image);
            GovernmentDescription.setWidth(GvtDescrWidth);
            GovernmentDescription.setHeight(Window.getHeight() - Image.getHeight() - 20);
            GovernmentDescription.setTop(Image.getHeight() + 10);
            GovernmentDescription.setLeft(GvtDescrLeft);
            GovernmentDescription.setColor(Color.white);
            GovernmentDescription.setFontSize(14);

            GovernmentGameplayDescription = new ViewLabel("");
            GovernmentGameplayDescription.setRelativeTo(Image);
            GovernmentGameplayDescription.setWidth(GvtGameplayWidth);
            GovernmentGameplayDescription.setHeight(Window.getHeight() - Image.getHeight() - 20);
            GovernmentGameplayDescription.setTop(Image.getHeight() + 10);
            GovernmentGameplayDescription.setLeft(GvtGameplayLeft);
            GovernmentGameplayDescription.setColor(Color.white);
            GovernmentGameplayDescription.setFontSize(14);

            this.addComponent(GovernmentDescription);
            this.addComponent(GovernmentGameplayDescription);
        }
예제 #13
0
    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 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);
            }
        }
예제 #15
0
        private void LoadScienceStations()
        {
            reloadBase();

            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);

            this.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);

            this.addComponent(TotalCoverage);

            Vessel[] ScienceStations = VesselHelper.GetScienceStations();

            int offsetY     = 150;
            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(Window);
                StationLabel.setTop(offsetY + labelHeight + (labelHeight + 5) * i);
                StationLabel.setLeft(140);
                StationLabel.setHeight(labelHeight);
                StationLabel.setWidth(Window.getWidth() - 140);
                StationLabel.setColor(Color.white);

                this.addComponent(StationLabel);
            }
        }
예제 #16
0
        private void LoadKerbals()
        {
            reloadBase();

            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, a science lab, " +
                                 "or a mining rig. They are floating without reason to be there.";

            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);

            this.addComponent(DescriptionLabel);

            ViewLabel TotalCoverage = new ViewLabel("Active Kerbals: " + Rev.activeKerbals + ". Stranded Kerbals: " + Rev.strandedKerbals + ".");

            TotalCoverage.setRelativeTo(Window);
            TotalCoverage.setLeft(140);
            TotalCoverage.setTop(130);
            TotalCoverage.setColor(Color.white);
            TotalCoverage.setHeight(30);
            TotalCoverage.setWidth(Window.getWidth() - 140);

            this.addComponent(TotalCoverage);

            ProtoCrewMember[] Kerbals = KerbalHelper.GetKerbals();

            int offsetY     = 150;
            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;
                }

                string label = Kerb.name + " (" + state + ")";

                ViewLabel KerbalLabel = new ViewLabel(label);
                KerbalLabel.setRelativeTo(Window);
                KerbalLabel.setTop(offsetY + labelHeight + (labelHeight + 5) * i);
                KerbalLabel.setLeft(140);
                KerbalLabel.setHeight(labelHeight);
                KerbalLabel.setWidth(Window.getWidth() - 140);
                KerbalLabel.setColor(color);

                this.addComponent(KerbalLabel);
            }
        }
        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 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);
        }
예제 #19
0
    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);
      }
    }
예제 #20
0
        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);
            }
        }
예제 #21
0
        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);
            }
        }
예제 #22
0
        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);
            }
        }
예제 #23
0
        private void LoadKerbals()
        {
            reloadBase ();

              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, a science lab, " +
                           "or a mining rig. They are floating without reason to be there.";

              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);

              this.addComponent (DescriptionLabel);

              ViewLabel TotalCoverage = new ViewLabel ("Active Kerbals: " + Rev.activeKerbals + ". Stranded Kerbals: " + Rev.strandedKerbals + ".");
              TotalCoverage.setRelativeTo (Window);
              TotalCoverage.setLeft (140);
              TotalCoverage.setTop (130);
              TotalCoverage.setColor (Color.white);
              TotalCoverage.setHeight (30);
              TotalCoverage.setWidth (Window.getWidth () - 140);

              this.addComponent (TotalCoverage);

              ProtoCrewMember[] Kerbals = KerbalHelper.GetKerbals ();

              int offsetY = 150;
              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;
            }

            string label = Kerb.name + " (" + state + ")";

            ViewLabel KerbalLabel = new ViewLabel (label);
            KerbalLabel.setRelativeTo (Window);
            KerbalLabel.setTop (offsetY + labelHeight + (labelHeight + 5) * i);
            KerbalLabel.setLeft (140);
            KerbalLabel.setHeight (labelHeight);
            KerbalLabel.setWidth (Window.getWidth () - 140);
            KerbalLabel.setColor (color);

            this.addComponent (KerbalLabel);
              }
        }
예제 #24
0
        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);
            }
        }
        public static void drawItem(BaseReport Base, 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     = "[" + Base.name + " is Landed At " + Base.entity + "]";
            ViewLabel BaseLabel = new ViewLabel(label);

            BaseLabel.setRelativeTo(Box);
            BaseLabel.setTop(5);
            BaseLabel.setLeft(5);
            BaseLabel.setHeight(15);
            BaseLabel.setPercentWidth(100);
            BaseLabel.setColor(Color.green);
            parent.Components.Add(BaseLabel);

            ViewLabel FuelLabel = new ViewLabel("Fuel: " + Base.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: " + Base.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: " + Base.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: " + Base.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: " + Base.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: " + Base.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: " + Base.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: " + Base.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 SCLabel = new ViewLabel("PO: " + Base.po);

            SCLabel.setRelativeTo(Box);
            SCLabel.setTop(25);
            SCLabel.setLeft(310);
            SCLabel.setHeight(15);
            SCLabel.setWidth(150);
            SCLabel.setColor(Color.white);
            parent.Components.Add(SCLabel);

            ViewLabel POLabel = new ViewLabel("SC: " + Base.sc);

            POLabel.setRelativeTo(Box);
            POLabel.setTop(45);
            POLabel.setLeft(310);
            POLabel.setHeight(15);
            POLabel.setWidth(150);
            POLabel.setColor(Color.white);
            parent.Components.Add(POLabel);
        }
    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 = "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);
      }
    }