public static string GetProperty(string className, List<string> _extantProps, MEGame game)
{
string temp = className;
List<string> classes = new List<string>();
Dictionary<string, ClassInfo> classList;
switch (game)
{
case MEGame.ME1:
classList = ME1Explorer.Unreal.ME1UnrealObjectInfo.Classes;
break;
case MEGame.ME2:
classList = ME2Explorer.Unreal.ME2UnrealObjectInfo.Classes;
break;
case MEGame.ME3:
default:
classList = ME3UnrealObjectInfo.Classes;
break;
}
while (classList.ContainsKey(temp) && temp != "Object")
{
classes.Add(temp);
temp = classList[temp].baseClass;
}
classes.Reverse();
AddPropertyDialog prompt = new AddPropertyDialog();
prompt.classList = classList;
prompt.extantProps = _extantProps;
prompt.classListBox.DataSource = classes;
prompt.classListBox.SelectedItem = className;
if(prompt.ShowDialog() == DialogResult.OK && prompt.propListBox.SelectedIndex != -1)
{
return prompt.propListBox.SelectedItem as string;
}
else
{
return null;
}
}
}