Skip to content

Conversation

@Mikey-Mikey
Copy link
Contributor

This adds a multitude of functions:

  • xuc:getMouseDeltaX()
  • xuc:getMouseDeltaY()
  • xuc:getForwardMove()
  • xuc:getSideMove()
  • xuc:getUpMove()
  • xmv:getForwardSpeed()
  • xmv:getSideSpeed()
  • xmv:getUpSpeed()
  • xmv:getMaxSpeed()
  • xmv:getMoveAngles()

And with an event to go alongside:

  • playerMove(Player:entity, MoveData:movedata, Command:usercmd)

Example:

event playerMove(P:entity, M:movedata, C:usercmd) {
    if(P == owner()) {
        print(C:getMouseDeltaX(), C:getMouseDeltaY())
    }
}

Copy link

@vurvdev vurvdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need E2Helper descriptions, add to lua/wire/client/e2descriptions.lua

@vurvdev vurvdev merged commit 56ee9b9 into wiremod:master Oct 9, 2023
@Denneisk
Copy link
Member

Denneisk commented Nov 4, 2023

What happened to mouse scroll?

@vurvdev
Copy link

vurvdev commented Nov 4, 2023

Looks like he forgot to include it here, although I thought you could already detect mouse scroll with keyPressed

@Denneisk
Copy link
Member

Denneisk commented Nov 4, 2023

Looks like he forgot to include it here, although I thought you could already detect mouse scroll with keyPressed

In the suggestion, he noted that this event allows you to get the precise amount scrolled.

@vurvdev
Copy link

vurvdev commented Nov 4, 2023

Looks like he forgot to include it here

https://wiki.facepunch.com/gmod/CUserCmd:GetMouseWheel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants