Пример #1
0
        private void CurrentActiveCharacterCombo_Selected(object sender, SelectionChangedEventArgs e)
        {
            if (CurrentActiveCharacterCombo.SelectedIndex == -1)
            {
                RegionsViewUC.ActiveCharacter = null;
                RegionUC.ActiveCharacter      = null;
                FleetMembersList.ItemsSource  = null;
                RegionUC.UpdateActiveCharacter();
                UniverseUC.UpdateActiveCharacter(null);
            }
            else
            {
                EVEData.LocalCharacter lc = CurrentActiveCharacterCombo.SelectedItem as EVEData.LocalCharacter;
                ActiveCharacter = lc;

                FleetMembersList.ItemsSource = lc.FleetInfo.Members;
                CollectionViewSource.GetDefaultView(FleetMembersList.ItemsSource).Refresh();

                RegionsViewUC.ActiveCharacter = lc;
                RegionUC.UpdateActiveCharacter(lc);
                UniverseUC.UpdateActiveCharacter(lc);
            }

            OnCharacterSelectionChanged();
        }
Пример #2
0
        private void CharactersList_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (sender != null)
            {
                DataGrid grid = sender as DataGrid;
                if (grid != null && grid.SelectedItems != null && grid.SelectedItems.Count == 1)
                {
                    DataGridRow            dgr = grid.ItemContainerGenerator.ContainerFromItem(grid.SelectedItem) as DataGridRow;
                    EVEData.LocalCharacter lc  = dgr.Item as EVEData.LocalCharacter;

                    if (lc != null)
                    {
                        ActiveCharacter = lc;
                        CurrentActiveCharacterCombo.SelectedItem = lc;

                        FleetMembersList.ItemsSource = lc.FleetInfo.Members;
                        CollectionViewSource.GetDefaultView(FleetMembersList.ItemsSource).Refresh();

                        RegionUC.FollowCharacter = true;
                        RegionUC.SelectSystem(lc.Location, true);

                        UniverseUC.FollowCharacter = true;
                        UniverseUC.UpdateActiveCharacter(lc);
                    }
                }
            }
        }
Пример #3
0
        private void deleteBtn_Click(object sender, RoutedEventArgs e)
        {
            EVEData.LocalCharacter lc = characterInfoGrid.DataContext as EVEData.LocalCharacter;
            if (lc != null)
            {
                MessageBoxResult result = MessageBox.Show("Would you like to Delete \"" + lc.Name + " ?", "Delete Character?", MessageBoxButton.YesNo, MessageBoxImage.Warning);

                if (result == MessageBoxResult.Yes)
                {
                    MainWindow mw = Owner as MainWindow;

                    mw.ActiveCharacter = null;
                    mw.FleetMembersList.ItemsSource = null;

                    mw.CurrentActiveCharacterCombo.SelectedIndex = -1;
                    mw.RegionsViewUC.ActiveCharacter             = null;
                    mw.RegionUC.ActiveCharacter = null;
                    mw.RegionUC.UpdateActiveCharacter();
                    mw.UniverseUC.ActiveCharacter = null;
                    mw.OnCharacterSelectionChanged();

                    mw.EVEManager.LocalCharacters.Remove(lc);

                    characterLV.Items.Refresh();

                    characterInfoGrid.Visibility = Visibility.Hidden;
                }
            }
        }
Пример #4
0
 private void ClearWaypointsBtn_Click(object sender, RoutedEventArgs e)
 {
     EVEData.LocalCharacter c = RegionUC.ActiveCharacter as EVEData.LocalCharacter;
     if (c != null)
     {
         c.ClearAllWaypoints();
     }
 }
Пример #5
0
 private void ReCalculateRouteBtn_Click(object sender, RoutedEventArgs e)
 {
     EVEData.LocalCharacter c = RegionUC.ActiveCharacter as EVEData.LocalCharacter;
     if (c != null && c.Waypoints.Count > 0)
     {
         c.RecalcRoute();
     }
 }
Пример #6
0
 private void dangerzone_ValueChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
 {
     EVEData.LocalCharacter lc = characterInfoGrid.DataContext as EVEData.LocalCharacter;
     if (lc != null)
     {
         lc.warningSystemsNeedsUpdate = true;
     }
 }
Пример #7
0
 private void dangerZoneEnabled_Checked(object sender, RoutedEventArgs e)
 {
     EVEData.LocalCharacter lc = characterInfoGrid.DataContext as EVEData.LocalCharacter;
     if (lc != null)
     {
         lc.warningSystemsNeedsUpdate = true;
     }
 }
Пример #8
0
        public void UpdateActiveCharacter(EVEData.LocalCharacter lc)
        {
            ActiveCharacter = lc;

            if (FollowCharacterChk.IsChecked.HasValue && (bool)FollowCharacterChk.IsChecked)
            {
                CentreMapOnActiveCharacter();
            }
        }
Пример #9
0
 private void ClearWaypointsBtn_Click(object sender, RoutedEventArgs e)
 {
     EVEData.LocalCharacter c = RegionRC.ActiveCharacter as EVEData.LocalCharacter;
     if (c != null)
     {
         lock (c.ActiveRouteLock)
         {
             c.ActiveRoute.Clear();
             c.Waypoints.Clear();
         }
     }
 }
Пример #10
0
        private void CopyRouteBtn_Click(object sender, RoutedEventArgs e)
        {
            EVEData.LocalCharacter c = RegionUC.ActiveCharacter as EVEData.LocalCharacter;
            if (c != null)
            {
                string WPT = c.GetWayPointText();

                try
                {
                    Clipboard.SetText(WPT);
                }
                catch { }
            }
        }
Пример #11
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            EVEData.ZKillRedisQ.ZKBDataSimple zs = value as EVEData.ZKillRedisQ.ZKBDataSimple;
            Color rowCol = Colors.WhiteSmoke;

            if (zs != null)
            {
                float Standing = 0.0f;

                EVEData.LocalCharacter c = MainWindow.AppWindow.RegionRC.ActiveCharacter;
                if (c != null && c.ESILinked)
                {
                    if (c.AllianceID != 0 && c.AllianceID == zs.VictimAllianceID)
                    {
                        Standing = 10.0f;
                    }

                    if (c.Standings.Keys.Contains(zs.VictimAllianceID))
                    {
                        Standing = c.Standings[zs.VictimAllianceID];
                    }

                    if (Standing == -10.0)
                    {
                        rowCol = Colors.Red;
                    }

                    if (Standing == -5.0)
                    {
                        rowCol = Colors.Orange;
                    }

                    if (Standing == 5.0)
                    {
                        rowCol = Colors.LightBlue;
                    }

                    if (Standing == 10.0)
                    {
                        rowCol = Colors.CornflowerBlue;
                    }
                }


                // Do the conversion from bool to visibility
            }

            return(new SolidColorBrush(rowCol));
        }
Пример #12
0
        private void CharactersList_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (sender != null)
            {
                DataGrid grid = sender as DataGrid;
                if (grid != null && grid.SelectedItems != null && grid.SelectedItems.Count == 1)
                {
                    DataGridRow            dgr = grid.ItemContainerGenerator.ContainerFromItem(grid.SelectedItem) as DataGridRow;
                    EVEData.LocalCharacter lc  = dgr.Item as EVEData.LocalCharacter;

                    if (lc != null)
                    {
                        RegionRC.SelectSystem(lc.Location, true);
                    }
                }
            }
        }
Пример #13
0
        private void CharactersListMenuItemDelete_Click(object sender, RoutedEventArgs e)
        {
            if (CharactersList.SelectedIndex == -1)
            {
                return;
            }

            EVEData.LocalCharacter lc = CharactersList.SelectedItem as EVEData.LocalCharacter;

            ActiveCharacter = null;
            CurrentActiveCharacterCombo.SelectedIndex = -1;
            RegionsViewUC.ActiveCharacter             = null;
            RegionUC.ActiveCharacter = null;
            RegionUC.UpdateActiveCharacter();
            UniverseUC.ActiveCharacter = null;
            OnCharacterSelectionChanged();

            EVEManager.LocalCharacters.Remove(lc);
        }
Пример #14
0
        private void CurrentActiveCharacterCombo_Selected(object sender, SelectionChangedEventArgs e)
        {
            if (CurrentActiveCharacterCombo.SelectedIndex == -1)
            {
                RegionsViewUC.ActiveCharacter = null;
                RegionUC.ActiveCharacter      = null;
                RegionUC.UpdateActiveCharacter();
                UniverseUC.UpdateActiveCharacter(null);
            }
            else
            {
                EVEData.LocalCharacter lc = CurrentActiveCharacterCombo.SelectedItem as EVEData.LocalCharacter;
                ActiveCharacter = lc;
                RegionsViewUC.ActiveCharacter = lc;
                RegionUC.UpdateActiveCharacter(lc);
                UniverseUC.UpdateActiveCharacter(lc);
            }

            OnCharacterSelectionChanged();
        }
Пример #15
0
        private void EnableDisableJumpGateMenuItem_Click(object sender, RoutedEventArgs e)
        {
            if (JumpBridgeList.SelectedIndex == -1)
            {
                return;
            }

            EVEData.JumpBridge jb = JumpBridgeList.SelectedItem as EVEData.JumpBridge;

            jb.Disabled = !jb.Disabled;

            EVEData.Navigation.ClearJumpBridges();
            EVEData.Navigation.UpdateJumpBridges(EVEManager.JumpBridges.ToList());
            RegionUC.ReDrawMap(true);

            EVEData.LocalCharacter c = RegionUC.ActiveCharacter as EVEData.LocalCharacter;
            if (c != null && c.Waypoints.Count > 0)
            {
                c.RecalcRoute();
            }
        }
Пример #16
0
        private void UpdateCharacterSelectionBasedOnActiveWindow()
        {
            string ActiveWindowText = Utils.GetCaptionOfActiveWindow();

            if (ActiveWindowText.Contains("EVE - "))
            {
                string characterName = ActiveWindowText.Substring(6);
                foreach (EVEData.LocalCharacter lc in EVEManager.LocalCharacters)
                {
                    if (lc.Name == characterName)
                    {
                        ActiveCharacter = lc;
                        CurrentActiveCharacterCombo.SelectedItem = lc;
                        RegionUC.UpdateActiveCharacter(lc);
                        UniverseUC.UpdateActiveCharacter(lc);

                        break;
                    }
                }
            }
        }
Пример #17
0
        private void UpdateCharacterSelectionBasedOnActiveWindow()
        {
            string ActiveWindowText = Utils.GetCaptionOfActiveWindow();

            if (ActiveWindowText.Contains("EVE - "))
            {
                string characterName = ActiveWindowText.Substring(6);
                foreach (EVEData.LocalCharacter lc in EVEManager.LocalCharacters)
                {
                    if (lc.Name == characterName)
                    {
                        ActiveCharacter = lc;
                        CurrentActiveCharacterCombo.SelectedItem = lc;
                        FleetMembersList.ItemsSource             = lc.FleetInfo.Members;
                        CollectionViewSource.GetDefaultView(FleetMembersList.ItemsSource).Refresh();
                        RegionUC.UpdateActiveCharacter(lc);
                        UniverseUC.UpdateActiveCharacter(lc);

                        break;
                    }
                }
            }
        }