Beispiel #1
0
        private void _drawDartScoreInText(SpriteBatch spriteBatch, Dart dart, Vector2 dartPosition)
        {
            string text;
            Color  color;

            dart.GetVerbose(out text, out color);

            var textOffset = ScreenManager.Trebuchet32.MeasureString(text) * 0.5f;

            TextBlock.DrawShadowed(spriteBatch, ScreenManager.Trebuchet32, text, color,
                                   dartPosition - textOffset);
        }
Beispiel #2
0
        private static void _checkSegmentMap()
        {
            var boundSegments = Options.SegmentMap.Where(x => x.Value != null);
            var count         = boundSegments.Count();

            if (count == 0)
            {
                var mb = new MessageBoxScreen("Segment Map Warning",
                                              "The segment map does not contain any bindings.\nEnter options to create the segment map.",
                                              MessageBoxButtons.Ok);
                ScreenManager.AddScreen(mb);
            }
            else
            {
                var numberOfTotalSegments = 62;
                if (count != numberOfTotalSegments)
                {
                    var mb = new MessageBoxScreen("Segment Map Warning",
                                                  "It seems like not all segments are bound\n(The segment map contains " + count +
                                                  " values,\nbut there are 62 segments on a dart board).\nEnter options to create the segment map.",
                                                  MessageBoxButtons.Ok);
                    ScreenManager.AddScreen(mb);
                }
            }

            foreach (var p1 in boundSegments)
            {
                foreach (var p2 in boundSegments)
                {
                    if (!p1.Key.Equals(p2.Key) && p1.Value.Equals(p2.Value))
                    {
                        Color  c;
                        string text1, text2;
                        var    dart1 = new Dart(null, p1.Key.X, p1.Key.Y);
                        dart1.GetVerbose(out text1, out c);
                        var dart2 = new Dart(null, p2.Key.X, p2.Key.Y);
                        dart2.GetVerbose(out text2, out c);
                        var mb = new MessageBoxScreen("Segment Map Warning",
                                                      "The segment: " + text1 + " and " + text2 + "\ncontains the same coordinates: " + p1.Value +
                                                      "!", MessageBoxButtons.Ok);
                        ScreenManager.AddScreen(mb);
                    }
                }
            }
        }