diff options
author | syeyoung <cyong06@naver.com> | 2021-05-08 20:24:13 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-05-08 20:24:13 +0900 |
commit | 293bb4f9cd34a46c3b33997491b4b7927d0d9e70 (patch) | |
tree | 348fd50ffb959595f974ee1ac99d0294945403d7 /src/main/java/kr/syeyoung/dungeonsguide/features/impl | |
parent | 5d1d86dd5220b61707a57d12d0fa1dbb356d30e7 (diff) | |
download | Skyblock-Dungeons-Guide-293bb4f9cd34a46c3b33997491b4b7927d0d9e70.tar.gz Skyblock-Dungeons-Guide-293bb4f9cd34a46c3b33997491b4b7927d0d9e70.tar.bz2 Skyblock-Dungeons-Guide-293bb4f9cd34a46c3b33997491b4b7927d0d9e70.zip |
cosmetics.
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features/impl')
4 files changed, 23 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 bf91a925..ebfa2456 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 @@ -39,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)" : "")))); + }, a -> (a.replace("&", "§")+"Color "+(a.replace("&", "§").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 911ee862..e3d5a28f 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)); + }, a->a.replace("&", "§"))); 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 566229e1..b0c2987f 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 @@ -94,7 +94,7 @@ public class PrefixSelectorGUI extends MPanel { GlStateManager.pushMatrix(); GlStateManager.translate(6,17,0); for (int i = 0; i < previews.length; i++) { - fr.drawString(previews[i].replace("%name%", Minecraft.getMinecraft().getSession().getUsername()).replace("%prefix%", prefix), 0, i*fr.FONT_HEIGHT, -1); + fr.drawString(previews[i].replace("%name%", Minecraft.getMinecraft().getSession().getUsername()).replace("%prefix%", prefix.replace("&", "§")), 0, i*fr.FONT_HEIGHT, -1); } GlStateManager.popMatrix(); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java index 24c25642..2ee94226 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java @@ -24,10 +24,13 @@ import com.mojang.authlib.minecraft.MinecraftProfileTexture; import io.github.moulberry.hychat.HyChat; import io.github.moulberry.hychat.chat.ChatManager; import io.github.moulberry.hychat.gui.GuiChatBox; +import kr.syeyoung.dungeonsguide.DungeonsGuide; import kr.syeyoung.dungeonsguide.config.guiconfig.ConfigPanelCreator; import kr.syeyoung.dungeonsguide.config.guiconfig.FeatureEditPane; import kr.syeyoung.dungeonsguide.config.guiconfig.GuiConfig; import kr.syeyoung.dungeonsguide.config.guiconfig.PanelDefaultParameterConfig; +import kr.syeyoung.dungeonsguide.cosmetics.ActiveCosmetic; +import kr.syeyoung.dungeonsguide.cosmetics.CosmeticData; import kr.syeyoung.dungeonsguide.features.FeatureParameter; import kr.syeyoung.dungeonsguide.features.FeatureRegistry; import kr.syeyoung.dungeonsguide.features.SimpleFeature; @@ -245,7 +248,23 @@ public class FeatureViewPlayerOnJoin extends SimpleFeature implements GuiPostRen GlStateManager.color(1, 1, 1, 1.0F); if (fakePlayer != null) { GuiInventory.drawEntityOnScreen(45, 150, 60, -(mouseX - popupRect.x - 75), 0, fakePlayer); - fr.drawString(fakePlayer.getName(), (90 - fr.getStringWidth(fakePlayer.getName())) / 2, 15, 0xFFEFFF00); + + String toDraw = fakePlayer.getName(); + List<ActiveCosmetic> activeCosmetics = DungeonsGuide.getDungeonsGuide().getCosmeticsManager().getActiveCosmeticByPlayer().get(UUID.fromString(TextUtils.insertDashUUID(playerProfile.get().getMemberUID()))); + CosmeticData prefix = null, color = null; + if (activeCosmetics != null) { + for (ActiveCosmetic activeCosmetic : activeCosmetics) { + CosmeticData cosmeticData = DungeonsGuide.getDungeonsGuide().getCosmeticsManager().getCosmeticDataMap().get(activeCosmetic.getCosmeticData()); + if (cosmeticData != null) { + if (cosmeticData.getCosmeticType().equals("prefix")) prefix = cosmeticData; + if (cosmeticData.getCosmeticType().equals("color")) color = cosmeticData; + } + } + } + toDraw = (color == null ? "§e" : color.getData().replace("&", "§"))+toDraw; + if (prefix != null) toDraw = prefix.getData().replace("&", "§") + " "+toDraw; + + fr.drawString(toDraw, (90 - fr.getStringWidth(toDraw)) / 2, 15, -1); ItemStack toHover = null; if (relX > 20 && relX < 70) { |