I’m making an app which includes badges. There are 3 variable lists, UNLOCKED BADGES, NAMES OF THE BADGES, and CALORIES REQUIRED. Related data is kept at the same list-item-number. That means that The WATERCRESS badge is not earned(false), and requires 50 calories. Likewise, the Fitness badge is also not earned, and requires 100 calories.
Now, these are app variables, so they are reset every session. That’s why all the UNLOCKED BADGES are false. I keep track of the user’s calories in a DVL-connected table, and I want to compare each calorie number to the required number of calories and and then assign true to each badge depending on if the calorie numbers meets the criteria.
All the buttons are disabled, and I want to make each unlocked badge enabled and also show an unlocked image at the bottom. But when I test my app, I get the TEMPTATION badge(which is correct), and the WATERCRESS badge which is worth 50 calories, which isn’t correct(that means that so far none of my calorie numbers have been equal to/less than 50). I’ve looked over my code a lot of times, but I don’t see anything that’s causing the enabling of the WATERCRESS badge.
Here’s my screen:
And my code:
and the rest:
The naming is all correct. The names of each badge-button is
- Watercress badge
- Fitness badge
- Healthy badge
- Temptation badge.
Since these are my badge names
that is correct, as well as the images. The other badges which should be disabled are staying disabled, yet the WATERCRESS badge is disabled. This is on Legacy UI. This is my end result: