public Review LastReview()
        {
            Instance Inst = StateFundingGlobal.fetch.GameInstance;

            Review[] Reviews = Inst.getReviews();
            return(Reviews [Reviews.Length - 1]);
        }
        private void LoadPastReviews()
        {
            reloadBase();

            Window.title = "Past Reviews";
            Instance GameInstance = StateFundingGlobal.fetch.GameInstance;

            int buttonWidth  = 60;
            int buttonHeight = 20;
            int buttonMargin = 10;
            int xOffset      = 0;
            int yOffset      = 0;

            for (int i = GameInstance.getReviews().Length - 1; i >= 0; i--)
            {
                Review Rev = GameInstance.getReviews() [i];

                ViewReviewButton Btn = new ViewReviewButton(Rev, OnReviewClick);
                Btn.setRelativeTo(Window);

                int left          = 140 + xOffset * buttonMargin + xOffset * buttonWidth;
                int top           = 40 + yOffset * buttonMargin + yOffset * buttonHeight;
                int absoluteRight = Window.getTopLeftX() + left + buttonWidth + 10;

                if (absoluteRight > Window.getBottomRightX())
                {
                    xOffset = 0;
                    yOffset++;

                    left = 140 + xOffset * buttonMargin + xOffset * buttonWidth;
                    top  = 40 + yOffset * buttonMargin + yOffset * buttonHeight;
                }


                Btn.setLeft(left);
                Btn.setTop(top);
                Btn.setWidth(buttonWidth);
                Btn.setHeight(buttonHeight);

                xOffset++;

                this.addComponent(Btn);
            }
        }
        public static void draw(View Vw, ViewWindow Window)
        {
            Window.title = "Past Reviews";
            Instance GameInstance = StateFundingGlobal.fetch.GameInstance;

            int buttonWidth  = 180;
            int buttonHeight = 30;
            int buttonMargin = 10;
            int xOffset      = 0;
            int yOffset      = 0;

            ViewScroll PastReviewsScroll = new ViewScroll();

            PastReviewsScroll.setRelativeTo(Window);
            PastReviewsScroll.setWidth(Window.getWidth() - 140);
            PastReviewsScroll.setHeight(Window.getHeight() - 50);
            PastReviewsScroll.setLeft(140);
            PastReviewsScroll.setTop(40);

            Vw.addComponent(PastReviewsScroll);

            for (int i = GameInstance.getReviews().Length - 1; i >= 0; i--)
            {
                Review Rev = GameInstance.getReviews() [i];

                ViewReviewButton Btn = new ViewReviewButton(Rev, OnReviewClick);
                Btn.setRelativeTo(PastReviewsScroll);

                int left = 0;
                int top  = yOffset * buttonMargin + yOffset * buttonHeight;

                Btn.setLeft(left);
                Btn.setTop(top);
                Btn.setWidth(buttonWidth);
                Btn.setHeight(buttonHeight);
                Btn.setColor(Color.white);

                yOffset++;

                PastReviewsScroll.Components.Add(Btn);
            }
        }
 public void tick()
 {
     if (GameInstance != null)
     {
         if (GameInstance.getReviews().Length > 0)
         {
             int year = (int)(TimeHelper.Quarters(Planetarium.GetUniversalTime()));
             if (year > ReviewMgr.LastReview().year)
             {
                 Debug.Log("Happy New Quarter!");
                 ReviewMgr.CompleteReview();
             }
         }
     }
 }
Exemple #5
0
 public void tick()
 {
     if (GameInstance != null)
     {
         if (GameInstance.getReviews().Length > 0)
         {
             int year = (int)(Planetarium.GetUniversalTime() / 60 / 60 / 6 / 426 * 4);
             if (year > ReviewMgr.LastReview().year)
             {
                 Debug.Log("Happy New Year!");
                 ReviewMgr.CompleteReview();
             }
         }
     }
 }