-
Notifications
You must be signed in to change notification settings - Fork 0
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
11 changed files
with
77 additions
and
60 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
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 was deleted.
Oops, something went wrong.
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,27 @@ | ||
package edeetee.pictocraft; | ||
|
||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.font.Font; | ||
import net.minecraft.client.font.TextRenderer; | ||
|
||
public class InfoRenderer { | ||
static final TextRenderer renderer = MinecraftClient.getInstance().textRenderer; | ||
static final float padding = 10; | ||
static final float scale = 1.5f; | ||
static final String webMessage = "AAC input: https://edeetee.github.io/pictocraft/"; | ||
static final String connectedText = PictoInputReceiver.key + " - CONNECTED!"; | ||
|
||
public static void render(){ | ||
// Font | ||
RenderUtil.push(); | ||
|
||
RenderUtil.translate(padding, padding); | ||
renderer.draw(webMessage, 0, 0, -1); | ||
|
||
RenderUtil.scale(scale, scale); | ||
RenderUtil.translate(0, padding); | ||
renderer.draw("Key: " + (PictoInputReceiver.isConnected() ? connectedText : PictoInputReceiver.key), 0, 0, -1); | ||
|
||
RenderUtil.pop(); | ||
} | ||
} |
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
18 changes: 18 additions & 0 deletions
18
src/main/java/edeetee/pictocraft/mixin/LoginInfoMixin.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,18 @@ | ||
package edeetee.pictocraft.mixin; | ||
|
||
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 net.minecraft.client.gui.screen.PauseScreen; | ||
import edeetee.pictocraft.InfoRenderer; | ||
|
||
@Mixin(PauseScreen.class) | ||
public abstract class LoginInfoMixin { | ||
|
||
@Inject(method = "render", at = @At("RETURN")) | ||
public void renderInfo(int x, int y, float float_1, CallbackInfo info) { | ||
InfoRenderer.render(); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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