private void PopulateAllVariables() { for (int i = 0, enumIndex = 0; i < TheEditor.GetNumGlobals(); i++, enumIndex++) { while (TheEditor.GetIndexOfGlobal((GlobalVariable)enumIndex) < i) { enumIndex++; } string name = Enum.GetName(typeof(GlobalVariable), enumIndex); Globals.Add(new GlobalVariableInfo() { Index = i, IntValue = TheEditor.GetGlobal(i), FloatValue = TheEditor.GetGlobalAsFloat(i), Name = name }); } }