Skip to content

Commit

Permalink
Super janky keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbudda committed May 30, 2016
1 parent 3ca49b8 commit 6e20440
Show file tree
Hide file tree
Showing 7 changed files with 403 additions and 63 deletions.
2 changes: 1 addition & 1 deletion minecriftversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
of_json_name = "1.7.10_HD_U_D1"
of_file_md5 = "57c724fe8335c82aef8d54c101043e60"
minecrift_version_num = "1.7.10"
minecrift_build = "Vivecraft-jrbudda11"
minecrift_build = "Vivecraft-jrbudda12"
of_file_extension = ".jar"
mcp_version = "mcp908"
mcp_uses_generics = False
Expand Down
2 changes: 1 addition & 1 deletion patches/net/minecraft/client/Minecraft.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5363,7 +5363,7 @@
+
+ while (Keyboard.next())
+ {
+ KeyBinding.setKeyBindState(Keyboard.getEventKey(), Keyboard.getEventKeyState());
+ KeyBinding.setKeyBindState(Keyboard.getEventKey(), Keyboard.getEventKeyState());
+
+ if (Keyboard.getEventKeyState())
+ {
Expand Down
29 changes: 13 additions & 16 deletions patches/net/minecraft/client/gui/GuiIngame.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
private static final String __OBFID = "CL_00000661";

public GuiIngame(Minecraft p_i46379_1_)
@@ -78,10 +85,34 @@
@@ -78,6 +85,30 @@
this.streamIndicator = new GuiStreamIndicator(this.mc);
}

Expand All @@ -85,7 +85,7 @@
+
+ GL11.glColorMask(true, true, true, false); // DISBALE CHANIGNG UNDERLYING ALPHA VALUE
+
+ GL11.glColor3f(1, 1, 1);
+ //GL11.glColor4f(.8f, .8f, .8f, 1f);
+ this.mc.mcProfiler.endStartSection("mouse pointer");
+ this.mc.getTextureManager().bindTexture(Gui.icons);
+ float menuMousePointerSize = 16f * this.mc.vrSettings.menuCrosshairScale;
Expand All @@ -102,11 +102,6 @@
/**
* Render the ingame overlay with quick icon bar, ...
*/
- public void renderGameOverlay(float p_73830_1_, boolean p_73830_2_, int p_73830_3_, int p_73830_4_)
+ public void drawHUDelements(float p_73830_1_, boolean p_73830_2_, int p_73830_3_, int p_73830_4_)
{
ScaledResolution var5 = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
int var6 = var5.getScaledWidth();
@@ -122,16 +153,32 @@

if (!this.mc.playerController.enableEverythingIsScrewedUpMode())
Expand Down Expand Up @@ -162,10 +157,11 @@
var8.drawStringWithShadow(this.mc.debugInfoRenders(), 2, 12, 16777215);
var8.drawStringWithShadow(this.mc.getEntityDebug(), 2, 22, 16777215);
var8.drawStringWithShadow(this.mc.debugInfoEntities(), 2, 32, 16777215);
@@ -326,6 +376,19 @@
@@ -326,6 +376,21 @@
this.drawString(var8, var20, var6 - var8.getStringWidth(var20) - 2, 2, 14737632);
var20 = "Allocated memory: " + var41 * 100L / var36 + "% (" + var41 / 1024L / 1024L + "MB)";
this.drawString(var8, var20, var6 - var8.getStringWidth(var20) - 2, 12, 14737632);
+
+ /** MINECRIFT FORGE **/
+ Object fmlCommonHandler = null;
+ if( Reflector.FMLCommonHandler_instance.exists()) {
Expand All @@ -179,10 +175,11 @@
+ }
+ }
+ /** END MINECRIFT FORGE **/
+
var22 = MathHelper.floor_double(this.mc.thePlayer.posX);
var23 = MathHelper.floor_double(this.mc.thePlayer.posY);
int var24 = MathHelper.floor_double(this.mc.thePlayer.posZ);
@@ -501,9 +564,10 @@
@@ -501,9 +566,10 @@
{
this.streamIndicator.render((int)(p_152126_1_ - 10.0F), 10);
}
Expand All @@ -196,7 +193,7 @@
Scoreboard var5 = p_96136_1_.getScoreboard();
Collection var6 = var5.getSortedScores(p_96136_1_);

@@ -549,9 +613,10 @@
@@ -549,9 +615,10 @@
}
}
}
Expand All @@ -210,7 +207,7 @@
boolean var3 = this.mc.thePlayer.hurtResistantTime / 3 % 2 == 1;

if (this.mc.thePlayer.hurtResistantTime < 10)
@@ -830,7 +895,9 @@
@@ -830,7 +897,9 @@
/**
* Renders dragon's (boss) health on the HUD
*/
Expand All @@ -221,7 +218,7 @@
{
if (BossStatus.bossName != null && BossStatus.statusBarTime > 0)
{
@@ -856,9 +923,15 @@
@@ -856,9 +925,15 @@
this.mc.getTextureManager().bindTexture(icons);
}
}
Expand All @@ -239,7 +236,7 @@
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(false);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
@@ -881,8 +954,15 @@
@@ -881,8 +956,15 @@
/**
* Renders the vignette. Args: vignetteBrightness, width, height
*/
Expand All @@ -256,7 +253,7 @@
p_73829_1_ = 1.0F - p_73829_1_;

if (p_73829_1_ < 0.0F)
@@ -913,8 +993,9 @@
@@ -913,8 +995,9 @@
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
}
Expand All @@ -268,7 +265,7 @@
{
if (p_130015_1_ < 1.0F)
{
@@ -950,7 +1031,9 @@
@@ -950,7 +1033,9 @@
/**
* Renders the specified item of the inventory slot at the specified location. Args: slot, x, y, partialTick
*/
Expand All @@ -279,7 +276,7 @@
{
ItemStack var5 = this.mc.thePlayer.inventory.mainInventory[p_73832_1_];

@@ -1039,4 +1122,22 @@
@@ -1039,4 +1124,22 @@
{
return this.updateCounter;
}
Expand Down
40 changes: 40 additions & 0 deletions patches/net/minecraft/client/gui/GuiTextField.java.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
--- a/net/minecraft/client/gui/GuiTextField.java
+++ b/net/minecraft/client/gui/GuiTextField.java
@@ -1,9 +1,12 @@
package net.minecraft.client.gui;

+import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ChatAllowedCharacters;
import org.lwjgl.opengl.GL11;

+import com.mtbs3d.minecrift.provider.MCOpenVR;
+
public class GuiTextField extends Gui
{
private final FontRenderer fontRendererInstance;
@@ -486,6 +489,11 @@

String var6 = this.fontRendererInstance.trimStringToWidth(this.text.substring(this.lineScrollOffset), this.getWidth());
this.setCursorPosition(this.fontRendererInstance.trimStringToWidth(var6, var5).length() + this.lineScrollOffset);
+
+ // VIVE START - show keyboard
+ ((MCOpenVR) Minecraft.getMinecraft().lookaimController).setKeyboardOverlayShowing(true, this);
+ // VIVE END - show keyboard
+
}
}

@@ -673,6 +681,12 @@
}

this.isFocused = p_146195_1_;
+
+ // VIVE START - show keyboard
+ System.out.println("Text element focused " + p_146195_1_);
+ if(p_146195_1_) ((MCOpenVR) Minecraft.getMinecraft().lookaimController).setKeyboardOverlayShowing(p_146195_1_, this);
+ // VIVE END - show keyboard
+
}

/**
78 changes: 43 additions & 35 deletions patches/net/minecraft/client/renderer/EntityRenderer.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,7 @@
float clipDistance = this.farPlaneDistance * 2.0F;

if (clipDistance < 128.0F)
@@ -825,1829 +1162,4166 @@
@@ -825,1829 +1162,4174 @@
{
clipDistance = 256.0F;
}
Expand Down Expand Up @@ -2198,13 +2198,11 @@
+ if(eyeCollision ){
+ int was = GL11.glGetInteger(GL11.GL_DEPTH_FUNC);
+ GL11.glDepthFunc(GL11.GL_ALWAYS);
+
+ renderCircle(mc.thePlayer.getPosition(par1).addVector(-renderOriginX, - mc.thePlayer.yOffset -renderOriginY + 0.02f, -renderOriginZ), 0.08f, 32, 0, 255, 255, 128, 1);
+
+ renderCircle(mc.thePlayer.getPosition(par1).addVector(-renderOriginX, - mc.thePlayer.yOffset -renderOriginY + 0.02f, -renderOriginZ), 0.08f, 32, 0, 255, 255, 64, 1);
+ GL11.glDepthFunc(was);
+
+ } else {
+ renderCircle(mc.thePlayer.getPosition(par1).addVector(-renderOriginX, - mc.thePlayer.yOffset -renderOriginY + 0.02f, -renderOriginZ), 0.08f, 32, 0, 255, 255, 128, 1);
+ renderCircle(mc.thePlayer.getPosition(par1).addVector(-renderOriginX, - mc.thePlayer.yOffset -renderOriginY + 0.02f, -renderOriginZ), 0.08f, 32, 0, 255, 255, 64, 1);
+ }
+
+ if (!this.mc.vrSettings.debugPos) {
Expand Down Expand Up @@ -2703,7 +2701,7 @@
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+
+
+ renderFramebufferIntoWorld(par1);
+ renderGuiLayer(par1);
+
+ // VIVE START - render controllers in main menu
+ if (this.mc.theWorld==null)
Expand Down Expand Up @@ -5141,7 +5139,7 @@
+ /** Renders the pre-generated 2-d framebuffer into the world at the appropriate location..
+ * @param par1
+ */
+ private void renderFramebufferIntoWorld(float par1)
+ private void renderGuiLayer(float par1)
+ {
+ if (this.guiScreenShowingThisFrame || this.inWorldGuiScreenShowingThisFrame || this.mc.showSplashScreen)
+ {
Expand Down Expand Up @@ -5280,6 +5278,9 @@
+ GL11.glClearColor(.1f, .1f, .1f, 0.1f);
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glColor4f(0.5f, 0.5f, 0.5f, 1f);
+
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_LIGHT0);
Expand Down Expand Up @@ -5409,7 +5410,7 @@
+ GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
+
+ //Render HUD elements
+ this.mc.ingameGUI.drawHUDelements(renderPartialTicks, this.mc.currentScreen != null, 0, 0);
+ this.mc.ingameGUI.renderGameOverlay(renderPartialTicks, this.mc.currentScreen != null, 0, 0);
+
+ mc.guiAchievement.updateAchievementWindow();
+ GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
Expand Down Expand Up @@ -5908,8 +5909,6 @@
+ public void renderLeftHand()
+ {
+
+
+
+ if (mc.thePlayer == null)
+ return;
+
Expand Down Expand Up @@ -5983,53 +5982,62 @@
+
+ // render
+ arm.render(0.0625F);
+
+ // restore arm position
+ arm.rotationPointX = rotationPointX;
+ arm.rotationPointY = rotationPointY;
+ arm.rotationPointZ = rotationPointZ;
+ arm.rotateAngleX = rotateAngleX;
+ arm.rotateAngleY = rotateAngleY;
+ arm.rotateAngleZ = rotateAngleZ;
+ arm.offsetX = offsetX;
+ arm.offsetY = offsetY;
+ arm.offsetZ = offsetZ;
+
+ //tes.draw();
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+ GL11.glPopMatrix();
+
+
+
+ if (mc.vrSettings.vrLimitedSurvivalTeleport && !mc.vrPlayer.getFreeMoveMode() && mc.playerController.isNotCreative() && mc.vrPlayer.vrMovementStyle.arcAiming){
+ GL11.glPushMatrix();
+ GL11.glRotatef(90, 0,0, 1f);
+ GL11.glTranslatef(0.55f, 0.142f, 0);
+
+
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ GL11.glEnable(GL11.GL_LIGHTING);
+
+ Vec3 start = Vec3.createVectorHelper(handX,handY,handZ);
+ Vec3 start = Vec3.createVectorHelper(0,0,0);
+
+ float r;
+
+ float max = 0.04f;
+ if (mc.vrPlayer.movementTeleportProgress > 0 ) {
+ r = (float) ( mc.vrPlayer.getTeleportEnergy() - 4 * mc.vrPlayer.movementTeleportDistance ) / 100 * 0.05f;
+ r = (float) ( mc.vrPlayer.getTeleportEnergy() - 4 * mc.vrPlayer.movementTeleportDistance ) / 100 * max;
+ } else {
+ r = mc.vrPlayer.getTeleportEnergy() / 100 * 0.05f;
+ r = mc.vrPlayer.getTeleportEnergy() / 100 * max;
+ }
+
+ if(r<0){r=0;}
+
+ renderCircle(start.addVector(0, .06, 0), r, 32, 255, 163, 255, 200, 1);
+ renderCircle(start.addVector(0, .06, 0), .05f, 32, 255, 163, 255, 100, 1);
+ renderCircle(start.addVector(0, .05001, 0), r, 32, 255, 163, 255, 255, 1);
+ renderCircle(start.addVector(0, .05, 0), max, 32, 255, 163, 255, 100, 1);
+
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+
+
+ // restore arm position
+ arm.rotationPointX = rotationPointX;
+ arm.rotationPointY = rotationPointY;
+ arm.rotationPointZ = rotationPointZ;
+ arm.rotateAngleX = rotateAngleX;
+ arm.rotateAngleY = rotateAngleY;
+ arm.rotateAngleZ = rotateAngleZ;
+ arm.offsetX = offsetX;
+ arm.offsetY = offsetY;
+ arm.offsetZ = offsetZ;
+
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+
+
+
+
+
+ mc.mcProfiler.endSection();
+
+ GL11.glPopMatrix();
+
+
+ if(!mc.vrPlayer.getFreeMoveMode()){
+ if(mc.vrPlayer.vrMovementStyle.arcAiming) {
Expand Down
Loading

0 comments on commit 6e20440

Please sign in to comment.