This is a tool to deal with TPF's and to install textures from TPF's and external images.
Inheritance: System.Windows.Forms.Form
        public static async Task<KFreonTPFTools3> GetCurrentInstance()
        {
            if (CurrentInstance == null)
            {
                CurrentInstance = new KFreonTPFTools3();
                CurrentInstance.Show();

                await Task.Run(() =>
                {
                    System.Threading.Thread.Sleep(400);
                    while (!CurrentInstance.LoadButton.Enabled)
                        System.Threading.Thread.Sleep(50);
                });
            }

            return CurrentInstance;
        }
        private void Form_Closing(object sender, FormClosingEventArgs e)
        {
            if (CancelButton.Visible && MessageBox.Show("Background Tasks are running. Are you sure you want to close?", "Reeeally sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.No)
            {
                e.Cancel = true;

                /*Task.Run(() =>
                {
                    while (!OverallStatusLabel.Text.ToLowerInvariant().Contains("failed"))
                        System.Threading.Thread.Sleep(100);

                    DebugOutput.PrintLn("-----Execution of TPF/DDS Tools closing...-----");
                    CurrentInstance = null;
                    SaveProperties();
                    this.Close();
                });*/
            }
            else
            {
                cts.Cancel();
                DebugOutput.PrintLn("-----Execution of TPF/DDS Tools closing...-----");
                CurrentInstance = null;
                SaveProperties();
            }
        }
Beispiel #3
0
 private void tPFDDSToolsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     KFreonTPFTools3 tpftools = new KFreonTPFTools3();
     tpftools.Show();
 }
        /// <summary>
        /// Constructor.
        /// </summary>
        public KFreonTPFTools3()
        {
            /*var tex1 = KFreonLib.Textures.Creation.CreateTexture2D(@"C:\Users\Freon\Desktop\New folder\commit\BioH_Vixen_00.pcc", 22, 2, @"C:\Users\Freon\Desktop\New folder\commit");
            var tex2 = KFreonLib.Textures.Creation.CreateTexture2D(@"C:\Users\Freon\Desktop\New folder\Old\BioH_Vixen_00.pcc", 2, 2, @"C:\Users\Freon\Desktop\New folder\commit");

            tex1.Compare(tex2);*/

            InitializeComponent();
            cts = new CancellationTokenSource();
            UpgradeSettings();

            // KFreon: Set number of threads if necessary
            if (Properties.Settings.Default.NumThreads == 0)
            {
                Properties.Settings.Default.NumThreads = KFreonLib.Misc.Methods.SetNumThreads(false);
                SaveProperties();
            }

            Overall = new TextUpdater(OverallStatusLabel, BottomStrip);
            Current = new TextUpdater(CurrentStatusLabel, BottomStrip);
            OverallProg = new ProgressBarChanger(BottomStrip, OverallProgressBar);
            CurrentProg = new ProgressBarChanger(BottomStrip, CurrentProgressBar);

            CurrentInstance = this;

            backbone = new BackBone(() =>
            {
                gooey.ChangeState(false);
                DisableCancelButton(false);
                return true;
            },
                () =>
                {
                    DisableCancelButton(true);
                    gooey.ChangeState(true);
                    return true;
                }
            );

            // KFreon: Setup GUI
            Task.Run(() =>
            {
                // KFreon: Wait for controls to be created
                while (!MainTreeView.Parent.Created)
                    System.Threading.Thread.Sleep(50);

                this.Invoke(new Action(() =>
                {
                    // KFreon: Setup pathing and stuff
                    InitialiseGUI();
                    Initialise(false);
                    BeginTreeLoading();
                    ResetImageList();
                    DisappearDuplicatesBox(true);
                    /*ContextPanel.Height = 0;
                    MainTreeView.Height = 753 + 25;
                    PreviewTabPages.Height = 525;*/  // KFreon: Scaling fixes
                }));
            });

            // KFreon: Display version
            VersionLabel.Text = "Version: " + Assembly.GetExecutingAssembly().GetName().Version.ToString();
        }
Beispiel #5
0
 private void tPFDDSToolsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     KFreonTPFTools3 tpftools = new KFreonTPFTools3();
     //OpenMaximized(tpftools);
     tpftools.Show();
     taskbar.AddTool(tpftools, Properties.Resources.TPFTools_64x64, true);
 }