void EditPlayer(Text text) { playerText = text; if (playerDialog == null) { Gtk.Dialog d = new Gtk.Dialog(Catalog.GetString("Select player"), this, DialogFlags.Modal | DialogFlags.DestroyWithParent, Stock.Cancel, ResponseType.Cancel); d.WidthRequest = 600; d.HeightRequest = 400; DrawingArea da = new DrawingArea(); TeamTagger tagger = new TeamTagger(new WidgetWrapper(da)); tagger.ShowSubstitutionButtons = false; tagger.LoadTeams(project.LocalTeamTemplate, project.VisitorTeamTemplate, project.Dashboard.FieldBackground); tagger.PlayersSelectionChangedEvent += players => { if (players.Count == 1) { Player p = players [0]; playerText.Value = p.ToString(); d.Respond(ResponseType.Ok); } tagger.ResetSelection(); }; d.VBox.PackStart(da, true, true, 0); d.ShowAll(); playerDialog = d; } if (playerDialog.Run() != (int)ResponseType.Ok) { text.Value = null; } playerDialog.Hide(); }
void LoadTeams(Project project, List <Player> homeFieldPlayers, List <Player> homeBenchPlayers, List <Player> awayFieldPlayers, List <Player> awayBenchPlayers) { List <Player> homeTeamPlayers, awayTeamPlayers; if (homeFieldPlayers != null) { homeTeamPlayers = homeFieldPlayers.Concat(homeBenchPlayers).ToList(); homeTeam = new Team { Colors = project.LocalTeamTemplate.Colors, ActiveColor = project.LocalTeamTemplate.ActiveColor, ID = project.LocalTeamTemplate.ID, Formation = project.LocalTeamTemplate.Formation, List = homeTeamPlayers }; } if (awayFieldPlayers != null) { awayTeamPlayers = awayFieldPlayers.Concat(awayBenchPlayers).ToList(); awayTeam = new Team { Colors = project.VisitorTeamTemplate.Colors, ActiveColor = project.VisitorTeamTemplate.ActiveColor, ID = project.VisitorTeamTemplate.ID, Formation = project.VisitorTeamTemplate.Formation, List = awayTeamPlayers }; } tagger.LoadTeams(homeTeam, awayTeam, project.Dashboard.FieldBackground); }
public void SetProject(Project project, ProjectType projectType, EventsFilter filter) { this.projectType = projectType; this.project = project; buttonswidget.Visible = true; if (project != null) { buttonswidget.Project = project; } buttonswidget.Mode = DashboardMode.Code; teamtagger.Project = project; teamtagger.LoadTeams(project.LocalTeamTemplate, project.VisitorTeamTemplate, project.Dashboard.FieldBackground); teamtagger.CurrentTime = new Time(0); if (projectType == ProjectType.FileProject) { timeline.SetProject(project, filter); } else if (projectType == ProjectType.FakeCaptureProject) { eventslistwidget.SetProject(project, filter); } eventslistwidget.Visible = projectType == ProjectType.FakeCaptureProject; timeline.Visible = projectType == ProjectType.FileProject; playspositionviewer1.LoadProject(project, filter); }
void LoadTemplate(Team template, TeamType team, bool forceColor) { if (team == TeamType.LOCAL) { hometemplate = template; hometacticsentry.Text = hometemplate.FormationStr; SetButtonColor(homecolor1, hometemplate.Colors [0]); SetButtonColor(homecolor2, hometemplate.Colors [1]); homecolor1button.Active = homecolor2button.Active = false; if ((forceColor && template.ActiveColor == 1) || (awaytemplate != null && awaytemplate.Color.Equals(hometemplate.Color))) { homecolor2button.Click(); } else { homecolor1button.Click(); } } else { awaytemplate = template; awaytacticsentry.Text = awaytemplate.FormationStr; SetButtonColor(awaycolor1, awaytemplate.Colors [0]); SetButtonColor(awaycolor2, awaytemplate.Colors [1]); awaycolor1button.Active = awaycolor2button.Active = false; if ((forceColor && template.ActiveColor == 1) || (hometemplate != null && hometemplate.Color.Equals(awaytemplate.Color))) { awaycolor2button.Click(); } else { awaycolor1button.Click(); } } teamtagger.LoadTeams(hometemplate, awaytemplate, analysisTemplate.FieldBackground); }
public void LoadPlay(TimelineEvent play, Project project, bool editTags, bool editPos, bool editPlayers, bool editNotes) { this.play = play; notesframe.Visible = editNotes; tagger.Visible = editPos && (play.EventType.TagFieldPosition || play.EventType.TagHalfFieldPosition || play.EventType.TagGoalPosition); drawingarea3.Visible = editPlayers; nameframe.Visible = editTags; tagsvbox.Visible = editTags; nameentry.Text = play.Name; nameentry.GrabFocus(); if (editPos) { tagger.LoadBackgrounds(project); tagger.LoadPlay(play); } if (editNotes) { notes.Play = play; } if (editPlayers) { teamtagger.Project = project; teamtagger.LoadTeams(project.LocalTeamTemplate, project.VisitorTeamTemplate, project.Dashboard.FieldBackground); /* Force lineup update */ teamtagger.CurrentTime = play.EventTime; teamtagger.Select(play.Players, play.Team); } if (editTags) { FillTags(project, play); } }