|
|
|
|
@@ -1,5 +1,6 @@
|
|
|
|
|
package eu.midnightdust.customsplashscreen.mixin;
|
|
|
|
|
|
|
|
|
|
import com.mojang.blaze3d.platform.GlStateManager;
|
|
|
|
|
import com.mojang.blaze3d.systems.RenderSystem;
|
|
|
|
|
import eu.midnightdust.customsplashscreen.CustomSplashScreenClient;
|
|
|
|
|
import eu.midnightdust.customsplashscreen.config.CustomSplashScreenConfig;
|
|
|
|
|
@@ -8,9 +9,10 @@ import eu.midnightdust.customsplashscreen.texture.ConfigTexture;
|
|
|
|
|
import eu.midnightdust.customsplashscreen.texture.EmptyTexture;
|
|
|
|
|
import net.minecraft.client.MinecraftClient;
|
|
|
|
|
import net.minecraft.client.gui.hud.BackgroundHelper;
|
|
|
|
|
import net.minecraft.client.gui.screen.SplashScreen;
|
|
|
|
|
import net.minecraft.client.gui.screen.SplashOverlay;
|
|
|
|
|
import net.minecraft.client.render.GameRenderer;
|
|
|
|
|
import net.minecraft.client.util.math.MatrixStack;
|
|
|
|
|
import net.minecraft.resource.ResourceReloadMonitor;
|
|
|
|
|
import net.minecraft.resource.ResourceReload;
|
|
|
|
|
import net.minecraft.util.Identifier;
|
|
|
|
|
import net.minecraft.util.Util;
|
|
|
|
|
import net.minecraft.util.math.MathHelper;
|
|
|
|
|
@@ -19,25 +21,28 @@ import org.spongepowered.asm.mixin.Mixin;
|
|
|
|
|
import org.spongepowered.asm.mixin.Shadow;
|
|
|
|
|
import org.spongepowered.asm.mixin.injection.At;
|
|
|
|
|
import org.spongepowered.asm.mixin.injection.Inject;
|
|
|
|
|
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
|
|
|
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
|
|
|
|
|
|
|
|
import static net.minecraft.client.gui.DrawableHelper.drawTexture;
|
|
|
|
|
import java.util.Optional;
|
|
|
|
|
import java.util.function.Consumer;
|
|
|
|
|
|
|
|
|
|
@Mixin(SplashScreen.class)
|
|
|
|
|
import static net.minecraft.client.gui.DrawableHelper.drawTexture;
|
|
|
|
|
import static net.minecraft.client.gui.DrawableHelper.fill;
|
|
|
|
|
|
|
|
|
|
@Mixin(SplashOverlay.class)
|
|
|
|
|
public class SplashScreenMixin {
|
|
|
|
|
|
|
|
|
|
@Shadow @Final private static Identifier LOGO;
|
|
|
|
|
@Shadow @Final static Identifier LOGO;
|
|
|
|
|
@Shadow @Final private MinecraftClient client;
|
|
|
|
|
@Shadow @Final private boolean reloading;
|
|
|
|
|
@Shadow private long applyCompleteTime;
|
|
|
|
|
@Shadow @Final private ResourceReloadMonitor reloadMonitor;
|
|
|
|
|
@Shadow private long prepareCompleteTime;
|
|
|
|
|
@Shadow @Final private ResourceReload reload;
|
|
|
|
|
@Shadow private float progress;
|
|
|
|
|
@Shadow private long reloadCompleteTime;
|
|
|
|
|
@Shadow private long reloadStartTime;
|
|
|
|
|
@Shadow @Final private Consumer<Optional<Throwable>> exceptionHandler;
|
|
|
|
|
|
|
|
|
|
private static final CustomSplashScreenConfig CS_CONFIG = CustomSplashScreenClient.CS_CONFIG;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final Identifier EMPTY_TEXTURE = new Identifier("empty.png");
|
|
|
|
|
private static final Identifier MOJANG_TEXTURE = new Identifier(CS_CONFIG.textures.MojangLogo);
|
|
|
|
|
private static final Identifier ASPECT_1to1_TEXTURE = new Identifier(CS_CONFIG.textures.Aspect1to1Logo);
|
|
|
|
|
@@ -63,113 +68,134 @@ public class SplashScreenMixin {
|
|
|
|
|
ci.cancel();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/texture/TextureManager;bindTexture(Lnet/minecraft/util/Identifier;)V",shift = At.Shift.BEFORE), method = "render")
|
|
|
|
|
private void renderBackground(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) { // Render our background image //
|
|
|
|
|
@Inject(at = @At("TAIL"), method = "render", cancellable = false)
|
|
|
|
|
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
|
|
|
|
int i = this.client.getWindow().getScaledWidth();
|
|
|
|
|
int j = this.client.getWindow().getScaledHeight();
|
|
|
|
|
long l = Util.getMeasuringTimeMs();
|
|
|
|
|
if (this.reloading && (this.reloadMonitor.isPrepareStageComplete() || this.client.currentScreen != null) && this.prepareCompleteTime == -1L) {
|
|
|
|
|
this.prepareCompleteTime = l;
|
|
|
|
|
if (this.reloading && this.reloadStartTime == -1L) {
|
|
|
|
|
this.reloadStartTime = l;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float f = this.applyCompleteTime > -1L ? (float)(l - this.applyCompleteTime) / 1000.0F : -1.0F;
|
|
|
|
|
float g = this.prepareCompleteTime > -1L ? (float)(l - this.prepareCompleteTime) / 500.0F : -1.0F;
|
|
|
|
|
float o;
|
|
|
|
|
if (f >= 1.0F) {
|
|
|
|
|
o = 1.0F - MathHelper.clamp(f - 1.0F, 0.0F, 1.0F);
|
|
|
|
|
} else if (this.reloading) {
|
|
|
|
|
o = MathHelper.clamp(g, 0.0F, 1.0F);
|
|
|
|
|
} else {
|
|
|
|
|
o = 1.0F;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int maxX = this.client.getWindow().getScaledWidth();
|
|
|
|
|
int maxY = this.client.getWindow().getScaledHeight();
|
|
|
|
|
|
|
|
|
|
if (CS_CONFIG.backgroundImage) {
|
|
|
|
|
client.getTextureManager().bindTexture(BACKGROUND_TEXTURE);
|
|
|
|
|
RenderSystem.enableBlend();
|
|
|
|
|
RenderSystem.alphaFunc(516, 0.0F);
|
|
|
|
|
RenderSystem.color4f(1.0F, 1.0F, 1.0F, o);
|
|
|
|
|
drawTexture(matrices, 0, 0, 0, 0, 0, maxX, maxY, maxY, maxX);
|
|
|
|
|
RenderSystem.defaultBlendFunc();
|
|
|
|
|
RenderSystem.defaultAlphaFunc();
|
|
|
|
|
RenderSystem.disableBlend();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Inject(at = @At("TAIL"), method = "render")
|
|
|
|
|
private void renderLogo(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) { // Render our 1 to 1 logo //
|
|
|
|
|
long l = Util.getMeasuringTimeMs();
|
|
|
|
|
if (this.reloading && (this.reloadMonitor.isPrepareStageComplete() || this.client.currentScreen != null) && this.prepareCompleteTime == -1L) {
|
|
|
|
|
this.prepareCompleteTime = l;
|
|
|
|
|
}
|
|
|
|
|
float f = this.applyCompleteTime > -1L ? (float)(l - this.applyCompleteTime) / 1000.0F : -1.0F;
|
|
|
|
|
float g = this.prepareCompleteTime > -1L ? (float)(l - this.prepareCompleteTime) / 500.0F : -1.0F;
|
|
|
|
|
float o;
|
|
|
|
|
float f = this.reloadCompleteTime > -1L ? (float)(l - this.reloadCompleteTime) / 1000.0F : -1.0F;
|
|
|
|
|
float g = this.reloadStartTime > -1L ? (float)(l - this.reloadStartTime) / 500.0F : -1.0F;
|
|
|
|
|
float s;
|
|
|
|
|
int m;
|
|
|
|
|
|
|
|
|
|
// Render our custom color
|
|
|
|
|
if (f >= 1.0F) {
|
|
|
|
|
o = 1.0F - MathHelper.clamp(f - 1.0F, 0.0F, 1.0F);
|
|
|
|
|
if (this.client.currentScreen != null) {
|
|
|
|
|
this.client.currentScreen.render(matrices, 0, 0, delta);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m = MathHelper.ceil((1.0F - MathHelper.clamp(f - 1.0F, 0.0F, 1.0F)) * 255.0F);
|
|
|
|
|
fill(matrices, 0, 0, i, j, withAlpha(m));
|
|
|
|
|
s = 1.0F - MathHelper.clamp(f - 1.0F, 0.0F, 1.0F);
|
|
|
|
|
} else if (this.reloading) {
|
|
|
|
|
o = MathHelper.clamp(g, 0.0F, 1.0F);
|
|
|
|
|
if (this.client.currentScreen != null && g < 1.0F) {
|
|
|
|
|
this.client.currentScreen.render(matrices, mouseX, mouseY, delta);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m = MathHelper.ceil(MathHelper.clamp((double)g, 0.15D, 1.0D) * 255.0D);
|
|
|
|
|
fill(matrices, 0, 0, i, j, withAlpha(m));
|
|
|
|
|
s = MathHelper.clamp(g, 0.0F, 1.0F);
|
|
|
|
|
} else {
|
|
|
|
|
o = 1.0F;
|
|
|
|
|
m = getBackgroundColor();
|
|
|
|
|
float p = (float)(m >> 16 & 255) / 255.0F;
|
|
|
|
|
float q = (float)(m >> 8 & 255) / 255.0F;
|
|
|
|
|
float r = (float)(m & 255) / 255.0F;
|
|
|
|
|
GlStateManager._clearColor(p, q, r, 1.0F);
|
|
|
|
|
GlStateManager._clear(16384, MinecraftClient.IS_SYSTEM_MAC);
|
|
|
|
|
s = 1.0F;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m = (int)((double)this.client.getWindow().getScaledWidth() * 0.5D);
|
|
|
|
|
|
|
|
|
|
if (CustomSplashScreenClient.CS_CONFIG.logoStyle == CustomSplashScreenConfig.LogoStyle.Aspect1to1) {
|
|
|
|
|
double d = Math.min((double)this.client.getWindow().getScaledWidth() * 0.75D, this.client.getWindow().getScaledHeight()) * 0.25D;
|
|
|
|
|
int r = (int)(d * 0.5D);
|
|
|
|
|
int u = (int)((double)this.client.getWindow().getScaledHeight() * 0.5D);
|
|
|
|
|
double d = Math.min((double)this.client.getWindow().getScaledWidth() * 0.75D, (double)this.client.getWindow().getScaledHeight()) * 0.25D;
|
|
|
|
|
int v = (int)(d * 0.5D);
|
|
|
|
|
double e = d * 4.0D;
|
|
|
|
|
int s = (int)(e * 0.5D);
|
|
|
|
|
client.getTextureManager().bindTexture(ASPECT_1to1_TEXTURE);
|
|
|
|
|
int w = (int)(e * 0.5D);
|
|
|
|
|
|
|
|
|
|
// Render our custom background image
|
|
|
|
|
if (CS_CONFIG.backgroundImage) {
|
|
|
|
|
RenderSystem.setShaderTexture(0, BACKGROUND_TEXTURE);
|
|
|
|
|
RenderSystem.enableBlend();
|
|
|
|
|
RenderSystem.alphaFunc(516, 0.0F);
|
|
|
|
|
RenderSystem.color4f(1.0F, 1.0F, 1.0F, o);
|
|
|
|
|
drawTexture(matrices, m - (s / 2), r, s, s, 0, 0, 512, 512, 512, 512);
|
|
|
|
|
RenderSystem.blendEquation(32774);
|
|
|
|
|
RenderSystem.blendFunc(770, 1);
|
|
|
|
|
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
|
|
|
|
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, s);
|
|
|
|
|
drawTexture(matrices, 0, 0, 0, 0, 0, i, j, j, i);
|
|
|
|
|
RenderSystem.defaultBlendFunc();
|
|
|
|
|
RenderSystem.defaultAlphaFunc();
|
|
|
|
|
RenderSystem.disableBlend();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Render the Logo
|
|
|
|
|
RenderSystem.setShaderTexture(0, CustomSplashScreenClient.CS_CONFIG.logoStyle == CustomSplashScreenConfig.LogoStyle.Aspect1to1 ? ASPECT_1to1_TEXTURE : LOGO);
|
|
|
|
|
RenderSystem.enableBlend();
|
|
|
|
|
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
|
|
|
|
|
|
|
|
|
if (CustomSplashScreenClient.CS_CONFIG.logoStyle == CustomSplashScreenConfig.LogoStyle.Aspect1to1) {
|
|
|
|
|
RenderSystem.blendFunc(GlStateManager.SrcFactor.SRC_ALPHA, GlStateManager.DstFactor.ONE_MINUS_SRC_ALPHA);
|
|
|
|
|
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, s);
|
|
|
|
|
drawTexture(matrices, m - (w / 2), v, w, w, 0, 0, 512, 512, 512, 512);
|
|
|
|
|
} else if (CustomSplashScreenClient.CS_CONFIG.logoStyle == CustomSplashScreenConfig.LogoStyle.Mojang) {
|
|
|
|
|
RenderSystem.blendFunc(770, 1);
|
|
|
|
|
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, s);
|
|
|
|
|
drawTexture(matrices, m - w, u - v, w, (int)d, -0.0625F, 0.0F, 120, 60, 120, 120);
|
|
|
|
|
drawTexture(matrices, m, u - v, w, (int)d, 0.0625F, 60.0F, 120, 60, 120, 120);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ModifyArg(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/SplashScreen;fill(Lnet/minecraft/client/util/math/MatrixStack;IIIII)V"), index = 5)
|
|
|
|
|
private int modifyBackgroundColor(int color) { // Set the Background Color to our configured value //
|
|
|
|
|
long l = Util.getMeasuringTimeMs();
|
|
|
|
|
if (this.reloading && (this.reloadMonitor.isPrepareStageComplete() || this.client.currentScreen != null) && this.prepareCompleteTime == -1L) {
|
|
|
|
|
this.prepareCompleteTime = l;
|
|
|
|
|
}
|
|
|
|
|
float f = this.applyCompleteTime > -1L ? (float)(l - this.applyCompleteTime) / 1000.0F : -1.0F;
|
|
|
|
|
int m;
|
|
|
|
|
m = MathHelper.ceil((1.0F - MathHelper.clamp(f - 1.0F, 0.0F, 1.0F)) * 255.0F);
|
|
|
|
|
RenderSystem.defaultBlendFunc();
|
|
|
|
|
RenderSystem.disableBlend();
|
|
|
|
|
|
|
|
|
|
int x = (int)((double)this.client.getWindow().getScaledHeight() * 0.8325D);
|
|
|
|
|
float y = this.reload.getProgress();
|
|
|
|
|
this.progress = MathHelper.clamp(this.progress * 0.95F + y * 0.050000012F, 0.0F, 1.0F);
|
|
|
|
|
if (f < 1.0F) {
|
|
|
|
|
this.renderProgressBar(matrices, i / 2 - w, x - 5, i / 2 + w, x + 5, 1.0F - MathHelper.clamp(f, 0.0F, 1.0F), null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (f >= 2.0F) {
|
|
|
|
|
this.client.setOverlay(null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.reloadCompleteTime == -1L && this.reload.isComplete() && (!this.reloading || g >= 2.0F)) {
|
|
|
|
|
try {
|
|
|
|
|
this.reload.throwException();
|
|
|
|
|
this.exceptionHandler.accept(Optional.empty());
|
|
|
|
|
} catch (Throwable var23) {
|
|
|
|
|
this.exceptionHandler.accept(Optional.of(var23));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.reloadCompleteTime = Util.getMeasuringTimeMs();
|
|
|
|
|
if (this.client.currentScreen != null) {
|
|
|
|
|
this.client.currentScreen.init(this.client, this.client.getWindow().getScaledWidth(), this.client.getWindow().getScaledHeight());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static int getBackgroundColor() {
|
|
|
|
|
if (CS_CONFIG.backgroundImage) {
|
|
|
|
|
return BackgroundHelper.ColorMixer.getArgb(0, 0, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
return CustomSplashScreenClient.CS_CONFIG.backgroundColor | m << 24;
|
|
|
|
|
return CustomSplashScreenClient.CS_CONFIG.backgroundColor;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ModifyArg(method = "renderProgressBar", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/SplashScreen;fill(Lnet/minecraft/client/util/math/MatrixStack;IIIII)V"), index = 5)
|
|
|
|
|
private int modifyProgressFrame(int color) { // Set the Progress Bar Frame Color to our configured value //
|
|
|
|
|
if (CustomSplashScreenClient.CS_CONFIG.progressBarType == CustomSplashScreenConfig.ProgressBarType.BossBar || CS_CONFIG.progressBarType == CustomSplashScreenConfig.ProgressBarType.Hidden) {
|
|
|
|
|
return BackgroundHelper.ColorMixer.getArgb(0, 0, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
else return CustomSplashScreenClient.CS_CONFIG.progressFrameColor | 255 << 24;
|
|
|
|
|
}
|
|
|
|
|
@ModifyArg(method = "renderProgressBar", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/SplashScreen;fill(Lnet/minecraft/client/util/math/MatrixStack;IIIII)V", ordinal = 4), index = 5)
|
|
|
|
|
private int modifyProgressColor(int color) { // Set the Progress Bar Color to our configured value //
|
|
|
|
|
if (CustomSplashScreenClient.CS_CONFIG.progressBarType == CustomSplashScreenConfig.ProgressBarType.BossBar || CS_CONFIG.progressBarType == CustomSplashScreenConfig.ProgressBarType.Hidden || CS_CONFIG.progressBarType == CustomSplashScreenConfig.ProgressBarType.Custom) {
|
|
|
|
|
return BackgroundHelper.ColorMixer.getArgb(0, 0, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
else return CustomSplashScreenClient.CS_CONFIG.progressBarColor | 255 << 24;
|
|
|
|
|
private static int withAlpha(int alpha) {
|
|
|
|
|
return getBackgroundColor() | alpha << 24;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Inject(at = @At("TAIL"), method = "renderProgressBar", cancellable = true)
|
|
|
|
|
private void renderCSProgressBar(MatrixStack matrices, int x1, int y1, int x2, int y2, float opacity, CallbackInfo ci) { // Render our custom Progress Bar //
|
|
|
|
|
@Inject(at = @At("TAIL"), method = "renderProgressBar", cancellable = false)
|
|
|
|
|
private void renderProgressBar(MatrixStack matrices, int x1, int y1, int x2, int y2, float opacity, CallbackInfo ci) {
|
|
|
|
|
int i = MathHelper.ceil((float)(x2 - x1 - 2) * this.progress);
|
|
|
|
|
if (CustomSplashScreenClient.CS_CONFIG.progressBarType == CustomSplashScreenConfig.ProgressBarType.BossBar) { // Bossbar Style Progress Bar //
|
|
|
|
|
client.getTextureManager().bindTexture(BOSS_BAR_TEXTURE);
|
|
|
|
|
|
|
|
|
|
// Bossbar Progress Bar
|
|
|
|
|
if (CustomSplashScreenClient.CS_CONFIG.progressBarType == CustomSplashScreenConfig.ProgressBarType.BossBar) {
|
|
|
|
|
RenderSystem.setShaderTexture(0, BOSS_BAR_TEXTURE);
|
|
|
|
|
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
|
|
|
|
|
|
|
|
|
int overlay = 0;
|
|
|
|
|
|
|
|
|
|
if (CustomSplashScreenClient.CS_CONFIG.bossBarType == CustomSplashScreenConfig.BossBarType.NOTCHED_6) {overlay = 93;}
|
|
|
|
|
@@ -182,24 +208,41 @@ public class SplashScreenMixin {
|
|
|
|
|
drawTexture(matrices, x1, y1 + 1, 0, 0, 0, x2 - x1, (int) ((y2-y1) / 1.4f), bbHeight, bbWidth);
|
|
|
|
|
drawTexture(matrices, x1, y1 + 1, 0, 0, 5f, i, (int) ((y2 - y1) / 1.4f), bbHeight, bbWidth);
|
|
|
|
|
|
|
|
|
|
RenderSystem.alphaFunc(516, 0.0F);
|
|
|
|
|
RenderSystem.enableBlend();
|
|
|
|
|
RenderSystem.blendEquation(32774);
|
|
|
|
|
RenderSystem.blendFunc(770, 1);
|
|
|
|
|
if (overlay != 0) {
|
|
|
|
|
drawTexture(matrices, x1, y1 + 1, 0, 0, overlay, x2 - x1, (int) ((y2 - y1) / 1.4f), bbHeight, bbWidth);
|
|
|
|
|
}
|
|
|
|
|
RenderSystem.defaultBlendFunc();
|
|
|
|
|
RenderSystem.defaultAlphaFunc();
|
|
|
|
|
RenderSystem.disableBlend();
|
|
|
|
|
}
|
|
|
|
|
if (CustomSplashScreenClient.CS_CONFIG.progressBarType == CustomSplashScreenConfig.ProgressBarType.Custom) { // Custom Progress Bar //
|
|
|
|
|
|
|
|
|
|
// Custom Progress Bar
|
|
|
|
|
if (CustomSplashScreenClient.CS_CONFIG.progressBarType == CustomSplashScreenConfig.ProgressBarType.Custom) {
|
|
|
|
|
int customWidth = CustomSplashScreenClient.CS_CONFIG.customProgressBarMode == CustomSplashScreenConfig.ProgressBarMode.Linear ? x2 - x1 : i;
|
|
|
|
|
if (CS_CONFIG.customProgressBarBackground) {
|
|
|
|
|
client.getTextureManager().bindTexture(CUSTOM_PROGRESS_BAR_BACKGROUND_TEXTURE);
|
|
|
|
|
RenderSystem.setShaderTexture(0, CUSTOM_PROGRESS_BAR_BACKGROUND_TEXTURE);
|
|
|
|
|
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
|
|
|
|
drawTexture(matrices, x1, y1, 0, 0, 6, x2 - x1, y2 - y1, 10, x2-x1);
|
|
|
|
|
}
|
|
|
|
|
client.getTextureManager().bindTexture(CUSTOM_PROGRESS_BAR_TEXTURE);
|
|
|
|
|
RenderSystem.setShaderTexture(0, CUSTOM_PROGRESS_BAR_TEXTURE);
|
|
|
|
|
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
|
|
|
|
drawTexture(matrices, x1, y1, 0, 0, 6, i, y2 - y1, 10, customWidth);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Vanilla / With Color progress bar
|
|
|
|
|
if (CustomSplashScreenClient.CS_CONFIG.progressBarType == CustomSplashScreenConfig.ProgressBarType.Vanilla) {
|
|
|
|
|
int j = Math.round(opacity * 255.0F);
|
|
|
|
|
int k = CustomSplashScreenClient.CS_CONFIG.progressBarColor | 255 << 24;
|
|
|
|
|
int kk = CustomSplashScreenClient.CS_CONFIG.progressFrameColor | 255 << 24;
|
|
|
|
|
fill(matrices, x1 + 2, y1 + 2, x1 + i, y2 - 2, k);
|
|
|
|
|
fill(matrices, x1 + 1, y1, x2 - 1, y1 + 1, kk);
|
|
|
|
|
fill(matrices, x1 + 1, y2, x2 - 1, y2 - 1, kk);
|
|
|
|
|
fill(matrices, x1, y1, x1 + 1, y2, kk);
|
|
|
|
|
fill(matrices, x2, y1, x2 - 1, y2, kk);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|