Example #1
0
    protected override void OnInitialized(EventArgs e)
    {
      base.OnInitialized(e);
      Program.Dispatcher = this.Dispatcher;

      fadeIn = (Storyboard)Resources["ImageFadeIn"];
      fadeOut = (Storyboard)Resources["ImageFadeOut"];

      cardViewer.Source = new BitmapImage(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

      // Show the Scripting console in dev only
      if (Application.Current.Properties["ArbitraryArgName"] != null)
      {
          string fname = Application.Current.Properties["ArbitraryArgName"].ToString();          
          if (fname == "/developer")
          {
              Console.Visibility = System.Windows.Visibility.Visible;
              Loaded += (sender, args) =>
              {
                  var wnd = new InteractiveConsole { Owner = this };
                  wnd.Show();
              };
          }
      }
    }
Example #2
0
 private void ConsoleClicked(object sender, RoutedEventArgs e)
 {
     e.Handled = true;
     var wnd = new InteractiveConsole { Owner = this };
     wnd.Show();
 }
Example #3
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");
            //TODO This path doesn't exist.
            if (!PartExists("http://schemas.octgn.org/game/rules"))
            {
                Rules.Visibility = Visibility.Hidden;
                Help.Visibility = Visibility.Hidden;
            }
            // TODO These paths don't exist.
            if (PartExists("http://schemas.octgn.org/game/font")) 
                ExtractFont("http://schemas.octgn.org/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();
                          };
        }
Example #4
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

            if (!PartExists()) Rules.Visibility = Visibility.Hidden;

#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();
                          };
        }