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);
        }
        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);
        }
Esempio n. 4
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 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 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);
        }