mirror of
https://github.com/JonasunderscoreJones/Microcraft.git
synced 2025-10-25 20:49:19 +02:00
Bumped up version to1.19.3
This commit is contained in:
parent
9a1d182802
commit
5c34c3d4ee
28 changed files with 72 additions and 190 deletions
|
|
@ -20,16 +20,16 @@ public class BoardScreen extends Screen {
|
|||
protected void init() {
|
||||
|
||||
|
||||
this.addDrawableChild(new ButtonWidget(this.width / 2 - 155, this.height / 6 + 12, 150, 20, Text.of("Configure Microcontrollers"), (button) -> {
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of("Configure Microcontrollers"), (button) -> {
|
||||
this.client.setScreen(new SelectDevice(this));
|
||||
}));
|
||||
this.addDrawableChild(new ButtonWidget(this.width / 2 + 5, this.height / 6 + 12, 150, 20, Text.of("Configure Microcraft"), (button) -> {
|
||||
}).dimensions(this.width / 2 - 155, this.height / 6 + 12, 150, 20).build());
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of("Configure Microcraft"), (button) -> {
|
||||
this.client.setScreen(new ModSettings(this));
|
||||
}));
|
||||
}).dimensions(this.width / 2 + 5, this.height / 6 + 12, 150, 20).build());
|
||||
|
||||
this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 168, 200, 20, ScreenTexts.DONE, (button) -> {
|
||||
this.addDrawableChild(ButtonWidget.builder(ScreenTexts.DONE, (button) -> {
|
||||
this.client.setScreen(this.parent);
|
||||
}));
|
||||
}).dimensions(this.width / 2 - 100, this.height / 6 + 168, 200, 20).build());
|
||||
this.client.setScreen(new ArduinoNanoWidget(this.parent));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,16 +19,16 @@ public class GuiHome extends Screen {
|
|||
protected void init() {
|
||||
|
||||
|
||||
this.addDrawableChild(new ButtonWidget(this.width / 2 - 155, this.height / 6 + 12, 150, 20, Text.of("Configure Microcontrollers"), (button) -> {
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of("Configure Microcontrollers"), (button) -> {
|
||||
this.client.setScreen(new SelectDevice(this));
|
||||
}));
|
||||
this.addDrawableChild(new ButtonWidget(this.width / 2 + 5, this.height / 6 + 12, 150, 20, Text.of("Configure Microcraft"), (button) -> {
|
||||
}).dimensions( this.width / 2 - 155, this.height / 6 + 12, 150, 20).build());
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of("Configure Microcraft"), (button) -> {
|
||||
this.client.setScreen(new ModSettings(this));
|
||||
}));
|
||||
}).dimensions(this.width / 2 + 5, this.height / 6 + 12, 150, 20).build());
|
||||
|
||||
this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 168, 200, 20, ScreenTexts.DONE, (button) -> {
|
||||
this.addDrawableChild(ButtonWidget.builder(ScreenTexts.DONE, (button) -> {
|
||||
this.client.setScreen(this.parent);
|
||||
}));
|
||||
}).dimensions(this.width / 2 - 100, this.height / 6 + 168, 200, 20).build());
|
||||
this.addDrawableChild(new net.minecraft.client.gui.widget.CheckboxWidget(50, 50, 100, 20, Text.of("uwu checkbox"), false));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,13 +20,13 @@ public class ModSettings extends Screen {
|
|||
protected void init() {
|
||||
|
||||
|
||||
this.addDrawableChild(new ButtonWidget(this.width / 2 - 155, this.height / 6 + 12, 150, 20, Text.of("Configure Microcontrollers"), (button) -> {
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of("Configure Microcontrollers"), (button) -> {
|
||||
this.client.setScreen(new SelectDevice(this));
|
||||
}));
|
||||
}).dimensions(this.width / 2 - 155, this.height / 6 + 12, 150, 20).build());
|
||||
|
||||
this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 168, 200, 20, ScreenTexts.DONE, (button) -> {
|
||||
this.addDrawableChild(ButtonWidget.builder(ScreenTexts.DONE, (button) -> {
|
||||
this.client.setScreen(this.parent);
|
||||
}));
|
||||
}).dimensions(this.width / 2 - 100, this.height / 6 + 168, 200, 20).build());
|
||||
}
|
||||
|
||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class SelectDevice extends Screen {
|
|||
}
|
||||
|
||||
protected void init() {
|
||||
this.client.keyboard.setRepeatEvents(true);
|
||||
//this.client.keyboard.setRepeatEvents(true);
|
||||
this.searchBox = new TextFieldWidget(this.textRenderer, this.width / 2 - 100, 22, 200, 20, this.searchBox, Text.translatable("selectWorld.search"));
|
||||
this.searchBox.setChangedListener((search) -> {
|
||||
//this.levelList.filter(search);
|
||||
|
|
@ -55,24 +55,24 @@ public class SelectDevice extends Screen {
|
|||
//this.levelList = new WorldListWidget(uwu, this.client, this.width, this.height, 48, this.height - 64, 36, this.getSearchFilter(), this.levelList);
|
||||
this.addSelectableChild(this.searchBox);
|
||||
this.addSelectableChild(this.levelList);
|
||||
this.selectButton = (ButtonWidget)this.addDrawableChild(new ButtonWidget(this.width / 2 - 154, this.height - 52, 150, 20, Text.translatable("selectWorld.select"), (button) -> {
|
||||
this.selectButton = (ButtonWidget)this.addDrawableChild(ButtonWidget.builder(Text.translatable("selectWorld.select"), (button) -> {
|
||||
this.levelList.getSelectedAsOptional().ifPresent(WorldListWidget.WorldEntry::play);
|
||||
}));
|
||||
this.addDrawableChild(new ButtonWidget(this.width / 2 + 4, this.height - 52, 150, 20, Text.translatable("selectWorld.create"), (button) -> {
|
||||
}).dimensions(this.width / 2 - 154, this.height - 52, 150, 20).build());
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.translatable("selectWorld.create"), (button) -> {
|
||||
CreateWorldScreen.create(this.client, this);
|
||||
}));
|
||||
this.editButton = (ButtonWidget)this.addDrawableChild(new ButtonWidget(this.width / 2 - 154, this.height - 28, 72, 20, Text.translatable("selectWorld.edit"), (button) -> {
|
||||
}).dimensions(this.width / 2 + 4, this.height - 52, 150, 20).build());
|
||||
this.editButton = (ButtonWidget)this.addDrawableChild(ButtonWidget.builder(Text.translatable("selectWorld.edit"), (button) -> {
|
||||
this.levelList.getSelectedAsOptional().ifPresent(WorldListWidget.WorldEntry::edit);
|
||||
}));
|
||||
this.deleteButton = (ButtonWidget)this.addDrawableChild(new ButtonWidget(this.width / 2 - 76, this.height - 28, 72, 20, Text.translatable("selectWorld.delete"), (button) -> {
|
||||
}).dimensions(this.width / 2 - 154, this.height - 28, 72, 20).build());
|
||||
this.deleteButton = (ButtonWidget)this.addDrawableChild(ButtonWidget.builder(Text.translatable("selectWorld.delete"), (button) -> {
|
||||
this.levelList.getSelectedAsOptional().ifPresent(WorldListWidget.WorldEntry::deleteIfConfirmed);
|
||||
}));
|
||||
this.recreateButton = (ButtonWidget)this.addDrawableChild(new ButtonWidget(this.width / 2 + 4, this.height - 28, 72, 20, Text.translatable("selectWorld.recreate"), (button) -> {
|
||||
}).dimensions(this.width / 2 - 76, this.height - 28, 72, 20).build());
|
||||
this.recreateButton = (ButtonWidget)this.addDrawableChild(ButtonWidget.builder(Text.translatable("selectWorld.recreate"), (button) -> {
|
||||
this.levelList.getSelectedAsOptional().ifPresent(WorldListWidget.WorldEntry::recreate);
|
||||
}));
|
||||
this.addDrawableChild(new ButtonWidget(this.width / 2 + 82, this.height - 28, 72, 20, ScreenTexts.CANCEL, (button) -> {
|
||||
}).dimensions(this.width / 2 + 4, this.height - 28, 72, 20).build());
|
||||
this.addDrawableChild(ButtonWidget.builder(ScreenTexts.CANCEL, (button) -> {
|
||||
this.client.setScreen(this.parent);
|
||||
}));
|
||||
}).dimensions(this.width / 2 + 82, this.height - 28, 72, 20).build());
|
||||
this.worldSelected(false);
|
||||
this.setInitialFocus(this.searchBox);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public class TextureSelectScreen extends Screen {
|
|||
protected void init() {
|
||||
|
||||
|
||||
this.addDrawableChild(new ButtonWidget(this.width / 2 - 155, this.height / 6 + 12, 150, 20, Text.of("Configure Microcontrollers"), (button) -> {
|
||||
/*this.addDrawableChild(new ButtonWidget(this.width / 2 - 155, this.height / 6 + 12, 150, 20, Text.of("Configure Microcontrollers"), (button) -> {
|
||||
this.client.setScreen(new SelectDevice(this));
|
||||
}));
|
||||
this.addDrawableChild(new ButtonWidget(this.width / 2 + 5, this.height / 6 + 12, 150, 20, Text.of("Configure Microcraft"), (button) -> {
|
||||
|
|
@ -31,7 +31,20 @@ public class TextureSelectScreen extends Screen {
|
|||
this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 168, 200, 20, ScreenTexts.DONE, (button) -> {
|
||||
this.client.setScreen(this.parent);
|
||||
}));
|
||||
this.addDrawableChild(new net.minecraft.client.gui.widget.CheckboxWidget(50, 50, 100, 20, Text.of("uwu checkbox"), false));*/
|
||||
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of("Configure Microcontrollers"),(button) -> {
|
||||
this.client.setScreen(new SelectDevice(this));
|
||||
}).dimensions(this.width / 2 - 155, this.height / 6 + 12, 150, 20).build());
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of("Configure Microcraft"), (button) -> {
|
||||
this.client.setScreen(new ModSettings(this));
|
||||
}).dimensions(this.width / 2 + 5, this.height / 6 + 12, 150, 20).build());
|
||||
|
||||
this.addDrawableChild(ButtonWidget.builder(ScreenTexts.DONE, (button) -> {
|
||||
this.client.setScreen(this.parent);
|
||||
}).dimensions(this.width / 2 - 100, this.height / 6 + 168, 200, 20).build());
|
||||
this.addDrawableChild(new net.minecraft.client.gui.widget.CheckboxWidget(50, 50, 100, 20, Text.of("uwu checkbox"), false));
|
||||
|
||||
}
|
||||
|
||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
|
|
|
|||
|
|
@ -35,20 +35,19 @@ public class ArduinoNanoWidget extends Screen {
|
|||
}
|
||||
protected void init() {
|
||||
//TODO: get current profile
|
||||
addDrawableChild(new ButtonWidget(this.width / 2 - 100, 40, 200, 20, Text.of("[Profile]"), (buttonWidget) -> this.client.setScreen(new ProfileSelectionScreen(this))));
|
||||
addDrawableChild(ButtonWidget.builder(Text.of("[Profile]"), (buttonWidget) -> this.client.setScreen(new ProfileSelectionScreen(this))).dimensions(this.width / 2 - 100, 40, 200, 20).build());
|
||||
|
||||
//TODO: make Board texture clickable to select different texture.
|
||||
this.addDrawableChild(new TexturedButtonWidget(this.width / 2 - 26, this.height / 2 - 65, 52, 130, 0, 0, 130, BOARD_TEXTURE, 52, 130, (buttonWidget) -> this.client.setScreen(this)));
|
||||
|
||||
this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height - 30, 200, 20, Text.of("About Microcraft"), (buttonWidget) -> this.client.setScreen(new ModCreditsScreen(this))));
|
||||
this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height - 55, 200, 20, Text.of("Advanced Pin Mapping"), (buttonWidget) -> this.client.setScreen(new AdvancedPinMappingScreen(this))));
|
||||
this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height - 80, 200, 20, Text.of("Advanced Board Settings"), (buttonWidget) -> this.client.setScreen(new AdvancedSettingsScreen(this))));
|
||||
this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height - 105, 200, 20, getToggleText(), (buttonWidget) -> Microcraft.toggle()));
|
||||
this.addDrawableChild(new ButtonWidget(this.width - 60, this.height - 30, 50, 20, Text.of("Done"), (buttonWidget) -> this.client.setScreen(this.parent)));
|
||||
this.addDrawableChild(new ButtonWidget(this.width - 210, this.height - 30, 140, 20, Text.of("Write Program to Board"), (buttonWidget) -> this.client.setScreen(this.parent)));
|
||||
this.addDrawableChild(new ButtonWidget(this.width - 210, this.height - 55, 200, 20, Text.of("Microcraft Settings"), (buttonWidget) -> this.client.setScreen(new ModSettings(this))));
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of("About Microcraft"), (buttonWidget) -> this.client.setScreen(new ModCreditsScreen(this))).dimensions(this.width / 2 - 100, this.height - 30, 200, 20).build());
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of("Advanced Pin Mapping"), (buttonWidget) -> this.client.setScreen(new AdvancedPinMappingScreen(this))).dimensions(this.width / 2 - 100, this.height - 55, 200, 20).build());
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of("Advanced Board Settings"), (buttonWidget) -> this.client.setScreen(new AdvancedSettingsScreen(this))).dimensions(this.width / 2 - 100, this.height - 80, 200, 20).build());
|
||||
this.addDrawableChild(ButtonWidget.builder(getToggleText(), (buttonWidget) -> Microcraft.toggle()).dimensions(this.width / 2 - 100, this.height - 105, 200, 20).build());
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of("Done"), (buttonWidget) -> this.client.setScreen(this.parent)).dimensions(this.width - 60, this.height - 30, 50, 20).build());
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of("Write Program to Board"), (buttonWidget) -> this.client.setScreen(this.parent)).dimensions(this.width - 210, this.height - 30, 140, 20).build());
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of("Microcraft Settings"), (buttonWidget) -> this.client.setScreen(new ModSettings(this))).dimensions(this.width - 210, this.height - 55, 200, 20).build());
|
||||
|
||||
this.addDrawableChild(new )
|
||||
|
||||
}
|
||||
private Text getToggleText() {
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@ public class GameMenuScreenMixin extends Screen {
|
|||
int buttonX = this.width / 2 + 108;
|
||||
int buttonY = this.height / 4 + 8;
|
||||
|
||||
this.addDrawableChild(new ButtonWidget(buttonX, buttonY, 20, 20, Text.of(""), (button) -> {
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of(""), (button) -> {
|
||||
this.client.setScreen(new GuiHome(this));
|
||||
}));
|
||||
}).dimensions(buttonX, buttonY, 20, 20).build());
|
||||
this.addDrawableChild( new TexturedButtonWidget(buttonX, buttonY, 20, 20, 0, 0, 0, ICON_TEXTURE, 20, 20, (buttonWidget) -> this.client.setScreen(new GuiHome(this))));
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package me.jonasjones.microcraft.mixin;
|
||||
|
||||
import me.jonasjones.microcraft.gui.screens.BoardScreen;
|
||||
import me.jonasjones.microcraft.gui.screens.GuiHome;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.screen.TitleScreen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
|
|
@ -29,9 +28,9 @@ public abstract class TitleScreenButtonMixin extends Screen {
|
|||
int buttonX = this.width / 2 + 104;
|
||||
int buttonY = y + spacingY * 2;
|
||||
|
||||
this.addDrawableChild(new ButtonWidget(buttonX, buttonY, 20, 20, Text.of(""), (button) -> {
|
||||
this.addDrawableChild(ButtonWidget.builder( Text.of(""), (button) -> {
|
||||
this.client.setScreen(new BoardScreen(this));
|
||||
}));
|
||||
}).dimensions(buttonX, buttonY, 20, 20).build());
|
||||
this.addDrawableChild( new TexturedButtonWidget(buttonX, buttonY, 20, 20, 0, 0, 0, ICON_TEXTURE, 20, 20, (buttonWidget) -> this.client.setScreen(new BoardScreen(this))));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue