Пример #1
0
        public static DialogResult ShowGenericDialog(string title, string message, Types type, Buttons buttons, string optionText, bool optionCheckedDefault, out bool optionChecked)
        {
            GenericDialog genericDialog = new GenericDialog(title, message, type, buttons, optionText, optionCheckedDefault);
            DialogResult  dialogResult  = genericDialog.ShowDialog();

            optionChecked = genericDialog.optionCheckBox.Checked;
            return(dialogResult);
        }
Пример #2
0
        private void assetDirectoryAutoDetectButton_Click(object sender, EventArgs e)
        {
            string assetsDirectory = AssetManager.DetectAssetDirectory();

            if (assetsDirectory == string.Empty)
            {
                GenericDialog.ShowGenericDialog(
                    "Error",
                    "ps2ls was unable to detect your PlanetSide 2 assets directory." +
                    Environment.NewLine + Environment.NewLine +
                    "This could mean that a PlanetSide 2 installation does not exist or that PlanetSide 2 is installed in a non-standard way.",
                    GenericDialog.Types.Warning);
            }
            else
            {
                assetDirectoryTextBox.Text = assetsDirectory;
            }
        }
Пример #3
0
        private void PackBrowserUserControl_Load(object sender, EventArgs e)
        {
            //TODO: figure out better way to set to infinity as indices are subject to change
            filesMaxComboBox.SelectedIndex = 3; //infinity

            if (!String.IsNullOrEmpty(Properties.Settings.Default.AssetDirectory))
            {
                if (Properties.Settings.Default.ShouldLoadAssetsOnStart)
                {
                    AssetManager.Instance.LoadFromDirectory(Properties.Settings.Default.AssetDirectory);
                }
                else if (Properties.Settings.Default.PromptLoadAssetsOnStart)
                {
                    bool optionChecked;

                    DialogResult dialogResult = GenericDialog.ShowGenericDialog(
                        "ps2ls",
                        "Would you like to load all asset (*.pak) files found in " + Properties.Settings.Default.AssetDirectory + " ?",
                        GenericDialog.Types.Default,
                        GenericDialog.Buttons.YesNo,
                        "Always perform this action (can be changed in Settings)",
                        false,
                        out optionChecked);

                    if (optionChecked)
                    {
                        Properties.Settings.Default.ShouldLoadAssetsOnStart = optionChecked;

                        if (optionChecked)
                        {
                            Properties.Settings.Default.PromptLoadAssetsOnStart = false;
                        }

                        Properties.Settings.Default.Save();
                    }

                    if (dialogResult == DialogResult.Yes)
                    {
                        AssetManager.Instance.LoadFromDirectory(Properties.Settings.Default.AssetDirectory);
                    }
                }
            }
        }
Пример #4
0
        private void exportCompleted(object sender, EventArgs args)
        {
            bool optionChecked;

            GenericDialog.ShowGenericDialog(
                "Export Complete",
                "Successfully exported " + assets.Count + " textures.",
                GenericDialog.Types.Default,
                GenericDialog.Buttons.OK,
                "Open in Windows Explorer",
                false,
                out optionChecked);

            if (optionChecked)
            {
                System.Diagnostics.Process.Start("explorer.exe", folderBrowserDialog.SelectedPath);
            }

            Hide();
        }
Пример #5
0
        private void openSelectedAssets()
        {
            if (assetsDataGridView.SelectedRows.Count >= AssetOpenStabilityThreshold)
            {
                DialogResult dialogResult = GenericDialog.ShowGenericDialog(
                    "Warning",
                    "You are about to open " + assetsDataGridView.SelectedRows.Count + " files simulatenously.  Doing so may cause system instability." +
                    Environment.NewLine + Environment.NewLine +
                    "Are you sure you want to continue?",
                    GenericDialog.Types.Warning,
                    GenericDialog.Buttons.YesNo);

                if (dialogResult != DialogResult.Yes)
                {
                    return;
                }
            }

            foreach (DataGridViewRow row in assetsDataGridView.SelectedRows)
            {
                if (row == null)
                {
                    return;
                }

                Asset asset = (Asset)row.Tag;

                if (asset != null)
                {
                    if (asset.Type == Asset.Types.CNK0)
                    {
                        ps2ls.Assets.Cnk.Cnk0 cnk0;
                        ps2ls.Assets.Cnk.Cnk0.LoadFromStream(asset.Pack.CreateAssetMemoryStreamByName(asset.Name), out cnk0);
                    }

                    asset.Pack.CreateTemporaryFileAndOpen(asset.Name);
                }
            }
        }
Пример #6
0
 public static DialogResult ShowGenericDialog(string title, string message, Types type, Buttons buttons, string optionText, bool optionCheckedDefault, out bool optionChecked)
 {
     GenericDialog genericDialog = new GenericDialog(title, message, type, buttons, optionText, optionCheckedDefault);
     DialogResult dialogResult = genericDialog.ShowDialog();
     optionChecked = genericDialog.optionCheckBox.Checked;
     return dialogResult;
 }