Esempio n. 1
0
        private void DrawServerList()
        {
            GUILayout.BeginHorizontal();

            if (DisplayedServers == null || !DisplayedServers.Any())
            {
                GUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                GUILayout.BeginVertical();
                GUILayout.FlexibleSpace();
                GUILayout.Label(LocalizationContainer.ServerListWindowText.NoServers, BigLabelStyle);
                GUILayout.FlexibleSpace();
                GUILayout.EndVertical();
                GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();
            }
            else
            {
                GUILayout.BeginVertical();

                for (var i = 0; i < DisplayedServers.Count; i++)
                {
                    var currentEntry = DisplayedServers[i];

                    GUILayout.BeginHorizontal(i % 2 != 0 ? _oddServerLine : _evenServerLine);
                    DrawServerEntry(currentEntry);
                    GUILayout.EndHorizontal();
                }
                GUILayout.EndVertical();
            }
            GUILayout.EndHorizontal();
        }
Esempio n. 2
0
        private void DrawServerList()
        {
            GUILayout.BeginHorizontal();

            if (DisplayedServers == null || !DisplayedServers.Any())
            {
                GUILayout.BeginHorizontal();
                GUILayout.Space(WindowWidth * 0.25f);
                GUILayout.BeginVertical();
                GUILayout.Space(WindowHeight * 0.25f);
                GUILayout.Label("No servers!", BigLabelStyle);
                GUILayout.EndVertical();
                GUILayout.EndHorizontal();
            }
            else
            {
                GUILayout.BeginVertical();
                foreach (var currentEntry in DisplayedServers)
                {
                    GUILayout.BeginHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.Width(25));
                    GUILayout.FlexibleSpace();
                    if (GUILayout.Button("▶", ButtonStyle))
                    {
                        NetworkServerList.IntroduceToServer(currentEntry.Id);
                        Display = false;
                    }
                    GUILayout.FlexibleSpace();
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.Width(50));
                    GUILayout.FlexibleSpace();
                    GUILayout.Label(new GUIContent($"{currentEntry.Ping}"));
                    GUILayout.FlexibleSpace();
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.Width(50));
                    GUILayout.FlexibleSpace();
                    GUILayout.Label(new GUIContent($"{currentEntry.PlayerCount}"));
                    GUILayout.FlexibleSpace();
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.Width(90));
                    GUILayout.FlexibleSpace();
                    GUILayout.Label(new GUIContent($"{currentEntry.MaxPlayers}"));
                    GUILayout.FlexibleSpace();
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.Width(85));
                    GUILayout.FlexibleSpace();
                    GUILayout.Label(new GUIContent($"{(GameMode)currentEntry.GameMode}"));
                    GUILayout.FlexibleSpace();
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.Width(85));
                    GUILayout.FlexibleSpace();
                    GUILayout.Label(new GUIContent($"{(WarpMode)currentEntry.WarpMode}"));
                    GUILayout.FlexibleSpace();
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.Width(35));
                    GUILayout.FlexibleSpace();
                    GUILayout.Label(new GUIContent($"{currentEntry.Cheats}"));
                    GUILayout.FlexibleSpace();
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.Width(325));
                    GUILayout.Space(20);
                    GUILayout.Label(new GUIContent($"{currentEntry.ServerName}"));
                    GUILayout.FlexibleSpace();
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.Width(1000));
                    GUILayout.Space(20);
                    GUILayout.Label(new GUIContent($"{currentEntry.Description}"));
                    GUILayout.FlexibleSpace();
                    GUILayout.EndHorizontal();

                    GUILayout.EndHorizontal();
                }
                GUILayout.EndVertical();
            }
            GUILayout.EndHorizontal();
        }
Esempio n. 3
0
        private void DrawServerList()
        {
            GUILayout.BeginHorizontal(BoxStyle);

            if (DisplayedServers == null || !DisplayedServers.Any())
            {
                GUILayout.BeginHorizontal();
                GUILayout.Space(WindowWidth * 0.25f);
                GUILayout.BeginVertical();
                GUILayout.Space(WindowHeight * 0.25f);
                GUILayout.Label(LocalizationContainer.ServerListWindowText.NoServers, BigLabelStyle);
                GUILayout.EndVertical();
                GUILayout.EndHorizontal();
            }
            else
            {
                GUILayout.BeginVertical();
                foreach (var currentEntry in DisplayedServers)
                {
                    GUILayout.BeginHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.MinWidth(HeaderGridSize[0]));
                    if (GUILayout.Button("▶", ButtonStyle))
                    {
                        if (currentEntry.Password)
                        {
                            ServerDetailsWindow.Singleton.ServerId = currentEntry.Id;
                            ServerDetailsWindow.Singleton.Display  = true;
                        }
                        else
                        {
                            NetworkServerList.IntroduceToServer(currentEntry.Id);
                            Display = false;
                        }
                    }
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.MinWidth(HeaderGridSize[1]));
                    if (currentEntry.Password)
                    {
                        GUILayout.Label(new GUIContent(KeyIcon, "Password"), LabelStyle, GUILayout.MinWidth(HeaderGridSize[1]));
                    }
                    else
                    {
                        GUILayout.Label("", GUILayout.MinWidth(HeaderGridSize[1]));
                    }
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.MinWidth(HeaderGridSize[2]));
                    GUILayout.Label(new GUIContent($"{currentEntry.Ping}"), LabelStyle, GUILayout.MinWidth(HeaderGridSize[2]));
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.MinWidth(HeaderGridSize[3]));
                    GUILayout.Label(new GUIContent($"{currentEntry.PlayerCount}"), LabelStyle, GUILayout.MinWidth(HeaderGridSize[3]));
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.MinWidth(HeaderGridSize[4]));
                    GUILayout.Label(new GUIContent($"{currentEntry.MaxPlayers}"), LabelStyle, GUILayout.MinWidth(HeaderGridSize[4]));
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.MinWidth(HeaderGridSize[5]));
                    GUILayout.Label(new GUIContent($"{(GameMode)currentEntry.GameMode}"), LabelStyle, GUILayout.MinWidth(HeaderGridSize[5]));
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.MinWidth(HeaderGridSize[6]));
                    GUILayout.Label(new GUIContent($"{(WarpMode)currentEntry.WarpMode}"), LabelStyle, GUILayout.MinWidth(HeaderGridSize[6]));
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.MinWidth(HeaderGridSize[7]));
                    GUILayout.Label(new GUIContent($"{(TerrainQuality)currentEntry.TerrainQuality}"), LabelStyle, GUILayout.MinWidth(HeaderGridSize[7]));
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.MinWidth(HeaderGridSize[8]));
                    GUILayout.Label(new GUIContent($"{currentEntry.Cheats}"), LabelStyle, GUILayout.MinWidth(HeaderGridSize[8]));
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.MinWidth(325));
                    GUILayout.Label(new GUIContent($"{currentEntry.ServerName}"), LabelStyle, GUILayout.MinWidth(HeaderGridSize[9]));
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(GUILayout.MinWidth(1000));
                    GUILayout.Label(new GUIContent($"{currentEntry.Description}"), LabelStyle, GUILayout.MinWidth(HeaderGridSize[10]));
                    GUILayout.EndHorizontal();

                    GUILayout.EndHorizontal();
                }
                GUILayout.EndVertical();
            }
            GUILayout.EndHorizontal();
        }