Skip to content

Commit

Permalink
Add glowing effect on challenge level icons that are completed.
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed Jan 24, 2019
1 parent 089f09d commit 087ee07
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ public ChallengesGUI(ChallengesAddon addon,

this.levelStatusList = this.challengesManager.getChallengeLevelStatus(this.user, this.world);

for (int i = 0; i < this.levelStatusList.size(); i++)
for (LevelStatus levelStatus : this.levelStatusList)
{
if (this.levelStatusList.get(i).isUnlocked())
if (levelStatus.isUnlocked())
{
this.lastSelectedLevel = this.levelStatusList.get(i);
this.lastSelectedLevel = levelStatus;
}
else
{
Expand Down Expand Up @@ -491,6 +491,7 @@ private PanelItem getLevelButton(LevelStatus level)
ItemStack icon;
List<String> description;
PanelItem.ClickHandler clickHandler;
boolean glow;

if (level.isUnlocked())
{
Expand All @@ -507,6 +508,7 @@ private PanelItem getLevelButton(LevelStatus level)
this.build();
return true;
};
glow = this.challengesManager.isLevelCompleted(this.user, level.getLevel());
}
else
{
Expand All @@ -518,9 +520,10 @@ private PanelItem getLevelButton(LevelStatus level)
"[thisLevel]", level.getPreviousLevel().getFriendlyName()));

clickHandler = null;
glow = false;
}

return new PanelItem(icon, name, description, false, clickHandler, false);
return new PanelItem(icon, name, description, glow, clickHandler, false);
}


Expand Down

0 comments on commit 087ee07

Please sign in to comment.