public string GetValue()
{
try
{
var props = export.GetProperties();
switch (type)
{
case VarTypes.Int:
if (export.ObjectName == "BioSeqVar_StoryManagerInt")
{
var m_sRefName = props.GetProp<StrProperty>("m_sRefName");
if (m_sRefName != null)
{
appendToComment(m_sRefName);
}
var m_nIndex = props.GetProp<IntProperty>("m_nIndex");
if (m_nIndex != null)
{
return "Plot Int\n#" + m_nIndex.Value;
}
}
var intValue = props.GetProp<IntProperty>("IntValue");
if (intValue != null)
{
return intValue.Value.ToString();
}
return "0";
case VarTypes.Float:
if (export.ObjectName == "BioSeqVar_StoryManagerFloat")
{
var m_sRefName = props.GetProp<StrProperty>("m_sRefName");
if (m_sRefName != null)
{
appendToComment(m_sRefName);
}
var m_nIndex = props.GetProp<IntProperty>("m_nIndex");
if (m_nIndex != null)
{
return "Plot Float\n#" + m_nIndex.Value;
}
}
var floatValue = props.GetProp<FloatProperty>("FloatValue");
if (floatValue != null)
{
return floatValue.Value.ToString();
}
return "0.00";
case VarTypes.Bool:
if (export.ObjectName == "BioSeqVar_StoryManagerBool")
{
var m_sRefName = props.GetProp<StrProperty>("m_sRefName");
if (m_sRefName != null)
{
appendToComment(m_sRefName);
}
var m_nIndex = props.GetProp<IntProperty>("m_nIndex");
if (m_nIndex != null)
{
return "Plot Bool\n#" + m_nIndex.Value;
}
}
var bValue = props.GetProp<IntProperty>("bValue");
if (bValue != null)
{
return (bValue.Value == 1).ToString();
}
return "False";
case VarTypes.Object:
if (export.ObjectName == "SeqVar_Player")
return "Player";
foreach (var prop in props)
{
if (prop.Name == "m_sObjectTagToFind")
{
return (prop as StrProperty).Value;
}
else if (prop.Name == "ObjValue")
{
return pcc.getEntry((prop as ObjectProperty).Value)?.ObjectName ?? "???";
}
}
return "???";
case VarTypes.StrRef:
foreach (var prop in props)
{
if (prop.Name == "m_srValue" || prop.Name == "m_srStringID")
{
StringRefProperty strRefProp = prop as StringRefProperty;
if (strRefProp != null)
{
switch (pcc.Game)
{
case MEGame.ME1:
return talkfiles.findDataById(strRefProp.Value);
case MEGame.ME2:
return ME2Explorer.ME2TalkFiles.findDataById(strRefProp.Value);
case MEGame.ME3:
return ME3TalkFiles.findDataById(strRefProp.Value);
default:
break;
}
}
}
}
return "???";
case VarTypes.String:
var strValue = props.GetProp<StrProperty>("StrValue");
if (strValue != null)
{
return strValue.Value;
}
return "???";
case VarTypes.Extern:
foreach (var prop in props)
{
if (prop.Name == "FindVarName")//Named Variable
{
return "< " + (prop as NameProperty) + " >";
}
else if (prop.Name == "NameValue")//SeqVar_Name
{
return (prop as NameProperty)?.Value;
}
else if (prop.Name == "VariableLabel")//External
{
return "Extern:\n" + (prop as StrProperty);
}
}
return "???";
case VarTypes.MatineeData:
return "#" + index + "\n" + "InterpData";
default:
return "???";
}
}
catch (Exception)
{
return "???";
}
}