mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 02:37:27 +00:00
Work on Player Event Script GUIs
This commit is contained in:
1 parent
44bd1692d1
commit
6aa98aecf3
8 files changed
+40
-14
No files matched your search
@@ -240,7 +240,7 @@ public class GuiMailmanWrite extends GuiContainerNPCInterface implements ITextfi
|
||||
*/
|
||||
public void keyTyped(char par1, int par2)
|
||||
{
|
||||
if(!GuiNpcTextField.isActive() && canEdit)
|
||||
if(!GuiNpcTextField.isFieldActive() && canEdit)
|
||||
this.keyTypedInBook(par1, par2);
|
||||
else
|
||||
super.keyTyped(par1, par2);
|
||||
|
||||
@@ -10,10 +10,8 @@ import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.util.GuiCustomScroll;
|
||||
import noppes.npcs.client.gui.util.ICustomScrollListener;
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
@@ -84,7 +82,7 @@ public class GuiNpcQuestTypeKill extends SubGuiInterface implements ITextfieldLi
|
||||
addScroll(scroll);
|
||||
this.addButton(new GuiNpcButton(0, guiLeft + 4, guiTop + 140, 98, 20, "gui.back"));
|
||||
|
||||
scroll.visible = GuiNpcTextField.isActive();
|
||||
scroll.visible = GuiNpcTextField.isFieldActive();
|
||||
}
|
||||
|
||||
protected void actionPerformed(GuiButton guibutton) {
|
||||
@@ -96,7 +94,7 @@ public class GuiNpcQuestTypeKill extends SubGuiInterface implements ITextfieldLi
|
||||
public void mouseClicked(int i, int j, int k)
|
||||
{
|
||||
super.mouseClicked(i, j, k);
|
||||
scroll.visible = GuiNpcTextField.isActive();
|
||||
scroll.visible = GuiNpcTextField.isFieldActive();
|
||||
}
|
||||
public void save() {
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ import net.minecraft.client.entity.EntityPlayerSP;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -243,7 +242,7 @@ public abstract class EventGuiNPCInterface extends GuiScreen {
|
||||
}
|
||||
}
|
||||
|
||||
active = active || GuiNpcTextField.isActive();
|
||||
active = active || GuiNpcTextField.isFieldActive();
|
||||
if (!this.closeOnEsc || i != 1 && (active || !this.isInventoryKey(i))) {
|
||||
var4 = (new ArrayList(this.textfields.values())).iterator();
|
||||
|
||||
|
||||
@@ -70,10 +70,14 @@ public class GuiScriptInterface extends EventGuiNPCInterface implements GuiYesNo
|
||||
top.active = true;
|
||||
if(this.activeTab > 0) {
|
||||
EventScriptContainer var7 = (EventScriptContainer)this.handler.getScripts().get(this.activeTab - 1);
|
||||
GuiTextArea left = new GuiTextArea(2, this.guiLeft + 1 + yoffset, this.guiTop + yoffset, this.xSize - 108 - yoffset, (int)((double)this.ySize * 0.96D) - yoffset * 2, var7 == null?"":var7.script);
|
||||
//left.enableCodeHighlighting();
|
||||
//left.setListener(this);
|
||||
GuiNpcTextArea left = new GuiNpcTextArea(2, this, this.guiLeft + 1 + yoffset, this.guiTop + yoffset, this.xSize - 108 - yoffset, (int)((double)this.ySize * 0.96D) - yoffset * 2, var7 == null?"":var7.script);
|
||||
this.add(left);
|
||||
/*
|
||||
GuiTextArea left = new GuiTextArea(2, this.guiLeft + 1 + yoffset, this.guiTop + yoffset, this.xSize - 108 - yoffset, (int)((double)this.ySize * 0.96D) - yoffset * 2, var7 == null?"":var7.script);
|
||||
left.enableCodeHighlighting();
|
||||
left.setListener(this);
|
||||
this.add(left);
|
||||
*/
|
||||
int left1 = this.guiLeft + this.xSize - 104;
|
||||
this.addButton(new GuiNpcButton(102, left1, this.guiTop + yoffset, 60, 20, "gui.clear"));
|
||||
this.addButton(new GuiNpcButton(101, left1 + 61, this.guiTop + yoffset, 60, 20, "gui.paste"));
|
||||
@@ -90,9 +94,14 @@ public class GuiScriptInterface extends EventGuiNPCInterface implements GuiYesNo
|
||||
|
||||
this.addScroll(scroll);
|
||||
} else {
|
||||
GuiNpcTextArea var8 = new GuiNpcTextArea(2, this, this.guiLeft + 4 + yoffset, this.guiTop + 6 + yoffset, this.xSize - 160 - yoffset, (int)((float)this.ySize * 0.92F) - yoffset * 2, this.getConsoleText());
|
||||
var8.enabled = false;
|
||||
this.add(var8);
|
||||
/*
|
||||
GuiTextArea var8 = new GuiTextArea(2, this.guiLeft + 4 + yoffset, this.guiTop + 6 + yoffset, this.xSize - 160 - yoffset, (int)((float)this.ySize * 0.92F) - yoffset * 2, this.getConsoleText());
|
||||
var8.enabled = false;
|
||||
this.add(var8);
|
||||
*/
|
||||
int var9 = this.guiLeft + this.xSize - 150;
|
||||
this.addButton(new GuiNpcButton(100, var9, this.guiTop + 125, 60, 20, "gui.copy"));
|
||||
this.addButton(new GuiNpcButton(102, var9, this.guiTop + 146, 60, 20, "gui.clear"));
|
||||
|
||||
@@ -109,7 +109,7 @@ public abstract class GuiContainerNPCInterface extends GuiContainer
|
||||
for(GuiNpcTextField tf : new ArrayList<GuiNpcTextField>(textfields.values()))
|
||||
tf.textboxKeyTyped(c, i);
|
||||
|
||||
if (closeOnEsc && (i == 1 || i == mc.gameSettings.keyBindInventory.getKeyCode() && !GuiNpcTextField.isActive()))
|
||||
if (closeOnEsc && (i == 1 || i == mc.gameSettings.keyBindInventory.getKeyCode() && !GuiNpcTextField.isFieldActive()))
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ public abstract class GuiNPCInterface extends GuiScreen
|
||||
for(GuiNpcTextField tf : textfields.values())
|
||||
tf.textboxKeyTyped(c, i);
|
||||
|
||||
if (closeOnEsc && (i == 1 || !GuiNpcTextField.isActive() && isInventoryKey(i))){
|
||||
if (closeOnEsc && (i == 1 || !GuiNpcTextField.isFieldActive() && isInventoryKey(i))){
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class GuiNpcTextArea extends GuiNpcTextField{
|
||||
public class GuiNpcTextArea extends GuiNpcTextField implements IGui{
|
||||
public boolean inMenu = true;
|
||||
public boolean numbersOnly = false;
|
||||
private int posX,posY,width,height;
|
||||
@@ -307,4 +307,24 @@ public class GuiNpcTextArea extends GuiNpcTextField{
|
||||
}
|
||||
drawTexturedModalRect(x, y, width, 11, 5, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getID() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int var1, int var2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return isFieldActive();
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public class GuiNpcTextField extends GuiTextField{
|
||||
listener = (ITextfieldListener) parent;
|
||||
}
|
||||
|
||||
public static boolean isActive(){
|
||||
public static boolean isFieldActive(){
|
||||
return activeTextfield != null;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user