Allows some control over changing the state (enabled/visible) of a set of controls. Features: Exclude controls from state changes. Switch state changes between enabling and changing visibility. A function can replace state changes. e.g. Instead of enabling, set some text or whatever.
        /// <summary>
        /// Sets up GUI elements 
        /// </summary>
        private void InitialiseGUI()
        {
            // KFreon: Make preview bigger
            DisappearTextBox(true);
            EnableSecondProgressBar(false);
            FirstHalfInfoState(false);
            SecondHalfInfoState(false);

            // KFreon: Setup gooey
            DebugOutput.PrintLn("Gooeying things");
            gooey = new Gooey(PreviewTabPages);
            gooey.AddControl(LoadButton, "Load", true);
            gooey.AddControl(ExtractTOP, "ExtractTOP", true);
            gooey.AddControl(ClearAllFilesButton, "ClearAll", true);
            gooey.AddControl(BuildTPFTOP, "Rebuild", true);
            gooey.AddControl(RunAutofixButton, "RunAutofix", true);
            //gooey.AddControl(MODtoTPFButton, "MODtoTPF", true);
            gooey.AddControl(AnalyseButton, "Analyse", true);
            gooey.AddControl(InstallButton, "InstallB", true);
            gooey.AddControl(extractInvalidToolStripMenuItem, "extractInvalid", true);
            gooey.AddControl(ChangeButton, "ChangeButton", true);
            gooey.AddControl(AutofixSingleButton, "AutofixSingleButton", false);
            gooey.AddControl(extractValidsToolStripMenuItem, "extractValids", true);

            gooey.ChangeState(false);


            // KFreon: Initialise MainListView



            OverallProgressBar.Value = 0;
            OverallStatusLabel.Text = "Ready.";
        }
Example #2
0
        private void Initialise(bool changeTree)
        {
            // KFreon: Setup GUI
            gooey = new Gooey(MainListView);
            gooey.AddControl(LoadButton, "Load", true);
            gooey.AddControl(RunAllButton, "RunAll", true);
            gooey.AddControl(ClearAllButton, "ClearAll", true);
            gooey.AddControl(SaveAllButton, "SaveAll", true);
            gooey.AddControl(RunSelectedButton, "RunSelected", true);
            gooey.AddControl(SaveSelectedButton, "SaveSelected", true);
            gooey.AddControl(MoveUpButton, "MoveUp", true);
            gooey.AddControl(MoveDownButton, "MoveDown", true);
            gooey.AddControl(SelectAllButton, "SelectAll", true);
            gooey.AddControl(UpdateJobButton, "UpdateJob", true);
            gooey.AddControl(ResetScriptButton, "ResetScript", true);
            gooey.AddControl(CancelationButton, "Cancel", false, true, false);
            gooey.AddControl(CancelationButton, "cts", new Action(() =>
            {
                if (CancelationButton.Visible)
                    cts = new CancellationTokenSource();
            }));

            DebugOutput.PrintLn();
            DebugOutput.PrintLn("Changing Trees...");

            // KFreon: Start debugger in separate thread
            if (!changeTree)
                DebugOutput.StartDebugger("Mod Maker 2.0");

            // KFreon: Get paths for each game
            CheckGameState();
        }
Example #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();
        }