Creative GUI will now remember what tab page you were on, thanks Matchlighter PR #290
This commit is contained in:
parent
dfd9844c13
commit
0e82a3952d
1 changed files with 11 additions and 12 deletions
|
@ -4,12 +4,12 @@
|
||||||
private Slot field_74235_v = null;
|
private Slot field_74235_v = null;
|
||||||
private boolean field_74234_w = false;
|
private boolean field_74234_w = false;
|
||||||
private CreativeCrafting field_82324_x;
|
private CreativeCrafting field_82324_x;
|
||||||
+ private int tabPage = 0;
|
+ private static int tabPage = 0;
|
||||||
+ private int maxPages = 0;
|
+ private int maxPages = 0;
|
||||||
|
|
||||||
public GuiContainerCreative(EntityPlayer par1EntityPlayer)
|
public GuiContainerCreative(EntityPlayer par1EntityPlayer)
|
||||||
{
|
{
|
||||||
@@ -207,6 +209,14 @@
|
@@ -207,6 +209,13 @@
|
||||||
this.func_74227_b(CreativeTabs.creativeTabArray[var1]);
|
this.func_74227_b(CreativeTabs.creativeTabArray[var1]);
|
||||||
this.field_82324_x = new CreativeCrafting(this.mc);
|
this.field_82324_x = new CreativeCrafting(this.mc);
|
||||||
this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_82324_x);
|
this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_82324_x);
|
||||||
|
@ -18,13 +18,12 @@
|
||||||
+ {
|
+ {
|
||||||
+ controlList.add(new GuiButton(101, guiLeft, guiTop - 50, 20, 20, "<"));
|
+ controlList.add(new GuiButton(101, guiLeft, guiTop - 50, 20, 20, "<"));
|
||||||
+ controlList.add(new GuiButton(102, guiLeft + xSize - 20, guiTop - 50, 20, 20, ">"));
|
+ controlList.add(new GuiButton(102, guiLeft + xSize - 20, guiTop - 50, 20, 20, ">"));
|
||||||
+ tabPage = 0;
|
|
||||||
+ maxPages = ((tabCount - 12) / 10) + 1;
|
+ maxPages = ((tabCount - 12) / 10) + 1;
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -327,7 +337,7 @@
|
@@ -327,7 +336,7 @@
|
||||||
{
|
{
|
||||||
CreativeTabs var3 = CreativeTabs.creativeTabArray[selectedTabIndex];
|
CreativeTabs var3 = CreativeTabs.creativeTabArray[selectedTabIndex];
|
||||||
|
|
||||||
|
@ -33,7 +32,7 @@
|
||||||
{
|
{
|
||||||
this.fontRenderer.drawString(var3.getTranslatedTabLabel(), 8, 6, 4210752);
|
this.fontRenderer.drawString(var3.getTranslatedTabLabel(), 8, 6, 4210752);
|
||||||
}
|
}
|
||||||
@@ -349,7 +359,7 @@
|
@@ -349,7 +358,7 @@
|
||||||
{
|
{
|
||||||
CreativeTabs var9 = var6[var8];
|
CreativeTabs var9 = var6[var8];
|
||||||
|
|
||||||
|
@ -42,7 +41,7 @@
|
||||||
{
|
{
|
||||||
this.func_74227_b(var9);
|
this.func_74227_b(var9);
|
||||||
return;
|
return;
|
||||||
@@ -365,11 +375,17 @@
|
@@ -365,11 +374,17 @@
|
||||||
*/
|
*/
|
||||||
private boolean needsScrollBars()
|
private boolean needsScrollBars()
|
||||||
{
|
{
|
||||||
|
@ -60,7 +59,7 @@
|
||||||
int var2 = selectedTabIndex;
|
int var2 = selectedTabIndex;
|
||||||
selectedTabIndex = par1CreativeTabs.getTabIndex();
|
selectedTabIndex = par1CreativeTabs.getTabIndex();
|
||||||
ContainerCreative var3 = (ContainerCreative)this.inventorySlots;
|
ContainerCreative var3 = (ContainerCreative)this.inventorySlots;
|
||||||
@@ -539,21 +555,42 @@
|
@@ -539,21 +554,42 @@
|
||||||
|
|
||||||
super.drawScreen(par1, par2, par3);
|
super.drawScreen(par1, par2, par3);
|
||||||
CreativeTabs[] var11 = CreativeTabs.creativeTabArray;
|
CreativeTabs[] var11 = CreativeTabs.creativeTabArray;
|
||||||
|
@ -108,7 +107,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
@@ -574,14 +611,32 @@
|
@@ -574,14 +610,32 @@
|
||||||
int var8 = var7.length;
|
int var8 = var7.length;
|
||||||
int var9;
|
int var9;
|
||||||
|
|
||||||
|
@ -143,7 +142,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -599,6 +654,14 @@
|
@@ -599,6 +653,14 @@
|
||||||
this.drawTexturedModalRect(var11, var8 + (int)((float)(var9 - var8 - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15);
|
this.drawTexturedModalRect(var11, var8 + (int)((float)(var9 - var8 - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +157,7 @@
|
||||||
this.renderCreativeTab(var5);
|
this.renderCreativeTab(var5);
|
||||||
|
|
||||||
if (var5 == CreativeTabs.tabInventory)
|
if (var5 == CreativeTabs.tabInventory)
|
||||||
@@ -609,6 +672,15 @@
|
@@ -609,6 +671,15 @@
|
||||||
|
|
||||||
protected boolean func_74232_a(CreativeTabs par1CreativeTabs, int par2, int par3)
|
protected boolean func_74232_a(CreativeTabs par1CreativeTabs, int par2, int par3)
|
||||||
{
|
{
|
||||||
|
@ -174,7 +173,7 @@
|
||||||
int var4 = par1CreativeTabs.getTabColumn();
|
int var4 = par1CreativeTabs.getTabColumn();
|
||||||
int var5 = 28 * var4;
|
int var5 = 28 * var4;
|
||||||
byte var6 = 0;
|
byte var6 = 0;
|
||||||
@@ -723,7 +795,7 @@
|
@@ -723,7 +794,7 @@
|
||||||
var8 += 8 + (var3 ? 1 : -1);
|
var8 += 8 + (var3 ? 1 : -1);
|
||||||
GL11.glEnable(GL11.GL_LIGHTING);
|
GL11.glEnable(GL11.GL_LIGHTING);
|
||||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||||
|
@ -183,7 +182,7 @@
|
||||||
itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.renderEngine, var10, var7, var8);
|
itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.renderEngine, var10, var7, var8);
|
||||||
itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.renderEngine, var10, var7, var8);
|
itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.renderEngine, var10, var7, var8);
|
||||||
GL11.glDisable(GL11.GL_LIGHTING);
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
@@ -745,6 +817,15 @@
|
@@ -745,6 +816,15 @@
|
||||||
{
|
{
|
||||||
this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter));
|
this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue