|
@ -106,6 +106,10 @@ namespace IPA.Loader.Features |
|
|
if (definingPlugin != declarer) |
|
|
if (definingPlugin != declarer) |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
featureDelcarers.Add(name, definingPlugin); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
featureTypes.Add(name, type); |
|
|
featureTypes.Add(name, type); |
|
|
return true; |
|
|
return true; |
|
@ -144,11 +148,13 @@ namespace IPA.Loader.Features |
|
|
// returns whether or not Initialize returned true, feature is always set when the thing exists
|
|
|
// returns whether or not Initialize returned true, feature is always set when the thing exists
|
|
|
public bool TryCreate(out Feature feature) |
|
|
public bool TryCreate(out Feature feature) |
|
|
{ |
|
|
{ |
|
|
feature = null; |
|
|
|
|
|
if (type == null) |
|
|
if (type == null) |
|
|
{ |
|
|
{ |
|
|
if (!featureTypes.TryGetValue(Name, out type)) |
|
|
if (!featureTypes.TryGetValue(Name, out type)) |
|
|
|
|
|
{ |
|
|
|
|
|
feature = new EmptyFeature() { InvalidMessage = "No such feature type found", FeatureName = Name }; |
|
|
return false; |
|
|
return false; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
bool result; |
|
|
bool result; |
|
@ -162,7 +168,7 @@ namespace IPA.Loader.Features |
|
|
catch (Exception e) |
|
|
catch (Exception e) |
|
|
{ |
|
|
{ |
|
|
result = false; |
|
|
result = false; |
|
|
feature = new EmptyFeature() { InvalidMessage = e.ToString() }; |
|
|
|
|
|
|
|
|
feature = new EmptyFeature() { InvalidMessage = e.ToString(), FeatureName = Name }; |
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|