mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Allow custom GuiEditArrayEntries without having to recreate the object in several places (#4329)
This commit is contained in:
1 parent
5db4505fdb
commit
da85dcadf5
1 file changed
+8
-3
@@ -103,7 +103,7 @@ public class GuiEditArray extends GuiScreen
|
||||
@Override
|
||||
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 resetGlyphWidth = mc.fontRenderer.getStringWidth(RESET_CHAR) * 2;
|
||||
@@ -136,15 +136,20 @@ public class GuiEditArray extends GuiScreen
|
||||
else if (button.id == 2001)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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
|
||||
public void handleMouseInput() throws IOException
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user