12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- /*
- * Roughly Enough Items by Danielshe.
- * Licensed under the MIT License.
- */
- package me.shedaniel.rei.gui.widget;
- import com.google.common.collect.Lists;
- import me.shedaniel.math.api.Point;
- import me.shedaniel.math.impl.PointHelper;
- import java.util.List;
- import java.util.function.Consumer;
- public class QueuedTooltip {
- private Point location;
- private List<String> text;
- private Consumer<QueuedTooltip> consumer = null;
- private QueuedTooltip(Point location, List<String> text) {
- this.location = location;
- this.text = Lists.newArrayList(text);
- }
- public static QueuedTooltip create(Point location, List<String> text) {
- return new QueuedTooltip(location, text);
- }
- public static QueuedTooltip create(Point location, String... text) {
- return QueuedTooltip.create(location, Lists.newArrayList(text));
- }
- public static QueuedTooltip create(List<String> text) {
- return QueuedTooltip.create(PointHelper.fromMouse(), text);
- }
- public static QueuedTooltip create(String... text) {
- return QueuedTooltip.create(PointHelper.fromMouse(), text);
- }
- @Deprecated
- public QueuedTooltip setSpecialRenderer(Consumer<QueuedTooltip> consumer) {
- this.consumer = consumer;
- return this;
- }
- @Deprecated
- public Consumer<QueuedTooltip> getConsumer() {
- return consumer;
- }
- public Point getLocation() {
- return location;
- }
- public int getX() {
- return getLocation().x;
- }
- public int getY() {
- return getLocation().y;
- }
- public List<String> getText() {
- return text;
- }
- }
|