-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
122 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
client/src/main/java/com/fox2code/foxloader/client/mixins/MixinPanelCrashReport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.fox2code.foxloader.client.mixins; | ||
|
||
import com.fox2code.foxloader.updater.UpdateManager; | ||
import net.minecraft.src.client.PanelCrashReport; | ||
import net.minecraft.src.client.UnexpectedThrowable; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Unique; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
|
||
@Mixin(PanelCrashReport.class) | ||
public class MixinPanelCrashReport extends Panel { | ||
@Unique JButton updateFoxLoader; | ||
|
||
@Inject(method = "<init>", at = @At("RETURN")) | ||
public void onCrash(UnexpectedThrowable var1, CallbackInfo ci) { | ||
this.updateFoxLoader = new JButton("Update FoxLoader"); | ||
Dimension dimension = new Dimension(200, 50); | ||
this.updateFoxLoader.setMaximumSize(dimension); | ||
JPanel jPanel = new JPanel(); | ||
jPanel.setMinimumSize(dimension); | ||
jPanel.setPreferredSize(dimension); | ||
jPanel.setBackground(null); | ||
jPanel.setLayout(new GridBagLayout()); | ||
jPanel.add(this.updateFoxLoader); | ||
this.add(jPanel, BorderLayout.SOUTH); | ||
UpdateManager.getInstance().bindButtonToFoxLoaderUpdate(this.updateFoxLoader); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters