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

[Feature request] quick move for ghost items via shift-click #802

Open
Mithi83 opened this issue Dec 12, 2024 · 0 comments
Open

[Feature request] quick move for ghost items via shift-click #802

Mithi83 opened this issue Dec 12, 2024 · 0 comments
Labels
thaumiel Feature request

Comments

@Mithi83
Copy link

Mithi83 commented Dec 12, 2024

EMI offers the EmiDragDropHandler API for moving ghost items into appropriate slots via drag & drop. I'd like to propose adding another API that does something similar but without requiring drag & drop.

My background and use case: AE2 allows setting up filtering for certain items, such as partitioning storage cells, filtering import & export busses etc. These filters can be set using different methods:

  • Clicking with an item in hand on the filter slot
  • Drag & drop from EMI
  • Quick move (shift-click) from player inventory

A typical storage cell can have up to 63 filter slots and filling them one by one with drag & drop from EMI is a tedious and error-prone process. Allowing to shift-click ghost items from EMI directly would greatly speed up the process and other mods could also benefit from such a feature.

I've implemented a quick and dirty proof of concept both on the EMI and the AE2 side of things to make a video of the use case. In the video you can first see the manual drag & drop approach, then the new keybind and at last the newer and faster shift-click variant:

quick-move.mp4

My quick and dirty approach for the proof of concept on the EMI side can be seen here (Mithi83@1c99ec0) and it involves:

  • Adding a keybind for the quick move (shift + left click)
  • Adding a new else if in EmiScreenManager.stackInteraction to handle the
    new keybind
  • Abusing the existing EmiDragDropHandlers.dropStack API with x=9999 and y=9999 to transport the information that it should be considered a quick move rather than a real drag & drop operation across the API and into AE2

Now I'm wondering how to make this proof of concept into a proper feature. Since I'm not that familiar with designing APIs in Java (in particular the backward compatibility question) I've decided to make it a feature request to discuss it rather than just posting a pull request.

Since the feature is very similar to the drag & drop approach my first idea was to add another function to EmiDragDropHandler along the lines of boolean quickMoveStack(T screen, EmiIngredient stack). There are some questions or drawbacks however:

  • The name EmiDragDropHandler does not cover quick move.
  • I'm not sure if this would affect backwards compatibility of existing users of that API if there was a default boolean quickMoveStack(T screen, EmiIngredient stack) { return false; } in there.
  • I'm not sure what would be a good wording for that feature. In my mind 'quick move' sounds good, but I'm not sure if that is the official terminology here.

The alternative would be a separate class for the API, e.g. EmiQuickMoveHandler which would probably avoid these problems. Either way I'd be willing to provide a pull request if a lack of time on your end would be the bottleneck here once the basic questions have been answered. Thanks for your time and a great mod.

@Mithi83 Mithi83 added the thaumiel Feature request label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
thaumiel Feature request
Projects
None yet
Development

No branches or pull requests

1 participant