/* * 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 text; private Consumer consumer = null; private QueuedTooltip(Point location, List text) { this.location = location; this.text = Lists.newArrayList(text); } public static QueuedTooltip create(Point location, List 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 text) { return QueuedTooltip.create(PointHelper.fromMouse(), text); } public static QueuedTooltip create(String... text) { return QueuedTooltip.create(PointHelper.fromMouse(), text); } @Deprecated public QueuedTooltip setSpecialRenderer(Consumer consumer) { this.consumer = consumer; return this; } @Deprecated public Consumer getConsumer() { return consumer; } public Point getLocation() { return location; } public int getX() { return getLocation().x; } public int getY() { return getLocation().y; } public List getText() { return text; } }