-
-
Notifications
You must be signed in to change notification settings - Fork 215
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: Reopen last storage command #2900
Conversation
One or more Detekt Failures were detected:
|
Cool idea, can we have the same thing for ender chest as well? |
Thank you for your hard work on this feature! I really hope it gets accepted, as it would make me genuinely happy to use it actively. I believe it has a lot of potential, and I appreciate the effort you’ve put into it. |
Converting to draft since I would still like to add @lunaynx's suggestion (see above) first. |
The newly-added `/lo` will always open the last-used storage irrespective of whether it was an ender chest or backpack page.
One or more Detekt Failures were detected:
|
(`/ec -1` works Hypixel-side, but not in the `/ec -` command logic)
One or more Detekt Failures were detected:
|
One or more Detekt Failures were detected:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/main/java/at/hannibal2/skyhanni/features/commands/OpenLastStorage.kt
Outdated
Show resolved
Hide resolved
src/main/java/at/hannibal2/skyhanni/features/commands/OpenLastStorage.kt
Outdated
Show resolved
Hide resolved
src/main/java/at/hannibal2/skyhanni/features/commands/OpenLastStorage.kt
Outdated
Show resolved
Hide resolved
This drastically reduces repetitiveness. Also, crucially, fixed not updating the last stored _type_ of storage (backpack vs. ender chest), only the page number/index; and this time in the correct location. Also trimmed use of `event.message.startsWith(x, ignoreCase = true)` where possible.
One or more Detekt Failures were detected:
|
One or more Detekt Failures were detected:
|
One or more Detekt Failures were detected:
|
As advised in the #coding channel on Discord. Also renamed both new commands to be prefixed with "sh" (`/shlastopened`, `/shlo`)
One or more Detekt Failures were detected:
|
(`/shlastopened` is a normal user command)
One or more Detekt Failures were detected:
|
I think 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worked for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a toggle to disable this behaviour.
What
This PR adds three new sub-commands as a (configless/always-on) feature. Example:
/bp -
(the single dash). Executing it will re-open the backpack that was last opened using/bp [int]
.The inspiration for this comes from Unix-style
cd -
for going to the previous current directory. Also, I'm using/bp
and/ec
for brevity everywhere,/backpack
and/enderchest
work as well of course.The new command
/shlo
(and/shlastopened
) will always open the last-used storage irrespective of whether it was an ender chest or backpack page.The key/command combinations are not yet taken AFAIK.
Currently in an unmodded client, executing
/bp -
givesCommand Failed: Non-Numeric argument!
./ec -
opens the first ender chest page, which is also still reachable via/ec
or/ec 1
/shlastopened
(and its short-form variant/shlo
) are of course also still unregisteredApart from typing it out as a command (or repeatedly accessing it via the up arrow), this feature also has the advantage that a single hotkey from any number of mods may be defined and used the same way every time you need to access any storage page multiple times in a row for removing/adding some items to it.
Also potentially noteworthy regarding the implementation, I made the explicit decision against resetting the most recent backpack/ender chest slot value in case of a non-integer argument. In this case, it will just keep the previous valid integer backpack number "active".
This feature was first suggested here.
Changelog New Features