Skip to content

Commit

Permalink
Fix enum display
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmfinol committed Nov 30, 2017
1 parent ac7cefb commit d4ab201
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Assets/Scripts/CardGameCore/Card.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ public string GetPropertyValueString(string propertyName)

EnumDef enumDef = CardGameManager.Current.Enums.Where(def => def.Property.Equals(propertyName)).FirstOrDefault();
if (enumDef != null) {
PropertyDefValuePair property = Properties [propertyName];
int lookupKeys;
string stringValue;
if (EnumDef.TryParseInt(Properties [propertyName].Value, out lookupKeys))
if (((property.Def.Type == PropertyType.EnumList || enumDef.LookupEqualsValue) && EnumDef.TryParseInt(property.Value, out lookupKeys)) || enumDef.ReverseLookup.TryGetValue(property.Value, out lookupKeys))
return enumDef.GetStringFromLookupKeys(lookupKeys);
if (enumDef.Values.TryGetValue(Properties [propertyName].Value, out stringValue))
if (enumDef.Values.TryGetValue(property.Value, out stringValue))
return stringValue;
}

Expand Down

0 comments on commit d4ab201

Please sign in to comment.