Upload files to "src/openonyx/features/hud"
This commit is contained in:
1 parent
694c0e984c
commit
46224f522f
5 files changed
+242
No files matched your search
@@ -0,0 +1,4 @@
|
||||
package openonyx.features.hud;
|
||||
|
||||
record WatermarkData3(String name, boolean positive) {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package openonyx.features.hud;
|
||||
|
||||
record WatermarkData4(String label, String value, float fill, float level, boolean alert) {
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package openonyx.features.hud;
|
||||
|
||||
enum WatermarkMode {
|
||||
IDLE,
|
||||
MUSIC,
|
||||
GAUGE,
|
||||
TOGGLE;
|
||||
|
||||
private static WatermarkMode[] L() {
|
||||
WatermarkMode[] watermarkModes = new WatermarkMode[4];
|
||||
boolean bl = true;
|
||||
watermarkModes[0] = IDLE;
|
||||
watermarkModes[1] = TOGGLE;
|
||||
watermarkModes[2] = GAUGE;
|
||||
watermarkModes[3] = MUSIC;
|
||||
return watermarkModes;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
package openonyx.features.hud;
|
||||
|
||||
import openonyx.render.Render2D;
|
||||
import openonyx.render.RenderSupport_120;
|
||||
import openonyx.render.group_d.Animation;
|
||||
import openonyx.render.group_d.Easings;
|
||||
import openonyx.render.group_e.FontStyle;
|
||||
import openonyx.theme.AlphaLevels;
|
||||
import openonyx.theme.Fonts;
|
||||
import openonyx.theme.Palette;
|
||||
import openonyx.ui.MaterialIcons;
|
||||
import openonyx.ui.UiSupport_545;
|
||||
|
||||
final class WatermarkPanel {
|
||||
private final UiSupport_545[] uiSupport_545s;
|
||||
private float J;
|
||||
private static final float D = 6.0F;
|
||||
private static final float c = 12.0F;
|
||||
private static final float a = 22.0F;
|
||||
private boolean k;
|
||||
private final Watermark watermark;
|
||||
private float M;
|
||||
private static final float L = 13.0F;
|
||||
private float j;
|
||||
private static final float m = 8.0F;
|
||||
private static final float h = 8.0F;
|
||||
private static final float l = 6.0F;
|
||||
private final Animation animation;
|
||||
private static final int d = 3;
|
||||
private static final float i = 1.0F;
|
||||
private static final float f = 3.0F;
|
||||
private float H;
|
||||
private static final StatsMode[] STATS_MODES = StatsMode.values();
|
||||
|
||||
WatermarkPanel(Watermark watermark) {
|
||||
UiSupport_545[] uiSupport_545s1 = new UiSupport_545[STATS_MODES.length];
|
||||
boolean bl = true;
|
||||
this.uiSupport_545s = uiSupport_545s1;
|
||||
int kx = 0;
|
||||
this.animation = new Animation(0.0F);
|
||||
this.watermark = watermarkx;
|
||||
|
||||
for (int ix = 0; kx < this.uiSupport_545s.length; kx = ix) {
|
||||
UiSupport_545[] uiSupport_545sx = this.uiSupport_545s;
|
||||
int jx = ix;
|
||||
UiSupport_545 uiSupport_545 = new UiSupport_545();
|
||||
ix++;
|
||||
uiSupport_545sx[jx] = uiSupport_545;
|
||||
}
|
||||
}
|
||||
|
||||
boolean d() {
|
||||
return this.k;
|
||||
}
|
||||
|
||||
void L(Render2D render2D, float f, float g, float h, float i) {
|
||||
this.k = true;
|
||||
this.j = L(render2D);
|
||||
this.H = 6.0F + 22.0F * STATS_MODES.length;
|
||||
this.M = Math.clamp(fx, 6.0F, Math.max(6.0F, hx - this.j - 6.0F));
|
||||
this.J = Math.clamp(g, 6.0F, Math.max(6.0F, ix - this.H - 6.0F));
|
||||
this.animation.animateTo(1.0F, 200.0F, Easings.EASING7);
|
||||
}
|
||||
|
||||
private static float L(Render2D render2D) {
|
||||
Render2D render2D1 = render2D;
|
||||
float fx = 0.0F;
|
||||
StatsMode[] statsModes = STATS_MODES;
|
||||
int jx = STATS_MODES.length;
|
||||
|
||||
int ix;
|
||||
for (int kx = ix = 0; kx < jx; kx = ix) {
|
||||
StatsMode statsMode = statsModes[ix];
|
||||
FontStyle fontStyle = Fonts.FONT_STYLE16;
|
||||
String string = statsMode.getDisplayName();
|
||||
ix++;
|
||||
fx = Math.max(fx, render2D1.getTextWidth(fontStyle, string));
|
||||
}
|
||||
|
||||
return 57.0F + fx;
|
||||
}
|
||||
|
||||
void L(float f, float g, float h) {
|
||||
WatermarkPanel watermarkPanel1 = this;
|
||||
int jx = 0;
|
||||
watermarkPanel1.animation.update(fx);
|
||||
|
||||
for (int ix = 0; jx < watermarkPanel1.uiSupport_545s.length; jx = ix) {
|
||||
boolean bl = watermarkPanel1.k && watermarkPanel1.L(ix, g, hx);
|
||||
UiSupport_545 uiSupport_545 = watermarkPanel1.uiSupport_545s[ix];
|
||||
ix++;
|
||||
uiSupport_545.L(fx, bl, false);
|
||||
}
|
||||
}
|
||||
|
||||
void L(Render2D render2D, Palette palette) {
|
||||
WatermarkPanel watermarkPanel1 = this;
|
||||
float fx;
|
||||
if (!((fx = watermarkPanel1.animation.getValue()) <= 0.01F)) {
|
||||
RenderSupport_120.L();
|
||||
int ix = AlphaLevels.L(3, palette);
|
||||
float jx = (1.0F - fx) * 6.0F;
|
||||
int q = 0;
|
||||
render2D.pushAlpha(fx);
|
||||
render2D.pushMatrix();
|
||||
render2D.translate(0.0F, jx);
|
||||
render2D.shadow(watermarkPanel1.M, watermarkPanel1.J, watermarkPanel1.j, watermarkPanel1.H, 12.0F, 3);
|
||||
RenderSupport_120.L(render2D, watermarkPanel1.M, watermarkPanel1.J, watermarkPanel1.j, watermarkPanel1.H, 12.0F, ix);
|
||||
|
||||
for (int o = 0; q < STATS_MODES.length; q = o) {
|
||||
StatsMode statsMode = STATS_MODES[o];
|
||||
float kx;
|
||||
float g = (kx = watermarkPanel1.J + 3.0F + o * 22.0F) + 11.0F;
|
||||
boolean bl = watermarkPanel1.watermark.stats.contains(statsMode);
|
||||
watermarkPanel1.uiSupport_545s[o].L(render2D, watermarkPanel1.M + 2.0F, kx, watermarkPanel1.j - 4.0F, 22.0F, 8.0F, palette.onSurface());
|
||||
float lx = watermarkPanel1.M + 8.0F;
|
||||
float hx = g - 6.0F;
|
||||
float p;
|
||||
if (bl) {
|
||||
render2D.roundedRect(lx, hx, 12.0F, 12.0F, 4.0F, palette.primary());
|
||||
p = lx;
|
||||
MaterialIcons.d(render2D, lx + 6.0F, hx + 6.0F, 9.6F, palette.onPrimary());
|
||||
} else {
|
||||
render2D.roundedOutline(lx, hx, 12.0F, 12.0F, 4.0F, 1.5F, palette.onSurfaceVariant());
|
||||
p = lx;
|
||||
}
|
||||
|
||||
float mx;
|
||||
float r = mx = p + 12.0F + 8.0F;
|
||||
MaterialIcons.L(render2D, statsMode, mx + 6.5F, g, 13.0F, palette.onSurfaceVariant());
|
||||
float n = r + 13.0F + 8.0F;
|
||||
FontStyle fontStyle = Fonts.FONT_STYLE16;
|
||||
String string = statsMode.getDisplayName();
|
||||
o++;
|
||||
render2D.drawTextVCentered(fontStyle, string, n, g, palette.onSurface());
|
||||
}
|
||||
|
||||
render2D.roundedOutline(watermarkPanel1.M, watermarkPanel1.J, watermarkPanel1.j, watermarkPanel1.H, 12.0F, 1.0F, palette.outlineVariant());
|
||||
render2D.popMatrix();
|
||||
render2D.popAlpha();
|
||||
}
|
||||
}
|
||||
|
||||
boolean L() {
|
||||
return this.k || this.animation.getValue() > 0.001F || !this.animation.isFinished();
|
||||
}
|
||||
|
||||
private boolean L(int i, float f, float g) {
|
||||
float hx = this.J + 3.0F + ix * 22.0F;
|
||||
return fx >= this.M && fx < this.M + this.j && g >= hx && g < hx + 22.0F;
|
||||
}
|
||||
|
||||
void L() {
|
||||
if (this.k) {
|
||||
this.k = false;
|
||||
this.animation.animateTo(0.0F, 100.0F, Easings.EASING);
|
||||
}
|
||||
}
|
||||
|
||||
boolean L(float f, float g) {
|
||||
WatermarkPanel watermarkPanel1 = this;
|
||||
if (!watermarkPanel1.k) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(fx < watermarkPanel1.M)
|
||||
&& !(fx >= watermarkPanel1.M + watermarkPanel1.j)
|
||||
&& !(g < watermarkPanel1.J)
|
||||
&& !(g >= watermarkPanel1.J + watermarkPanel1.H)) {
|
||||
for (int jx = ix = 0; jx < STATS_MODES.length; jx = ++ix) {
|
||||
if (watermarkPanel1.L(ix, fx, g)) {
|
||||
watermarkPanel1.watermark.stats.toggle(STATS_MODES[ix]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package openonyx.features.hud;
|
||||
|
||||
import openonyx.history.DisplayNamed;
|
||||
import openonyx.render.group_e.TargetHudTextSettingsWeightMode;
|
||||
|
||||
public enum WeightMode implements DisplayNamed {
|
||||
REGULAR("Regular", TargetHudTextSettingsWeightMode.REGULAR),
|
||||
MEDIUM("Medium", TargetHudTextSettingsWeightMode.MEDIUM);
|
||||
|
||||
private final String i;
|
||||
private final TargetHudTextSettingsWeightMode targetHudTextSettingsWeightMode;
|
||||
|
||||
private static WeightMode[] L() {
|
||||
WeightMode[] weightModes = new WeightMode[2];
|
||||
boolean bl = true;
|
||||
weightModes[0] = REGULAR;
|
||||
weightModes[1] = MEDIUM;
|
||||
return weightModes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return this.i;
|
||||
}
|
||||
|
||||
WeightMode(String string1, TargetHudTextSettingsWeightMode targetHudTextSettingsWeightMode) {
|
||||
this.i = string1;
|
||||
this.targetHudTextSettingsWeightMode = targetHudTextSettingsWeightModex;
|
||||
}
|
||||
|
||||
public TargetHudTextSettingsWeightMode getTargetHudTextSettingsWeightMode() {
|
||||
return this.targetHudTextSettingsWeightMode;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user