mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 14:52:58 +00:00
Cleanup a couple more Tab elements
This commit is contained in:
2 files changed
+14
-76
No files matched your search
@@ -2,62 +2,31 @@ package mekanism.generators.client.gui.element;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.client.gui.IGuiWrapper;
|
||||
import mekanism.client.gui.element.GuiTileEntityElement;
|
||||
import mekanism.client.sound.SoundHandler;
|
||||
import mekanism.client.gui.element.tab.GuiTabElement;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.network.PacketSimpleGui.SimpleGuiMessage;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorController;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiFuelTab extends GuiTileEntityElement<TileEntityReactorController> {
|
||||
public class GuiFuelTab extends GuiTabElement<TileEntityReactorController> {
|
||||
|
||||
public GuiFuelTab(IGuiWrapper gui, TileEntityReactorController tile, ResourceLocation def) {
|
||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiFuelTab.png"), gui, def, tile);
|
||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiFuelTab.png"), gui, def, tile, 34);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rectangle4i getBounds(int guiWidth, int guiHeight) {
|
||||
return new Rectangle4i(guiWidth - 26, guiHeight + 34, 26, 26);
|
||||
public void displayForegroundTooltip(int xAxis, int yAxis) {
|
||||
displayTooltip(LangUtils.localize("gui.fuel"), xAxis, yAxis);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean inBounds(int xAxis, int yAxis) {
|
||||
return xAxis >= -21 && xAxis <= -3 && yAxis >= 38 && yAxis <= 56;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight) {
|
||||
mc.renderEngine.bindTexture(RESOURCE);
|
||||
guiObj.drawTexturedRect(guiWidth - 26, guiHeight + 34, 0, 0, 26, 26);
|
||||
guiObj.drawTexturedRect(guiWidth - 21, guiHeight + 38, 26, inBounds(xAxis, yAxis) ? 0 : 18, 18, 18);
|
||||
mc.renderEngine.bindTexture(defaultLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderForeground(int xAxis, int yAxis) {
|
||||
mc.renderEngine.bindTexture(RESOURCE);
|
||||
if (inBounds(xAxis, yAxis)) {
|
||||
displayTooltip(LangUtils.localize("gui.fuel"), xAxis, yAxis);
|
||||
}
|
||||
mc.renderEngine.bindTexture(defaultLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preMouseClicked(int xAxis, int yAxis, int button) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(int xAxis, int yAxis, int button) {
|
||||
if (button == 0 && inBounds(xAxis, yAxis)) {
|
||||
Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tileEntity), 1, 12));
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
}
|
||||
public void buttonClicked() {
|
||||
Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tileEntity), 1, 12));
|
||||
}
|
||||
}
|
||||
@@ -2,62 +2,31 @@ package mekanism.generators.client.gui.element;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.client.gui.IGuiWrapper;
|
||||
import mekanism.client.gui.element.GuiTileEntityElement;
|
||||
import mekanism.client.sound.SoundHandler;
|
||||
import mekanism.client.gui.element.tab.GuiTabElement;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.network.PacketSimpleGui.SimpleGuiMessage;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorController;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiStatTab extends GuiTileEntityElement<TileEntityReactorController> {
|
||||
public class GuiStatTab extends GuiTabElement<TileEntityReactorController> {
|
||||
|
||||
public GuiStatTab(IGuiWrapper gui, TileEntityReactorController tile, ResourceLocation def) {
|
||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiStatsTab.png"), gui, def, tile);
|
||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiStatsTab.png"), gui, def, tile, 62);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rectangle4i getBounds(int guiWidth, int guiHeight) {
|
||||
return new Rectangle4i(guiWidth - 26, guiHeight + 62, 26, 26);
|
||||
public void displayForegroundTooltip(int xAxis, int yAxis) {
|
||||
displayTooltip(LangUtils.localize("gui.stats"), xAxis, yAxis);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean inBounds(int xAxis, int yAxis) {
|
||||
return xAxis >= -21 && xAxis <= -3 && yAxis >= 66 && yAxis <= 84;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight) {
|
||||
mc.renderEngine.bindTexture(RESOURCE);
|
||||
guiObj.drawTexturedRect(guiWidth - 26, guiHeight + 62, 0, 0, 26, 26);
|
||||
guiObj.drawTexturedRect(guiWidth - 21, guiHeight + 66, 26, inBounds(xAxis, yAxis) ? 0 : 18, 18, 18);
|
||||
mc.renderEngine.bindTexture(defaultLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderForeground(int xAxis, int yAxis) {
|
||||
mc.renderEngine.bindTexture(RESOURCE);
|
||||
if (inBounds(xAxis, yAxis)) {
|
||||
displayTooltip(LangUtils.localize("gui.stats"), xAxis, yAxis);
|
||||
}
|
||||
mc.renderEngine.bindTexture(defaultLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preMouseClicked(int xAxis, int yAxis, int button) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(int xAxis, int yAxis, int button) {
|
||||
if (button == 0 && inBounds(xAxis, yAxis)) {
|
||||
Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tileEntity), 1, 13));
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
}
|
||||
public void buttonClicked() {
|
||||
Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tileEntity), 1, 13));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user