Feature request: mouse wheel interaction mode switching

Discuss coding questions, pull requests, and implementation details.
Post Reply
ACNAero
Posts: 113
Joined: Thu Sep 13, 2018 4:27 pm

Feature request: mouse wheel interaction mode switching

Post by ACNAero »

Since the mouse wheel isn’t currently being used in gameplay, I was hoping it could be that the mouse wheel can switch between interaction modes since I think that’d be a more convenient alternative to the F1-4 buttons (I don’t have anymore room to rebind those keys in a comfortable way).

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Feature request: mouse wheel interaction mode switching

Post by Interkarma »

Had a quick look into this one.

I note that mouse wheel not currently tracked by DFU's InputManager class and can't be bound to actions. If someone just wanted to make the mouse wheel do this via a mod, they could do the following In Update():

Code: Select all

Vector2 mouseScrollDelta = Input.mouseScrollDelta;
// if mouseScrollDelta.y < 0 then mouse wheel scrolled down, if mouseScrollDelta.y > 0 then mouse wheel scrolled up
// set newMode as next/previous based on current mode and direction mouse wheel scrolled
GameManager.Instance.PlayerActivate.ChangeInteractionMode(newMode, true); // use false as second param to suppress notification
If this was something built into DFU, then it should be equally useful to both controllers and keyboard/mouse, and would need to be bindable via the controls UI. That would mean creating new actions and making the mouse wheel axis bindable to start with. The advanced controls UI is also getting a bit cramped and would need some things moved around to make space for player to bind from UI.

Post Reply