1
0
forked from Clones/Controlify

🐛 Fix mismatched controller guides in inventory (closes #131)

This commit is contained in:
isXander
2023-08-06 23:39:45 +01:00
parent 3286712804
commit e643eb8dc3

View File

@ -106,7 +106,7 @@ public class AbstractContainerScreenProcessor<T extends AbstractContainerScreen<
.rowPadding(0) .rowPadding(0)
.elementPosition(RowLayoutComponent.ElementPosition.MIDDLE) .elementPosition(RowLayoutComponent.ElementPosition.MIDDLE)
.element(new GuideActionRenderer<>( .element(new GuideActionRenderer<>(
new GuideAction<>(bindings.VMOUSE_LCLICK, ctx -> { new GuideAction<>(bindings.INV_SELECT, ctx -> {
if (!ctx.holdingItem().isEmpty()) if (!ctx.holdingItem().isEmpty())
if (ctx.hoveredSlot() != null && ctx.hoveredSlot().hasItem()) if (ctx.hoveredSlot() != null && ctx.hoveredSlot().hasItem())
if (ctx.hoveredSlot().mayPlace(ctx.holdingItem())) if (ctx.hoveredSlot().mayPlace(ctx.holdingItem()))
@ -160,7 +160,7 @@ public class AbstractContainerScreenProcessor<T extends AbstractContainerScreen<
.rowPadding(0) .rowPadding(0)
.elementPosition(RowLayoutComponent.ElementPosition.MIDDLE) .elementPosition(RowLayoutComponent.ElementPosition.MIDDLE)
.element(new GuideActionRenderer<>( .element(new GuideActionRenderer<>(
new GuideAction<>(bindings.VMOUSE_RCLICK, ctx -> { new GuideAction<>(bindings.INV_TAKE_HALF, ctx -> {
if (ctx.hoveredSlot() != null && ctx.hoveredSlot().getItem().getCount() > 1 && ctx.holdingItem().isEmpty()) if (ctx.hoveredSlot() != null && ctx.hoveredSlot().getItem().getCount() > 1 && ctx.holdingItem().isEmpty())
return Optional.of(Component.translatable("controlify.guide.container.take_half")); return Optional.of(Component.translatable("controlify.guide.container.take_half"));
if (ctx.hoveredSlot() != null && !ctx.holdingItem().isEmpty() && ctx.hoveredSlot().mayPlace(ctx.holdingItem())) if (ctx.hoveredSlot() != null && !ctx.holdingItem().isEmpty() && ctx.hoveredSlot().mayPlace(ctx.holdingItem()))
@ -170,7 +170,7 @@ public class AbstractContainerScreenProcessor<T extends AbstractContainerScreen<
true, false true, false
)) ))
.element(new GuideActionRenderer<>( .element(new GuideActionRenderer<>(
new GuideAction<>(bindings.VMOUSE_SHIFT_CLICK, ctx -> { new GuideAction<>(bindings.INV_QUICK_MOVE, ctx -> {
if (ctx.hoveredSlot() != null && ctx.hoveredSlot().hasItem()) if (ctx.hoveredSlot() != null && ctx.hoveredSlot().hasItem())
return Optional.of(Component.translatable("controlify.guide.container.quick_move")); return Optional.of(Component.translatable("controlify.guide.container.quick_move"));
return Optional.empty(); return Optional.empty();