Upload files to "src/openonyx/features/hud/internal"
This commit is contained in:
1 parent
fe7078edb7
commit
da6b737551
1 file changed
+91
@@ -0,0 +1,91 @@
|
|||||||
|
package openonyx.features.hud.internal;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.function.IntSupplier;
|
||||||
|
import openonyx.history.Setting;
|
||||||
|
import openonyx.history.SettingSection;
|
||||||
|
import openonyx.history.SettingValue;
|
||||||
|
import openonyx.history.internal.BooleanSetting;
|
||||||
|
import openonyx.history.internal.ColorSetting;
|
||||||
|
import openonyx.history.internal.EnumSetting;
|
||||||
|
import openonyx.history.internal.NumberSetting;
|
||||||
|
import openonyx.history.internal.TextSetting;
|
||||||
|
import openonyx.render.group_e.TargetHudTextSettingsWeightMode;
|
||||||
|
|
||||||
|
public final class TargetHudTextSettings extends SettingSection {
|
||||||
|
public NumberSetting glow;
|
||||||
|
public NumberSetting offsetX;
|
||||||
|
private static final double L = 150.0;
|
||||||
|
public ColorSetting colour;
|
||||||
|
public NumberSetting offsetY;
|
||||||
|
public TextSetting text;
|
||||||
|
public NumberSetting size;
|
||||||
|
public BooleanSetting damageTrail;
|
||||||
|
private final TargetHudElement targetHudElement;
|
||||||
|
public BooleanSetting absorption;
|
||||||
|
public EnumSetting<TargetHudTextSettingsWeightMode> weight;
|
||||||
|
public NumberSetting thickness;
|
||||||
|
public EnumSetting<HealthDisplayMode> readout;
|
||||||
|
|
||||||
|
public boolean h() {
|
||||||
|
return this.isEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
public float L() {
|
||||||
|
return this.targetHudElement.D() ? 1.0F : this.size.getFloat();
|
||||||
|
}
|
||||||
|
|
||||||
|
public TargetHudTextSettings(TargetHudElement targetHudElement, boolean bl, String string, IntSupplier intSupplier) {
|
||||||
|
super(targetHudElementx.getDisplayName(), bl);
|
||||||
|
this.targetHudElement = targetHudElementx;
|
||||||
|
this.text = new TextSetting("Text", string).describe("Supports {name} {health} {max} {hearts} {distance} {status}");
|
||||||
|
L(this.text, targetHudElementx.d());
|
||||||
|
this.readout = new EnumSetting<>("Readout", HealthDisplayMode.NUMBER).describe("How {health} and {max} are written out");
|
||||||
|
L(this.readout, targetHudElementx.L());
|
||||||
|
TargetHudTextSettingsWeightMode targetHudTextSettingsWeightMode = TargetHudTextSettingsWeightMode.MEDIUM;
|
||||||
|
TargetHudTextSettingsWeightMode[] targetHudTextSettingsWeightModes = new TargetHudTextSettingsWeightMode[5];
|
||||||
|
boolean bl1 = true;
|
||||||
|
targetHudTextSettingsWeightModes[0] = TargetHudTextSettingsWeightMode.LIGHT;
|
||||||
|
targetHudTextSettingsWeightModes[1] = TargetHudTextSettingsWeightMode.REGULAR;
|
||||||
|
targetHudTextSettingsWeightModes[2] = TargetHudTextSettingsWeightMode.MEDIUM;
|
||||||
|
targetHudTextSettingsWeightModes[3] = TargetHudTextSettingsWeightMode.SEMI_BOLD;
|
||||||
|
targetHudTextSettingsWeightModes[4] = TargetHudTextSettingsWeightMode.BOLD;
|
||||||
|
this.weight = new EnumSetting<>("Weight", targetHudTextSettingsWeightMode, targetHudTextSettingsWeightModes).describe("Font weight");
|
||||||
|
L(this.weight, targetHudElementx.d());
|
||||||
|
this.size = new NumberSetting("Size", 1.0, 0.25, 3.0, 0.05).withSuffix("x");
|
||||||
|
L(this.size, !targetHudElementx.D());
|
||||||
|
this.thickness = new NumberSetting("Thickness", 3.0, 1.0, 12.0, 0.5);
|
||||||
|
L(this.thickness, targetHudElementx.D());
|
||||||
|
this.offsetX = new NumberSetting("Offset X", 0.0, -150.0, 150.0, 0.5);
|
||||||
|
this.offsetY = new NumberSetting("Offset Y", 0.0, -150.0, 150.0, 0.5);
|
||||||
|
this.colour = new ColorSetting("Colour", -1).D().linkTo(intSupplier);
|
||||||
|
this.glow = new NumberSetting("Glow", 0.0, 0.0, 12.0, 0.5).describe("Halo radius behind the element - 0 turns it off");
|
||||||
|
this.absorption = new BooleanSetting("Absorption", true).describe("Count golden hearts as an extra bar segment");
|
||||||
|
L(this.absorption, targetHudElementx.D());
|
||||||
|
this.damageTrail = new BooleanSetting("Damage trail", true).describe("Trailing bar that drains after a hit");
|
||||||
|
L(this.damageTrail, targetHudElementx.D());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void L(Setting setting, boolean bl) {
|
||||||
|
if (!bl) {
|
||||||
|
setting.visibleWhen(Setting.BOOLEAN_SUPPLIER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void i() {
|
||||||
|
TargetHudTextSettings targetHudTextSettings1 = this;
|
||||||
|
targetHudTextSettings1.getEnabled().reset();
|
||||||
|
Iterator iterator = targetHudTextSettings1.getSettings().iterator();
|
||||||
|
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
Setting setting;
|
||||||
|
if ((setting = (Setting)iterator.next()) instanceof SettingValue) {
|
||||||
|
((SettingValue)setting).reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public TargetHudElement getTargetHudElement() {
|
||||||
|
return this.targetHudElement;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user