Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] New tweak: Drag item to another slot #130

Open
AlisonHuang777 opened this issue Apr 4, 2024 · 8 comments
Open

[Suggestion] New tweak: Drag item to another slot #130

AlisonHuang777 opened this issue Apr 4, 2024 · 8 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@AlisonHuang777
Copy link

AlisonHuang777 commented Apr 4, 2024

Suppose I want to move an item from slot A to slot B.
Currently, I can do the following:

  1. Click the item located in slot A
  2. Move the cursor to where the slot B is
  3. Click again to drop the item

And the new tweak works like this:

  1. Click the item at slot A and then hold the button
  2. Move the cursor to slot B
  3. Release button to drop the item

So basically I can drag the item to another slot with this new tweak.
This can be useful when I want to move many items to some specific slots.

@AlisonHuang777 AlisonHuang777 changed the title [Suggestion] New tweak: Drag item to another location [Suggestion] New tweak: Drag item to another slot Apr 4, 2024
@YaLTeR
Copy link
Owner

YaLTeR commented Apr 5, 2024

I see what you mean. Do any existing mods do this to use as a reference for the button to use? I think it makes sense if this was some modifier (i.e. if you hold Alt then dragging works like this), but not sure.

@YaLTeR YaLTeR added enhancement New feature or request question Further information is requested labels Apr 5, 2024
@AlisonHuang777
Copy link
Author

AlisonHuang777 commented Apr 5, 2024

I think we actually don't need to press any additional keys to activate the dragging behavior. It'll work like this:
Firstly, you press down RMB (or LMB) on an item to pick it up, and then, when you release the button:

  • If the cursor is still on the slot where you originally picked up the item, this is identified as a "click" action, and you simply make the item attach to the cursor;
  • If, instead, the cursor has moved to a new slot, then this is identified as a "drag" action, putting down the item (which is previously attached to the cursor until the button is released) to that slot.

@YaLTeR
Copy link
Owner

YaLTeR commented Apr 5, 2024

That is a good idea, however I think there's a conflict with one of the existing LMB drag mechanics where it will add more items into the stack on the mouse when dragging with LMB held.

@AlisonHuang777
Copy link
Author

Maybe we can make this feature to be part of the RMB tweaks instead?
And make the existing tweak for RMB to be activated only if it's a "click" action, e.g. you need to make the item to attach to the cursor first, and then you can do the distribution.

@YaLTeR
Copy link
Owner

YaLTeR commented Apr 6, 2024

Well, you still want the vanilla "right click to take half" to keep working though.

@AlisonHuang777
Copy link
Author

AlisonHuang777 commented Apr 6, 2024

How about using middle mouse button? Currently there is no behavior for middle clicking a item in survival mode.
And using this tweak won't be a issue in creative mode, as you can use the "click" action to activate the vanilla behavior (which is duping item). Maybe an additional config option can be introduced to decide whether to dupe the item when the dragging behavior is activated. (So if it's activated, you just leave the original item in its slot while dragging a copy of it to a new slot.)
Furthermore, if there are other mod that take use of MMB, (e.g. AE2 autocrafting,) just bind it to "click" action as well.

@YaLTeR
Copy link
Owner

YaLTeR commented Apr 6, 2024

Possible. If it was a modifier like Alt, then you could use it with both LMB and RMB though (if you need to take a half-stack and drop it somewhere).

@AlisonHuang777
Copy link
Author

Then it can be made like using the modifier key, which is default to be MMB. And while using that, you don't need to additionally press LMB to drag the entire stack, but still need to click RMB to take half of the stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants