Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GT-New-Horizons-Modpack#7789 - Game Over GUI buttons disabled if … #13

Merged
merged 1 commit into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ public enum MixinSets {
() -> config.dropPickedLootOnDespawn,
Collections.singletonList("dropPickedLootOnDespawn.MixinEntityLiving")
),
GAMEOVER_GUI_LOCKED_DISABLED("Game Over GUI buttons disabled if switching fullscreen Fix",
() -> config.fixGuiGameOver,
Collections.singletonList("fixGuiGameOver.MixinGuiGameOver")
),
WAKE_ANCHORS_ON_LOGIN("Wake up personal anchors on owner login",
() -> config.installAnchorAlarm,
"Railcraft_1.7.10",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public class LoadingConfig {
public boolean fixHungerOverhaul;
public boolean removeUpdateChecks;
public boolean preventPickupLoot;
public boolean dropPickedLootOnDespawn;
public boolean dropPickedLootOnDespawn;
public boolean fixGuiGameOver;
public boolean installAnchorAlarm;
// ASM
public boolean pollutionAsm;
Expand All @@ -44,6 +45,7 @@ public LoadingConfig(File file) {
fixThaumcraftUnprotectedGetBlock = config.get("fixes", "fixThaumcraftUnprotectedGetBlock", true, "Various Thaumcraft unchecked getBlock() patches").getBoolean();
fixHungerOverhaul = config.get("fixes", "fixHungerOverhaul", true, "Fix hunger overhaul low stat effects").getBoolean();
removeUpdateChecks = config.get("fixes", "removeUpdateChecks", true, "Remove old/stale/outdated update checks.").getBoolean();
fixGuiGameOver = config.get("fixes", "fixGuiGameOver", true, "Fix Game Over GUI buttons disabled if switching fullscreen").getBoolean();
installAnchorAlarm = config.get("tweaks", "installAnchorAlarm", true, "Wake up passive & personal anchors on player login").getBoolean();

preventPickupLoot = config.get("tweaks", "preventPickupLoot", true, "Prevent monsters from picking up loot.").getBoolean();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.mitchej123.hodgepodge.mixins.fixGuiGameOver;

import net.minecraft.client.gui.GuiGameOver;

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.callback.CallbackInfo;

@Mixin(GuiGameOver.class)
public class MixinGuiGameOver {

// Number of ticks screen was open
@Shadow
private int field_146347_a;

/**
* @author ElNounch
* @reason Fix Game Over GUI buttons disabled if switching fullscreen
*/
@Inject(method = "initGui", at = @At("HEAD"))
public void resetedInitGui(CallbackInfo ci) {
if (field_146347_a > 19) {
// Make sure buttons will be re-enabled next tick
field_146347_a = 19;
}
}
}