Search in sources :

Example 1 with GameMenuScreen

use of net.minecraft.client.gui.screen.GameMenuScreen in project SpeedRunIGT by RedLime.

the class MinecraftClientMixin method drawTimer.

@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/toast/ToastManager;draw(Lnet/minecraft/client/util/math/MatrixStack;)V", shift = At.Shift.AFTER))
private void drawTimer(CallbackInfo ci) {
    this.profiler.swap("timer");
    InGameTimer timer = InGameTimer.getInstance();
    if (InGameTimerUtils.canUnpauseTimer(true)) {
        if (!(SpeedRunOption.getOption(SpeedRunOptions.WAITING_FIRST_INPUT) && !timer.isStarted())) {
            timer.setPause(false, "rendered");
        } else {
            timer.updateFirstRendered();
        }
    }
    SpeedRunIGT.DEBUG_DATA = timer.getStatus().name();
    if (!this.options.hudHidden && this.world != null && timer.getStatus() != TimerStatus.NONE && (!this.isPaused() || this.currentScreen instanceof CreditsScreen || this.currentScreen instanceof GameMenuScreen || !SpeedRunOption.getOption(SpeedRunOptions.HIDE_TIMER_IN_OPTIONS)) && !(!this.isPaused() && SpeedRunOption.getOption(SpeedRunOptions.HIDE_TIMER_IN_DEBUGS) && this.options.debugEnabled) && !(this.currentScreen instanceof TimerCustomizeScreen)) {
        SpeedRunIGT.TIMER_DRAWER.draw();
    }
}
Also used : CreditsScreen(net.minecraft.client.gui.screen.CreditsScreen) InGameTimer(com.redlimerl.speedrunigt.timer.InGameTimer) TimerCustomizeScreen(com.redlimerl.speedrunigt.gui.screen.TimerCustomizeScreen) GameMenuScreen(net.minecraft.client.gui.screen.GameMenuScreen) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

TimerCustomizeScreen (com.redlimerl.speedrunigt.gui.screen.TimerCustomizeScreen)1 InGameTimer (com.redlimerl.speedrunigt.timer.InGameTimer)1 CreditsScreen (net.minecraft.client.gui.screen.CreditsScreen)1 GameMenuScreen (net.minecraft.client.gui.screen.GameMenuScreen)1 Inject (org.spongepowered.asm.mixin.injection.Inject)1