Ejemplo n.º 1
0
    public override IEnumerator Enter(bool entry, IntVector v)
    {
        this.gameObject.SetActive(true);
        yield return(StartCoroutine(Load()));

        MUI.SetActive(true);
        MOB.SetActive(true);
        GameManager.UI.PermUI["exit"].TweenActive(true);
        GameManager.UI.PermUI["exit"].ClearActions();
        GameManager.UI.PermUI["exit"].AddAction(UIAction.MouseUp, () =>
        {
            StartCoroutine(GameManager.instance.LoadModule("Menu"));
        });
        GameManager.UI.PermUI["exit"][0].TweenActive(false);

        if (entry)
        {
            Sequence f = OpeningSequence(v);
            yield return(f.WaitForCompletion());
        }
        CreateDinner();
        yield return(StartCoroutine(CheckForIntro()));

        yield return(StartCoroutine(StartGame(GG_Indexes)));
    }
Ejemplo n.º 2
0
    public override void InitUI()
    {
        MUI["thirdeye"].AddAction(UIAction.MouseDown, () =>
        {
            if (GameManager.WorldRes.Meds.Charge(ThirdEyeCost))
            {
                Ability_ThirdEye();
            }
        });
        MUI["thirdeye"].Txt[0].text = ThirdEyeCost + "";
        MUI["kitchen"].AddAction(UIAction.MouseDown, () =>
        {
            Complete();
        });

        if (timerobj == null)
        {
            timerobj = MUI["kitchen"];
        }
        MUI.SetActive(false);
    }
Ejemplo n.º 3
0
 public static void Main()
 {
     MUI.Run(Run, "Encoder", "encoder.ico");
 }
Ejemplo n.º 4
0
 public void Dispose()
 {
     Theme.Dispose();
     MUI.Dispose();
     NativeThemeFile?.Dispose();
 }
Ejemplo n.º 5
0
        public static void cmd(string input)
        {
            var command = input.ToLower();

            string[] cmd_args = input.Split(' ');
            if (command == "cd ..")
            {
                try
                {
                    if (Kernel.current_dir == Kernel.root_dir)
                    {
                        Console.WriteLine("Cannot go up any more levels!");
                    }
                    else
                    {
                        var pos = Kernel.current_dir.LastIndexOf('\\');
                        if (pos >= 0)
                        {
                            Kernel.current_dir = Kernel.current_dir.Substring(0, pos) + @"\";
                        }

                        /*
                         * var dir = FSfunc.fs.GetDirectory(Kernel.current_dir);
                         * string p = dir.mParent.mName;
                         * if (!string.IsNullOrEmpty(p))
                         * {
                         *  Kernel.current_dir = p;
                         * }
                         */
                    }
                }
                catch (Exception ex)
                {
                    ErrorHandler.Init(0, ex.Message, false, "");
                }
            }
            else if (command.StartsWith("cd "))
            {
                Fsfunc.cd(cmd_args[1]);
            }
            else if (command.StartsWith("ccolor "))
            {
                if (cmd_args[1] == "bgc")
                {
                    ColorChanger.ChangeBGC(cmd_args[2]);
                }
                else if (cmd_args[1] == "fgc")
                {
                    ColorChanger.ChangeFGC(cmd_args[2]);
                }
            }
            else if (command == "reinstall")
            {
                try
                {
                    //Directory.Delete(Kernel.root_dir + @"\" + OSVars.username);
                    Fsfunc.delfile(OSVars.usrinfo);
                    Fsfunc.delfile(OSVars.pcinfo);
                }
                catch (Exception ex)
                {
                    Console.Clear();
                    Console.WriteLine("Reinstallation failed!");
                    Console.WriteLine("Reason: " + ex.Message);
                }
                Console.WriteLine("Press any key to reboot...");
                Console.ReadKey(true);
                Sysfunc.reboot();
            }
            else if (command == "time")
            {
                MedliTime.printTime();
            }
            else if (command == "date")
            {
                MedliTime.printDate();
            }

            /*
             * else if (command == "day")
             * {
             *  DateTime.Now.Day.ToString();
             * }
             */
            else if (command.StartsWith("run "))
            {
                if (!File.Exists(Kernel.current_dir + cmd_args[1]))
                {
                    invalidCommand(command.Remove(0, 4), 2);
                }
                else
                {
                    mdscript.Execute(Kernel.current_dir + cmd_args[1]);
                }
            }
            else if (command.StartsWith("rmf "))
            {
                try
                {
                    Fsfunc.delfile(cmd_args[1]);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    invalidCommand(cmd_args[1], 2);
                }
            }
            else if (command.StartsWith("rmd "))
            {
                try
                {
                    Fsfunc.deldir(cmd_args[1]);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    invalidCommand(cmd_args[1], 2);
                }
            }
            else if (command == "getram")
            {
                Sysfunc.ram();
            }
            else if (command.StartsWith("dir"))
            {
                Fsfunc.dir();
            }
            else if (command.StartsWith("miv "))
            {
                MIV.StartMIV(cmd_args[1]);
            }
            else if (command == "miv")
            {
                MIV.StartMIV();
            }
            else if (command == "reboot")
            {
                Sysfunc.reboot();
            }
            else if (command == "shutdown")
            {
                Sysfunc.shutdown();
            }
            else if (command == "panic")
            {
                ErrorHandler.Init(1, "Medli received the 'panic' command, Nothing's gonna happen.", false, "");
            }
            else if (command.StartsWith("panic"))
            {
                if (cmd_args[1] == "critical")
                {
                    ErrorHandler.Init(0, "Medli received the 'panic critical' command , Nothings gonna happen", true, "User-invoked panic");
                }
                else if (cmd_args[1] == "userlvl")
                {
                    ErrorHandler.Init(1, "Medli received the 'panic userlvl' command, Nothing's gonna happen.", false, "");
                }
            }
            else if (command == "startm")
            {
                MUI.Init();
            }
            else if (command == "cowsay")
            {
                Cowsay.Cow("Say something using 'Cowsay <message>'");
                Console.WriteLine(@"You can also use 'cowsay -f' tux for penguin, cow for cow and 
sodomized-sheep for, you guessed it, a sodomized-sheep");
            }
            else if (command.StartsWith("cowsay"))
            {
                if (cmd_args[1] == "-f")
                {
                    if (cmd_args[2] == "cow")
                    {
                        Cowsay.Cow(command.Remove(0, cmd_args[0].Length + cmd_args[1].Length + cmd_args[2].Length + 3));
                    }
                    else if (cmd_args[2] == "tux")
                    {
                        Cowsay.Tux(command.Remove(0, cmd_args[0].Length + cmd_args[1].Length + cmd_args[2].Length + 3));
                    }
                    else if (cmd_args[2] == "sodomized-sheep")
                    {
                        Cowsay.SodomizedSheep(command.Remove(0, cmd_args[0].Length + cmd_args[1].Length + cmd_args[2].Length + 3));
                    }
                }
                else
                {
                    Cowsay.Cow(cmd_args[1]);
                }
            }
            else if (command == "mkdir")
            {
                Console.WriteLine("Usage: mkdir <directory>");
            }
            else if (command.StartsWith("mkdir "))
            {
                Fsfunc.mkdir(cmd_args[1]);
            }
            else if (command == "shell2")
            {
                Console.Clear();
                Shell2.Run();
                Console.Clear();
            }
            else if (command.StartsWith("alias "))
            {
                Console.WriteLine("Aliases are cleared over reboot. W.I.P");
                throw new NotImplementedException();
            }
            else if (command == "clear")
            {
                Sysfunc.clearScreen();
            }
            else if (command.StartsWith("cedit "))
            {
                cpedit.Run(cmd_args[1]);
            }
            else if (command == "cview")
            {
                cpview.Run();
            }
            else if (command.StartsWith("cview "))
            {
                cpview.ViewFile(cmd_args[1]);
            }
            else if (command == "")
            {
            }
            else if (input == "lock")
            {
                Console.WriteLine("Missing password - try again.");
            }
            else if (input.StartsWith("lock"))
            {
                Console.Clear();
                bool locked = true;
                while (locked == true)
                {
                    Console.BackgroundColor = ConsoleColor.DarkBlue;
                    Console.WriteLine("Insert correct password: "******"Correct - unlocking system");
                        Console.Clear();
                        Console.BackgroundColor = ConsoleColor.Black;
                        locked = false;
                    }
                    else
                    {
                        Console.WriteLine("Incorrect password - try again.");
                        locked = true;
                    }
                }
                Console.Clear();
                Console.BackgroundColor = ConsoleColor.Black;
            }
            else if (command.StartsWith("echo "))
            {
                try
                {
                    Console.WriteLine(command.Remove(0, 5));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
            else if (command.StartsWith("help "))
            {
                if (cmd_args[1] == "1" || cmd_args[1] == "app")
                {
                    GetHelp.pages(1);
                }
                else if (cmd_args[1] == "2" || cmd_args[1] == "fs")
                {
                    GetHelp.pages(2);
                }
                else if (cmd_args[1] == "3" || cmd_args[1] == "sys")
                {
                    GetHelp.pages(3);
                }
                else if (cmd_args[1] == "specific")
                {
                    GetHelp.specific(cmd_args[2]);
                }
                else
                {
                    GetHelp.full();
                }
            }
            else if (command == "ver")
            {
                OSVars.Ver();
            }
            else
            {
                invalidCommand(command, 1);
            }
        }