@Override protected void keyTyped(char c, int key) { if (listenKeyType == -1 && key == 1) { if (returnStates[guiState] != -1337) { guiState = returnStates[guiState]; createGui(); } else { this.mc.thePlayer.closeScreen(); } } else if (listenKeyType != -1) { switch (listenKeyType) { case 0: RecMod.instance.keyRec = key == 1 ? -1337 : key; break; case 1: RecMod.instance.keyStr = key == 1 ? -1337 : key; break; } listenKeyType = -1; RecMod.instance.writeToFile(); createGui(); } else { switch (guiState) { case 2: if (tfAbsX != null && tfAbsY != null) { tfAbsX.keyTyped(c, key); tfAbsY.keyTyped(c, key); } break; } } }
@Override protected void mouseClicked(int x, int y, int k) { super.mouseClicked(x, y, k); if (tfAbsX != null && tfAbsY != null) { tfAbsX.mouseClicked(x, y); tfAbsY.mouseClicked(x, y); } }
@Override public void drawGuiContainerForegroundLayer(int par1, int par2) { this.fontRendererObj.drawString( translate("recmod.interface.name") + stateNames[guiState], 8, 11, 4210752); switch (guiState) { case 2: GL11.glPopMatrix(); if (tfAbsX != null && tfAbsY != null) { tfAbsX.draw("X Position: "); tfAbsY.draw("Y Position: "); } GL11.glPushMatrix(); break; case 4: break; } }
@Override public void actionPerformed(GuiButton button) { listenKeyType = -1; if (button.id == -1337) { this.mc.thePlayer.closeScreen(); } if (button.id >= 1594) { listenKeyType = button.id - 1594; } else if (button.id >= 1337) { guiState = button.id - 1337; } else { switch (button.id) { case 0: RecMod.instance.updatePlayerInformation( boundPlayer, 0, !RecMod.instance.isPlayerRecording(boundPlayer)); RecMod.packetPipeline.sendToServer( new PacketUpdatePlayerStatus( boundPlayer, 0, RecMod.instance.isPlayerRecording(boundPlayer))); break; case 1: RecMod.instance.updatePlayerInformation( boundPlayer, 1, !RecMod.instance.isPlayerStreaming(boundPlayer)); RecMod.packetPipeline.sendToServer( new PacketUpdatePlayerStatus( boundPlayer, 1, RecMod.instance.isPlayerStreaming(boundPlayer))); break; case 2: RecMod.instance.enableKeys = !RecMod.instance.enableKeys; RecMod.instance.writeToFile(); break; case 3: RecMod.instance.showSelf = !RecMod.instance.showSelf; break; case 4: RecMod.instance.showMode++; if (RecMod.instance.showMode >= showModes.length) { RecMod.instance.showMode = 0; } RecMod.instance.writeToFile(); break; case 5: RecMod.instance.keepState = !RecMod.instance.keepState; RecMod.instance.writeToFile(); break; case 6: RecMod.instance.posMode++; if (RecMod.instance.posMode >= posModes.length) { RecMod.instance.posMode = 0; } RecMod.instance.writeToFile(); break; case 7: if (tfAbsX != null && tfAbsY != null) { RecMod.instance.absX = tfAbsX.value(); RecMod.instance.absY = tfAbsY.value(); RecMod.instance.writeToFile(); } break; } } createGui(); }