Esempio n. 1
0
        public static void Theme(int mode)
        {
            switch (mode)
            {
            case 0:
            {
                Colors.Base = new ColorScheme()
                {
                    Normal    = TGAttribute.Make(Color.White, Color.Black),
                    HotNormal = TGAttribute.Make(Color.White, Color.DarkGray),
                    Focus     = TGAttribute.Make(Color.White, Color.Blue),
                    HotFocus  = TGAttribute.Make(Color.BrighCyan, Color.Blue)
                };

                Colors.Menu = new ColorScheme()
                {
                    Normal    = TGAttribute.Make(Color.Black, Color.Gray),
                    Focus     = TGAttribute.Make(Color.White, Color.Blue),
                    HotNormal = TGAttribute.Make(Color.DarkGray, Color.Gray),
                    HotFocus  = TGAttribute.Make(Color.BrighCyan, Color.Blue)
                };

                Colors.Dialog = new ColorScheme()
                {
                    Normal    = TGAttribute.Make(Color.White, Color.DarkGray),
                    Focus     = TGAttribute.Make(Color.White, Color.Blue),
                    HotNormal = TGAttribute.Make(Color.Blue, Color.White),
                    HotFocus  = TGAttribute.Make(Color.BrighCyan, Color.Blue)
                };

                ArchivedList = new ColorScheme()
                {
                    Normal    = TGAttribute.Make(Color.White, Color.Blue),
                    Focus     = TGAttribute.Make(Color.White, Color.BrightBlue),
                    HotNormal = TGAttribute.Make(Color.White, Color.Blue),
                    HotFocus  = TGAttribute.Make(Color.White, Color.BrightBlue)
                };

                HighlighedLabel = new ColorScheme()
                {
                    Normal = TGAttribute.Make(Color.BrightYellow, Color.Black)
                };
                break;
            }

            case 1:
            {
                Colors.Base = new ColorScheme()
                {
                    Normal    = TGAttribute.Make(Color.Black, Color.Gray),
                    HotNormal = TGAttribute.Make(Color.White, Color.DarkGray),

                    Focus    = TGAttribute.Make(Color.White, Color.Brown),
                    HotFocus = TGAttribute.Make(Color.BrightYellow, Color.Brown)
                };

                Colors.Menu = new ColorScheme()
                {
                    Normal    = TGAttribute.Make(Color.Black, Color.Gray),
                    Focus     = TGAttribute.Make(Color.White, Color.Blue),
                    HotNormal = TGAttribute.Make(Color.DarkGray, Color.Gray),
                    HotFocus  = TGAttribute.Make(Color.BrighCyan, Color.Blue)
                };

                Colors.Dialog = new ColorScheme()
                {
                    Normal    = TGAttribute.Make(Color.Black, Color.White),
                    Focus     = TGAttribute.Make(Color.White, Color.Brown),
                    HotNormal = TGAttribute.Make(Color.Brown, Color.White),
                    HotFocus  = TGAttribute.Make(Color.BrightYellow, Color.Brown)
                };

                ArchivedList = new ColorScheme()
                {
                    Normal    = TGAttribute.Make(Color.White, Color.Brown),
                    Focus     = TGAttribute.Make(Color.Black, Color.BrightYellow),
                    HotNormal = TGAttribute.Make(Color.White, Color.Brown),
                    HotFocus  = TGAttribute.Make(Color.Black, Color.BrightYellow)
                };

                HighlighedLabel = new ColorScheme()
                {
                    Normal = TGAttribute.Make(Color.BrightBlue, Color.Gray)
                };
                break;
            }

            default: { break; }
            }

            StaticWindows.RefreshColors();
            Application.Refresh();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            // update detector
            if (!Functions.Checks.IsUpToDate())
            {
                var defaultFore = Console.ForegroundColor;
                Console.Write("This version of RPG Patcher is out of date\nPlease update it manually with .NET Core 3 from:\n");
                Console.ForegroundColor = ConsoleColor.Blue;
                Console.WriteLine("https://github.com/xubiod/RPG-Patcher");

                Console.ForegroundColor = defaultFore;
                Console.Write("\nPress any key to continue...");

                Console.ReadKey();
                Console.Clear();
            }

            Functions.Checks.CheckForRPGMaker();

            // initalize terminal.gui
            Application.Init();

            //Application.Top.ColorScheme =

            Theme(0);

            // menubar
            var menu = new MenuBar(new MenuBarItem[] {
                new MenuBarItem("_File", new MenuItem [] {
                    new MenuItem("_About", "", () => {
                        Application.Run(StaticWindows.About._window);
                    }),
                    new MenuItem("_Focus on main window", "", () => {
                        Application.Top.SetFocus(StaticWindows.Main._window);
                    }),
                    new MenuItem("_Quit", "", () => {
                        Application.RequestStop();
                    })
                }),

                new MenuBarItem("_Project", new MenuItem [] {
                    new MenuItem("_Load (DO FIRST)", "", () => {
                        Functions.FileDialog.CreateOpenDialog("Project", "Pick a project", new string[] { "rgssad", "rgss2a", "rgss3a" }, Program.UpdateElements);
                    }),
                    new MenuItem("_Create project files with loaded version", "", () => {
                        Functions.Project.MakeProject();
                    }),
                    new MenuItem("_Create XP project files", "", () => {
                        Functions.Project.MakeProjectIndeterministic(RPGMakerVersion.Xp);
                    }),
                    new MenuItem("_Create VX project files", "", () => {
                        Functions.Project.MakeProjectIndeterministic(RPGMakerVersion.Vx);
                    }),
                    new MenuItem("_Create VX Ace project files", "", () => {
                        Functions.Project.MakeProjectIndeterministic(RPGMakerVersion.VxAce);
                    })
                }),

                new MenuBarItem("_Extracting", new MenuItem [] {
                    new MenuItem("_Load (DO FIRST)", "", () => {
                        Functions.FileDialog.CreateOpenDialog("Project", "Pick a project", new string[] { "rgssad", "rgss2a", "rgss3a" }, Program.UpdateElements);
                    }),
                    new MenuItem("_Copy game files from project directory", "", () => {
                        Functions.Extract.CopyGameFiles();
                    }),
                    new MenuItem("_List files in the archive", "", () => {
                        Functions.Extract.GetAllFiles();
                    }),
                    new MenuItem("_Extract single file", "", () => {
                        Functions.Operation.ExecuteIfProjectSelected(() => Application.Run(StaticWindows.ExportOneFile._window));
                    }),
                    new MenuItem("_Extract everything", "", () => {
                        Functions.FileDialog.CreateSaveDialog("Save to...", "Pick a place", new string[] { "" }, () => Functions.Operation.ExecuteIfProjectSelected(() => Functions.Extract.ExtractAllFiles()));
                    }),
                    new MenuItem("_Extract everything + project files", "", () => {
                        Functions.FileDialog.CreateSaveDialog("Save to...", "Pick a place", new string[] { "" }, () => Functions.Operation.ExecuteIfProjectSelected(() => Functions.Extract.ExtractAllFiles(true)));
                        Functions.Project.MakeProjectWithSavePath();
                    }),
                    new MenuItem("_Extract everything + project files + game", "", () => {
                        Functions.FileDialog.CreateSaveDialog("Save to...", "Pick a place", new string[] { "" }, () => Functions.Operation.ExecuteIfProjectSelected(() => Functions.Extract.ExtractAllFiles(true)));
                        Functions.Project.MakeProjectWithSavePath(true);
                        Functions.Extract.CopyGameFilesIndeterministic();
                    }),
                }),

                new MenuBarItem("_Patching", new MenuItem [] {
                    new MenuItem("_Working on it", "", () => {
                        Functions.Operation.ShowError("Ok. You clicked on something that deliberately says \"Working on it\" and expect it to f*****g do something? Are you f*****g serious? How dense is your f*****g brain to have something bounce clean off your goddamn eyes? Now f**k off and do something else.");
                    })
                }),

                new MenuBarItem("_Settings", new MenuItem [] {
                    new MenuItem("_Open settings window", "", () => {
                        Application.Run(StaticWindows.Settings._window);
                    })
                })
            });

            // add menu and main window
            Application.Top.Add(menu, StaticWindows.Main._window, new Label("Current operation status will be displayed here")
            {
                Id = "ProgressText", X = 1, Y = Pos.Percent(99F)
            });

            // initalize static windows
            StaticWindows.Create();
            Functions.Operation.Init();

            // run it
            Application.Run();
        }