aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/test/TestHud.java
blob: 930d8273dc911b210c32921f5a251b2bcea099a8 (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
package cc.polyfrost.oneconfig.test;

import cc.polyfrost.oneconfig.config.annotations.Option;
import cc.polyfrost.oneconfig.config.data.OptionType;
import cc.polyfrost.oneconfig.hud.TextHud;
import net.minecraft.client.Minecraft;

import java.util.ArrayList;
import java.util.List;

public class TestHud extends TextHud {
    public TestHud(boolean enabled, int x, int y) {
        super(enabled, x, y);
    }

    @Override
    public List<String> getLines() {
        ArrayList<String> lines = new ArrayList<>();
        lines.add("FPS: " + Minecraft.getDebugFPS());
        if (hasSecondLine) lines.add(secondLine);
        return lines;
    }

    @Option(
            name = "Enable Second Line",
            type = OptionType.SWITCH
    )
    public boolean hasSecondLine = false;

    @Option(
            name = "Second Line Text",
            type = OptionType.TEXT
    )
    public String secondLine = "Epic text";
}