Exemple #1
0
        private bool vueMode = false; // false = ortho, true = orbite

        #endregion Fields

        #region Constructors

        internal Editor(EditorController _controller)
        {
            InitializeComponent();
            controller = _controller;

            // Ne pas enlever Forms : c'est pour éviter l'ambiguïté.
            KeyDown += controller.KeyPressed;
            KeyUp += controller.KeyUnPressed;
            GamePanel.MouseDown += new Forms.MouseEventHandler(controller.MouseButtonDown);
            GamePanel.MouseUp += new Forms.MouseEventHandler(controller.MouseButtonUp);
            GamePanel.MouseEnter += new EventHandler(GamePanel_MouseEnter);
            GamePanel.MouseLeave -= new EventHandler(GamePanel_MouseExit);
            GamePanel.MouseWheel += new Forms.MouseEventHandler(controller.RouletteSouris);
            GamePanel.MouseMove += new Forms.MouseEventHandler(controller.MouseMove);
            /// Resize on resize only
            Application.Current.MainWindow.SizeChanged += new SizeChangedEventHandler(ResizeGamePanel);

            settings = (new ConfigPanelData()).LoadSettings();
            profiles = (new ConfigPanelData()).LoadProfiles();

            var defaultProfile = profiles.Where(x => settings != null && x.CompareTo(settings.DefaultProfile) == 0);

            if (defaultProfile.Count() > 0)
            {
                selectedProfile = defaultProfile.First();
                controller.ChangeProfile(selectedProfile);
            }
            else
            {
                selectedProfile = profiles[0];
                controller.ChangeProfile(selectedProfile);
            }
        }
Exemple #2
0
 public Settings()
 {
     defaultProfile = new Profil();
     Test = InterfaceGraphique.Debug.IsDebugEnabled();
     Console = true;
     Capteur_gauche_safe = true;
     Capteur_gauche_danger = true;
     Capteur_centre_safe = true;
     Capteur_centre_danger = true;
     Capteur_droit_safe = true;
     Capteur_droit_danger = true;
     Balayage = true;
     Lum_ambiante = true;
     Lum_directionnelle = true;
     Lum_spot = true;
     Collision = true;
     Visuals = true;
     Log = true;
 }
 public void ChangeProfile(Profil profile)
 {
     engine.setProfileData(profile.GetData());
 }
        private void profileListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (((ListView)sender).SelectedItems.Count > 0)
            {
                SelectedItem = (Profil)((ListView)sender).SelectedItems[0];
                DataContext = SelectedItem;
                SelectedItem.PropertyChanged += ProfilePropertyChanges;
                profileForm.Visibility = Visibility.Visible;

                if (SelectedItem == profils[0])
                {
                    saveBtn.IsEnabled = false;
                    deleteBtn.IsEnabled = false;
                }
                else
                {
                    saveBtn.IsEnabled = ShouldSave;
                    deleteBtn.IsEnabled = true;
                }
            }
            else
            {
                profileForm.Visibility = Visibility.Hidden;
            }
        }
Exemple #5
0
 private void MenuItemProfile_Click(object sender, RoutedEventArgs e)
 {
     var i = 0;
     foreach (MenuItem item in ProfilesMenu.Items)
     {
         if (item != sender)
         {
             item.IsChecked = false;
         }
         else
         {
             SelectedProfile = profiles[i];
         }
         i++;
     }
 }