Fixed OneButtonPrompt wildcards generating same results when used multiple times in same prompt. Mostly just moved all the existing prompt generation code down to the final step (replacing into the prompt text), which ensures it doesn't reuse the previous generation.
For normal wildcards, the contents of their text file is added to the placeholder_choices dict, and then in the second loop at the end of the process_wildcards() function it picks a random one from that list for each wildcard encountered in the prompt and replaces it with that pick. However, what the old code for OneButtonPrompt wildcards did, was add a list with a single entry to that dict for the relevant OneButtonPrompt generation, then for each future matches, it would overwrite the existing dict entry with a new single-item list. Then, at the end, it loops again and picks a random entry from this single-item list, which of course is always the same entry. By moving the generation code down to the second loop, it will now generate a random prompt for each OneButtonPrompt wildcard it encounters even when it has seen it before, because it's no longer tracking them in the dict but generating a new one when needed.
Fixed OneButtonPrompt wildcards generating same results when used multiple times in same prompt. Mostly just moved all the existing prompt generation code down to the final step (replacing into the prompt text), which ensures it doesn't reuse the previous generation.
For normal wildcards, the contents of their text file is added to the
placeholder_choices
dict, and then in the second loop at the end of theprocess_wildcards()
function it picks a random one from that list for each wildcard encountered in the prompt and replaces it with that pick. However, what the old code for OneButtonPrompt wildcards did, was add a list with a single entry to that dict for the relevant OneButtonPrompt generation, then for each future matches, it would overwrite the existing dict entry with a new single-item list. Then, at the end, it loops again and picks a random entry from this single-item list, which of course is always the same entry. By moving the generation code down to the second loop, it will now generate a random prompt for each OneButtonPrompt wildcard it encounters even when it has seen it before, because it's no longer tracking them in the dict but generating a new one when needed.