-
Notifications
You must be signed in to change notification settings - Fork 6
Wire / Cable State Scrolling Feature #49
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
base: 0.7.x-1.20.x
Are you sure you want to change the base?
Conversation
| val menuIndex = wiresAndCables.indexOf(activeItem) | ||
|
|
||
| val hotbarX = guiGraphics.scaledWindowWidth / 2 - 91 | ||
| val hotbarY = guiGraphics.scaledWindowHeight - 22 |
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.
Magic code, don't touch if works
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.
This code looks fine. I can tell generally what it's doing and how to tweak it if necessary.
src/main/java/com/kneelawk/wiredredstone/mixin/impl/InGameHudMixin.java
Outdated
Show resolved
Hide resolved
| ci.cancel(); | ||
| @ModifyArg(method = "renderHeldItemTooltip", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;drawShadowedText(Lnet/minecraft/client/font/TextRenderer;Lnet/minecraft/text/Text;III)I"), index = 3) | ||
| private int modifyHeldItemTooltipOffset(int offset) { | ||
| return offset - WRKeyBindings.getHeldItemTooltipOffset(); |
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.
Found out that I can greatly simplify the mixin responsible for HUD offset
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.
This is fine and makes sense.
|
Maybe I should improve the UI when selecting a state. I will probably use the following source as a basis: https://github.com/AntiCope/radialhud |
|
Wow! This looks really good! I'll checkout this branch when I get the chance to get a closer look at how everything works but I like what I've seen so far. Good work! Thanks for working on this! |
|
I'm probably going to tweak a couple things, like switching the networking over to LNS, and changing the keybinding key to ALT, but in general, this looks really solid. |
|
I might also want to add some stuff to make this work in survival. |
|
The radial menu would work great here, allowing wr show multiple colors from a single item. It would also work with survival too, allowing wr to ex-out items the player doesn't have in their inventory. |
Overview
This PR adds a new keybind for quick item switching:
[Standing] Insulated Wire,[Standing] Bundled Cable. By default, it is set to theRkey, but it can be reassigned in the settings:Interactivity
When this keybind is held, a HUD overlay is added with a selection of several options of the same color. Scroll with mouse in order to switch. This solves the issue of excessive variations of essentially the same functional block, which previously occupied more than 50 slots, now reduced to 17.
This feature only works in creative mode, and the switching is cyclic.
Technical Changes
Request