[longomatch] Implement player selection in the teams tagger
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Implement player selection in the teams tagger
- Date: Wed, 24 Sep 2014 20:12:00 +0000 (UTC)
commit fc619da4954fbb1570f9ea676c38c26a029f2c0b
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Thu Aug 21 18:50:13 2014 +0200
Implement player selection in the teams tagger
.../CanvasObjects/PlayersTaggerObject.cs | 18 ++++++++++++++++++
LongoMatch.Drawing/Widgets/TeamTagger.cs | 2 ++
2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/LongoMatch.Drawing/CanvasObjects/PlayersTaggerObject.cs
b/LongoMatch.Drawing/CanvasObjects/PlayersTaggerObject.cs
index 2fd2680..b81a58c 100644
--- a/LongoMatch.Drawing/CanvasObjects/PlayersTaggerObject.cs
+++ b/LongoMatch.Drawing/CanvasObjects/PlayersTaggerObject.cs
@@ -122,6 +122,24 @@ namespace LongoMatch.Drawing.CanvasObjects
awayBench.Update ();
field.Update ();
}
+
+ public void Select (Player player)
+ {
+ PlayerObject po;
+
+ po = homePlayers.FirstOrDefault (p => p.Player == player);
+ if (po == null) {
+ po = awayPlayers.FirstOrDefault (p => p.Player == player);
+ }
+ if (po != null) {
+ ResetSelection ();
+ SelectedPlayers.Add (player);
+ po.Active = true;
+ if (PlayersSelectionChangedEvent != null) {
+ PlayersSelectionChangedEvent (SelectedPlayers);
+ }
+ }
+ }
public void ResetSelection ()
{
diff --git a/LongoMatch.Drawing/Widgets/TeamTagger.cs b/LongoMatch.Drawing/Widgets/TeamTagger.cs
index c5aa763..e42479e 100644
--- a/LongoMatch.Drawing/Widgets/TeamTagger.cs
+++ b/LongoMatch.Drawing/Widgets/TeamTagger.cs
@@ -75,6 +75,8 @@ namespace LongoMatch.Drawing.Widgets
public void Select (Player p)
{
+ tagger.Select (p);
+ widget.ReDraw ();
}
protected override void ShowMenu (Point coords)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]