diff --git a/src/main/java/kamkeel/npcs/controllers/ProfileController.java b/src/main/java/kamkeel/npcs/controllers/ProfileController.java index 6c2808e1b..e7d14dbfd 100644 --- a/src/main/java/kamkeel/npcs/controllers/ProfileController.java +++ b/src/main/java/kamkeel/npcs/controllers/ProfileController.java @@ -91,6 +91,9 @@ public class ProfileController implements IProfileHandler { } public synchronized void login(EntityPlayer player) { + if(!ConfigMain.ProfilesEnabled) + return; + if (player == null) return; Profile profile; diff --git a/src/main/java/noppes/npcs/client/gui/SubGuiEffectGeneral.java b/src/main/java/noppes/npcs/client/gui/SubGuiEffectGeneral.java index a5f8f0418..ea9152189 100644 --- a/src/main/java/noppes/npcs/client/gui/SubGuiEffectGeneral.java +++ b/src/main/java/noppes/npcs/client/gui/SubGuiEffectGeneral.java @@ -16,6 +16,8 @@ import org.lwjgl.opengl.GL11; import java.util.ArrayList; import java.util.List; +import static noppes.npcs.client.gui.player.inventory.GuiCNPCInventory.specialIcons; + public class SubGuiEffectGeneral extends SubGuiInterface implements ITextfieldListener { private final GuiNPCManageEffects parent; public CustomEffect effect; @@ -128,10 +130,8 @@ public class SubGuiEffectGeneral extends SubGuiInterface implements ITextfieldLi func_152125_a(x, y, 0, 0, 1, 1, iconRenderSize, iconRenderSize, 1, 1); } GL11.glDisable(GL11.GL_DEPTH_TEST); - - // TODO: FIX TEXTURE - // textureManager.bindTexture(new ResourceLocation(CustomNpcPlusDBC.ID + ":textures/gui/icons.png")); - // func_152125_a(x, y, 0, 240, 16, 16, iconRenderSize, iconRenderSize, 256, 256); + textureManager.bindTexture(specialIcons); + func_152125_a(x, y, 0, 224, 16, 16, iconRenderSize, iconRenderSize, 256, 256); GL11.glEnable(GL11.GL_DEPTH_TEST); } }; diff --git a/src/main/java/noppes/npcs/client/gui/global/GuiNPCManageEffects.java b/src/main/java/noppes/npcs/client/gui/global/GuiNPCManageEffects.java index b227cc829..d0da71469 100644 --- a/src/main/java/noppes/npcs/client/gui/global/GuiNPCManageEffects.java +++ b/src/main/java/noppes/npcs/client/gui/global/GuiNPCManageEffects.java @@ -28,6 +28,8 @@ import java.util.HashMap; import java.util.List; import java.util.Vector; +import static noppes.npcs.client.gui.player.inventory.GuiCNPCInventory.specialIcons; + public class GuiNPCManageEffects extends GuiNPCInterface2 implements ICustomScrollListener, IScrollData, IGuiData, ISubGuiListener, GuiYesNoCallback { public GuiCustomScroll scrollEffects; public HashMap data = new HashMap<>(); @@ -170,10 +172,8 @@ public class GuiNPCManageEffects extends GuiNPCInterface2 implements ICustomScro func_152125_a(x, y, 0, 0, 1, 1, iconRenderSize, iconRenderSize, 1, 1); } GL11.glDisable(GL11.GL_DEPTH_TEST); - - // TODO: Fix ICONS - // textureManager.bindTexture(new ResourceLocation(CustomNpcPlusDBC.ID + ":textures/gui/icons.png")); - // func_152125_a(x, y, 0, 240, 16, 16, iconRenderSize, iconRenderSize, 256, 256); + textureManager.bindTexture(specialIcons); + func_152125_a(x, y, 0, 224, 16, 16, iconRenderSize, iconRenderSize, 256, 256); GL11.glEnable(GL11.GL_DEPTH_TEST); x += iconRenderSize + 3; diff --git a/src/main/java/noppes/npcs/client/gui/mainmenu/GuiNPCGlobalMainMenu.java b/src/main/java/noppes/npcs/client/gui/mainmenu/GuiNPCGlobalMainMenu.java index 203b32c9f..a4b38906e 100644 --- a/src/main/java/noppes/npcs/client/gui/mainmenu/GuiNPCGlobalMainMenu.java +++ b/src/main/java/noppes/npcs/client/gui/mainmenu/GuiNPCGlobalMainMenu.java @@ -83,7 +83,7 @@ public class GuiNPCGlobalMainMenu extends GuiNPCInterface2 { tagButton.setIconPos(24, 24, 192, 32).setIconTexture(specialIcons); registerButton(effectsButton = new GuiNpcSquareButton(19, 0, 0, 20, "global.customeffects", 0xFF333333)); - effectsButton.setIconPos(24, 24, 192, 32).setIconTexture(specialIcons); + effectsButton.setIconPos(24, 24, 24, 56).setIconTexture(specialIcons); // Layout composite buttons optimally. layoutButtons(); diff --git a/src/main/java/noppes/npcs/client/gui/player/inventory/GuiCNPCInventory.java b/src/main/java/noppes/npcs/client/gui/player/inventory/GuiCNPCInventory.java index ee607398b..7e5480712 100644 --- a/src/main/java/noppes/npcs/client/gui/player/inventory/GuiCNPCInventory.java +++ b/src/main/java/noppes/npcs/client/gui/player/inventory/GuiCNPCInventory.java @@ -83,7 +83,7 @@ public class GuiCNPCInventory extends GuiNPCInterface { int effectBarX = guiLeft + xSize + 65; int effectBarY = guiTop + 10; - int effectBarWidth = 24; + int effectBarWidth = 20; int effectBarHeight = ySize; effectBar = new GuiEffectBar(effectBarX, effectBarY, effectBarWidth, effectBarHeight); } @@ -107,7 +107,7 @@ public class GuiCNPCInventory extends GuiNPCInterface { public void drawScreen(int mouseX, int mouseY, float partialTicks) { updateEffectBar(); super.drawScreen(mouseX, mouseY, partialTicks); - if (effectBar != null) { + if (!ConfigClient.HideEffectsBar && effectBar != null && !effectBar.entries.isEmpty()) { effectBar.drawScreen(mouseX, mouseY, partialTicks); } } diff --git a/src/main/java/noppes/npcs/client/gui/player/inventory/GuiSettings.java b/src/main/java/noppes/npcs/client/gui/player/inventory/GuiSettings.java index 19aea1433..44f2af54e 100644 --- a/src/main/java/noppes/npcs/client/gui/player/inventory/GuiSettings.java +++ b/src/main/java/noppes/npcs/client/gui/player/inventory/GuiSettings.java @@ -13,6 +13,7 @@ import noppes.npcs.client.gui.util.GuiNpcLabel; import noppes.npcs.client.gui.util.GuiNpcTextField; import noppes.npcs.client.gui.util.ITextfieldListener; import noppes.npcs.config.ConfigClient; +import noppes.npcs.config.ConfigMain; import org.lwjgl.opengl.GL11; import tconstruct.client.tabs.AbstractTab; @@ -77,6 +78,9 @@ public class GuiSettings extends GuiCNPCInventory implements ITextfieldListener, y += 22; + this.addLabel(new GuiNpcLabel(8, "settings.effectsBar", guiLeft + 8, guiTop + 14 + y)); + this.addButton(new GuiNpcButton(8, guiLeft + 105, guiTop + 9 + y, 50, 20, new String[]{"gui.no", "gui.yes"}, ConfigClient.HideEffectsBar?1:0)); + y += 22; y += 22; @@ -154,6 +158,12 @@ public class GuiSettings extends GuiCNPCInventory implements ITextfieldListener, ConfigClient.BannerAlerts = button.getValue() == 1; ConfigClient.BannerAlertsProperty.set(ConfigClient.BannerAlerts); } + if(button.id == 8){ + ConfigClient.HideEffectsBar = button.getValue() == 1; + ConfigClient.HideEffectsBarProperty.set(ConfigClient.HideEffectsBar); + } + + ConfigClient.config.save(); } diff --git a/src/main/java/noppes/npcs/client/gui/util/GuiEffectBar.java b/src/main/java/noppes/npcs/client/gui/util/GuiEffectBar.java index 96b78fc59..938265149 100644 --- a/src/main/java/noppes/npcs/client/gui/util/GuiEffectBar.java +++ b/src/main/java/noppes/npcs/client/gui/util/GuiEffectBar.java @@ -4,6 +4,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.ResourceLocation; import noppes.npcs.client.ClientCacheHandler; import noppes.npcs.client.renderer.ImageData; import noppes.npcs.controllers.data.CustomEffect; @@ -13,6 +14,8 @@ import org.lwjgl.opengl.GL11; import java.util.ArrayList; import java.util.List; +import static noppes.npcs.client.gui.player.inventory.GuiCNPCInventory.specialIcons; + public class GuiEffectBar extends GuiScreen { public int x, y, width, height; public int scrollY = 0; // Tracks vertical scrolling @@ -77,6 +80,11 @@ public class GuiEffectBar extends GuiScreen { int texWidth = imageData.getTotalWidth(); func_152125_a(x + 2, drawY + 2, iconU, iconV, iconWidth, iconHeight, iconRenderSize, iconRenderSize, texWidth, texWidth); + + GL11.glDisable(GL11.GL_DEPTH_TEST); + minecraft.getTextureManager().bindTexture(specialIcons); + func_152125_a(x + 2, drawY + 2, 0, 224, 16, 16, iconRenderSize, iconRenderSize, 256, 256); + GL11.glEnable(GL11.GL_DEPTH_TEST); } // If mouse hovers over this effect, save tooltip info diff --git a/src/main/java/noppes/npcs/config/ConfigClient.java b/src/main/java/noppes/npcs/config/ConfigClient.java index 459268552..d2d7d1a85 100644 --- a/src/main/java/noppes/npcs/config/ConfigClient.java +++ b/src/main/java/noppes/npcs/config/ConfigClient.java @@ -47,6 +47,9 @@ public class ConfigClient public static Property ChatBubblesFontTypeProperty; public static boolean ChatBubblesFontType = false; + public static Property HideEffectsBarProperty; + public static boolean HideEffectsBar = false; + /** * Questing Properties **/ @@ -127,6 +130,9 @@ public class ConfigClient ChatBubblesFontTypeProperty = config.get(VISUAL, "Chat Bubbles Font Type", false, "Enable the use of Custom Font for Chat Bubbles"); ChatBubblesFontType = ChatBubblesFontTypeProperty.getBoolean(false); + HideEffectsBarProperty = config.get(VISUAL, "Hide Effects Bar", false, "Hides CNPC+ Inventory Effects Bar"); + HideEffectsBar = HideEffectsBarProperty.getBoolean(false); + // Questing TrackingInfoAlignmentProperty = config.get(QUESTING, "Tracking Info Alignment", 3, "Client sided! Determines where tracking quest info shows up on the screen based on a number from 0 to 8. Default: 3"); TrackingInfoAlignment = TrackingInfoAlignmentProperty.getInt(3); diff --git a/src/main/resources/assets/customnpcs/lang/en_US.lang b/src/main/resources/assets/customnpcs/lang/en_US.lang index 908d9f23c..c4f26dd2d 100644 --- a/src/main/resources/assets/customnpcs/lang/en_US.lang +++ b/src/main/resources/assets/customnpcs/lang/en_US.lang @@ -210,6 +210,7 @@ settings.dialogSound=Dialog Sound settings.dialogSpeed=Dialog Speed settings.chatAlerts=Chat Alerts settings.bannerAlerts=Banner Alerts +settings.effectsBar=Hide Effects Bar settings.alignmentX=Alignment X settings.alignmentY=Alignment Y settings.trackScale=Tracking Scale diff --git a/src/main/resources/assets/customnpcs/textures/gui/icons.png b/src/main/resources/assets/customnpcs/textures/gui/icons.png index bcfb3ba65..49c1b77e9 100644 Binary files a/src/main/resources/assets/customnpcs/textures/gui/icons.png and b/src/main/resources/assets/customnpcs/textures/gui/icons.png differ