aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/gui/widgets/GT_GuiTooltip.java
blob: 6b9e70a71b8d755f587b6243efde8b79d4a9e66f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package gregtech.api.gui.widgets;

import java.awt.*;
import java.util.ArrayList;
import java.util.List;

public class GT_GuiTooltip {

    protected Rectangle bounds;
    private List<String> text;
    public boolean enabled = true;

    public GT_GuiTooltip(Rectangle bounds, String... text) {
        this.bounds = bounds;
        setToolTipText(text);
    }

    protected void updateText() {
    }

    public void setToolTipText(String... text) {
        if (text != null) {
            this.text = new ArrayList<>(text.length);
            for (int i = 0; i < text.length; i++) {
                if (i == 0)
                    this.text.add("\u00a7f" + text[i]);
                else
                    this.text.add("\u00a77" + text[i]);
            }
        } else
            this.text = new ArrayList<>();
    }

    public List<String> getToolTipText() {
        return text;
    }

    public Rectangle getBounds() {
        return bounds;
    }

    public boolean isDelayed() {
        return true;
    }
}