2015-10-16, 19:42
I've been trying to add a conditional <colordiffuse> tag to the icon image (the built-in control id=400) in DialogKaiToast.xml for some time now. But I just haven't been able to get it to work, no matter what I try.
Specifically, I'm just wanting to <colordiffuse> 3 icons (should they be the ones shown): DialogIconError, DialogIconWarning, and DialogIconInfo.
I first tried adding a conditional to the colordiffuse tag, but that didn't work, and to be honest I'm not even sure if that's even a real thing
Then I tried using variables like so:
In DialogKaiToast.xml I had:
And in Includes_Variables.xml I had:
But this caused no icon to appear at all, regardless of if it was one of the three I intended to exclude. I figured that meant it had something to do with my conditional, so I tried this to test it out
But I got the same result as I did when using the previous variables.
Thinking it might be the dash in the second value string, I changed that one to:
But that didn't work for me either.
I also tried using a conditional <include> in place of the colordiffuse tag, but I didn't have any luck with that either.
I'm sure this is another dumb mistake, but any help would be appreciated. Thank you in advance!
Specifically, I'm just wanting to <colordiffuse> 3 icons (should they be the ones shown): DialogIconError, DialogIconWarning, and DialogIconInfo.
I first tried adding a conditional to the colordiffuse tag, but that didn't work, and to be honest I'm not even sure if that's even a real thing
Then I tried using variables like so:
In DialogKaiToast.xml I had:
PHP Code:
<control type="image" id="400">
<description>Icon</description>
<posx>10</posx>
<posy>10</posy>
<width>60</width>
<height>60</height>
<aspectratio>keep</aspectratio>
<colordiffuse>$VAR[NotificationIconColor]</colordiffuse>
</control>
And in Includes_Variables.xml I had:
PHP Code:
<variable name="NotificationIconColor">
<value condition="SubString(ListItem.Icon,Error) | SubString(ListItem.Icon,Info) | SubString(ListItem.Icon,Warning)">AccentColor</value>
<value condition="!SubString(ListItem.Icon,Error) + !SubString(ListItem.Icon,Info) + !SubString(ListItem.Icon,Warning)">-</value>
</variable>
But this caused no icon to appear at all, regardless of if it was one of the three I intended to exclude. I figured that meant it had something to do with my conditional, so I tried this to test it out
PHP Code:
<variable name="NotificationIconColor">
<value condition="SubString(ListItem.Icon,Default)">AccentColor</value>
<value condition="!SubString(ListItem.Icon,Default)">-</value>
</variable>
But I got the same result as I did when using the previous variables.
Thinking it might be the dash in the second value string, I changed that one to:
PHP Code:
<value condition="!SubString(ListItem.Icon,Default)">00000000</value>
I also tried using a conditional <include> in place of the colordiffuse tag, but I didn't have any luck with that either.
I'm sure this is another dumb mistake, but any help would be appreciated. Thank you in advance!