Exemplo n.º 1
0
        private void ButtonX6_Click(object sender, EventArgs e)
        {
            var script = GetSelectedScript();
            var patch  = GetSelectedPatch();

            if (script is object && patch is object)
            {
                var editor = new TweakScriptEditor(script, rommgr, patch.EmbeddedFiles);
                Flyout1.Close();
                editor.ShowDialog(this);
                ComboItem ci = (ComboItem)ComboBoxEx_Scripts.SelectedItem;
                if (ci is object)
                {
                    if (!string.IsNullOrEmpty(script.Name))
                    {
                        ci.Text = script.Name;
                    }
                    else
                    {
                        ci.Text = "Untitled";
                    }
                }

                if (editor.WantToSave && editor.NeedToSave)
                {
                    SaveSinglePatch(GetSelectedPatch());
                    ItemListBox1_SelectedItemChanged();
                }
            }
        }
Exemplo n.º 2
0
 private void ButtonX7_Click(object sender, EventArgs e)
 {
     ComboBoxEx2.SuspendLayout();
     File.Delete(SelectedProfile().FileName);
     presets.Remove(SelectedProfile());
     ComboBoxEx2.Items.Remove(ComboBoxEx2.SelectedItem);
     ComboBoxEx2.SelectedIndex = 0;
     ComboBoxEx2.ResumeLayout();
     Flyout1.Close();
 }
Exemplo n.º 3
0
        private void ButtonX5_Click(object sender, EventArgs e)
        {
            ButtonItem   btnItem = (ButtonItem)ItemListBox1.SelectedItem;
            PatchProfile patch   = (PatchProfile)btnItem?.Tag;

            if (patch is object && MessageBoxEx.Show(this, "Are you sure to remove this tweak? You will not be able to recover it.", "Remove Tweak", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                Flyout1.Close();
                ItemListBox1.Items.Remove(btnItem);
                ItemListBox1.Refresh();
                myPatchs.Remove(patch);
                File.Delete(patch.FileName);
            }
        }
Exemplo n.º 4
0
        private void ButtonX2_Click(object sender, EventArgs e)
        {
            PatchProfile patch = (PatchProfile)((ButtonItem)ItemListBox1.SelectedItem)?.Tag;

            // Close Flyout
            Flyout1.Close();

            // Edit the Patch
            EditPatch(patch);

            // Save Patch
            SaveSinglePatch(patch);

            // Update Tweak Infos
            ItemListBox1_SelectedItemChanged();
        }
Exemplo n.º 5
0
 private void ItemListBox1_Scroll(object sender, ScrollEventArgs e)
 {
     Flyout1.Close();
 }
Exemplo n.º 6
0
 private void ButtonX3_Click(object sender, EventArgs e)
 {
     Flyout1.Close();
 }