Jump to content

Recommended Posts

Posted

I was wondering if it is possible to cancel mouse input in forge by canceling a specific event or an instruction for minecraft to not accept mouse input for steering. Like when you are in a bed or have a GUI open.

 

At this point i'm considering making an invsible gui for the moment just so the mouse is disconnected from steering inputs, but I was wondering if there's a more standard way to accomplish this.

I really would like a standard way that disconnects the mouse but not the keyboard.

 

If you are wondering why I want this. I have delicious grog in my mod and it has some effect on the way your head looks. You kinda swerve all over the place, left right intermittently. So if you walk when drunk you can suddenly swerve sideways.

The problem comes when the player steers against the movement it becomes really jittery and not the smooth swerving you have if you don't steer against it.

How much wood could a woodchuck chuck if a wood chuck could chuck wood - Guybrush Treepwood

 

I wrote my own mod ish... still a few bugs to fix. http://thaumcraft.duckdns.org/downloads/MagicCookies-1.0.6.4.jar

Posted

Actually that doesnt cancel the event what i've read on a topic from someone who wanted to do stuff with touchscreen.

 

I delved into the GUI class and I found a delicously simple way to cancel out the mouse so it doesn't interfere as much with the steering which makes the drunkeness that more harsh now :D

 

            if(e.getPlayer().worldObj.isRemote) {
				if(Drunk.instance.grabbedCursor) {
					Drunk.instance.grabbedCursor = false;
    				Minecraft.getMinecraft().mouseHelper.grabMouseCursor();
				}
			}

 

Minecraft.getMinecraft().mouseHelper.grabMouseCursor(); Makes the crosshair control the movements allowing the player to do 360 degree turns and such.

 

Minecraft.getMinecraft().mouseHelper.ungrabMouseCursor(); turns control over to the OS, allowing very limited steering by the player.

 

I love it where there is a simple solution.

How much wood could a woodchuck chuck if a wood chuck could chuck wood - Guybrush Treepwood

 

I wrote my own mod ish... still a few bugs to fix. http://thaumcraft.duckdns.org/downloads/MagicCookies-1.0.6.4.jar

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.