mirror of
https://github.com/GTNewHorizons/ThaumicEnergistics.git
synced 2026-10-25 20:32:27 +00:00
Change crafting status button to ThE button (#68)
* Change crafting status button to ThE button and swap button sequence in ACT. * Remove duplicate icons
This commit is contained in:
1 parent
b77d38a24b
commit
3e378764ac
6 files changed
+92
-39
No files matched your search
@@ -23,12 +23,10 @@ import appeng.api.config.TerminalStyle;
|
||||
import appeng.api.config.ViewItems;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.client.gui.widgets.ISortSource;
|
||||
import appeng.client.me.ItemRepo;
|
||||
import appeng.client.render.AppEngRenderItem;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.util.Platform;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -36,6 +34,7 @@ import thaumcraft.client.lib.UtilsFX;
|
||||
import thaumcraft.common.config.Config;
|
||||
import thaumicenergistics.client.gui.abstraction.GuiConstants_ACT;
|
||||
import thaumicenergistics.client.gui.buttons.GuiButtonClearCraftingGrid;
|
||||
import thaumicenergistics.client.gui.buttons.GuiButtonCraftingStatus;
|
||||
import thaumicenergistics.client.gui.buttons.GuiButtonSearchMode;
|
||||
import thaumicenergistics.client.gui.buttons.GuiButtonSortingDirection;
|
||||
import thaumicenergistics.client.gui.buttons.GuiButtonSortingMode;
|
||||
@@ -187,11 +186,6 @@ public class GuiArcaneCraftingTerminal extends GuiConstants_ACT implements ISort
|
||||
*/
|
||||
private static String memoryText = "";
|
||||
|
||||
/**
|
||||
* Tab button to show crafting status
|
||||
*/
|
||||
private GuiTabButton btnCraftingStatus;
|
||||
|
||||
public GuiArcaneCraftingTerminal(final PartArcaneCraftingTerminal part, final EntityPlayer player) {
|
||||
// Call super
|
||||
super(new ContainerPartArcaneCraftingTerminal(part, player));
|
||||
@@ -308,7 +302,8 @@ public class GuiArcaneCraftingTerminal extends GuiConstants_ACT implements ISort
|
||||
// Search for the widget the mouse is over, and send extract request.
|
||||
this.sendItemWidgetClicked(mouseX, mouseY, mouseButton);
|
||||
} else {
|
||||
// Inform the server the user would like to deposit the currently held item into the ME network.
|
||||
// Inform the server the user would like to deposit the currently held item into
|
||||
// the ME network.
|
||||
Packet_S_ArcaneCraftingTerminal.sendDeposit(this.player, mouseButton);
|
||||
}
|
||||
|
||||
@@ -339,7 +334,8 @@ public class GuiArcaneCraftingTerminal extends GuiConstants_ACT implements ISort
|
||||
if (deltaZ > 0) {
|
||||
// Is the player holding anything?
|
||||
if (this.player.inventory.getItemStack() != null) {
|
||||
// Inform the server the user would like to deposit 1 of the currently held items into the ME
|
||||
// Inform the server the user would like to deposit 1 of the currently held
|
||||
// items into the ME
|
||||
// network.
|
||||
Packet_S_ArcaneCraftingTerminal.sendDeposit(this.player, ThEGuiHelper.MOUSE_WHEEL_MOTION);
|
||||
}
|
||||
@@ -859,10 +855,6 @@ public class GuiArcaneCraftingTerminal extends GuiConstants_ACT implements ISort
|
||||
return;
|
||||
}
|
||||
|
||||
if (button == this.btnCraftingStatus) {
|
||||
Packet_S_ArcaneCraftingTerminal.sendOpenCraftingStatus(this.player);
|
||||
}
|
||||
|
||||
switch (button.id) {
|
||||
// Clear grid
|
||||
case GuiConstants_ACT.BUTTON_CLEAR_GRID_ID:
|
||||
@@ -968,6 +960,11 @@ public class GuiArcaneCraftingTerminal extends GuiConstants_ACT implements ISort
|
||||
this.lastTooltipUpdateTime = 0;
|
||||
|
||||
break;
|
||||
|
||||
// Crafting status
|
||||
case GuiConstants_ACT.BUTTON_CRAFTING_STATUS_ID:
|
||||
Packet_S_ArcaneCraftingTerminal.sendOpenCraftingStatus(this.player);
|
||||
break;
|
||||
}
|
||||
|
||||
// Was the sorting mode changed?
|
||||
@@ -1168,13 +1165,12 @@ public class GuiArcaneCraftingTerminal extends GuiConstants_ACT implements ISort
|
||||
this.terminalStyle));
|
||||
|
||||
this.buttonList.add(
|
||||
this.btnCraftingStatus = new GuiTabButton(
|
||||
this.guiLeft + 170,
|
||||
this.guiTop - 4,
|
||||
2 + 11 * 16,
|
||||
GuiText.CraftingStatus.getLocal(),
|
||||
itemRender));
|
||||
this.btnCraftingStatus.setHideEdge(13);
|
||||
new GuiButtonCraftingStatus(
|
||||
GuiConstants_ACT.BUTTON_CRAFTING_STATUS_ID,
|
||||
this.guiLeft + GuiConstants_ACT.BUTTON_CRAFTING_STATUS_POS_X,
|
||||
this.guiTop + GuiConstants_ACT.BUTTON_CRAFTING_STATUS_POS_Y,
|
||||
GuiConstants_ACT.BUTTON_AE_TAB_SIZE,
|
||||
GuiConstants_ACT.BUTTON_AE_TAB_SIZE));
|
||||
|
||||
// Add the container as a listener
|
||||
((ContainerPartArcaneCraftingTerminal) this.inventorySlots).registerForUpdates();
|
||||
|
||||
@@ -19,8 +19,6 @@ import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import appeng.api.config.ViewItems;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.core.localization.GuiText;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
@@ -29,6 +27,7 @@ import thaumicenergistics.api.gui.IAspectSelectorContainer;
|
||||
import thaumicenergistics.api.gui.IAspectSelectorGui;
|
||||
import thaumicenergistics.api.storage.IAspectStack;
|
||||
import thaumicenergistics.client.gui.abstraction.GuiConstants_ECT;
|
||||
import thaumicenergistics.client.gui.buttons.GuiButtonCraftingStatus;
|
||||
import thaumicenergistics.client.gui.buttons.GuiButtonSortingMode;
|
||||
import thaumicenergistics.client.gui.buttons.GuiButtonViewType;
|
||||
import thaumicenergistics.client.gui.widget.ThEWidget;
|
||||
@@ -159,7 +158,7 @@ public class GuiEssentiaCellTerminal extends GuiConstants_ECT implements IAspect
|
||||
/**
|
||||
* Tab button to show crafting status
|
||||
*/
|
||||
private GuiTabButton btnCraftingStatus;
|
||||
private GuiButtonCraftingStatus btnCraftingStatus;
|
||||
|
||||
/**
|
||||
* Creates the gui.
|
||||
@@ -773,13 +772,12 @@ public class GuiEssentiaCellTerminal extends GuiConstants_ECT implements IAspect
|
||||
if ((this.baseContainer instanceof ContainerEssentiaTerminal)
|
||||
|| (this.baseContainer instanceof ContainerWirelessEssentiaTerminal)) {
|
||||
this.buttonList.add(
|
||||
this.btnCraftingStatus = new GuiTabButton(
|
||||
this.guiLeft + 170,
|
||||
this.guiTop - 4,
|
||||
2 + 11 * 16,
|
||||
GuiText.CraftingStatus.getLocal(),
|
||||
itemRender));
|
||||
this.btnCraftingStatus.setHideEdge(13);
|
||||
this.btnCraftingStatus = new GuiButtonCraftingStatus(
|
||||
GuiConstants_ECT.BUTTON_CRAFTING_STATUS_ID,
|
||||
this.guiLeft + GuiConstants_ECT.BUTTON_CRAFTING_STATUS_POS_X,
|
||||
this.guiTop + GuiConstants_ECT.BUTTON_CRAFTING_STATUS_POS_Y,
|
||||
GuiConstants_ECT.BUTTON_AE_TAB_SIZE,
|
||||
GuiConstants_ECT.BUTTON_AE_TAB_SIZE));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,17 +55,17 @@ public abstract class GuiConstants_ACT extends ThEScrollbarGui {
|
||||
*/
|
||||
protected static final int BUTTON_SORT_MODE_ID = 1, BUTTON_SORT_MODE_POS_X = -18, BUTTON_SORT_MODE_POS_Y = 8;
|
||||
|
||||
/**
|
||||
* Sort direction button
|
||||
*/
|
||||
protected static final int BUTTON_SORT_DIR_ID = 2, BUTTON_SORT_DIR_POS_X = BUTTON_SORT_MODE_POS_X,
|
||||
BUTTON_SORT_DIR_POS_Y = BUTTON_SORT_MODE_POS_Y + 20;
|
||||
|
||||
/**
|
||||
* View type button
|
||||
*/
|
||||
protected static final int BUTTON_VIEW_TYPE_ID = 3, BUTTON_VIEW_TYPE_POS_X = BUTTON_SORT_MODE_POS_X,
|
||||
BUTTON_VIEW_TYPE_POS_Y = BUTTON_SORT_DIR_POS_Y + 20;
|
||||
protected static final int BUTTON_VIEW_TYPE_ID = 2, BUTTON_VIEW_TYPE_POS_X = BUTTON_SORT_MODE_POS_X,
|
||||
BUTTON_VIEW_TYPE_POS_Y = BUTTON_SORT_MODE_POS_Y + 20;
|
||||
|
||||
/**
|
||||
* Sort direction button
|
||||
*/
|
||||
protected static final int BUTTON_SORT_DIR_ID = 3, BUTTON_SORT_DIR_POS_X = BUTTON_SORT_MODE_POS_X,
|
||||
BUTTON_SORT_DIR_POS_Y = BUTTON_VIEW_TYPE_POS_Y + 20;
|
||||
|
||||
/**
|
||||
* Swap armor button
|
||||
@@ -76,7 +76,7 @@ public abstract class GuiConstants_ACT extends ThEScrollbarGui {
|
||||
* Search mode
|
||||
*/
|
||||
protected static final int BUTTON_SEARCH_MODE_ID = 5, BUTTON_SEARCH_MODE_POS_X = BUTTON_SORT_MODE_POS_X,
|
||||
BUTTON_SEARCH_MODE_POS_Y = BUTTON_VIEW_TYPE_POS_Y + 20;
|
||||
BUTTON_SEARCH_MODE_POS_Y = BUTTON_SORT_DIR_POS_Y + 20;
|
||||
|
||||
/**
|
||||
* Terminal style button
|
||||
@@ -84,11 +84,22 @@ public abstract class GuiConstants_ACT extends ThEScrollbarGui {
|
||||
protected static final int BUTTON_TERM_STYLE_ID = 6, BUTTON_TERM_STYLE_POS_X = BUTTON_SORT_MODE_POS_X,
|
||||
BUTTON_TERM_STYLE_POS_Y = BUTTON_SEARCH_MODE_POS_Y + 20;
|
||||
|
||||
/**
|
||||
* Crafting status button
|
||||
*/
|
||||
protected static final int BUTTON_CRAFTING_STATUS_ID = 7, BUTTON_CRAFTING_STATUS_POS_X = 170,
|
||||
BUTTON_CRAFTING_STATUS_POS_Y = -4;
|
||||
|
||||
/**
|
||||
* Size of the AE buttons
|
||||
*/
|
||||
protected static final int BUTTON_AE_SIZE = 16;
|
||||
|
||||
/**
|
||||
* Size of the AE tab buttons
|
||||
*/
|
||||
protected static final int BUTTON_AE_TAB_SIZE = 22;
|
||||
|
||||
/**
|
||||
* Size of the tiny buttons.
|
||||
*/
|
||||
|
||||
@@ -83,6 +83,14 @@ public abstract class GuiConstants_ECT extends ThEScrollbarGui {
|
||||
protected static final int WIDGETS_PER_PAGE = GuiConstants_ECT.WIDGETS_PER_ROW
|
||||
* GuiConstants_ECT.WIDGET_ROWS_PER_PAGE;
|
||||
|
||||
/**
|
||||
* Crafting status button
|
||||
*/
|
||||
protected static final int BUTTON_CRAFTING_STATUS_ID = 1, BUTTON_CRAFTING_STATUS_POS_X = 170,
|
||||
BUTTON_CRAFTING_STATUS_POS_Y = -4;
|
||||
|
||||
protected static final int BUTTON_AE_TAB_SIZE = 22;
|
||||
|
||||
public GuiConstants_ECT(final Container container) {
|
||||
super(container);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package thaumicenergistics.client.gui.buttons;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import appeng.core.localization.GuiText;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumicenergistics.client.textures.AEStateIconsEnum;
|
||||
|
||||
/**
|
||||
* Button for crafting status.
|
||||
*
|
||||
* @author MCTBL
|
||||
*
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiButtonCraftingStatus extends ThEStateButton {
|
||||
|
||||
public GuiButtonCraftingStatus(final int ID, final int xPosition, final int yPosition, final int buttonWidth,
|
||||
final int buttonHeight) {
|
||||
super(ID, xPosition, yPosition, buttonWidth, buttonHeight, null, 0, 0, AEStateIconsEnum.CRAFT_ONLY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(List<String> tooltip) {
|
||||
this.addAboutToTooltip(tooltip, GuiText.CraftingStatus.getLocal());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -128,6 +128,17 @@ public abstract class ThEStateButton extends ThEGuiButtonBase {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds info to the tooltip as a white header.
|
||||
*
|
||||
* @param tooltip
|
||||
* @param title
|
||||
*/
|
||||
protected void addAboutToTooltip(final List<String> tooltip, final String title) {
|
||||
// Title
|
||||
tooltip.add(EnumChatFormatting.WHITE + title);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws an icon to the screen.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user