Example #1
0
        public void SetGamePath(object sender, RoutedEventArgs e)
        {
            string gamepath = Interaction.InputBox("Enter path to /FINAL FANTASY XIV - A Realm Reborn/game/sqpack folder. This will reinitialise EXDs and may take a few seconds.", "FFXIVMon Reborn", Properties.Settings.Default.GamePath);

            if (gamepath == "")
            {
                return;
            }

            Properties.Settings.Default.GamePath = gamepath;
            Properties.Settings.Default.Save();

            try
            {
                ExdProvider = new ExdDataCache(Properties.Settings.Default.GamePath);
            }
            catch (Exception exc)
            {
                new ExtendedErrorView("Unable to init EXD data. Please check your game path in Options -> Set Game Path.", exc.ToString(), "FFXIVMon Reborn").ShowDialog();
                Properties.Settings.Default.LoadEXD = false;
            }

            MessageBox.Show("EXD data set up successfully.", "FFXIVMon Reborn", MessageBoxButton.OK,
                            MessageBoxImage.Asterisk);
        }
Example #2
0
        private void ExEnabledCheckbox_OnChecked(object sender, RoutedEventArgs e)
        {
            try
            {
                if (ExdProvider == null)
                {
                    ExdProvider = new ExdDataCache();
                }
            }
            catch (Exception exc)
            {
                new ExtendedErrorView("Unable to init EXD data. Please check your game path in Options -> Set Game Path.", exc.ToString(), "FFXIVMon Reborn").ShowDialog();
                ExEnabledCheckbox.IsChecked = false;
                return;
            }

            ((XivMonTab)MainTabControl.SelectedContent)?.ReloadDb();

            Properties.Settings.Default.LoadEXD = true;
            Properties.Settings.Default.Save();
        }
Example #3
0
 private void ReloadExClick(object sender, RoutedEventArgs e)
 {
     ExdProvider = new ExdDataCache();
     ((XivMonTab)MainTabControl.SelectedContent).ReloadDb();
 }
Example #4
0
 private void ReloadExClick(object sender, RoutedEventArgs e)
 {
     ExdProvider = new ExdDataCache(Properties.Settings.Default.GamePath);
     ((XivMonTab)MainTabControl.SelectedContent).ReloadDb();
 }
Example #5
0
        public MainWindow()
        {
            InitializeComponent();

            #if !DEBUG
            AppDomain.CurrentDomain.UnhandledException += delegate(object sender, UnhandledExceptionEventArgs eventArgs)
            {
                new ExtendedErrorView("FFXIVMon Reborn ran into an error and needs to close.",
                                      eventArgs.ExceptionObject.ToString(), "Unhandled Exception").ShowDialog();

                Process.GetCurrentProcess().Kill();
            };
            #endif

            bool loadedByArg = false;
            var  args        = Environment.GetCommandLineArgs();
            for (var i = 1; i + 1 < args.Length; i += 2)
            {
                if (args[i] == "--xml")
                {
                    var tab = new TabItem();

                    tab.Content = new XivMonTab();
                    tab.Header  = "New Capture";
                    ((XivMonTab)tab.Content).SetParents(tab, this);
                    MainTabControl.Items.Add(tab);
                    ((XivMonTab)tab.Content).LoadCapture(args[i + 1]);

                    loadedByArg = true;
                }
            }

            if (!loadedByArg)
            {
                var item = new TabItem();
                item.Content = new XivMonTab();
                item.Header  = "New Capture";
                ((XivMonTab)item.Content).SetParents(item, this);
                MainTabControl.Items.Add(item);
            }


            // register the event that is fired after the key press.
            _kbHook.KeyPressed += hook_KeyPressed;

            try
            {
                _kbHook.RegisterHotKey(ModifierKeys.Control | ModifierKeys.Alt, Keys.F12);
            }
            catch (Exception)
            {
                // ignored
            }

            CaptureMode = (TCPNetworkMonitor.NetworkMonitorType)Properties.Settings.Default.NetworkMonitorType;

            if (CaptureMode == TCPNetworkMonitor.NetworkMonitorType.RawSocket)
            {
                SwitchModeSockets.IsChecked = true;
            }
            else
            {
                SwitchModePcap.IsChecked = true;
            }

            try
            {
                ExdProvider = new ExdDataCache(Properties.Settings.Default.GamePath);
            }
            catch (Exception exc)
            {
                new ExtendedErrorView("Unable to init EXD data. Please check your game path in Options -> Set Game Path.", exc.ToString(), "FFXIVMon Reborn").ShowDialog();
                Properties.Settings.Default.LoadEXD = false;
            }

            if (!Properties.Settings.Default.DontUsePacketTimestamp)
            {
                DontUsePacketTimestamp.IsChecked = false;
                Properties.Settings.Default.DontUsePacketTimestamp = false;
            }
            else
            {
                CaptureFlags |= MachinaCaptureWorker.ConfigFlags.DontUsePacketTimestamp;
                DontUsePacketTimestamp.IsChecked = true;
                Properties.Settings.Default.DontUsePacketTimestamp = true;
            }

            if (Properties.Settings.Default.ForceRealtimePriority)
            {
                Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.RealTime;
                ForceRealtimePriority.IsChecked = true;
            }

            if (Properties.Settings.Default.LoadEXD)
            {
                ExEnabledCheckbox.IsChecked = true;
            }

            if (Properties.Settings.Default.EnableFsWatcher)
            {
                WatchDefFilesCheckBox.IsChecked = true;
            }

            if (Properties.Settings.Default.HideHexBoxActorId)
            {
                HideHexBoxActorIdCheckBox.IsChecked = true;
            }

            VersioningProvider.LocalDbChanged += VersioningProviderOnLocalDbChanged;
            LogView.Show();
            LogView.Visibility = Visibility.Hidden;

            VersionChecker.CheckVersion();
        }