aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dulkirmod/mixins/MixinGuiUtils.java
blob: 52a6d9b736a30532f67aeab12fea9d3463522871 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package dulkirmod.mixins;

import dulkirmod.features.ScalableTooltips;
import net.minecraft.client.gui.FontRenderer;
import net.minecraftforge.fml.client.config.GuiUtils;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.List;

@Mixin(value = {GuiUtils.class}, remap = false)
public class MixinGuiUtils {

    @Inject(method = "drawHoveringText", at = @At("HEAD"), cancellable = true)
    private static void drawScaledHoveringText(List<String> textLines, int mouseX, int mouseY, int screenWidth, int screenHeight, int maxTextWidth, FontRenderer font, CallbackInfo ci) {
        if (ScalableTooltips.INSTANCE.drawScaledHoveringText(textLines, mouseX, mouseY, screenWidth, screenHeight, font))
            ci.cancel();
    }
}