Ejemplo n.º 1
0
 void SwitchPlayer(Player inPlayer, Player outPlayer)
 {
     if (inPlayer != null)
     {
         this.inPlayer = inPlayer;
         inpo.Player   = inPlayer;
         inpo.Active   = false;
         drawingarea2.QueueDraw();
         tagger.ResetSelection();
     }
     else
     {
         inframe.Visible = false;
     }
     if (outPlayer != null)
     {
         this.outPlayer = outPlayer;
         outpo.Player   = outPlayer;
         outpo.Active   = false;
         drawingarea3.QueueDraw();
         tagger.ResetSelection();
     }
     else
     {
         outframe.Visible = false;
     }
     selectedPlayer = null;
 }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        void HandleNewTagEvent(EventType eventType, List <Player> players, TeamType team, List <Tag> tags,
                               Time start, Time stop, Time eventTime, Score score, PenaltyCard card, DashboardButton btn)
        {
            TimelineEvent play = project.AddEvent(eventType, start, stop, eventTime, null, score, card, false);

            play.Team    = teamtagger.SelectedTeam;
            play.Players = selectedPlayers ?? new List <Player> ();
            play.Tags    = tags ?? new List <Tag> ();
            teamtagger.ResetSelection();
            selectedPlayers = null;
            Config.EventsBroker.EmitNewDashboardEvent(play, btn, true, null);
        }