private void ReadConVar(char charToCheck)
        {
            bool checkComplete = false;

            while (!checkComplete)
            {
                SeekToConVarName();
                string conVarName = ReadConVarName();
                if (conVarName != string.Empty)
                {
                    currentConVar      = new ConVar();
                    currentConVar.name = conVarName;
                    AdvanceReader(); //Advance to get inside the bracket.
                    string[] arguments = ReadConVarParameters();

                    currentConVar.symbolRequired = currentSymbol;
                    currentConVar.conVarType     = GetConVarTypeFromArgumentList(arguments);
                    ParseConVarArguments(arguments);
                    checkComplete = true;
                    conVars.Add(currentConVar);
                }
                else
                {
                    return;
                }
            }
        }
Example #2
0
        static void WriteToDebug(List <ConVar> conVarList, string path)
        {
            DisplayMessage(string.Format("Found {0} ConVar(s) in file {1}:", conVarList.Count, Path.GetFileNameWithoutExtension(path)));
            for (int i = 0; i < conVarList.Count; i++)
            {
                ConVar conVar = conVarList[i];
                switch (conVar.conVarType)
                {
                case ConVarType.ConVar:
                case ConVarType.ConVarWithFlags:
                    DisplayMessage(string.Format("\t-{0}: {1} - {2}", i, conVar.name, conVar.initialValue, conVar.flags));
                    break;

                case ConVarType.ConVarDescription:
                    DisplayMessage(string.Format("\t-{0}: {1} - Default Value: {2} - Flags: {3} - \"{4}\"",
                                                 i,
                                                 conVar.name,
                                                 conVar.initialValue,
                                                 conVar.flags,
                                                 conVar.description));
                    break;

                case ConVarType.ConVarCallback:
                    DisplayMessage(string.Format("\t-{0}: {1} - Default Value: {2} - Flags: {3} - \"{4}\" - Callback Function Name: {5}",
                                                 i,
                                                 conVar.name,
                                                 conVar.initialValue,
                                                 conVar.flags,
                                                 conVar.description,
                                                 conVar.callbackName));
                    break;

                case ConVarType.ConVarLimitedInput:
                    DisplayMessage(string.Format("\t-{0}: {1} - Default Value: {2} - Flags: {3} - \"{4}\" - Uses Min Value: {5} - Min Value: {6} - Uses Max Value: {7} - Max Value: {8}",
                                                 i,
                                                 conVar.name,
                                                 conVar.initialValue,
                                                 conVar.flags,
                                                 conVar.description,
                                                 conVar.usesMinValue,
                                                 conVar.minValue,
                                                 conVar.usesMaxValue,
                                                 conVar.maxValue));
                    break;

                case ConVarType.ConVarLimitedInputCallback:
                    DisplayMessage(string.Format("\t-{0}: {1} - Default Value: {2} - Flags: {3} - \"{4}\" - Uses Min Value: {5} - Min Value: {6} - Uses Max Value: {7} - Max Value: {8} - Callback Function Name: {9}",
                                                 i,
                                                 conVar.name,
                                                 conVar.initialValue,
                                                 conVar.flags,
                                                 conVar.description,
                                                 conVar.usesMinValue,
                                                 conVar.minValue,
                                                 conVar.usesMaxValue,
                                                 conVar.maxValue,
                                                 conVar.callbackName));
                    break;

                case ConVarType.ConVarLimitedInputComp:
                    DisplayMessage(string.Format("\t-{0}: {1} - Default Value: {2} - Flags: {3} - \"{4}\" - Uses Min Value: {5} - Min Value: {6} - Uses Max Value: {7} - Max Value: {8} - Uses Comp Min Value: {9} - Comp Min Value: {10} - Uses Comp Max Value: {11} - Comp Max Value: {12} - Callback Function Name: {13}",
                                                 i,
                                                 conVar.name,
                                                 conVar.initialValue,
                                                 conVar.flags,
                                                 conVar.description,
                                                 conVar.usesMinValue,
                                                 conVar.minValue,
                                                 conVar.usesMaxValue,
                                                 conVar.maxValue,
                                                 conVar.usesCompetitiveMinValue,
                                                 conVar.competitiveMinValue,
                                                 conVar.usesCompetitiveMaxValue,
                                                 conVar.competitiveMaxValue,
                                                 conVar.callbackName));
                    break;
                }
            }
        }