Update Forge to 1399, and getting ready to add in some more sorting options
This commit is contained in:
parent
eec200f133
commit
42cc381970
|
@ -1,6 +1,6 @@
|
|||
#
|
||||
#Sat Dec 28 00:14:08 EST 2013
|
||||
minecraft_version = 1.7.10
|
||||
forge_version = 10.13.3.1388-1.7.10
|
||||
forge_version = 10.13.3.1399-1.7.10
|
||||
mod_version = 0.3
|
||||
release_type = beta
|
||||
|
|
|
@ -10,7 +10,6 @@ import com.pahimar.ee3.reference.Colors;
|
|||
import com.pahimar.ee3.reference.Messages;
|
||||
import com.pahimar.ee3.reference.Textures;
|
||||
import com.pahimar.ee3.tileentity.TileEntityTransmutationTablet;
|
||||
import com.pahimar.ee3.util.LogHelper;
|
||||
import com.pahimar.repackage.cofh.lib.gui.GuiBase;
|
||||
import com.pahimar.repackage.cofh.lib.gui.GuiColor;
|
||||
import com.pahimar.repackage.cofh.lib.gui.element.ElementSlider;
|
||||
|
@ -29,7 +28,7 @@ public class GuiTransmutationTablet extends GuiBase
|
|||
private TileEntityTransmutationTablet tileEntityTransmutationTablet;
|
||||
|
||||
private ElementTextField searchTextField;
|
||||
private ElementStatefulButton sortOrderButton;
|
||||
private ElementStatefulButton sortOptionButton;
|
||||
private ElementSlider slider;
|
||||
protected int tickCount;
|
||||
|
||||
|
@ -62,7 +61,7 @@ public class GuiTransmutationTablet extends GuiBase
|
|||
searchTextField.backgroundColor = new GuiColor(0, 0, 0, 0).getColor();
|
||||
searchTextField.borderColor = new GuiColor(0, 0, 0, 0).getColor();
|
||||
|
||||
sortOrderButton = new ElementStatefulButton(this, 151, 36, "sortOrder", 0, 0, 18, 0, 36, 0, 18, 18, 54, 18, Textures.Gui.Elements.BUTTON_SORT_ORDER)
|
||||
sortOptionButton = new ElementStatefulButton(this, 151, 36, "sortOption", 0, 0, 18, 0, 36, 0, 18, 18, 54, 18, Textures.Gui.Elements.BUTTON_SORT_OPTION)
|
||||
{
|
||||
@Override
|
||||
public void drawBackground(int mouseX, int mouseY, float gameTicks)
|
||||
|
@ -107,7 +106,6 @@ public class GuiTransmutationTablet extends GuiBase
|
|||
public boolean onMouseWheel(int mouseX, int mouseY, int movement)
|
||||
{
|
||||
PacketHandler.INSTANCE.sendToServer(new MessageSliderElementUpdated(this));
|
||||
LogHelper.info(tickCount);
|
||||
return super.onMouseWheel(mouseX, mouseY, movement);
|
||||
}
|
||||
|
||||
|
@ -127,7 +125,7 @@ public class GuiTransmutationTablet extends GuiBase
|
|||
slider.borderColor = new GuiColor(0, 0, 0, 0).getColor();
|
||||
slider.setSliderSize(12, 15);
|
||||
|
||||
addElement(sortOrderButton);
|
||||
addElement(sortOptionButton);
|
||||
addElement(searchTextField);
|
||||
addElement(slider);
|
||||
}
|
||||
|
@ -150,38 +148,38 @@ public class GuiTransmutationTablet extends GuiBase
|
|||
@Override
|
||||
public void handleElementButtonClick(String buttonName, int mouseButton)
|
||||
{
|
||||
if (buttonName.equals("sortOrder"))
|
||||
if (buttonName.equals("sortOption"))
|
||||
{
|
||||
PacketHandler.INSTANCE.sendToServer(new MessageGuiElementClicked(buttonName, mouseButton));
|
||||
|
||||
if (mouseButton == LEFT_MOUSEBUTTON)
|
||||
{
|
||||
if (sortOrderButton.getState() == SORT_BY_DISPLAY_NAME)
|
||||
if (sortOptionButton.getState() == SORT_BY_DISPLAY_NAME)
|
||||
{
|
||||
sortOrderButton.setState(SORT_BY_ENERGY_VALUE);
|
||||
sortOptionButton.setState(SORT_BY_ENERGY_VALUE);
|
||||
}
|
||||
else if (sortOrderButton.getState() == SORT_BY_ENERGY_VALUE)
|
||||
else if (sortOptionButton.getState() == SORT_BY_ENERGY_VALUE)
|
||||
{
|
||||
sortOrderButton.setState(SORT_BY_ID);
|
||||
sortOptionButton.setState(SORT_BY_ID);
|
||||
}
|
||||
else if (sortOrderButton.getState() == SORT_BY_ID)
|
||||
else if (sortOptionButton.getState() == SORT_BY_ID)
|
||||
{
|
||||
sortOrderButton.setState(SORT_BY_DISPLAY_NAME);
|
||||
sortOptionButton.setState(SORT_BY_DISPLAY_NAME);
|
||||
}
|
||||
}
|
||||
else if (mouseButton == RIGHT_MOUSEBUTTON)
|
||||
{
|
||||
if (sortOrderButton.getState() == SORT_BY_DISPLAY_NAME)
|
||||
if (sortOptionButton.getState() == SORT_BY_DISPLAY_NAME)
|
||||
{
|
||||
sortOrderButton.setState(SORT_BY_ID);
|
||||
sortOptionButton.setState(SORT_BY_ID);
|
||||
}
|
||||
else if (sortOrderButton.getState() == SORT_BY_ENERGY_VALUE)
|
||||
else if (sortOptionButton.getState() == SORT_BY_ENERGY_VALUE)
|
||||
{
|
||||
sortOrderButton.setState(SORT_BY_DISPLAY_NAME);
|
||||
sortOptionButton.setState(SORT_BY_DISPLAY_NAME);
|
||||
}
|
||||
else if (sortOrderButton.getState() == SORT_BY_ID)
|
||||
else if (sortOptionButton.getState() == SORT_BY_ID)
|
||||
{
|
||||
sortOrderButton.setState(SORT_BY_ENERGY_VALUE);
|
||||
sortOptionButton.setState(SORT_BY_ENERGY_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -191,18 +189,18 @@ public class GuiTransmutationTablet extends GuiBase
|
|||
|
||||
private void setTooltipByState()
|
||||
{
|
||||
sortOrderButton.clearToolTip();
|
||||
if (sortOrderButton.getState() == SORT_BY_DISPLAY_NAME)
|
||||
sortOptionButton.clearToolTip();
|
||||
if (sortOptionButton.getState() == SORT_BY_DISPLAY_NAME)
|
||||
{
|
||||
sortOrderButton.setToolTip(Messages.Tooltips.SORT_BY_DISPLAY_NAME);
|
||||
sortOptionButton.setToolTip(Messages.Tooltips.SORT_BY_DISPLAY_NAME);
|
||||
}
|
||||
else if (sortOrderButton.getState() == SORT_BY_ENERGY_VALUE)
|
||||
else if (sortOptionButton.getState() == SORT_BY_ENERGY_VALUE)
|
||||
{
|
||||
sortOrderButton.setToolTip(Messages.Tooltips.SORT_BY_ENERGY_VALUE);
|
||||
sortOptionButton.setToolTip(Messages.Tooltips.SORT_BY_ENERGY_VALUE);
|
||||
}
|
||||
else if (sortOrderButton.getState() == SORT_BY_ID)
|
||||
else if (sortOptionButton.getState() == SORT_BY_ID)
|
||||
{
|
||||
sortOrderButton.setToolTip(Messages.Tooltips.SORT_BY_ID);
|
||||
sortOptionButton.setToolTip(Messages.Tooltips.SORT_BY_ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public class ContainerTransmutationTablet extends ContainerEE implements IElemen
|
|||
public final TileEntityTransmutationTablet tileEntityTransmutationTablet;
|
||||
private float energyValue;
|
||||
private String searchTerm;
|
||||
private int sortOrder;
|
||||
private int sortOption;
|
||||
private int scrollBarPosition;
|
||||
|
||||
public ContainerTransmutationTablet(InventoryPlayer inventoryPlayer, TileEntityTransmutationTablet tileEntityTransmutationTablet)
|
||||
|
@ -54,7 +54,7 @@ public class ContainerTransmutationTablet extends ContainerEE implements IElemen
|
|||
}
|
||||
inventoryTransmutationTablet = new InventoryTransmutationTablet(knownTransmutations);
|
||||
|
||||
this.sortOrder = 0;
|
||||
this.sortOption = 0;
|
||||
this.scrollBarPosition = 0;
|
||||
this.energyValue = tileEntityTransmutationTablet.getAvailableEnergyValue().getValue();
|
||||
|
||||
|
@ -151,7 +151,7 @@ public class ContainerTransmutationTablet extends ContainerEE implements IElemen
|
|||
}
|
||||
else if (valueType == 2)
|
||||
{
|
||||
sortOrder = updatedValue;
|
||||
sortOption = updatedValue;
|
||||
}
|
||||
else if (valueType == 3)
|
||||
{
|
||||
|
@ -202,9 +202,9 @@ public class ContainerTransmutationTablet extends ContainerEE implements IElemen
|
|||
|
||||
int adjustedStartIndex = (int) ((scrollBarPosition / 187f) * filteredList.size());
|
||||
|
||||
if (sortOrder >= 0 && sortOrder < Comparators.itemComparators.length)
|
||||
if (sortOption >= 0 && sortOption < Comparators.itemComparators.length)
|
||||
{
|
||||
Collections.sort(filteredList, Comparators.itemComparators[sortOrder]);
|
||||
Collections.sort(filteredList, Comparators.itemComparators[sortOption]);
|
||||
}
|
||||
|
||||
if (filteredList.size() <= 30)
|
||||
|
@ -374,36 +374,36 @@ public class ContainerTransmutationTablet extends ContainerEE implements IElemen
|
|||
@Override
|
||||
public void handleElementButtonClick(String elementName, int mouseButton)
|
||||
{
|
||||
if (elementName.equals("sortOrder"))
|
||||
if (elementName.equals("sortOption"))
|
||||
{
|
||||
if (mouseButton == 0)
|
||||
{
|
||||
if (sortOrder == 0)
|
||||
if (sortOption == 0)
|
||||
{
|
||||
sortOrder = 1;
|
||||
sortOption = 1;
|
||||
}
|
||||
else if (sortOrder == 1)
|
||||
else if (sortOption == 1)
|
||||
{
|
||||
sortOrder = 2;
|
||||
sortOption = 2;
|
||||
}
|
||||
else if (sortOrder == 2)
|
||||
else if (sortOption == 2)
|
||||
{
|
||||
sortOrder = 0;
|
||||
sortOption = 0;
|
||||
}
|
||||
}
|
||||
else if (mouseButton == 1)
|
||||
{
|
||||
if (sortOrder == 0)
|
||||
if (sortOption == 0)
|
||||
{
|
||||
sortOrder = 2;
|
||||
sortOption = 2;
|
||||
}
|
||||
else if (sortOrder == 1)
|
||||
else if (sortOption == 1)
|
||||
{
|
||||
sortOrder = 0;
|
||||
sortOption = 0;
|
||||
}
|
||||
else if (sortOrder == 2)
|
||||
else if (sortOption == 2)
|
||||
{
|
||||
sortOrder = 1;
|
||||
sortOption = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -411,7 +411,7 @@ public class ContainerTransmutationTablet extends ContainerEE implements IElemen
|
|||
for (Object crafter : this.crafters)
|
||||
{
|
||||
ICrafting iCrafting = (ICrafting) crafter;
|
||||
iCrafting.sendProgressBarUpdate(this, 2, sortOrder);
|
||||
iCrafting.sendProgressBarUpdate(this, 2, sortOption);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -113,10 +113,6 @@ public class MessageSyncEnergyValues implements IMessage, IMessageHandler<Messag
|
|||
e.printStackTrace();
|
||||
}
|
||||
|
||||
for (WrappedStack wrappedStack : energyValueStackMap.keySet())
|
||||
{
|
||||
LogHelper.info(String.format("Object: %s, Value: %s", wrappedStack, energyValueStackMap.get(wrappedStack)));
|
||||
}
|
||||
EnergyValueRegistry.getInstance().loadFromMap(energyValueStackMap);
|
||||
LogHelper.info("Client successfully received EnergyValues from server");
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ public final class Textures
|
|||
public static final ResourceLocation BUTTON_ENABLED = ResourceLocationHelper.getResourceLocation(ELEMENT_TEXTURE_LOCATION + "buttonEnabled.png");
|
||||
public static final ResourceLocation BUTTON_DISABLED = ResourceLocationHelper.getResourceLocation(ELEMENT_TEXTURE_LOCATION + "buttonDisabled.png");
|
||||
public static final ResourceLocation BUTTON_HOVER = ResourceLocationHelper.getResourceLocation(ELEMENT_TEXTURE_LOCATION + "buttonHover.png");
|
||||
public static final ResourceLocation BUTTON_SORT_OPTION = ResourceLocationHelper.getResourceLocation(ELEMENT_TEXTURE_LOCATION + "buttonSortOption.png");
|
||||
public static final ResourceLocation BUTTON_SORT_ORDER = ResourceLocationHelper.getResourceLocation(ELEMENT_TEXTURE_LOCATION + "buttonSortOrder.png");
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
Binary file not shown.
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 3.0 KiB |
Loading…
Reference in New Issue