Skip to content

Commit

Permalink
Translates color codes for database texts.
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed Sep 19, 2021
1 parent 5f4fc31 commit c1a0eaa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import world.bentobox.bentobox.api.panels.builders.PanelBuilder;
import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.util.Util;
import world.bentobox.challenges.ChallengesAddon;
import world.bentobox.challenges.database.object.Challenge;
import world.bentobox.challenges.database.object.requirements.InventoryRequirements;
Expand Down Expand Up @@ -458,7 +459,7 @@ private PanelItem createButton(Button button)
icon = new ItemStack(Material.WRITTEN_BOOK);

description.add(this.user.getTranslation(reference + "value"));
description.addAll(this.challenge.getDescription());
this.challenge.getDescription().forEach(line -> description.add(Util.translateColorCodes(line)));

clickHandler = (panel, user, clickType, i) ->
{
Expand Down Expand Up @@ -1290,7 +1291,7 @@ private PanelItem createRewardButton(RewardButton button)
icon = new ItemStack(Material.WRITTEN_BOOK);

description.add(this.user.getTranslation(reference + "value"));
description.add(this.challenge.getRewardText());
description.add(Util.translateColorCodes(this.challenge.getRewardText()));

clickHandler = (panel, user, clickType, i) ->
{
Expand Down Expand Up @@ -1514,7 +1515,7 @@ private PanelItem createRewardButton(RewardButton button)
icon = new ItemStack(Material.WRITTEN_BOOK);

description.add(this.user.getTranslation(reference + "value"));
description.add(this.challenge.getRepeatRewardText());
description.add(Util.translateColorCodes(this.challenge.getRepeatRewardText()));

clickHandler = (panel, user, clickType, i) ->
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ private PanelItem createButton(Button button)
icon = new ItemStack(Material.WRITTEN_BOOK);

description.add(this.user.getTranslation(reference + "value"));
description.add(this.challengeLevel.getRewardText());
description.add(Util.translateColorCodes(this.challengeLevel.getRewardText()));

clickHandler = (panel, user, clickType, i) ->
{
Expand Down Expand Up @@ -534,7 +534,7 @@ private PanelItem createButton(Button button)
icon = new ItemStack(Material.WRITTEN_BOOK);

description.add(this.user.getTranslation(reference + "value"));
description.add(this.challengeLevel.getUnlockMessage());
description.add(Util.translateColorCodes(this.challengeLevel.getUnlockMessage()));

clickHandler = (panel, user, clickType, i) ->
{
Expand Down

0 comments on commit c1a0eaa

Please sign in to comment.