예제 #1
0
 private void ReadDrive(string[] parts)
 {
     if (parts.Length < 2)
     {
         UIConsole.WriteLine("Invalid parameters for 'read'. (read [drive letter])");
         return;
     }
     _controller.ReadDrive(parts[1].ToLower()[0]);
 }
 private void RenderColorLine(string totalSize, string output)
 {
     if (totalSize.Contains("GB"))
     {
         UIConsole.WriteColorLine(ConsoleColor.Red, output);
     }
     else if (totalSize.Contains("MB"))
     {
         UIConsole.WriteColorLine(ConsoleColor.Yellow, output);
     }
     else
     {
         UIConsole.WriteLine(output);
     }
 }
예제 #3
0
        public void AddGame(string name)
        {
            int ypos = CurrentY;

            CurrentY += 100;
            AddChild(new UIButton("ui/menus/buttons/sp", "== " + name + " ==", TheClient.FontSets.Standard, () =>
            {
                UIConsole.WriteLine("Opening singleplayer game: " + name);
                TheClient.Network.Disconnect();
                if (TheClient.LocalServer != null)
                {
                    UIConsole.WriteLine("Shutting down pre-existing server.");
                    TheClient.LocalServer.ShutDown();
                    TheClient.LocalServer = null;
                }
                TheClient.LocalServer = new Server(28010);
                Server.Central        = TheClient.LocalServer;
                TheClient.ShowLoading();
                TheClient.Schedule.StartAsyncTask(() =>
                {
                    try
                    {
                        TheClient.LocalServer.StartUp(name, () =>
                        {
                            TheClient.Schedule.ScheduleSyncTask(() =>
                            {
                                TheClient.Network.Connect("localhost", "28010", false, name);
                            }, 1.0);
                        });
                    }
                    catch (Exception ex)
                    {
                        Utilities.CheckException(ex);
                        SysConsole.Output("Running singleplayer game server", ex);
                    }
                });
            }, new UIPositionHelper(Client.MainUI).Anchor(UIAnchor.TOP_LEFT).ConstantXY(10, ypos).ConstantWidthHeight(600, 70)));
        }
예제 #4
0
        public MainMenuScreen(Client tclient) : base(tclient)
        {
            Background = new UIImage(TheClient.Textures.GetTexture("ui/menus/menuback"), UIAnchor.TOP_LEFT, GetWidth, GetHeight, () => 0, () => 0);
            AddChild(Background);
            FontSet    font = TheClient.FontSets.SlightlyBigger;
            UITextLink quit = new UITextLink(null, "^%Q^7uit", "^%Q^e^7uit", "^7^e^%Q^0uit", font, () => TheClient.Window.Close(), UIAnchor.BOTTOM_RIGHT, () => - 100, () => - 100);

            AddChild(quit);
            UITextLink sp = new UITextLink(null, "^%S^7ingleplayer", "^%S^e^7ingleplayer", "^7^e^%S^0ingleplayer", font, () => TheClient.ShowSingleplayer(), UIAnchor.BOTTOM_RIGHT, () => - 100, () => - 100 - (int)quit.GetHeight());

            AddChild(sp);
            UITextLink mp = new UITextLink(null, "^%M^7ultiplayer", "^%M^e^7ultiplayer", "^7^e^%M^0ultiplayer", font, () => UIConsole.WriteLine("Multiplayer menu coming soon!"), UIAnchor.BOTTOM_RIGHT, () => - 100, () => - 100 - (int)(sp.GetHeight() + quit.GetHeight()));

            AddChild(mp);
            List <string> hints = TheClient.Languages.GetTextList(TheClient.Files, "voxalia", "hints.common");
            UILabel       label = new UILabel("^0^e^7" + hints[Utilities.UtilRandom.Next(hints.Count)], TheClient.FontSets.Standard, UIAnchor.BOTTOM_LEFT, () => 0, () => - (int)TheClient.Fonts.Standard.Height * 3, () => TheClient.Window.Width);

            AddChild(label);
        }
예제 #5
0
        public override void Bad(string tagged_text, DebugMode mode)
        {
            string text = ClientCommands.CommandSystem.TagSystem.ParseTags(tagged_text, TextStyle.Color_Outbad, null, mode);

            UIConsole.WriteLine(TextStyle.Color_Outbad + text);
        }