@bambam89
Viel einfacher:
let NeedsVodka = [ "Wodka Sunrise", "long Island Icetea" ]
let NeedsCola = [ "whateverneedsthatstuff", "whatevqrelseneedsthatstuff"]
on({id:"Flasche_Vodka_leer", change:"ne"}, function(obj) {
if (obj.state.value) {
allowedList = RemoveCocktails(allowedList, NeedsVodka);
}
else {
allowedList = AddCocktails(allowedList, NeedsVodka);
}
on({id:"Flasche_Cola_leer", change:"ne"}, function(obj) {
if (obj.state.value) {
allowedList = RemoveCocktails(allowedList, NeedsCola);
}
else {
allowedList = AddCocktails(allowedList, NeedsCola);
}
});
A.