mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 02:37:27 +00:00
Some More Fixes to Rendering, etc
This commit is contained in:
1 parent
cb206348c5
commit
d6c70167bf
6 files changed
+16
-11
No files matched your search
@@ -39,7 +39,7 @@ public class SubGuiEffectGeneral extends SubGuiInterface implements ITextfieldLi
|
||||
super.initGui();
|
||||
GuiMenuTopButton close = new GuiMenuTopButton(-5, guiLeft + xSize - 22, guiTop - 10, "X");
|
||||
|
||||
GuiMenuTopButton general = new GuiMenuTopButton(-1, guiLeft + 4, guiTop - 10, "display.general");
|
||||
GuiMenuTopButton general = new GuiMenuTopButton(-1, guiLeft + 4, guiTop - 10, "menu.general");
|
||||
GuiMenuTopButton scripts = new GuiMenuTopButton(-2, general.xPosition + general.getWidth(), guiTop - 10, "script.scripts");
|
||||
|
||||
close.active = false;
|
||||
|
||||
@@ -50,7 +50,7 @@ public class GuiNPCManageEffects extends GuiNPCInterface2 implements ICustomScro
|
||||
addButton(new GuiNpcButton(1, guiLeft + 368, guiTop + 32, 45, 20, "gui.remove"));
|
||||
getButton(1).enabled = effect != null && effect.id != -1;
|
||||
|
||||
addButton(new GuiNpcButton(2, guiLeft + 368, guiTop + 56, 45, 20, "gui.clone"));
|
||||
addButton(new GuiNpcButton(2, guiLeft + 368, guiTop + 56, 45, 20, "gui.copy"));
|
||||
getButton(2).enabled = effect != null && effect.id != -1;
|
||||
|
||||
addButton(new GuiNpcButton(3, guiLeft + 368, guiTop + 80, 45, 20, "gui.edit"));
|
||||
@@ -173,7 +173,7 @@ public class GuiNPCManageEffects extends GuiNPCInterface2 implements ICustomScro
|
||||
|
||||
// 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);
|
||||
// func_152125_a(x, y, 0, 240, 16, 16, iconRenderSize, iconRenderSize, 256, 256);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
|
||||
x += iconRenderSize + 3;
|
||||
|
||||
@@ -142,8 +142,7 @@ public abstract class GuiNPCInterface extends GuiScreen {
|
||||
tf.mouseClicked(i, j, k);
|
||||
|
||||
for (GuiScrollWindow guiScrollableComponent : scrollWindows.values()) {
|
||||
if (guiScrollableComponent.isMouseOver(i, j))
|
||||
guiScrollableComponent.mouseClicked(i, j, k);
|
||||
guiScrollableComponent.mouseClicked(i, j, k);
|
||||
}
|
||||
|
||||
if (k == 0) {
|
||||
|
||||
@@ -94,7 +94,6 @@ public class GuiScrollWindow extends GuiScreen implements ITextfieldListener, IC
|
||||
}
|
||||
|
||||
public void mouseClicked(int i, int j, int k) {
|
||||
|
||||
i = i - xPos;
|
||||
j = (int) (j - yPos + scrollY);
|
||||
|
||||
|
||||
@@ -304,13 +304,11 @@ public class CustomEffectController implements ICustomEffectHandler {
|
||||
customEffect.setID(getUnusedId());
|
||||
while (has(customEffect.getName()))
|
||||
customEffect.setName(customEffect.getName() + "_");
|
||||
} else {
|
||||
CustomEffect existing = getCustomEffects().get(customEffect.getID());
|
||||
if (existing != null && !existing.name.equalsIgnoreCase(customEffect.getName()))
|
||||
while (has(customEffect.getName()))
|
||||
customEffect.setName(customEffect.getName() + "_");
|
||||
}
|
||||
|
||||
while (hasOther(customEffect.getName(), customEffect.getID()))
|
||||
customEffect.setName(customEffect.getName() + "_");
|
||||
|
||||
getCustomEffects().remove(customEffect.getID());
|
||||
getCustomEffects().put(customEffect.getID(), (CustomEffect) customEffect);
|
||||
|
||||
@@ -337,6 +335,14 @@ public class CustomEffectController implements ICustomEffectHandler {
|
||||
return getCustomEffects().get(customEffect.getID());
|
||||
}
|
||||
|
||||
private boolean hasOther(String name, int id) {
|
||||
for (CustomEffect effect : getCustomEffects().values()) {
|
||||
if (effect.getID() != id && effect.getName().equalsIgnoreCase(name))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void clearEffects(EntityPlayer player) {
|
||||
Map<EffectKey, PlayerEffect> effects = getPlayerEffects(player);
|
||||
if (effects != null) {
|
||||
|
||||
Reference in new issue
Block a user