Help with condition changes
Posted: Sun Jun 17, 2018 9:56 am
Hello, I have a question for you regarding condition changing in labels for a patch. I hope that I'll make it clear what I mean.
Lets say we have the same conditions set in different labels, but I don't want to go change them manually or with retyping every label and then use config.label_overrides, but with a single file that contains a label or a command like for config.label_overrides but only for the conditions and not the text or anything else, I also know about the hardChanged option for text, and I'm looking for something similar, for example:
how I want to do things:
or:
or:
and having a result for the previous labels as:
I hope that I made it clear. So how do you recommend doing this, is it possible?
Thanks in advance for your help with this mater.
Lets say we have the same conditions set in different labels, but I don't want to go change them manually or with retyping every label and then use config.label_overrides, but with a single file that contains a label or a command like for config.label_overrides but only for the conditions and not the text or anything else, I also know about the hardChanged option for text, and I'm looking for something similar, for example:
Code: Select all
label exemple:
if var == var1:
do something...
label exemple1:
if var == var1:
do something...
Code: Select all
init 200 python:
config.label_content_overrides = {
"if var == var1:" : "if var == var2:"
}
Code: Select all
init 200 python:
hardChanged = {
"if var == var1:" : "if var == var2:"
}
Code: Select all
label change:
if in labels find "if var == var1:":
set {"if var == var1:" : "if var == var2:"}
and having a result for the previous labels as:
Code: Select all
label exemple:
if var == var2:
do something...
label exemple1:
if var == var2:
do something...
Thanks in advance for your help with this mater.