小修
This commit is contained in:
@@ -20,11 +20,9 @@ namespace Continentis.MainGame
|
||||
TextInterpreter.SetVariable(keyword.Key, keyword.Key);
|
||||
}
|
||||
}
|
||||
|
||||
public static void InterpretText(CardInstance card, bool overrideDescription = false)
|
||||
|
||||
public static string InterpretText(CardInstance card, string textToInterpret)
|
||||
{
|
||||
//card.contentSubmodule.keywords.Clear();
|
||||
|
||||
foreach (KeyValuePair<string, float> attribute in card.attributeSubmodule.attributeGroup.current)
|
||||
{
|
||||
TextInterpreter.SetVariable(attribute.Key, attribute.Value);
|
||||
@@ -34,13 +32,18 @@ namespace Continentis.MainGame
|
||||
TextInterpreter.SetFunction("Attribute", new Func<string, string>((name) => GetAttribute(card, name, true, false)));
|
||||
TextInterpreter.SetFunction("Attribute", new Func<string, bool, string>((name, high) => GetAttribute(card, name, high, false)));
|
||||
TextInterpreter.SetFunction("Attribute", new Func<string, bool, bool, string>((name, high, percent) => GetAttribute(card, name, high, percent)));
|
||||
|
||||
string result = DynamicTextInterpreter.Parse(TextInterpreter, textToInterpret);
|
||||
|
||||
Debug.Log($"Interpreted Text: {result}");
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void InterpretText(CardInstance card)
|
||||
{
|
||||
string descriptionToParse = card.contentSubmodule.originalFunctionText;
|
||||
string result = DynamicTextInterpreter.Parse(TextInterpreter, descriptionToParse);
|
||||
|
||||
string result = InterpretText(card, descriptionToParse);
|
||||
card.contentSubmodule.interpretedFunctionText = result;
|
||||
|
||||
Debug.Log($"Interpreted Description: {result}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user