Esempio n. 1
0
        public ConsoleTab()
        {
            Reference = this;
            InitializeComponent();

            MinecraftOutputHandler.OutputParsed += PrintOutput;
            ProcessHandler.ServerStarting       += HandleServerStart;
            ProcessHandler.ServerStopped        += HandleServerStop;
            CIConsoleInput.CommandSent          += HandleCommandSent;
            PlayerHandler.PlayerListAddition    += HandlePlayerAddition;
            PlayerHandler.PlayerListDeletion    += HandlePlayerDeletion;

            MCCOut.MessageColorInfo         = Color.FromArgb(Config.ReadInt("console", "color_info", Color.Blue.ToArgb()));
            MCCOut.MessageColorPlayerAction =
                Color.FromArgb(Config.ReadInt("console", "color_playeraction", Color.DarkGreen.ToArgb()));
            MCCOut.MessageColorSevere  = Color.FromArgb(Config.ReadInt("console", "color_severe", Color.DarkRed.ToArgb()));
            MCCOut.MessageColorWarning =
                Color.FromArgb(Config.ReadInt("console", "color_warning", Color.DarkOrange.ToArgb()));

            MCCOut.ShowDate = Config.ReadBool("console", "date", false);
            MCCOut.ShowTime = Config.ReadBool("console", "time", true);

            imgListPlayerFaces.Images.Clear();
            imgListPlayerFaces.Images.Add("default", Resources.player_face);

            MCCOut.Autoscroll = Config.ReadBool("console", "autoscroll", true);

            CIConsoleInput.AddAutocompleteSource(PlayerHandler.GetOnlinePlayerNames);
            CIConsoleInput.AddAutocompleteSource(GetKnownCommands);
        }
Esempio n. 2
0
 private void HandleServerStart()
 {
     SLVPlayers.Items.Clear();
     MCCOut.Clear();
     CIConsoleInput.ClearAutoCompletionHistory();
     MCCOut.WriteOutput(MessageType.Info, "[GUI] Starting a new server");
 }
Esempio n. 3
0
 private void HandleServerStop()
 {
     SLVPlayers.Items.Clear();
     CIConsoleInput.ClearAutoCompletionHistory();
     MCCOut.WriteOutput(MessageType.Info, "[GUI] The server has stopped");
 }