Closed Tualin14 closed 1 year ago
Trying to figure out, why using alias causing the story to continue run (except when selecting button) without showing the dialogue. Using the normal way is fine.
https://github.com/Tualin14/ArisStudio/assets/58289710/c95f5ff2-fd02-4143-8e1f-2cc7cef59405
Fixed! Instead of adding this line to PreLoad(string[] texts):
foreach (var kv in aliasList.Where(kv => text.Contains(kv.Key)))
{
text = text.Replace(kv.Key, kv.Value);
}
place it in SolveCommand(string text):
...
if (nameIdList.ContainsKey(command[0]))
textCommand = $"{nameIdList[command[0]]} {textCommand}";
foreach (KeyValuePair<string, string> alias in aliasList.Where(alias => textCommand.Contains(alias.Key)))
{
// if current command contain alias name, replace the command with the alias value.
textCommand = textCommand.Replace(alias.Key, alias.Value);
}
command = AsCommand.Parse(textCommand);
...
Archive this repository
Repeating the txt, character name and their group is tiring. Example:
So, we use alias to resolve this issue. Instead of writing like above, we can use alias to save a specified text then use it later by simply writing the alias name.
Syntax:
alias alias_name "alias content"
Example:
The output will be the same, but we write it more shortly.
The important note in here is that, you can't use the same alias name that has been given to another command. Example: