Provides threadsafe methods to update text of a ToolStripItem's Text property.
Beispiel #1
0
        public ModMaker()
        {
            InitializeComponent();
            KFreonTPFTools3.UpgradeSettings();

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

            StatusUpdater = new TextUpdater(MainStatusLabel, BottomStrip);
            MainProgBar = new ProgressBarChanger(BottomStrip, MainProgressBar);
            backbone = new BackBone(() => { gooey.ChangeState(false); return true; }, () => { gooey.ChangeState(true); return true; });

            currentInstance = this;

            MainSplitter.SplitterDistance = MainSplitter.Width;
            MainContextStrip.Height = 0;
            PCCSplitter.SplitterDistance = PCCSplitter.Height;

            Initialise(false);
            KFreonLib.Scripting.ModMaker.Initialise();

            SearchTextBox.KeyDown += SearchTextBox_KeyDown;
            SearchTextBox.MouseDown += SearchTextBox_MouseDown;
            SearchTextBox.LostFocus += SearchTextBox_LostFocus;

            SearchTextBox.ForeColor = Color.Gray;
            SearchTextBox.Text = EmptyText;

            // KFreon: Display version
            VersionLabel.Text = "Version: " + Assembly.GetExecutingAssembly().GetName().Version.ToString();
        }
        public TexplorerFirstTimeSetup(int game, string DLCPath, string CookedPath)
        {
            InitializeComponent();

            StatusProgLabel.Text = "Loading...";

            StatusUpdater = new TextUpdater(StatusProgLabel, toolStrip1);
            ProgressUpdater = new ProgressBarChanger(toolStrip1, StatusProgBar);

            SetupStuff(game, DLCPath, CookedPath);

            foreach (DLCInfo dlc in DLCs)
                MainListView.Items.Add(dlc.isExtracted ? dlc.Name : "NOT EXTRACTED: " + dlc.Name, dlc.isExtracted);


            StatusUpdater.UpdateText("Ready. Loaded " + (DLCs.Count - 1) + " DLC's.");
        }
Beispiel #3
0
        public Texplorer2(bool nowindow = false, int which = -1)
        {
            if (!nowindow)
                InitializeComponent();
            KFreonTPFTools3.UpgradeSettings();

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

            WhichGame = (which == -1) ? Properties.Settings.Default.TexplorerGameVersion : which;
            MEExDirecs.WhichGame = WhichGame;

            StatusUpdater = new TextUpdater(StatusLabel, StatusStrip);
            ProgBarUpdater = new ProgressBarChanger(StatusStrip, MainProgressBar);
            gooey = new Gooey(MainTreeView);
            SetupGUI();

            DebugOutput.StartDebugger("Texplorer 2.0");
            if (!nowindow)
            {
                ChangeButton.Text = "Modding ME" + WhichGame;
                WindowTitle = "Texplorer 2.0:  " + "ME" + WhichGame;
                this.Text = WindowTitle;
                DisappearPictureBox();
                ResetSearchBox();
            }
            backbone = new BackBone(() =>
            {
                Console.WriteLine("changing gui to false");
                gooey.ChangeState(false);
                return true;
            }, () =>
            {
                Console.WriteLine("Changeing gui to true");
                gooey.ChangeState(true);
                return true;
            });

            noWindow = nowindow;


            // KFreon: Get number of threads to use
            NumThreads = KFreonLib.Misc.Methods.SetNumThreads(false);

            DebugOutput.PrintLn("Using: " + NumThreads + " threads.");

            // KFreon: Setup paths
            // KFreon: Check game states DONE HERE COS TREE NEEDS THESE THINGS
            CheckGameStates();


            // KFreon: Check path exists
            bool exists = true;

            // KFreon: Load tree only if necessary
            if (!nowindow && exists)
                backbone.AddToBackBone(b =>
                {
                    BeginLoadingTree();
                    return true;
                });

            // KFreon: Display version
            if (!nowindow)
                VersionLabel.Text = "Version: " + Assembly.GetExecutingAssembly().GetName().Version.ToString();
        }
        /// <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();
        }
        public TexplorerFirstTimeSetup(int game, string DLCPath, string CookedPath)
        {
            InitializeComponent();

            // KFreon: Hide GUI stuff
            BackupCheckBox.Visible = false;
            BackupPresentLabel.Visible = false;
            ExtractedLabel.Visible = false;
            ExtractedListBox.Visible = false;


            StatusProgLabel.Text = "Loading...";

            StatusUpdater = new TextUpdater(StatusProgLabel, toolStrip1);
            ProgressUpdater = new ProgressBarChanger(toolStrip1, StatusProgBar);

            SetupStuff(game, DLCPath, CookedPath);

            foreach (DLCInfo dlc in DLCs)
            {
                MainListView.Items.Add(dlc.Name, true);
            }

            StatusUpdater.UpdateText("Ready. Loaded " + (DLCs.Count - 1) + " DLC's. Disk space to be used: ~" + DLCs.Select(d => d.Size).Sum() + " GB");
        }