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; } }
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; }
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(); }