Example #1
0
        /// <summary>Draw the menu to the screen.</summary>
        /// <param name="b">The sprite batch.</param>
        public override void draw(SpriteBatch b)
        {
            Utilities.Data.Helper.Input.Suppress(Utilities.Data.MenuButton);

            //draw screen fade
            b.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * 0.75f);

            // draw menu box
            Game1.drawDialogueBox(xPositionOnScreen, yPositionOnScreen, width, height, false, true);

            // draw title scroll
            SpriteText.drawStringWithScrollCenteredAt(b, "New Recurring Reminder", Game1.viewport.Width / 2, yPositionOnScreen, "New Recurring Reminder");

            // draw textboxes
            ReminderMessageTextBox.Draw(b, false);
            ReminderIntervalTextBox.Draw(b, false);

            // draw labels
            foreach (ClickableComponent label in Labels)
            {
                if (label.name == "Reminder Message: " || label.name == "Reminder Interval: ")
                {
                    Utility.drawTextWithShadow(b, label.name, Game1.dialogueFont, new Vector2(label.bounds.X, label.bounds.Y), Color.Black);
                }
                else
                {
                    Utility.drawTextWithShadow(b, label.name, Game1.smallFont, new Vector2(label.bounds.X, label.bounds.Y), Color.Black);
                }
            }

            // draw OK button
            if (IsOkButtonReady())
            {
                OkButton.draw(b);
            }
            else
            {
                OkButton.draw(b);
                OkButton.draw(b, Color.Black * 0.5f, 0.97f);
            }

            // draw displayreminder button
            DisplayRemindersButton.draw(b);

            // draw cursor
            drawMouse(b);
        }
Example #2
0
        public override void receiveLeftClick(int x, int y, bool playSound = true)
        {
            ReminderMessageTextBox.Update();
            ReminderIntervalTextBox.Update();

            if (OkButton.containsPoint(x, y) && IsOkButtonReady())
            {
                HandleButtonClick(OkButton.name);
                OkButton.scale -= 0.25f;
                OkButton.scale  = Math.Max(0.75f, OkButton.scale);
            }

            if (DisplayRemindersButton.containsPoint(x, y))
            {
                Game1.activeClickableMenu = new DisplayReminders(OnChanged);
            }

            ReminderMessageTextBox.Update();
            ReminderIntervalTextBox.Update();
        }