Exemple #1
0
        /// <summary>
        /// Handles the left click on the UI elements
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="playSound"></param>
        public override void receiveLeftClick(int x, int y, bool playSound = true)
        {
            // clicked next page
            if (NextPageButton.containsPoint(x, y))
            {
                if (Reminders.Count > (PageIndex + 1) * 5)
                {
                    PageIndex += 1;
                    SetUpUI();
                }
            }
            // clicked previous page
            else if (PrevPageButton.containsPoint(x, y))
            {
                if (PageIndex != 0)
                {
                    PageIndex -= 1;
                    SetUpUI();
                }
            }

            // clicked new reminder
            if (NewReminderButton.containsPoint(x, y))
            {
                Game1.activeClickableMenu = new NewReminder_Page1(Page1OnChangeBehaviour);
            }

            // clicked delete button
            int reminderindex = 0;

            foreach (ClickableTextureComponent deleteButton in DeleteButtons)
            {
                reminderindex++;
                if (deleteButton.containsPoint(x, y))
                {
                    int reminderIndex = (PageIndex * 5) + reminderindex;
                    Utilities.Files.DeleteReminder(reminderIndex);
                    SetUpUI();
                    break;
                }
            }
        }
Exemple #2
0
 /// <summary>Defines what to do when hovering over UI elements</summary>
 public override void performHoverAction(int x, int y)
 {
     NewReminderButton.scale = NewReminderButton.containsPoint(x, y)
         ? Math.Min(NewReminderButton.scale + 0.02f, NewReminderButton.baseScale + 0.1f)
         : Math.Max(NewReminderButton.scale - 0.02f, NewReminderButton.baseScale);
 }