forked from sddsd2332/MEK-1.12.2-v10
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the GUI that you don't need Remove the same GUI Update the GUI interface of the factory Update the color of the configuration slot --中文-- 移除不需要的GUI 去掉相同的GUI 更新工厂的GUI界面 更新配置插槽的颜色
- Loading branch information
Showing
144 changed files
with
467 additions
and
398 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/main/java/mekanism/client/gui/element/GuiRecipeType3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package mekanism.client.gui.element; | ||
|
||
import mekanism.client.gui.IGuiWrapper; | ||
import mekanism.common.tile.TileEntityFactory; | ||
import mekanism.common.util.MekanismUtils; | ||
import mekanism.common.util.MekanismUtils.ResourceType; | ||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraftforge.fml.relauncher.Side; | ||
import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
||
@SideOnly(Side.CLIENT) | ||
public class GuiRecipeType3 extends GuiTileEntityElement<TileEntityFactory> { | ||
|
||
public GuiRecipeType3(IGuiWrapper gui, TileEntityFactory tile, ResourceLocation def) { | ||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiRecipeType.png"), gui, def, tile); | ||
} | ||
|
||
@Override | ||
public Rectangle4i getBounds(int guiWidth, int guiHeight) { | ||
return new Rectangle4i(guiWidth + 176 + 72, guiHeight + 70, 26, 63); | ||
} | ||
|
||
@Override | ||
protected boolean inBounds(int xAxis, int yAxis) { | ||
return xAxis >= 180 + 72 && xAxis <= 196 + 72 && (yAxis >= 75 && yAxis <= 91 || yAxis >= 112 && yAxis <= 128); | ||
} | ||
|
||
@Override | ||
public void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight) { | ||
mc.renderEngine.bindTexture(RESOURCE); | ||
guiObj.drawTexturedRect(guiWidth + 176 + 72, guiHeight + 70, 0, 0, 26, 63); | ||
int displayInt = tileEntity.getScaledRecipeProgress(15); | ||
guiObj.drawTexturedRect(guiWidth + 181 + 72, guiHeight + 94, 26, 0, 10, displayInt); | ||
mc.renderEngine.bindTexture(defaultLocation); | ||
} | ||
|
||
@Override | ||
public void renderForeground(int xAxis, int yAxis) { | ||
} | ||
|
||
@Override | ||
public void preMouseClicked(int xAxis, int yAxis, int button) { | ||
if (button == 0 && inBounds(xAxis, yAxis)) { | ||
offsetX(26); | ||
} | ||
} | ||
|
||
@Override | ||
public void mouseClicked(int xAxis, int yAxis, int button) { | ||
if (button == 0 && inBounds(xAxis, yAxis)) { | ||
offsetX(-26); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
src/main/java/mekanism/client/gui/element/GuiRedstoneControl3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package mekanism.client.gui.element; | ||
|
||
import mekanism.api.Coord4D; | ||
import mekanism.client.gui.IGuiWrapper; | ||
import mekanism.client.sound.SoundHandler; | ||
import mekanism.common.Mekanism; | ||
import mekanism.common.base.IRedstoneControl; | ||
import mekanism.common.base.IRedstoneControl.RedstoneControl; | ||
import mekanism.common.network.PacketRedstoneControl.RedstoneControlMessage; | ||
import mekanism.common.util.MekanismUtils; | ||
import mekanism.common.util.MekanismUtils.ResourceType; | ||
import net.minecraft.init.SoundEvents; | ||
import net.minecraft.tileentity.TileEntity; | ||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraftforge.fml.relauncher.Side; | ||
import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
||
@SideOnly(Side.CLIENT) | ||
public class GuiRedstoneControl3 extends GuiTileEntityElement<TileEntity> { | ||
|
||
public GuiRedstoneControl3(IGuiWrapper gui, TileEntity tile, ResourceLocation def) { | ||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiRedstoneControl.png"), gui, def, tile); | ||
} | ||
|
||
@Override | ||
public Rectangle4i getBounds(int guiWidth, int guiHeight) { | ||
return new Rectangle4i(guiWidth + 176 + 72, guiHeight + 138, 26, 26); | ||
} | ||
|
||
@Override | ||
protected boolean inBounds(int xAxis, int yAxis) { | ||
return xAxis >= 179 + 72&& xAxis <= 197 + 72 && yAxis >= 142 && yAxis <= 160; | ||
} | ||
|
||
@Override | ||
public void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight) { | ||
mc.renderEngine.bindTexture(RESOURCE); | ||
guiObj.drawTexturedRect(guiWidth + 176 + 72, guiHeight + 138, 0, 0, 26, 26); | ||
IRedstoneControl control = (IRedstoneControl) tileEntity; | ||
int renderX = 26 + (18 * control.getControlType().ordinal()); | ||
guiObj.drawTexturedRect(guiWidth + 179 + 72, guiHeight + 142, renderX, inBounds(xAxis, yAxis) ? 0 : 18, 18, 18); | ||
mc.renderEngine.bindTexture(defaultLocation); | ||
} | ||
|
||
@Override | ||
public void renderForeground(int xAxis, int yAxis) { | ||
mc.renderEngine.bindTexture(RESOURCE); | ||
IRedstoneControl control = (IRedstoneControl) tileEntity; | ||
if (inBounds(xAxis, yAxis)) { | ||
displayTooltip(control.getControlType().getDisplay(), 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) { | ||
IRedstoneControl control = (IRedstoneControl) tileEntity; | ||
|
||
if (button == 0 && inBounds(xAxis, yAxis)) { | ||
RedstoneControl current = control.getControlType(); | ||
int ordinalToSet = current.ordinal() < (RedstoneControl.values().length - 1) ? current.ordinal() + 1 : 0; | ||
if (ordinalToSet == RedstoneControl.PULSE.ordinal() && !control.canPulse()) { | ||
ordinalToSet = 0; | ||
} | ||
|
||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK); | ||
Mekanism.packetHandler.sendToServer(new RedstoneControlMessage(Coord4D.get(tileEntity), RedstoneControl.values()[ordinalToSet])); | ||
} | ||
} | ||
} |
Oops, something went wrong.