示例#1
0
        private void PlayPictureBox_Click(object sender, EventArgs e)
        {
            if (!UOHelper.IsUoInstalled(controller))
            {
                MessageBox.Show("Najpierw zainstaluj pliki bazowe do gry.", "Błąd uruchamiania", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }

            controller.DownloadUpdates();
        }
示例#2
0
        private void BindControls()
        {
            InstallUoPictureBox.MouseEnter += ButtonEnter;
            PlayPictureBox.MouseEnter      += ButtonEnter;
            SettingsPictureBox.MouseEnter  += ButtonEnter;

            InstallUoPictureBox.MouseLeave += ButtonLeave;
            PlayPictureBox.MouseLeave      += ButtonLeave;
            SettingsPictureBox.MouseLeave  += ButtonLeave;



            ShardTitleLabel.Text = controller.Settings.Values.ShardName;
            Text =
                $"UOLoader :: {controller.Settings.Values.ShardName} :: version {controller.Settings.Values.Version} :: created by Karol C.";

            shardAddressLabel.Text = controller.Settings.Values.WebsiteLink;
            shardMailLabel.Text    = controller.Settings.Values.AdminEmail;

            InstallationText.Text = String.Format(InstallationText.Text, controller.Settings.Values.ShardName);
            CheckUpdatesText.Text = String.Format(CheckUpdatesText.Text, controller.Settings.Values.ShardName);

            controller.FileDownloadStarted         += FileDownloadStarted;
            controller.FileDownloadProgressChanged += FileDownloadProgressChanged;
            controller.FileDownloadFinished        += FileDownloadFinished;
            controller.ConnectionToServerError     += ConnectionToServerError;
            controller.ServerFileFormatError       += ServerFileFormatError;
            controller.NewsFileFormatError         += NewsFileFormatError;
            controller.NewsDownloadError           += NewsDownloadError;
            controller.NewsLoaded       += NewsLoaded;
            controller.UpdatesAvailable += UpdatesAvailable;

            controller.FileDecompressionStarted += FileDecompressionStarted;
            controller.FileDecompressionEnded   += FileDecompressionEnded;

            controller.DownloadedUpdates += DownloadedUpdates;

            // If DMR is installed (the base package) then we don't offer to download the files pointlessly
            if (UOHelper.IsUoInstalled(controller))
            {
                UI.SetControlInvisible(InstallUoPictureBox);
                UI.SetControlInvisible(InstallationText);
            }
        }