mirror of
https://github.com/Motschen/Blur.git
synced 2025-12-13 10:25:09 +01:00
Blur 3.1.1 - 1.20.2 & New excluded screens
- Port to 1.20.2 by @TheMrEngMan & @backryun - Exclude MidnightControls' touchscreen overlay and Baritone click screen by default (closes #75) - Miscellaneous fixes
This commit is contained in:
@@ -41,7 +41,7 @@ public class Blur implements ClientModInitializer {
|
||||
|
||||
public static void onScreenChange(Screen newGui) {
|
||||
if (client.world != null) {
|
||||
boolean excluded = newGui == null || BlurConfig.blurExclusions.stream().anyMatch(exclusion -> newGui.getClass().getName().contains(exclusion));
|
||||
boolean excluded = newGui == null || BlurConfig.blurExclusions.stream().anyMatch(exclusion -> newGui.getClass().getName().startsWith(exclusion));
|
||||
if (!excluded) {
|
||||
screenHasBackground = false;
|
||||
if (BlurConfig.showScreenTitle) System.out.println(newGui.getClass().getName());
|
||||
|
||||
@@ -7,33 +7,34 @@ import net.minecraft.client.gui.screen.ChatScreen;
|
||||
import java.util.List;
|
||||
|
||||
public class BlurConfig extends MidnightConfig {
|
||||
public static final String style = "style";
|
||||
public static final String screens = "screens";
|
||||
public static final String STYLE = "style";
|
||||
public static final String SCREENS = "screens";
|
||||
|
||||
|
||||
@Entry(category = screens)
|
||||
@Entry(category = SCREENS)
|
||||
public static List<String> blurExclusions = Lists.newArrayList(ChatScreen.class.getName(),
|
||||
"com.replaymod.lib.de.johni0702.minecraft.gui.container.AbstractGuiOverlay$UserInputGuiScreen",
|
||||
"ai.arcblroth.projectInception.client.InceptionInterfaceScreen",
|
||||
"net.optifine.gui.GuiChatOF",
|
||||
"baritone.",
|
||||
"io.github.darkkronicle.advancedchatcore.chat.AdvancedChatScreen",
|
||||
"net.coderbot.iris.gui.screen.ShaderPackScreen");
|
||||
@Entry(category = style, min = 0, max = 5000, width = 4)
|
||||
"net.coderbot.iris.gui.screen.ShaderPackScreen",
|
||||
"eu.midnightdust.midnightcontrols.client.gui.TouchscreenOverlay");
|
||||
@Entry(category = STYLE, min = 0, max = 5000, width = 4)
|
||||
public static int fadeTimeMillis = 200;
|
||||
@Entry(category = style, min = 0, max = 5000, width = 4)
|
||||
@Entry(category = STYLE, min = 0, max = 5000, width = 4)
|
||||
public static int fadeOutTimeMillis = 200;
|
||||
@Entry(category = style)
|
||||
@Entry(category = STYLE)
|
||||
public static boolean ease = true;
|
||||
@Entry(category = style, isSlider = true, min = 0, max = 100)
|
||||
@Entry(category = STYLE, isSlider = true, min = 0, max = 100)
|
||||
public static int radius = 8;
|
||||
@Entry(category = style, isColor = true, width = 7, min = 7)
|
||||
@Entry(category = STYLE, isColor = true, width = 7, min = 7)
|
||||
public static String gradientStart = "#000000";
|
||||
@Entry(category = style, isSlider = true, min = 0, max = 255)
|
||||
@Entry(category = STYLE, isSlider = true, min = 0, max = 255)
|
||||
public static int gradientStartAlpha = 75;
|
||||
@Entry(category = style, isColor = true, width = 7, min = 7)
|
||||
@Entry(category = STYLE, isColor = true, width = 7, min = 7)
|
||||
public static String gradientEnd = "#000000";
|
||||
@Entry(category = style, isSlider = true, min = 0, max = 255)
|
||||
@Entry(category = STYLE, isSlider = true, min = 0, max = 255)
|
||||
public static int gradientEndAlpha = 75;
|
||||
@Entry(category = screens)
|
||||
@Entry(category = SCREENS)
|
||||
public static boolean showScreenTitle = false;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.tterrag.blur.mixin;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.tterrag.blur.Blur;
|
||||
import com.tterrag.blur.config.BlurConfig;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
@@ -20,7 +19,7 @@ public class MixinInGameHud {
|
||||
@Final @Shadow private MinecraftClient client;
|
||||
@Inject(at = @At("TAIL"), method = "render")
|
||||
public void blur$onRender(DrawContext context, float tickDelta, CallbackInfo ci) {
|
||||
if (client.currentScreen == null && client.world != null && Blur.start > 0 && !BlurConfig.blurExclusions.contains(Blur.prevScreen) && Blur.screenHasBackground) {
|
||||
if (client.currentScreen == null && client.world != null && Blur.start > 0 && BlurConfig.blurExclusions.stream().noneMatch(exclusion -> Blur.prevScreen.startsWith(exclusion)) && Blur.screenHasBackground) {
|
||||
context.fillGradient(0, 0, this.scaledWidth, this.scaledHeight, Blur.getBackgroundColor(false, false), Blur.getBackgroundColor(true, false));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user