Allow custom GuiEditArrayEntries without having to recreate the object in several places (#4329)
This commit is contained in:
parent
5db4505fdb
commit
da85dcadf5
1 changed files with 8 additions and 3 deletions
|
@ -103,7 +103,7 @@ public class GuiEditArray extends GuiScreen
|
||||||
@Override
|
@Override
|
||||||
public void initGui()
|
public void initGui()
|
||||||
{
|
{
|
||||||
this.entryList = new GuiEditArrayEntries(this, this.mc, this.configElement, this.beforeValues, this.currentValues);
|
this.entryList = createEditArrayEntries();
|
||||||
|
|
||||||
int undoGlyphWidth = mc.fontRenderer.getStringWidth(UNDO_CHAR) * 2;
|
int undoGlyphWidth = mc.fontRenderer.getStringWidth(UNDO_CHAR) * 2;
|
||||||
int resetGlyphWidth = mc.fontRenderer.getStringWidth(RESET_CHAR) * 2;
|
int resetGlyphWidth = mc.fontRenderer.getStringWidth(RESET_CHAR) * 2;
|
||||||
|
@ -136,15 +136,20 @@ public class GuiEditArray extends GuiScreen
|
||||||
else if (button.id == 2001)
|
else if (button.id == 2001)
|
||||||
{
|
{
|
||||||
this.currentValues = configElement.getDefaults();
|
this.currentValues = configElement.getDefaults();
|
||||||
this.entryList = new GuiEditArrayEntries(this, this.mc, this.configElement, this.beforeValues, this.currentValues);
|
this.entryList = createEditArrayEntries();
|
||||||
}
|
}
|
||||||
else if (button.id == 2002)
|
else if (button.id == 2002)
|
||||||
{
|
{
|
||||||
this.currentValues = Arrays.copyOf(beforeValues, beforeValues.length);
|
this.currentValues = Arrays.copyOf(beforeValues, beforeValues.length);
|
||||||
this.entryList = new GuiEditArrayEntries(this, this.mc, this.configElement, this.beforeValues, this.currentValues);
|
this.entryList = createEditArrayEntries();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected GuiEditArrayEntries createEditArrayEntries()
|
||||||
|
{
|
||||||
|
return new GuiEditArrayEntries(this, this.mc, this.configElement, this.beforeValues, this.currentValues);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleMouseInput() throws IOException
|
public void handleMouseInput() throws IOException
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue