Ejemplo n.º 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            loadingSplash.Show();

            this.Location = new Point((Screen.PrimaryScreen.WorkingArea.Width - this.Width) / 2,
                          (Screen.PrimaryScreen.WorkingArea.Height - this.Height) / 2);

            //FeedMethod = new Feed(FeedContentPanel, Properties.GlobalValues.FP_FeedUrl);
            //FeedMethod.GetRSSNews();
            //delayFecthNews.Start();

            if (Properties.Settings.Default.UpdateSettings)
            {
                Properties.Settings.Default.Upgrade();
                Properties.Settings.Default.UpdateSettings = false;
                if (AssemblyVersion == "0.6")
                    Properties.Settings.Default.firstLaunch = true;
                Properties.Settings.Default.Save();
            }

            if (GlobalVar.isServer) { WindowTitle.Text = AssemblyTitle + " | v" + AssemblyVersion + " | Server Edition"; }
            else { WindowTitle.Text = AssemblyTitle + " | v" + AssemblyVersion; }

            // Change stuff if isServer
            if (GlobalVar.isServer)
            {
                panel_recommendedAddons.Visible = false;
                panel_TeamSpeakDir.Visible = false;
                pref_joinServerAuto.Visible = false;
                btn_reinstallTFRPlugins.Visible = false;
                pref_serverAutopilot.Visible = true;
                chb_battleye.Enabled = false;

                pref_startGameAfterDownloadsAreCompleted.Text = "Start server when ready";

                if (!Properties.Settings.Default.firstLaunch)
                    if (new Windows.DelayServerStart().ShowDialog() == DialogResult.OK)
                        switchAutopilot(true);
                    else
                        switchAutopilot(false);
            }

            if (!GlobalVar.autoPilot && !QuickUpdateMethod.QuickCheck())
            {
                menuSelected = 4;
                HideUnhide(menuSelected);

                panelLaunch.Enabled = false;
                sysbtn_moreOptions.Visible = false;

                aboutPanelIO = new PanelIO(panel_about, Panels, 435, 437, 33);

                activeButton = btn_update;
                backgroundBlinker.RunWorkerAsync();

                isUpdate = true;
            }
            else if (Properties.Settings.Default.firstLaunch)
            {
                if (GlobalVar.isServer) { pref_startGameAfterDownloadsAreCompleted.Checked = true; }

                menuSelected = 3;
                HideUnhide(menuSelected);
            }
            else
            {
                menuSelected = 0;
                HideUnhide(menuSelected);
            }

            FetchSettings();

            if (!isUpdate)
            {
                updateCurrentPack(true);
                getMalloc();


                if (Directory.Exists(AddonsFolder + @"@task_force_radio\plugins"))
                    btn_reinstallTFRPlugins.Enabled = true;
                else
                    btn_reinstallTFRPlugins.Enabled = false;
            }

            UpdateMethod.CheckUpdates();

            loadingSplash.Close();
        }
Ejemplo n.º 2
0
        public MainForm()
        {
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);

            InitializeComponent();

            txt_appTitle.Text = AssemblyTitle;
            txt_appVersion.Text = AssemblyVersion;

            QuickUpdateMethod = new zCheckUpdate(WindowVersionStatus, busy);
            UpdateMethod = new zCheckUpdate(btn_update, btn_checkUpdates, txt_curversion, txt_latestversion, busy);

            installer = new Installer(this, prb_progressBar_File, prb_progressBar_All, txt_progressStatus, txt_percentageStatus, txt_curFile, btn_Launch, btn_cancelDownload, txtb_armaDirectory, txtb_tsDirectory, txtb_modsDirectory, btn_ereaseArmaDirectory, btn_ereaseTSDirectory, btn_ereaseModsDirectory, btn_browseA3, btn_browseTS3, btn_browseModsDirectory, btn_reinstallTFRPlugins, btn_downloadDragonFyre, btn_downloadBlastcore);
            downloader = new Downloader(this, installer, prb_progressBar_File, prb_progressBar_All, txt_curFile, txt_progressStatus, txt_percentageStatus, btn_Launch, btn_cancelDownload);
            remoteReader = new RemoteReader();
            fetchAddonPacks = new Packs(this, PacksPanel);
            eReport = new EmailReporter();
            aLooker = new AddonsLooker(lstb_detectedAddons, lstb_activeAddons, chb_dragonfyre, chb_blastcore);
            loadingSplash = new Windows.Splash();
            windowIO = new WindowIO(this);

            addonsPanelIO = new PanelIO(panel_packs, Panels, 304, 306, 33);
            communityPanelIO = new PanelIO(panel_community, Panels, 304, 306, 33);
            launchoptionsPanelIO = new PanelIO(panel_launchOptions, Panels, 304, 306, 33);
            helpPanelIO = new PanelIO(panel_help, Panels, 304, 306, 33);
            aboutPanelIO = new PanelIO(panel_about, Panels, 304, 306, 33);
            topPanelsIO = new PanelIO(panelDirectories, panelMenu, 4);
            botPanelIO = new PanelIO(panel_bottomHide_Inner, panel_bottomhide, 746, 750, 53);
        }