Files
NotEnoughItems/src/main/java/codechicken/nei/Widget.java
T
65ffbad491 Show a full recipe widget in item tooltips for bookmarked recipes (#398)
* Update buildscript

* Show a full recipe widget in item tooltips for bookmarked recipes

* Make recipe tooltips configurable and only show in the bookmarks panel

* Fix layout relative to tooltip boxes

* Fix wildcard import

* spotlessApply (#401)

Co-authored-by: GitHub GTNH Actions <>

* Fix handler tooltip offsets for new&legacy handlers

* Fix render order to draw crafting tooltips on top of container manager buttons

* Fix wrong mouse Y half-point calculation

* Allow saving recipes with empty item ingredient lists to bookmarks (e.g. fluid-only)

* Fix waila vs. non-waila tooltip offsets

Co-authored-by: Wilhelm Schuster <dev@rot13.io>

---------

Co-authored-by: Wilhelm Schuster <dev@rot13.io>
2023-07-10 17:38:07 +01:00

71 lines
1.5 KiB
Java

package codechicken.nei;
import java.util.List;
import net.minecraft.item.ItemStack;
import codechicken.lib.vec.Rectangle4i;
public abstract class Widget {
public Widget() {}
public abstract void draw(int mx, int my);
public void postDraw(int mx, int my) {}
public void postDrawTooltips(int mx, int my, List<String> tooltip) {}
public boolean handleClick(int mx, int my, int button) {
return true;
}
public void onGuiClick(int mx, int my) {}
public void mouseUp(int mx, int my, int button) {}
public boolean handleKeyPress(int keyID, char keyChar) {
return false;
}
public void lastKeyTyped(int keyID, char keyChar) {}
public boolean handleClickExt(int mx, int my, int button) {
return false;
}
public boolean onMouseWheel(int i, int mx, int my) {
return false;
}
public void update() {}
public Rectangle4i bounds() {
return new Rectangle4i(x, y, w, h);
}
public boolean contains(int px, int py) {
return bounds().contains(px, py);
}
public ItemStack getStackMouseOver(int mx, int my) {
return null;
}
public void mouseDragged(int mx, int my, int button, long heldTime) {}
public List<String> handleTooltip(int mx, int my, List<String> tooltip) {
return tooltip;
}
public void loseFocus() {}
public void gainFocus() {}
public int x;
public int y;
public int z;
public int w;
public int h;
}