Wire / Cable State Scrolling Feature#49
Wire / Cable State Scrolling Feature#49ButterSus wants to merge 2 commits intoKneelawk:0.7.x-1.20.xfrom
Conversation
| val menuIndex = wiresAndCables.indexOf(activeItem) | ||
|
|
||
| val hotbarX = guiGraphics.scaledWindowWidth / 2 - 91 | ||
| val hotbarY = guiGraphics.scaledWindowHeight - 22 |
There was a problem hiding this comment.
Magic code, don't touch if works
There was a problem hiding this comment.
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.
Found out that I can greatly simplify the mixin responsible for HUD offset
|
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