aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/ftbsc/bscv/modules/HudModule.java
blob: 031995e5008dfda9f793822a1a69043311bc8769 (plain) (blame)
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
46
47
48
49
50
package ftbsc.bscv.modules;

import ftbsc.bscv.ICommons;
import ftbsc.bscv.tools.Anchor;
import ftbsc.bscv.tools.Setting;
import net.minecraftforge.common.ForgeConfigSpec;

public abstract class HudModule extends AbstractModule {

   public final ForgeConfigSpec.ConfigValue<Integer> x;
   public final ForgeConfigSpec.ConfigValue<Integer> y;
   public final ForgeConfigSpec.ConfigValue<Double>  scale;
   public final ForgeConfigSpec.ConfigValue<Anchor>  anchor;

   @Override
   public String getGroup() {
      return "HUD";
   }

   protected HudModule() {
      super();
      this.x = Setting.Number.builder()
         .name("x")
         .comment("horizontal offset")
         .fallback(0)
         .build(this);

      this.y = Setting.Number.builder()
         .name("y")
         .comment("vertical offset")
         .fallback(0)
         .build(this);

      this.scale = Setting.Decimal.builder()
         .name("scale")
         .comment("scale of element")
         .fallback(1.0)
         .build(this);

      this.anchor = Setting.Switch.builder(Anchor.class)
         .name("anchor")
         .comment("origin point for coordinates")
         .fallback(Anchor.TOPLEFT)
         .build(this);
   }

   protected boolean shouldHide() {
      return ICommons.MC.options.renderDebug;
   }
}