public static Button Chal_remove_att(ChalLine line) { var btn = Get(line.Chal.Remove_att, 0, 0, line.Chal.Row_4, "Remove attempt"); line.Chal.Remove_att.Width = 125; line.Chal.Remove_att.Click += (source, e) => { AttemptsControl.RemoveLast(line.Quest.Type); line.Chal.Remove_att.IsEnabled = false; line.Chal.Disable_quest.IsEnabled = true; line.Chal.Grid_chal.Background = UtilWPF.Vocour_row_off; line.Quest.LoadCrossData(); var updated = QuestControl.Get(line.Quest.Type).First(x => x.Id == line.Quest.Id); line.Chal.Avg_w.Content = updated.Avg_week + "% (w)"; line.Chal.Avg_m.Content = updated.Avg_month + "% (m)"; line.Chal.Avg_all.Content = updated.Avg_all + "% (all)"; line.Chal.Tries.Content = updated.Tries.Count + " tries"; line.Chal.Chance.Content = updated.Chance + " (" + Math.Round(updated.Chance_real, 2) + ")"; }; return(btn); }
public static Label Chal_quest_id(ChalLine line, int Column) { var reference = line.Chal.Id_Voc; var content = "Quest Id: " + line.Quest.Id; Get(reference, 0, Column, line.Chal.Row_4, content); reference.ToolTip = "Right click to copy the Id"; reference.MouseRightButtonDown += (source, e) => Clipboard.SetText(line.Quest.Id.ToString()); return(reference); }
public static Button Chal_disable_quest(ChalLine line) { var btn = Get(line.Chal.Disable_quest, 0, 4, line.Chal.Row_4, "Disable quest"); line.Chal.Disable_quest.Width = 125; line.Chal.Disable_quest.IsEnabled = false; line.Chal.Disable_quest.Click += (source, e) => { line.Quest.Disable(); QuestControl.Update(line.Quest); line.Chal.Disable_quest.IsEnabled = false; }; return(btn); }