Beispiel #1
0
        protected override void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);
            Program.Dispatcher = Dispatcher;
            DataContext        = Program.Game;

            _fadeIn  = (Storyboard)Resources["ImageFadeIn"];
            _fadeOut = (Storyboard)Resources["ImageFadeOut"];

            cardViewer.Source = ExtensionMethods.BitmapFromUri(new Uri(Program.Game.Definition.CardDefinition.Back));
            if (Program.Game.Definition.CardDefinition.CornerRadius > 0)
            {
                cardViewer.Clip = new RectangleGeometry();
            }
            AddHandler(CardControl.CardHoveredEvent, new CardEventHandler(CardHovered));
            AddHandler(CardRun.ViewCardModelEvent, new EventHandler <CardModelEventArgs>(ViewCardModel));

            Loaded += (sender, args) => Keyboard.Focus(table);
            // Solve various issues, like disabled menus or non-available keyboard shortcuts

            GroupControl.groupFont    = new FontFamily("Segoe UI");
            GroupControl.fontsize     = 12;
            chat.output.FontFamily    = new FontFamily("Seqoe UI");
            chat.output.FontSize      = 12;
            chat.watermark.FontFamily = new FontFamily("Sequo UI");
            if (!PartExists("http://schemas.octgn.org/game/rules"))
            {
                Rules.Visibility = Visibility.Hidden;
                Help.Visibility  = Visibility.Hidden;
            }
            if (PartExists("http://schemas.octgn.info/game/font"))
            {
                ExtractFont("http://schemas.octgn.info/game/font");
            }

#if (!DEBUG)
            // Show the Scripting console in dev only
            if (Application.Current.Properties["ArbitraryArgName"] == null)
            {
                return;
            }
            string fname = Application.Current.Properties["ArbitraryArgName"].ToString();
            if (fname != "/developer")
            {
                return;
            }
#endif
            Console.Visibility = Visibility.Visible;
            Loaded            += (sender, args) =>
            {
                var wnd = new InteractiveConsole {
                    Owner = this
                };
                wnd.Show();
            };
        }
Beispiel #2
0
        private void OnLoaded(object sen, RoutedEventArgs routedEventArgs)
        {
            this.OnIsSubbedChanged(SubscriptionModule.Get().IsSubscribed ?? false);
            this.Loaded -= OnLoaded;
            _fadeIn      = (Storyboard)Resources["ImageFadeIn"];
            _fadeOut     = (Storyboard)Resources["ImageFadeOut"];

            cardViewer.Source = ExtensionMethods.BitmapFromUri(new Uri(Program.GameEngine.Definition.CardBack));
            if (Program.GameEngine.Definition.CardCornerRadius > 0)
            {
                cardViewer.Clip = new RectangleGeometry();
            }
            AddHandler(CardControl.CardHoveredEvent, new CardEventHandler(CardHovered));
            AddHandler(CardRun.ViewCardModelEvent, new EventHandler <CardModelEventArgs>(ViewCardModel));

            Loaded += (sender, args) => Keyboard.Focus(table);
            // Solve various issues, like disabled menus or non-available keyboard shortcuts

            GroupControl.groupFont    = new FontFamily("Segoe UI");
            GroupControl.fontsize     = 12;
            chat.output.FontFamily    = new FontFamily("Segoe UI");
            chat.output.FontSize      = 12;
            chat.watermark.FontFamily = new FontFamily("Segoe UI");
            MenuConsole.Visibility    = Visibility.Visible;
            Log.Info(string.Format("Found #{0} amount of fonts", Program.GameEngine.Definition.Fonts.Count));
            if (Program.GameEngine.Definition.Fonts.Count > 0)
            {
                UpdateFont();
            }

            Log.Info(string.Format("Checking if the loaded game has boosters for limited play."));
            int setsWithBoosterCount = Program.GameEngine.Definition.Sets().Where(x => x.Packs.Count() > 0).Count();

            Log.Info(string.Format("Found #{0} sets with boosters.", setsWithBoosterCount));
            if (setsWithBoosterCount == 0)
            {
                LimitedGameMenuItem.Visibility = Visibility.Collapsed;
                Log.Info("Hiding limited play in the menu.");
            }

            //SubTimer.Start();

#if (!DEBUG)
            // Show the Scripting console in dev only
            if (Application.Current.Properties["ArbitraryArgName"] == null)
            {
                return;
            }
            string fname = Application.Current.Properties["ArbitraryArgName"].ToString();
            if (fname != "/developer")
            {
                return;
            }
#endif
        }
Beispiel #3
0
        private void SetBoard(DataNew.Entities.Group tableDef)
        {
            Rect pos = new Rect(tableDef.BoardPosition.X, tableDef.BoardPosition.Y, tableDef.BoardPosition.Width, tableDef.BoardPosition.Height);
            var  img = new Image
            {
                Source = ExtensionMethods.BitmapFromUri(new Uri(tableDef.Board)),
                Width  = pos.Width,
                Height = pos.Height,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment   = VerticalAlignment.Top,
                Margin = new Thickness(pos.Left, pos.Top, 0, 0)
            };

            boardContainer.Children.Insert(0, img);
        }
Beispiel #4
0
        private void OnLoaded(object sen, RoutedEventArgs routedEventArgs)
        {
            this.Loaded -= OnLoaded;
            _fadeIn      = (Storyboard)Resources["ImageFadeIn"];
            _fadeOut     = (Storyboard)Resources["ImageFadeOut"];

            cardViewer.Source = ExtensionMethods.BitmapFromUri(new Uri(Program.GameEngine.Definition.CardBack));
            if (Program.GameEngine.Definition.CardCornerRadius > 0)
            {
                cardViewer.Clip = new RectangleGeometry();
            }
            AddHandler(CardControl.CardHoveredEvent, new CardEventHandler(CardHovered));
            AddHandler(CardRun.ViewCardModelEvent, new EventHandler <CardModelEventArgs>(ViewCardModel));

            Loaded += (sender, args) => Keyboard.Focus(table);
            // Solve various issues, like disabled menus or non-available keyboard shortcuts

            GroupControl.groupFont    = new FontFamily("Segoe UI");
            GroupControl.fontsize     = 12;
            chat.output.FontFamily    = new FontFamily("Seqoe UI");
            chat.output.FontSize      = 12;
            chat.watermark.FontFamily = new FontFamily("Sequo UI");
            MenuConsole.Visibility    = Visibility.Visible;
            Log.Info(string.Format("Found #{0} amount of fonts", Program.GameEngine.Definition.Fonts.Count));
            if (Program.GameEngine.Definition.Fonts.Count > 0)
            {
                UpdateFont();
            }

#if (!DEBUG)
            // Show the Scripting console in dev only
            if (Application.Current.Properties["ArbitraryArgName"] == null)
            {
                return;
            }
            string fname = Application.Current.Properties["ArbitraryArgName"].ToString();
            if (fname != "/developer")
            {
                return;
            }
#endif
        }