diff options
author | syeyoung <cyong06@naver.com> | 2021-05-08 17:28:38 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-05-08 17:28:38 +0900 |
commit | 5d1d86dd5220b61707a57d12d0fa1dbb356d30e7 (patch) | |
tree | 72a7a7f9b535371799426bf0e6efe7372cb373cf /src/main/java/kr | |
parent | b34b217f44c0c5ae7e69a4d7b830a8607f5fc13a (diff) | |
download | Skyblock-Dungeons-Guide-5d1d86dd5220b61707a57d12d0fa1dbb356d30e7.tar.gz Skyblock-Dungeons-Guide-5d1d86dd5220b61707a57d12d0fa1dbb356d30e7.tar.bz2 Skyblock-Dungeons-Guide-5d1d86dd5220b61707a57d12d0fa1dbb356d30e7.zip |
cosmetics.
Diffstat (limited to 'src/main/java/kr')
3 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/FeatureNicknameColor.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/FeatureNicknameColor.java index 02bad9f1..bf91a925 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/FeatureNicknameColor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/FeatureNicknameColor.java @@ -22,6 +22,7 @@ import kr.syeyoung.dungeonsguide.config.guiconfig.ConfigPanelCreator; import kr.syeyoung.dungeonsguide.config.guiconfig.GuiConfig; import kr.syeyoung.dungeonsguide.features.FeatureParameter; import kr.syeyoung.dungeonsguide.features.SimpleFeature; +import net.minecraft.util.EnumChatFormatting; public class FeatureNicknameColor extends SimpleFeature { public FeatureNicknameColor() { @@ -38,7 +39,7 @@ public class FeatureNicknameColor extends SimpleFeature { "§dFrom §r§r§a[RANK§r§6+§r§a] %prefix%%name%§r§7: §r§7TEST§r", "§r§b[RANK§c+§b] %prefix%%name%§f: TEST", "§r§bCo-op > §r§a[RANK§6+§a] %prefix%%name%§f: §rTEST§r" - })); + }, a -> (a+"Color "+(a.equals("§z") ? "(Rainbow on sba)" : "")))); return "base." + getKey(); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/FeatureNicknamePrefix.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/FeatureNicknamePrefix.java index 5ffcc26b..911ee862 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/FeatureNicknamePrefix.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/FeatureNicknamePrefix.java @@ -46,7 +46,7 @@ public class FeatureNicknamePrefix extends SimpleFeature { "§dFrom §r%prefix% §r§a[RANK§r§6+§r§a] %name%§r§7: §r§7TEST§r", "§r%prefix% §b[RANK§c+§b] %name%§f: TEST", "§r§bCo-op > §r%prefix% §a[RANK§6+§a] %name%§f: §rTEST§r" - })); + }, a->a)); return "base." + getKey(); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/PrefixSelectorGUI.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/PrefixSelectorGUI.java index dd0dc387..566229e1 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/PrefixSelectorGUI.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/PrefixSelectorGUI.java @@ -34,16 +34,19 @@ import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.UUID; +import java.util.function.Function; import java.util.stream.Collectors; public class PrefixSelectorGUI extends MPanel { private GuiConfig config; private String cosmeticType; + private Function<String, String> optionTransformer; - public PrefixSelectorGUI(GuiConfig config, String cosmeticType, String[] previews) { + public PrefixSelectorGUI(GuiConfig config, String cosmeticType, String[] previews, Function<String, String> optionTransformer) { this.config = config; this.cosmeticType = cosmeticType; this.previews = previews; + this.optionTransformer = optionTransformer; CosmeticsManager cosmeticsManager = DungeonsGuide.getDungeonsGuide().getCosmeticsManager(); List<ActiveCosmetic> activeCosmeticList = cosmeticsManager.getActiveCosmeticByPlayer().computeIfAbsent(Minecraft.getMinecraft().thePlayer.getGameProfile().getId(), (a) -> new ArrayList<>()); for (ActiveCosmetic activeCosmetic : activeCosmeticList) { @@ -104,7 +107,7 @@ public class PrefixSelectorGUI extends MPanel { if (value.getCosmeticType().equals(cosmeticType)) { Gui.drawRect(0,0,220, fr.FONT_HEIGHT+3, 0xFF222222); Gui.drawRect(1,1, 219, fr.FONT_HEIGHT+2, 0xFF555555); - fr.drawString(value.getData(), 2, 2, -1); + fr.drawString(optionTransformer.apply(value.getData()), 2, 2, -1); Gui.drawRect(120,1,160, fr.FONT_HEIGHT+2, new Rectangle(120,cnt * (fr.FONT_HEIGHT+4) + 2,40,fr.FONT_HEIGHT+1).contains(relX, relY) ? 0xFF859DF0 : 0xFF7289da); fr.drawString("TEST", (280-fr.getStringWidth("TEST"))/2, 2, -1); |