Move JEI item pane out of the way if the slot config goes of the side of the screen.

This commit is contained in:
modmuss50 2017-12-29 18:12:04 +00:00
parent ff2ed99d14
commit 1d6c6139ec
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
4 changed files with 49 additions and 0 deletions

View file

@ -39,6 +39,7 @@ import techreborn.client.gui.slot.elements.SlotType;
import java.awt.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@ -190,4 +191,16 @@ public class GuiSlotConfiguration {
return clicked;
}
public static List<Rectangle> getExtraSpace(GuiBase guiBase){
if(!GuiBase.showSlotConfig || slectedSlot == -1){
return Collections.emptyList();
}
List<Rectangle> list = new ArrayList<>();
ConfigSlotElement slotElement = slotElementMap.get(slectedSlot);
//I have no idea why this works, but it does. pls fix if you know how.
list.add(new Rectangle(slotElement.adjustX(guiBase, slotElement.getX()) + guiBase.getGuiLeft(), slotElement.adjustY(guiBase, 0), slotElement.getWidth() - 20, slotElement.getHeight()));
return list;
}
}

View file

@ -84,6 +84,8 @@ public class ConfigSlotElement extends ElementBase {
popupElement.filter = true;
}
}
setWidth(85);
setHeight(105 + (filter ? 15 : 0));
}
@Override

View file

@ -185,6 +185,14 @@ public class ElementBase {
return height;
}
public int getWidth() {
return width;
}
public int getHeight() {
return height;
}
public ElementBase addHoverAction(ElementBase.Action action) {
this.hoverActions.add(action);
return this;