Experimental port to 23w06a

Some stuff is still broken, but I managed to implement directional movement in screens
This commit is contained in:
Motschen
2023-02-15 11:11:39 +01:00
parent d48952fec9
commit 1c999137ba
12 changed files with 58 additions and 116 deletions

View File

@@ -24,7 +24,7 @@ public abstract class ChatScreenMixin extends Screen {
private void midnightcontrols$moveInputField(CallbackInfo ci) {
if (MidnightControlsConfig.moveChat) chatField.setY(4);
}
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/TextFieldWidget;setTextFieldFocused(Z)V", shift = At.Shift.AFTER))
@Inject(method = "render", at = @At("HEAD"))
private void midnightcontrols$moveInputFieldBackground(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) {
if (MidnightControlsConfig.moveChat) matrices.translate(0f, -this.height + 16, 0f);
}

View File

@@ -9,12 +9,13 @@
package eu.midnightdust.midnightcontrols.client.mixin;
import net.minecraft.client.gui.navigation.NavigationDirection;
import net.minecraft.client.gui.widget.EntryListWidget;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(EntryListWidget.class)
public interface EntryListWidgetAccessor {
@Invoker("moveSelection")
void midnightcontrols$moveSelection(EntryListWidget.MoveDirection direction);
//@Invoker("getNeighbouringEntry")
//void midnightcontrols$getNeighbouringEntry(NavigationDirection direction);
}