In progress
This commit is contained in:
parent
62efc5cd5c
commit
6e3014a371
|
@ -35,8 +35,8 @@ public class GuiTransmutationTablet extends GuiBase
|
||||||
|
|
||||||
private static DecimalFormat energyValueDecimalFormat = new DecimalFormat("###,###,###,###,###.###");
|
private static DecimalFormat energyValueDecimalFormat = new DecimalFormat("###,###,###,###,###.###");
|
||||||
|
|
||||||
private static final int LEFT_MOUSEBUTTON = 0;
|
private static final int LEFT_MOUSE_BUTTON = 0;
|
||||||
private static final int RIGHT_MOUSEBUTTON = 1;
|
private static final int RIGHT_MOUSE_BUTTON = 1;
|
||||||
|
|
||||||
private static final int SORT_BY_DISPLAY_NAME = 0;
|
private static final int SORT_BY_DISPLAY_NAME = 0;
|
||||||
private static final int SORT_BY_ENERGY_VALUE = 1;
|
private static final int SORT_BY_ENERGY_VALUE = 1;
|
||||||
|
@ -65,26 +65,6 @@ public class GuiTransmutationTablet extends GuiBase
|
||||||
searchTextField.backgroundColor = new GuiColor(0, 0, 0, 0).getColor();
|
searchTextField.backgroundColor = new GuiColor(0, 0, 0, 0).getColor();
|
||||||
searchTextField.borderColor = new GuiColor(0, 0, 0, 0).getColor();
|
searchTextField.borderColor = new GuiColor(0, 0, 0, 0).getColor();
|
||||||
|
|
||||||
sortOrderButton = new ElementStatefulButton(this, 151, 58, "sortOrder", 0, 0, 18, 0, 36, 0, 18, 18, 36, 18, Textures.Gui.Elements.BUTTON_SORT_ORDER)
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void drawBackground(int mouseX, int mouseY, float gameTicks)
|
|
||||||
{
|
|
||||||
RenderHelper.bindTexture(texture);
|
|
||||||
if (isEnabled())
|
|
||||||
{
|
|
||||||
if (getState() == SORT_ASCENDING)
|
|
||||||
{
|
|
||||||
drawTexturedModalRect(posX, posY, 36, 0, sizeX, sizeY);
|
|
||||||
}
|
|
||||||
else if (getState() == SORT_DESCENDING)
|
|
||||||
{
|
|
||||||
drawTexturedModalRect(posX, posY, 0, 0, sizeX, sizeY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
sortOptionButton = new ElementStatefulButton(this, 151, 36, "sortOption", 0, 0, 18, 0, 36, 0, 18, 18, 54, 18, Textures.Gui.Elements.BUTTON_SORT_OPTION)
|
sortOptionButton = new ElementStatefulButton(this, 151, 36, "sortOption", 0, 0, 18, 0, 36, 0, 18, 18, 54, 18, Textures.Gui.Elements.BUTTON_SORT_OPTION)
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
@ -108,6 +88,25 @@ public class GuiTransmutationTablet extends GuiBase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
sortOrderButton = new ElementStatefulButton(this, 151, 58, "sortOrder", 0, 0, 0, 0, 18, 0, 18, 18, 36, 18, Textures.Gui.Elements.BUTTON_SORT_ORDER)
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void drawBackground(int mouseX, int mouseY, float gameTicks)
|
||||||
|
{
|
||||||
|
RenderHelper.bindTexture(texture);
|
||||||
|
if (isEnabled())
|
||||||
|
{
|
||||||
|
if (getState() == SORT_ASCENDING)
|
||||||
|
{
|
||||||
|
drawTexturedModalRect(posX, posY, 36, 0, sizeX, sizeY);
|
||||||
|
}
|
||||||
|
else if (getState() == SORT_DESCENDING)
|
||||||
|
{
|
||||||
|
drawTexturedModalRect(posX, posY, 0, 0, sizeX, sizeY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
setTooltipByState();
|
setTooltipByState();
|
||||||
|
|
||||||
slider = new ElementSlider(this, "scrollBar", 239, 36, 12, 201, 187, 0)
|
slider = new ElementSlider(this, "scrollBar", 239, 36, 12, 201, 187, 0)
|
||||||
|
@ -176,7 +175,7 @@ public class GuiTransmutationTablet extends GuiBase
|
||||||
{
|
{
|
||||||
PacketHandler.INSTANCE.sendToServer(new MessageGuiElementClicked(buttonName, mouseButton));
|
PacketHandler.INSTANCE.sendToServer(new MessageGuiElementClicked(buttonName, mouseButton));
|
||||||
|
|
||||||
if (mouseButton == LEFT_MOUSEBUTTON)
|
if (mouseButton == LEFT_MOUSE_BUTTON)
|
||||||
{
|
{
|
||||||
if (sortOptionButton.getState() == SORT_BY_DISPLAY_NAME)
|
if (sortOptionButton.getState() == SORT_BY_DISPLAY_NAME)
|
||||||
{
|
{
|
||||||
|
@ -191,7 +190,7 @@ public class GuiTransmutationTablet extends GuiBase
|
||||||
sortOptionButton.setState(SORT_BY_DISPLAY_NAME);
|
sortOptionButton.setState(SORT_BY_DISPLAY_NAME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (mouseButton == RIGHT_MOUSEBUTTON)
|
else if (mouseButton == RIGHT_MOUSE_BUTTON)
|
||||||
{
|
{
|
||||||
if (sortOptionButton.getState() == SORT_BY_DISPLAY_NAME)
|
if (sortOptionButton.getState() == SORT_BY_DISPLAY_NAME)
|
||||||
{
|
{
|
||||||
|
@ -207,6 +206,21 @@ public class GuiTransmutationTablet extends GuiBase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setTooltipByState();
|
||||||
|
}
|
||||||
|
else if (buttonName.equals("sortOrder"))
|
||||||
|
{
|
||||||
|
PacketHandler.INSTANCE.sendToServer(new MessageGuiElementClicked(buttonName, mouseButton));
|
||||||
|
|
||||||
|
if (sortOrderButton.getState() == SORT_ASCENDING)
|
||||||
|
{
|
||||||
|
sortOrderButton.setState(SORT_DESCENDING);
|
||||||
|
}
|
||||||
|
else if (sortOrderButton.getState() == SORT_DESCENDING)
|
||||||
|
{
|
||||||
|
sortOrderButton.setState(SORT_ASCENDING);
|
||||||
|
}
|
||||||
|
|
||||||
setTooltipByState();
|
setTooltipByState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -226,5 +240,15 @@ public class GuiTransmutationTablet extends GuiBase
|
||||||
{
|
{
|
||||||
sortOptionButton.setToolTip(Messages.Tooltips.SORT_BY_ID);
|
sortOptionButton.setToolTip(Messages.Tooltips.SORT_BY_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sortOrderButton.clearToolTip();
|
||||||
|
if (sortOrderButton.getState() == SORT_ASCENDING)
|
||||||
|
{
|
||||||
|
sortOrderButton.setToolTip(Messages.Tooltips.SORT_ASCENDING);
|
||||||
|
}
|
||||||
|
else if (sortOrderButton.getState() == SORT_DESCENDING)
|
||||||
|
{
|
||||||
|
sortOrderButton.setToolTip(Messages.Tooltips.SORT_DESCENDING);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,7 @@ public class EnergyValueStackMapping implements JsonSerializer<EnergyValueStackM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wrappedStack != null)
|
if (wrappedStack != null && energyValue != null)
|
||||||
{
|
{
|
||||||
return new EnergyValueStackMapping(wrappedStack, energyValue);
|
return new EnergyValueStackMapping(wrappedStack, energyValue);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ public class ContainerTransmutationTablet extends ContainerEE implements IElemen
|
||||||
private float energyValue;
|
private float energyValue;
|
||||||
private String searchTerm;
|
private String searchTerm;
|
||||||
private int sortOption;
|
private int sortOption;
|
||||||
|
private int sortOrder;
|
||||||
private int scrollBarPosition;
|
private int scrollBarPosition;
|
||||||
|
|
||||||
public ContainerTransmutationTablet(InventoryPlayer inventoryPlayer, TileEntityTransmutationTablet tileEntityTransmutationTablet)
|
public ContainerTransmutationTablet(InventoryPlayer inventoryPlayer, TileEntityTransmutationTablet tileEntityTransmutationTablet)
|
||||||
|
@ -407,11 +408,16 @@ public class ContainerTransmutationTablet extends ContainerEE implements IElemen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (elementName.equals("sortOption"))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
for (Object crafter : this.crafters)
|
for (Object crafter : this.crafters)
|
||||||
{
|
{
|
||||||
ICrafting iCrafting = (ICrafting) crafter;
|
ICrafting iCrafting = (ICrafting) crafter;
|
||||||
iCrafting.sendProgressBarUpdate(this, 2, sortOption);
|
iCrafting.sendProgressBarUpdate(this, 2, sortOption);
|
||||||
|
iCrafting.sendProgressBarUpdate(this, 3, sortOrder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,8 @@ public final class Messages
|
||||||
public static final String SORT_BY_DISPLAY_NAME = TOOLTIP_PREFIX + "sortByDisplayName";
|
public static final String SORT_BY_DISPLAY_NAME = TOOLTIP_PREFIX + "sortByDisplayName";
|
||||||
public static final String SORT_BY_ENERGY_VALUE = TOOLTIP_PREFIX + "sortByEnergyValue";
|
public static final String SORT_BY_ENERGY_VALUE = TOOLTIP_PREFIX + "sortByEnergyValue";
|
||||||
public static final String SORT_BY_ID = TOOLTIP_PREFIX + "sortByID";
|
public static final String SORT_BY_ID = TOOLTIP_PREFIX + "sortByID";
|
||||||
|
public static final String SORT_ASCENDING = TOOLTIP_PREFIX + "sortAscending";
|
||||||
|
public static final String SORT_DESCENDING = TOOLTIP_PREFIX + "sortDescending";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class Commands
|
public static final class Commands
|
||||||
|
|
|
@ -173,6 +173,8 @@ tooltip.ee3:large=Large
|
||||||
tooltip.ee3:sortByDisplayName=Sort by Display Name
|
tooltip.ee3:sortByDisplayName=Sort by Display Name
|
||||||
tooltip.ee3:sortByEnergyValue=Sort by Energy Value
|
tooltip.ee3:sortByEnergyValue=Sort by Energy Value
|
||||||
tooltip.ee3:sortByID=Sort by ID
|
tooltip.ee3:sortByID=Sort by ID
|
||||||
|
tooltip.ee3:sortAscending=Ascending Order
|
||||||
|
tooltip.ee3:sortDescending=Descending Order
|
||||||
|
|
||||||
#Misc
|
#Misc
|
||||||
misc.ee3:owner-set-to-self=You are now the owner of %s
|
misc.ee3:owner-set-to-self=You are now the owner of %s
|
||||||
|
|
Loading…
Reference in a new issue