Exemple #1
0
        private void addServer(String name, String motd1, String motd2, int current, int max)
        {
            HBoxContainer hBoxContainer = new HBoxContainer {
                Name = name
            };
            // TODO server icon
            TextureRect  icon    = new TextureRect();
            NoiseTexture texture = new NoiseTexture {
                Width = 64, Height = 64, Noise = new OpenSimplexNoise {
                    Seed = (int)random.Randi()
                }
            };

            icon.Texture = texture;

            Label label = new Label {
                Text = name + " (" + current + "/" + max + ")\n" + motd1 + "\n" + motd2
            };

            hBoxContainer.AddChild(icon);
            hBoxContainer.AddChild(label);
            serverList.AddChild(hBoxContainer);

            hBoxContainer.Connect("gui_input", this, nameof(serverInput), new Array {
                name
            });
        }