Exemple #1
0
        public MainWindow()
        {
#if DEBUG
            if (!File.Exists("idzconfig.bin"))
            {
                MainWindow_new mwNew = new MainWindow_new();
                mwNew.ShowDialog();
                gameConfig = mwNew.newConfig;
                if (!gameConfig.XOrDInput)
                {
                    ControllerSettings cs = new ControllerSettings(gameConfig, gameConfig.XOrDInput);
                    cs.ShowDialog();
                }
            }
#endif
            AutoUpdater.Start("https://raw.githubusercontent.com/nzgamer41/ZeroLauncher/master/Autoupdate.xml");
            try
            {
                InitializeComponent();
                foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
                {
                    if (nic.Supports(NetworkInterfaceComponent.IPv4) == false)
                    {
                        continue;
                    }
                    foreach (UnicastIPAddressInformation ip in nic.GetIPProperties().UnicastAddresses)
                    {
                        if (ip.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
                        {
                            networkAdapters.Add(nic);
                            comboBoxNetAdapter.Items.Add(nic.Name + " " + ip.Address.ToString());
                        }
                    }
                }

                if (File.Exists("idzconfig.bin"))
                {
                    gameConfig = ReadFromBinaryFile <IDZConfig>("idzconfig.bin");
                    updateUI();
                }
                else
                {
                    comboBoxNetAdapter.SelectedIndex = 0;
                    updateUI();
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }
        private void ButtonControls_Click(object sender, RoutedEventArgs e)
        {
            ControllerSettings cs = new ControllerSettings(gameConfig, gameConfig.XOrDInput);

            cs.ShowDialog();
        }