public GuiServerListEntryElement(IServerQueryProvider queryProvider, SavedServerEntry entry) : this(
         queryProvider,
         entry.ServerType == ServerType.Java ? $"§o[JAVA]§r - {entry.Name}" : $"{entry.Name}",
         entry.Host + ":" + entry.Port)
 {
     SavedServerEntry = entry;
 }
        private GuiServerListEntryElement(IServerQueryProvider queryProvider, string serverName, string serverAddress)
        {
            QueryProvider = queryProvider;
            SetFixedSize(355, 36);

            ServerName    = serverName;
            ServerAddress = serverAddress;

            Margin  = new Thickness(5, 5, 5, 5);
            Padding = Thickness.One;
            Anchor  = Alignment.TopFill;

            AddChild(_serverIcon = new GuiTextureElement()
            {
                Width  = ServerIconSize,
                Height = ServerIconSize,

                Anchor = Alignment.TopLeft,

                Background = GuiTextures.DefaultServerIcon,
            });

            AddChild(_pingStatus = new GuiConnectionPingIcon()
            {
                Anchor = Alignment.TopRight,
            });

            AddChild(_textWrapper = new GuiStackContainer()
            {
                ChildAnchor = Alignment.TopFill,
                Anchor      = Alignment.TopLeft
            });
            _textWrapper.Padding = new Thickness(0, 0);
            _textWrapper.Margin  = new Thickness(ServerIconSize + 5, 0, 0, 0);

            _textWrapper.AddChild(_serverName = new GuiTextElement()
            {
                Text   = ServerName,
                Margin = Thickness.Zero
            });

            _textWrapper.AddChild(_serverMotd = new GuiTextElement()
            {
                TranslationKey = "multiplayer.status.pinging",
                Margin         = new Thickness(0, 0, 5, 0),

                //Anchor = center
            });
        }
Пример #3
0
 public ServerTypeImplementation(IServerQueryProvider queryProvider, string displayName)
 {
     DisplayName   = displayName;
     QueryProvider = queryProvider;
 }
Пример #4
0
 public ServerTypeImplementation(IServerQueryProvider queryProvider, string displayName, string typeIdentifier)
 {
     DisplayName    = displayName;
     QueryProvider  = queryProvider;
     TypeIdentifier = typeIdentifier;
 }