mirror of
https://github.com/TeamMidnightDust/MidnightControls.git
synced 2025-12-18 17:25:09 +01:00
Compare commits
2 Commits
1bdac346b1
...
a8d778eb7c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8d778eb7c | ||
|
|
50103ce4cf |
@@ -1,6 +1,7 @@
|
||||
package eu.midnightdust.midnightcontrols.client.mixin;
|
||||
|
||||
import net.minecraft.client.gui.screen.ingame.BookEditScreen;
|
||||
import net.minecraft.client.util.SelectionManager;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
@@ -16,6 +17,9 @@ public interface BookEditScreenAccessor {
|
||||
@Accessor("title")
|
||||
void midnightcontrols$setTitle(String title);
|
||||
|
||||
@Accessor("currentPageSelectionManager")
|
||||
SelectionManager midnightcontrols$getCurrentPageSelectionManager();
|
||||
|
||||
@Invoker("getCurrentPageContent")
|
||||
String midnightcontrols$getCurrentPageContent();
|
||||
|
||||
|
||||
@@ -95,6 +95,7 @@ public class MouseClickListener implements ScreenMouseEvents.AllowMouseClick {
|
||||
virtualKeyboardScreen = new VirtualKeyboardScreen(accessor.midnightcontrols$getCurrentPageContent(), (text) -> {
|
||||
client.setScreen(bookEditScreen);
|
||||
accessor.midnightcontrols$setPageContent(text);
|
||||
accessor.midnightcontrols$getCurrentPageSelectionManager().putCursorAtEnd();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user