Example #1
0
        public string GetField(int field)
        {
            switch (field)
            {
            case 0: return(HostName);

            case 1: return(GameName);

            case 2: return(GameVersion);

            case 3: return(MapName);

            case 4: return(GameType);

            case 5: return(GameVariant);

            case 6: return(NumPlayers.ToString());

            case 7: return(MaxPlayers.ToString());

            case 8: return(GameMode);

            case 9: return((Password ? 1 : 0).ToString());

            case 10: return(TimeLimit.ToString());

            case 11: return(RoundTime.ToString());

            case 12: return(HostPort.ToString());

            case 13: return((Dedicated ? 1 : 0).ToString());

            case 14: return((Ranked ? 1 : 0).ToString());

            case 15: return((AntiCheat ? 1 : 0).ToString());

            case 16: return(OS);

            case 17: return((BattleRecorder ? 1 : 0).ToString());

            case 18: return(BRIndex);

            case 19: return(BRDownload);

            case 20: return((Voip ? 1 : 0).ToString());

            case 21: return((AutoBalance ? 1 : 0).ToString());

            case 22: return((FriendlyFire ? 1 : 0).ToString());

            case 23: return(TKMode);

            case 24: return(StartDelay.ToString());

            case 25: return(SpawnTime.ToString("0.000000", CultureInfo.InvariantCulture));

            case 26: return(ServerText);

            case 27: return(ServerLogo);

            case 28: return(CommunityWebsite);

            case 29: return(ScoreLimit.ToString());

            case 30: return(TicketRatio.ToString());

            case 31: return(TeamRatio.ToString("0.000000", CultureInfo.InvariantCulture));

            case 32: return(Team1Name);

            case 33: return(Team2Name);

            case 34: return((CoopEnabled ? 1 : 0).ToString());

            case 35: return((Pure ? 1 : 0).ToString());

            case 36: return(MapSize.ToString());

            case 37: return((Unlocks ? 1 : 0).ToString());

            case 38: return(Fps.ToString());

            case 39: return((Plasma ? 1 : 0).ToString());

            case 40: return(ReservedSlots.ToString());

            case 41: return(CoopBotRatio.ToString());

            case 42: return(CoopBotCount.ToString());

            case 43: return(CoopBotDifficulty.ToString());

            case 44: return((NoVehicles ? 1 : 0).ToString());

            default:
                return("");
            }
        }
    private void DisplayRoundOptions()
    {
        GUILayout.BeginHorizontal();

        GUILayout.BeginVertical();
        {
            GUILayout.BeginHorizontal(Relay.Instance.BaseSkin.box);
            GUILayout.Label("DEATHMATCH", Relay.Instance.OptionsMenu.LabelStyle);
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            if (IsRoundInProgress)
            {
                if (GUIExts.Button("END ROUND", new GUIStyle(Relay.Instance.BaseSkin.button)
                {
                    fixedWidth = 95 * 3 + 1
                }))
                {
                    EndRoundNow();
                    StartRoundAfterMapChange = false;
                }
            }
            else
            {
                if (GUIExts.Button("START ROUND", new GUIStyle(Relay.Instance.BaseSkin.button)
                {
                    fixedWidth = 95 * 3 + 1
                }))
                {
                    StartRound();
                    StartRoundAfterMapChange   = true;
                    Relay.Instance.ShowOptions = false;
                }
            }
            GUILayout.Space(-3);
            GUILayout.EndHorizontal();
        }
        GUILayout.EndVertical();

        GUILayout.Space(1);

        GUILayout.BeginVertical(new GUIStyle()
        {
            fixedWidth = 95
        });
        {
            GUILayout.BeginHorizontal(Relay.Instance.BaseSkin.box);
            GUILayout.Label("SCORE LIMIT", Relay.Instance.OptionsMenu.LabelStyle);
            GUILayout.EndHorizontal();

            GUI.enabled = !IsRoundInProgress;
            var numText = GUILayout.TextField(ScoreLimit.ToString(), new GUIStyle(Relay.Instance.BaseSkin.textField)
            {
                fixedWidth = 95
            });
            if (numText.Length < 1)
            {
                ScoreLimit = 0;
            }
            else
            {
                int num;
                if (int.TryParse(numText, out num) && num > 0)
                {
                    ScoreLimit = num;
                }
            }
            GUI.enabled = true;
        }
        GUILayout.EndVertical();

        GUILayout.EndHorizontal();
    }