示例#1
0
 public void ChooseFood(PictureBox p)
 {
     if (_chosen == null || _chosen != (AchievementBox)p.Parent)
     {
         if (_chosen != null)
         {
             _chosen.clicked   = false;
             _chosen.BackColor = Color.White;
         }
         _chosen         = (AchievementBox)p.Parent;
         _chosen.clicked = true;
         ShowDetail();
     }
     else
     {
         _chosen = null;
     }
 }
示例#2
0
 public void SetAchievement()
 {
     Global.SynchronizeAchievement();
     for (int i = 0; i < Global.DefaultAchievements.Count; i++)
     {
         foreach (Achievement a in Global.Achievements)
         {
             if (Global.DefaultAchievements[i].title == a.title)
             {
                 _achievementBtn[i].Images().BackgroundImage = Global.DefaultAchievements[i].image;
                 _achievementBtn[i].Title().Text             = Global.DefaultAchievements[i].title;
                 _achievementBtn[i].Desc().Text = Global.DefaultAchievements[i].desc;
                 break;
             }
         }
     }
     _chosen = null;
     _achievementDetail.Visible = false;
 }
示例#3
0
        private void ChooseAchievement(object sender, EventArgs e)
        {
            PictureBox p = (PictureBox)sender;

            if (_chosen == null || _chosen != (AchievementBox)p.Parent)
            {
                if (_chosen != null)
                {
                    _chosen.clicked   = false;
                    _chosen.BackColor = Color.White;
                }
                _chosen         = (AchievementBox)p.Parent;
                _chosen.clicked = true;
                ShowDetail();
            }
            else
            {
                _chosen = null;
                _achievementDetail.Visible = false;
            }
            Invalidate();
        }