I have to track two or three globals at the same time. How do I do that? Nothing has worked so far

I create a music widget. And it works very well. This widget can do everything.
It has a search bar and shortcuts on the right and/or left side of the music player. It can also display shortcuts under the music player. It can also change the colors. Either manually with 3 selected (according to the material you design) colors or automatically according to the system. And much more.

Now I clean up the widget after some changes and make everything as clean as possible. And very important. Beginners should also understand it. So there must be as little custom work as possible but as much as there are functions.

Hence my question now.

I have 3 buttons at the bottom right. These should be separated from the normal lower buttons. These also have only one background. But this background has to adapt. Depending on whether I want to have o icons at the bottom or 3. The background does not change in height. Only the width.

Now I have created a global background for each icon under

And an on-off switch under

Now I am trying to create the 3 backgrounds. And with an icon this is easy.
Just add a background to an overlap group and switch on this overlap group when an icon is used.
$if(gv(shortcut/dshort/1sdshort)=off, remove, always)$

This then 3 times and that’s it. But I can’t manage to do this for two at the same time.

So that I can recognize whether shortcut 1 & shortcut 2 are on or off at the same time.

If shortcut 1 is off and shortcut 2 is on, then it should be removed. Likewise if shortcut 2 is off and if shortcut 1 is off. It should only be switched on if shortcut 1 & shortcut 2 are on at the same time.

This should of course also be the case when shortcut 1 & 3 are on or when 2 & 3 are on.

Later, this must also be done for all 3 shortcuts. So only when all 3 sghortcuts are on, the background should be displayed. Otherwise the background should be removed.

I hope you understand what I mean.

Here is my attempt for shortcut 1 & 2:

$if(gv(shortcut/dshort/1sdshort) * gv(shortcut/dshort/2sdshort)=off, remove, always)$

I have actually got further.

Whenever one of the 3 lists shows Off, a new variable now shows a 0. Everything else shows a 1. I have created these 3 times. One for each list:
$if(gv(shortcut/dshort/1sdshort)=off, 0,1)$

This of course 3 times.

Then I created another variable that calculates all 3 together.

And depending on what the result is, an overlap group should then be triggered. And this then displays the corresponding background.

So far so good.

Here is the calculation:
$gv(shortcut/dshort/1) + gv(shortcut/dshort/2) + gv(shortcut/dshort/3)$

The result is also correct. But it cannot be read out with anything. When I try to read it out, the result is not transferred and therefore the other variables do not work either.

I can’t upload more than 1 picture. That is not enough. Sorry.

I have done it. Instead of creating the last variable in the folder, I have to create it in the root folder of the globals, then it can be read out.

1 Like