mirror of
https://github.com/JonasunderscoreJones/Microcraft.git
synced 2025-10-25 12:39:21 +02:00
change: migrated to mojmap
This commit is contained in:
parent
483a4a96fc
commit
3ba6a2917d
15 changed files with 199 additions and 217 deletions
|
|
@ -3,6 +3,7 @@ org.gradle.jvmargs=-Xmx1G
|
|||
|
||||
# Fabric Properties
|
||||
minecraft_version=1.19.3
|
||||
yarn_mappings=1.19.3+build.1
|
||||
loader_version=0.14.11
|
||||
|
||||
# Mod Properties
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package me.jonasjones.microcraft;
|
|||
import me.jonasjones.microcraft.config.ModConfigs;
|
||||
import me.jonasjones.microcraft.config.ProfileConfig;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
package me.jonasjones.microcraft.board;
|
||||
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
public record MicrocontrollerBoardIcon(Identifier boardTextureHorizontal, Identifier boardTextureVertical, int width, int height) {}
|
||||
public record MicrocontrollerBoardIcon(ResourceLocation boardTextureHorizontal, ResourceLocation boardTextureVertical, int width, int height) {}
|
||||
|
|
@ -1,15 +1,6 @@
|
|||
package me.jonasjones.microcraft.config;
|
||||
|
||||
import me.jonasjones.microcraft.object.BoardData;
|
||||
//import org.json.simple.JSONArray;
|
||||
//import org.json.simple.JSONObject;
|
||||
//import org.json.simple.parser.JSONParser;
|
||||
//import org.json.simple.parser.ParseException;
|
||||
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
public class ProfileConfig {
|
||||
public static void uwu() throws IOException {
|
||||
|
|
|
|||
|
|
@ -1,41 +1,41 @@
|
|||
package me.jonasjones.microcraft.gui.screens;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import me.jonasjones.microcraft.gui.widget.BoardConfigwidget;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.screen.ScreenTexts;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class BoardScreen extends Screen {
|
||||
private final Screen parent;
|
||||
|
||||
public BoardScreen (Screen parent) {
|
||||
super(Text.of("Microcraft Configuration"));
|
||||
super(Component.nullToEmpty("Microcraft Configuration"));
|
||||
this.parent = parent;
|
||||
}
|
||||
protected void init() {
|
||||
|
||||
|
||||
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.addRenderableWidget(Button.builder(Component.nullToEmpty("Configure Microcontrollers"), (button) -> {
|
||||
this.minecraft.setScreen(new SelectDevice(this));
|
||||
}).bounds(this.width / 2 - 155, this.height / 6 + 12, 150, 20).build());
|
||||
this.addRenderableWidget(Button.builder(Component.nullToEmpty("Configure Microcraft"), (button) -> {
|
||||
this.minecraft.setScreen(new ModSettings(this));
|
||||
}).bounds(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.client.setScreen(new BoardConfigwidget(this.parent));
|
||||
this.addRenderableWidget(Button.builder(CommonComponents.GUI_DONE, (button) -> {
|
||||
this.minecraft.setScreen(this.parent);
|
||||
}).bounds(this.width / 2 - 100, this.height / 6 + 168, 200, 20).build());
|
||||
this.minecraft.setScreen(new BoardConfigwidget(this.parent));
|
||||
}
|
||||
|
||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
public void render(PoseStack matrices, int mouseX, int mouseY, float delta) {
|
||||
this.renderBackground(matrices);
|
||||
drawCenteredText(matrices, this.textRenderer, this.title, this.width / 2, 15, 16777215);
|
||||
drawCenteredString(matrices, this.font, this.title, this.width / 2, 15, 16777215);
|
||||
super.render(matrices, mouseX, mouseY, delta);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,40 +1,38 @@
|
|||
package me.jonasjones.microcraft.gui.screens;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.screen.ScreenTexts;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class GuiHome extends Screen {
|
||||
private final Screen parent;
|
||||
|
||||
public GuiHome (Screen parent) {
|
||||
super(Text.of("Microcraft Configuration"));
|
||||
super(Component.nullToEmpty("Microcraft Configuration"));
|
||||
this.parent = parent;
|
||||
}
|
||||
protected void init() {
|
||||
this.addRenderableWidget(Button.builder(Component.nullToEmpty("Configure Microcontrollers"), (button) -> {
|
||||
this.minecraft.setScreen(new SelectDevice(this));
|
||||
}).bounds( this.width / 2 - 155, this.height / 6 + 12, 150, 20).build());
|
||||
this.addRenderableWidget(Button.builder(Component.nullToEmpty("Configure Microcraft"), (button) -> {
|
||||
this.minecraft.setScreen(new ModSettings(this));
|
||||
}).bounds(this.width / 2 + 5, this.height / 6 + 12, 150, 20).build());
|
||||
|
||||
|
||||
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));
|
||||
this.addRenderableWidget(Button.builder(CommonComponents.GUI_DONE, (button) -> {
|
||||
this.minecraft.setScreen(this.parent);
|
||||
}).bounds(this.width / 2 - 100, this.height / 6 + 168, 200, 20).build());
|
||||
this.addRenderableWidget(new net.minecraft.client.gui.components.Checkbox(50, 50, 100, 20, Component.nullToEmpty("uwu checkbox"), false));
|
||||
}
|
||||
|
||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
public void render(PoseStack matrices, int mouseX, int mouseY, float delta) {
|
||||
this.renderBackground(matrices);
|
||||
drawCenteredText(matrices, this.textRenderer, this.title, this.width / 2, 15, 16777215);
|
||||
drawCenteredString(matrices, this.font, this.title, this.width / 2, 15, 16777215);
|
||||
super.render(matrices, mouseX, mouseY, delta);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +1,14 @@
|
|||
package me.jonasjones.microcraft.gui.screens;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.gui.screen.ConfirmLinkScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.widget.*;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.screen.ScreenTexts;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.client.gui.screens.ConfirmLinkScreen;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class ModCreditsScreen extends Screen {
|
||||
|
|
@ -17,64 +16,64 @@ public class ModCreditsScreen extends Screen {
|
|||
private final Screen parent;
|
||||
|
||||
public ModCreditsScreen(Screen parent) {
|
||||
super(Text.of("About Microcraft"));
|
||||
super(Component.nullToEmpty("About Microcraft"));
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of("Modrinth"), this::openModrinthPage).dimensions(this.width / 2 - 155, this.height / 6 + 12, 100, 20).build());
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of("GitHub"), this::openGithubPage).dimensions(this.width / 2 - 50, this.height / 6 + 12, 100, 20).build());
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of("Curseforge"), this::openCurseforgePage).dimensions(this.width / 2 + 55, this.height / 6 + 12, 100, 20).build());
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of("Homepage"), this::openHomepagePage).dimensions(this.width / 2 - 155, this.height / 6 + 35, 310, 20).build());
|
||||
this.addRenderableWidget(Button.builder(Component.nullToEmpty("Modrinth"), this::openModrinthPage).bounds(this.width / 2 - 155, this.height / 6 + 12, 100, 20).build());
|
||||
this.addRenderableWidget(Button.builder(Component.nullToEmpty("GitHub"), this::openGithubPage).bounds(this.width / 2 - 50, this.height / 6 + 12, 100, 20).build());
|
||||
this.addRenderableWidget(Button.builder(Component.nullToEmpty("Curseforge"), this::openCurseforgePage).bounds(this.width / 2 + 55, this.height / 6 + 12, 100, 20).build());
|
||||
this.addRenderableWidget(Button.builder(Component.nullToEmpty("Homepage"), this::openHomepagePage).bounds(this.width / 2 - 155, this.height / 6 + 35, 310, 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.addRenderableWidget(Button.builder(CommonComponents.GUI_DONE, (button) -> {
|
||||
this.minecraft.setScreen(this.parent);
|
||||
}).bounds(this.width / 2 - 100, this.height / 6 + 168, 200, 20).build());
|
||||
}
|
||||
|
||||
private void openModrinthPage(ButtonWidget button) {
|
||||
this.client.setScreen(new ConfirmLinkScreen((confirmed) -> {
|
||||
private void openModrinthPage(Button button) {
|
||||
this.minecraft.setScreen(new ConfirmLinkScreen((confirmed) -> {
|
||||
if (confirmed) {
|
||||
Util.getOperatingSystem().open("http://aka.jonasjones.me/microcraft-modrinth");
|
||||
Util.getPlatform().openUri("http://aka.jonasjones.me/microcraft-modrinth");
|
||||
}
|
||||
|
||||
this.client.setScreen(this);
|
||||
this.minecraft.setScreen(this);
|
||||
}, "http://aka.jonasjones.me/microcraft-modrinth", true));
|
||||
}
|
||||
|
||||
private void openGithubPage(ButtonWidget button) {
|
||||
this.client.setScreen(new ConfirmLinkScreen((confirmed) -> {
|
||||
private void openGithubPage(Button button) {
|
||||
this.minecraft.setScreen(new ConfirmLinkScreen((confirmed) -> {
|
||||
if (confirmed) {
|
||||
Util.getOperatingSystem().open("http://aka.jonasjones.me/microcraft-github");
|
||||
Util.getPlatform().openUri("http://aka.jonasjones.me/microcraft-github");
|
||||
}
|
||||
|
||||
this.client.setScreen(this);
|
||||
this.minecraft.setScreen(this);
|
||||
}, "http://aka.jonasjones.me/microcraft-github", true));
|
||||
}
|
||||
|
||||
private void openCurseforgePage(ButtonWidget button) {
|
||||
this.client.setScreen(new ConfirmLinkScreen((confirmed) -> {
|
||||
private void openCurseforgePage(Button button) {
|
||||
this.minecraft.setScreen(new ConfirmLinkScreen((confirmed) -> {
|
||||
if (confirmed) {
|
||||
Util.getOperatingSystem().open("http://aka.jonasjones.me/microcraft-curseforge");
|
||||
Util.getPlatform().openUri("http://aka.jonasjones.me/microcraft-curseforge");
|
||||
}
|
||||
|
||||
this.client.setScreen(this);
|
||||
this.minecraft.setScreen(this);
|
||||
}, "http://aka.jonasjones.me/microcraft-curseforge", true));
|
||||
}
|
||||
|
||||
private void openHomepagePage(ButtonWidget button) {
|
||||
this.client.setScreen(new ConfirmLinkScreen((confirmed) -> {
|
||||
private void openHomepagePage(Button button) {
|
||||
this.minecraft.setScreen(new ConfirmLinkScreen((confirmed) -> {
|
||||
if (confirmed) {
|
||||
Util.getOperatingSystem().open("https://jonasjones.me/microcraft");
|
||||
Util.getPlatform().openUri("https://jonasjones.me/microcraft");
|
||||
}
|
||||
|
||||
this.client.setScreen(this);
|
||||
this.minecraft.setScreen(this);
|
||||
}, "https://jonasjones.me/microcraft", true));
|
||||
}
|
||||
|
||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
public void render(PoseStack matrices, int mouseX, int mouseY, float delta) {
|
||||
this.renderBackground(matrices);
|
||||
drawCenteredText(matrices, this.textRenderer, this.title, this.width / 2, 15, 16777215);
|
||||
drawCenteredString(matrices, this.font, this.title, this.width / 2, 15, 16777215);
|
||||
super.render(matrices, mouseX, mouseY, delta);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
package me.jonasjones.microcraft.gui.screens;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.screen.ScreenTexts;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
|
|
@ -14,24 +14,24 @@ public class ModSettings extends Screen {
|
|||
private final Screen parent;
|
||||
|
||||
public ModSettings (Screen parent) {
|
||||
super(Text.of("MicrocontrollerMC Controls"));
|
||||
super(Component.nullToEmpty("MicrocontrollerMC Controls"));
|
||||
this.parent = parent;
|
||||
}
|
||||
protected void init() {
|
||||
|
||||
|
||||
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.addRenderableWidget(Button.builder(Component.nullToEmpty("Configure Microcontrollers"), (button) -> {
|
||||
this.minecraft.setScreen(new SelectDevice(this));
|
||||
}).bounds(this.width / 2 - 155, 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.addRenderableWidget(Button.builder(CommonComponents.GUI_DONE, (button) -> {
|
||||
this.minecraft.setScreen(this.parent);
|
||||
}).bounds(this.width / 2 - 100, this.height / 6 + 168, 200, 20).build());
|
||||
}
|
||||
|
||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
public void render(PoseStack matrices, int mouseX, int mouseY, float delta) {
|
||||
this.renderBackground(matrices);
|
||||
drawCenteredText(matrices, this.textRenderer, this.title, this.width / 2, 15, 16777215);
|
||||
drawCenteredString(matrices, this.font, this.title, this.width / 2, 15, 16777215);
|
||||
super.render(matrices, mouseX, mouseY, delta);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +1,18 @@
|
|||
package me.jonasjones.microcraft.gui.screens;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.logging.LogUtils;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.screen.world.CreateWorldScreen;
|
||||
import net.minecraft.client.gui.screen.world.SelectWorldScreen;
|
||||
import net.minecraft.client.gui.screen.world.WorldListWidget;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.screen.ScreenTexts;
|
||||
import net.minecraft.text.OrderedText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.client.gui.components.EditBox;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.client.gui.screens.worldselection.CreateWorldScreen;
|
||||
import net.minecraft.client.gui.screens.worldselection.SelectWorldScreen;
|
||||
import net.minecraft.client.gui.screens.worldselection.WorldSelectionList;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.util.FormattedCharSequence;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
|
|
@ -24,16 +24,16 @@ public class SelectDevice extends Screen {
|
|||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
protected final Screen parent;
|
||||
@Nullable
|
||||
private List<OrderedText> tooltip;
|
||||
private ButtonWidget deleteButton;
|
||||
private ButtonWidget selectButton;
|
||||
private ButtonWidget editButton;
|
||||
private ButtonWidget recreateButton;
|
||||
protected TextFieldWidget searchBox;
|
||||
private WorldListWidget levelList;
|
||||
private List<FormattedCharSequence> tooltip;
|
||||
private Button deleteButton;
|
||||
private Button selectButton;
|
||||
private Button editButton;
|
||||
private Button recreateButton;
|
||||
protected EditBox searchBox;
|
||||
private WorldSelectionList levelList;
|
||||
|
||||
public SelectDevice(Screen parent) {
|
||||
super(Text.translatable("selectWorld.title"));
|
||||
super(Component.translatable("selectWorld.title"));
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
|
|
@ -47,32 +47,32 @@ public class SelectDevice extends Screen {
|
|||
|
||||
protected void init() {
|
||||
//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.searchBox = new EditBox(this.font, this.width / 2 - 100, 22, 200, 20, this.searchBox, Component.translatable("selectWorld.search"));
|
||||
this.searchBox.setResponder((search) -> {
|
||||
//this.levelList.filter(search);
|
||||
});
|
||||
SelectWorldScreen uwu = new SelectWorldScreen(this);
|
||||
//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(ButtonWidget.builder(Text.translatable("selectWorld.select"), (button) -> {
|
||||
this.levelList.getSelectedAsOptional().ifPresent(WorldListWidget.WorldEntry::play);
|
||||
}).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);
|
||||
}).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);
|
||||
}).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);
|
||||
}).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);
|
||||
}).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.addWidget(this.searchBox);
|
||||
this.addWidget(this.levelList);
|
||||
this.selectButton = (Button)this.addRenderableWidget(Button.builder(Component.translatable("selectWorld.select"), (button) -> {
|
||||
this.levelList.getSelectedOpt().ifPresent(WorldSelectionList.WorldListEntry::joinWorld);
|
||||
}).bounds(this.width / 2 - 154, this.height - 52, 150, 20).build());
|
||||
this.addRenderableWidget(Button.builder(Component.translatable("selectWorld.create"), (button) -> {
|
||||
CreateWorldScreen.openFresh(this.minecraft, this);
|
||||
}).bounds(this.width / 2 + 4, this.height - 52, 150, 20).build());
|
||||
this.editButton = (Button)this.addRenderableWidget(Button.builder(Component.translatable("selectWorld.edit"), (button) -> {
|
||||
this.levelList.getSelectedOpt().ifPresent(WorldSelectionList.WorldListEntry::editWorld);
|
||||
}).bounds(this.width / 2 - 154, this.height - 28, 72, 20).build());
|
||||
this.deleteButton = (Button)this.addRenderableWidget(Button.builder(Component.translatable("selectWorld.delete"), (button) -> {
|
||||
this.levelList.getSelectedOpt().ifPresent(WorldSelectionList.WorldListEntry::deleteWorld);
|
||||
}).bounds(this.width / 2 - 76, this.height - 28, 72, 20).build());
|
||||
this.recreateButton = (Button)this.addRenderableWidget(Button.builder(Component.translatable("selectWorld.recreate"), (button) -> {
|
||||
this.levelList.getSelectedOpt().ifPresent(WorldSelectionList.WorldListEntry::recreateWorld);
|
||||
}).bounds(this.width / 2 + 4, this.height - 28, 72, 20).build());
|
||||
this.addRenderableWidget(Button.builder(CommonComponents.GUI_CANCEL, (button) -> {
|
||||
this.minecraft.setScreen(this.parent);
|
||||
}).bounds(this.width / 2 + 82, this.height - 28, 72, 20).build());
|
||||
this.worldSelected(false);
|
||||
this.setInitialFocus(this.searchBox);
|
||||
}
|
||||
|
|
@ -81,27 +81,27 @@ public class SelectDevice extends Screen {
|
|||
return super.keyPressed(keyCode, scanCode, modifiers) ? true : this.searchBox.keyPressed(keyCode, scanCode, modifiers);
|
||||
}
|
||||
|
||||
public void close() {
|
||||
this.client.setScreen(this.parent);
|
||||
public void onClose() {
|
||||
this.minecraft.setScreen(this.parent);
|
||||
}
|
||||
|
||||
public boolean charTyped(char chr, int modifiers) {
|
||||
return this.searchBox.charTyped(chr, modifiers);
|
||||
}
|
||||
|
||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
public void render(PoseStack matrices, int mouseX, int mouseY, float delta) {
|
||||
this.tooltip = null;
|
||||
//this.levelList.render(matrices, mouseX, mouseY, delta);
|
||||
this.searchBox.render(matrices, mouseX, mouseY, delta);
|
||||
drawCenteredText(matrices, this.textRenderer, this.title, this.width / 2, 8, 16777215);
|
||||
drawCenteredString(matrices, this.font, this.title, this.width / 2, 8, 16777215);
|
||||
super.render(matrices, mouseX, mouseY, delta);
|
||||
if (this.tooltip != null) {
|
||||
this.renderOrderedTooltip(matrices, this.tooltip, mouseX, mouseY);
|
||||
this.renderTooltip(matrices, this.tooltip, mouseX, mouseY);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setTooltip(List<OrderedText> tooltip) {
|
||||
public void setTooltipForNextRenderPass(List<FormattedCharSequence> tooltip) {
|
||||
this.tooltip = tooltip;
|
||||
}
|
||||
|
||||
|
|
@ -114,14 +114,14 @@ public class SelectDevice extends Screen {
|
|||
|
||||
public void removed() {
|
||||
if (this.levelList != null) {
|
||||
this.levelList.children().forEach(WorldListWidget.Entry::close);
|
||||
this.levelList.children().forEach(WorldSelectionList.Entry::close);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Supplier<String> getSearchFilter() {
|
||||
return () -> {
|
||||
return this.searchBox.getText();
|
||||
return this.searchBox.getValue();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,24 @@
|
|||
package me.jonasjones.microcraft.gui.screens.board;
|
||||
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.Text;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
||||
public class AdvancedPinMappingScreen extends Screen {
|
||||
|
||||
private final Screen parent;
|
||||
|
||||
public AdvancedPinMappingScreen(Screen parent) {
|
||||
super(Text.of("Advanced Pin Mapping"));
|
||||
super(Component.nullToEmpty("Advanced Pin Mapping"));
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
}
|
||||
|
||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
public void render(PoseStack matrices, int mouseX, int mouseY, float delta) {
|
||||
this.renderBackground(matrices);
|
||||
drawCenteredText(matrices, this.textRenderer, this.title, this.width / 2, 15, 16777215);
|
||||
drawCenteredString(matrices, this.font, this.title, this.width / 2, 15, 16777215);
|
||||
super.render(matrices, mouseX, mouseY, delta);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
package me.jonasjones.microcraft.gui.screens.board;
|
||||
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.Text;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
||||
public class AdvancedSettingsScreen extends Screen {
|
||||
|
||||
private final Screen parent;
|
||||
|
||||
public AdvancedSettingsScreen(Screen parent) {
|
||||
super(Text.of("Advanced Board Settings"));
|
||||
super(Component.nullToEmpty("Advanced Board Settings"));
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
public void render(PoseStack matrices, int mouseX, int mouseY, float delta) {
|
||||
this.renderBackground(matrices);
|
||||
drawCenteredText(matrices, this.textRenderer, this.title, this.width / 2, 15, 16777215);
|
||||
drawCenteredString(matrices, this.font, this.title, this.width / 2, 15, 16777215);
|
||||
super.render(matrices, mouseX, mouseY, delta);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
package me.jonasjones.microcraft.gui.screens.board;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import me.jonasjones.microcraft.Microcraft;
|
||||
import me.jonasjones.microcraft.board.MicrocontrollerBoardIcon;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.gui.widget.TexturedButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.client.gui.components.ImageButton;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
import static me.jonasjones.microcraft.gui.widget.BoardConfigwidget.BOARD_TEXTURE;
|
||||
|
||||
|
|
@ -15,36 +15,36 @@ public class BoardIconSelectionScreen extends Screen {
|
|||
|
||||
private final Screen parent;
|
||||
|
||||
private final MicrocontrollerBoardIcon NANO_BOARD_TEXTURE = new MicrocontrollerBoardIcon(new Identifier(Microcraft.MOD_ID, "textures/boards/arduino-nano-sideways.png"), new Identifier(Microcraft.MOD_ID, "textures/boards/arduino-nano.png"), 128, 52);
|
||||
private final MicrocontrollerBoardIcon UNO_BOARD_TEXTURE = new MicrocontrollerBoardIcon(new Identifier(Microcraft.MOD_ID, "textures/boards/arduino-uno-sideways.png"), new Identifier(Microcraft.MOD_ID, "textures/boards/arduino-uno.png"), 128, 90);
|
||||
private final MicrocontrollerBoardIcon PROMINI_BOARD_TEXTURE = new MicrocontrollerBoardIcon(new Identifier(Microcraft.MOD_ID, "textures/boards/arduino-pro_mini-sideways.png"), new Identifier(Microcraft.MOD_ID, "textures/boards/arduino-pro_mini.png"), 97, 52);
|
||||
private final MicrocontrollerBoardIcon NANO_BOARD_TEXTURE = new MicrocontrollerBoardIcon(new ResourceLocation(Microcraft.MOD_ID, "textures/boards/arduino-nano-sideways.png"), new ResourceLocation(Microcraft.MOD_ID, "textures/boards/arduino-nano.png"), 128, 52);
|
||||
private final MicrocontrollerBoardIcon UNO_BOARD_TEXTURE = new MicrocontrollerBoardIcon(new ResourceLocation(Microcraft.MOD_ID, "textures/boards/arduino-uno-sideways.png"), new ResourceLocation(Microcraft.MOD_ID, "textures/boards/arduino-uno.png"), 128, 90);
|
||||
private final MicrocontrollerBoardIcon PROMINI_BOARD_TEXTURE = new MicrocontrollerBoardIcon(new ResourceLocation(Microcraft.MOD_ID, "textures/boards/arduino-pro_mini-sideways.png"), new ResourceLocation(Microcraft.MOD_ID, "textures/boards/arduino-pro_mini.png"), 97, 52);
|
||||
|
||||
public BoardIconSelectionScreen(Screen parent) {
|
||||
super(Text.of("Select Board Icon"));
|
||||
super(Component.nullToEmpty("Select Board Icon"));
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
this.addDrawableChild(new TexturedButtonWidget(this.width / 2 - 138, this.height / 2 - 85, NANO_BOARD_TEXTURE.width(), NANO_BOARD_TEXTURE.height(), 0, 0, 0, NANO_BOARD_TEXTURE.boardTextureHorizontal(), NANO_BOARD_TEXTURE.width(), NANO_BOARD_TEXTURE.height(), (buttonWidget) -> {
|
||||
this.addRenderableWidget(new ImageButton(this.width / 2 - 138, this.height / 2 - 85, NANO_BOARD_TEXTURE.width(), NANO_BOARD_TEXTURE.height(), 0, 0, 0, NANO_BOARD_TEXTURE.boardTextureHorizontal(), NANO_BOARD_TEXTURE.width(), NANO_BOARD_TEXTURE.height(), (buttonWidget) -> {
|
||||
BOARD_TEXTURE = NANO_BOARD_TEXTURE;
|
||||
this.client.setScreen(this.parent);
|
||||
this.minecraft.setScreen(this.parent);
|
||||
}));
|
||||
this.addDrawableChild(new TexturedButtonWidget(this.width / 2 - 138, this.height / 2 - 20, UNO_BOARD_TEXTURE.width(), UNO_BOARD_TEXTURE.height(), 0, 0, 0, UNO_BOARD_TEXTURE.boardTextureHorizontal(), UNO_BOARD_TEXTURE.width(), UNO_BOARD_TEXTURE.height(), (buttonWidget) -> {
|
||||
this.addRenderableWidget(new ImageButton(this.width / 2 - 138, this.height / 2 - 20, UNO_BOARD_TEXTURE.width(), UNO_BOARD_TEXTURE.height(), 0, 0, 0, UNO_BOARD_TEXTURE.boardTextureHorizontal(), UNO_BOARD_TEXTURE.width(), UNO_BOARD_TEXTURE.height(), (buttonWidget) -> {
|
||||
BOARD_TEXTURE = UNO_BOARD_TEXTURE;
|
||||
this.client.setScreen(this.parent);
|
||||
this.minecraft.setScreen(this.parent);
|
||||
}));
|
||||
this.addDrawableChild(new TexturedButtonWidget(this.width / 2 + 10, this.height / 2 - 85, PROMINI_BOARD_TEXTURE.width(), PROMINI_BOARD_TEXTURE.height(), 0, 0, 0, PROMINI_BOARD_TEXTURE.boardTextureHorizontal(), PROMINI_BOARD_TEXTURE.width(), PROMINI_BOARD_TEXTURE.height(), (buttonWidget) -> {
|
||||
this.addRenderableWidget(new ImageButton(this.width / 2 + 10, this.height / 2 - 85, PROMINI_BOARD_TEXTURE.width(), PROMINI_BOARD_TEXTURE.height(), 0, 0, 0, PROMINI_BOARD_TEXTURE.boardTextureHorizontal(), PROMINI_BOARD_TEXTURE.width(), PROMINI_BOARD_TEXTURE.height(), (buttonWidget) -> {
|
||||
BOARD_TEXTURE = PROMINI_BOARD_TEXTURE;
|
||||
this.client.setScreen(this.parent);
|
||||
this.minecraft.setScreen(this.parent);
|
||||
}));
|
||||
this.addDrawableChild(ButtonWidget.builder(Text.of("Cancel"), (button) -> {
|
||||
this.client.setScreen(this.parent);
|
||||
}).dimensions(this.width / 2 - 100, this.height / 6 + 168, 200, 20).build());
|
||||
this.addRenderableWidget(Button.builder(Component.nullToEmpty("Cancel"), (button) -> {
|
||||
this.minecraft.setScreen(this.parent);
|
||||
}).bounds(this.width / 2 - 100, this.height / 6 + 168, 200, 20).build());
|
||||
}
|
||||
|
||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
public void render(PoseStack matrices, int mouseX, int mouseY, float delta) {
|
||||
this.renderBackground(matrices);
|
||||
drawCenteredText(matrices, this.textRenderer, this.title, this.width / 2, 15, 16777215);
|
||||
drawCenteredString(matrices, this.font, this.title, this.width / 2, 15, 16777215);
|
||||
super.render(matrices, mouseX, mouseY, delta);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
package me.jonasjones.microcraft.gui.screens.board;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class ProfileSelectionScreen extends Screen {
|
||||
|
|
@ -13,13 +12,13 @@ public class ProfileSelectionScreen extends Screen {
|
|||
private final Screen parent;
|
||||
|
||||
public ProfileSelectionScreen(Screen parent) {
|
||||
super(Text.of("Profile Selection Screen"));
|
||||
super(Component.nullToEmpty("Profile Selection Screen"));
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
public void render(PoseStack matrices, int mouseX, int mouseY, float delta) {
|
||||
this.renderBackground(matrices);
|
||||
drawCenteredText(matrices, this.textRenderer, this.title, this.width / 2, 15, 16777215);
|
||||
drawCenteredString(matrices, this.font, this.title, this.width / 2, 15, 16777215);
|
||||
super.render(matrices, mouseX, mouseY, delta);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
package me.jonasjones.microcraft.gui.screens.board;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import me.jonasjones.microcraft.gui.screens.ModSettings;
|
||||
import me.jonasjones.microcraft.gui.screens.SelectDevice;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.screen.ScreenTexts;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class TextureSelectScreen extends Screen {
|
||||
private final Screen parent;
|
||||
|
||||
public TextureSelectScreen(Screen parent) {
|
||||
super(Text.of("Microcraft Configuration"));
|
||||
super(Component.nullToEmpty("Microcraft Configuration"));
|
||||
this.parent = parent;
|
||||
}
|
||||
protected void init() {
|
||||
|
|
@ -33,23 +33,23 @@ public class TextureSelectScreen extends Screen {
|
|||
}));
|
||||
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.addRenderableWidget(Button.builder(Component.nullToEmpty("Configure Microcontrollers"),(button) -> {
|
||||
this.minecraft.setScreen(new SelectDevice(this));
|
||||
}).bounds(this.width / 2 - 155, this.height / 6 + 12, 150, 20).build());
|
||||
this.addRenderableWidget(Button.builder(Component.nullToEmpty("Configure Microcraft"), (button) -> {
|
||||
this.minecraft.setScreen(new ModSettings(this));
|
||||
}).bounds(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));
|
||||
this.addRenderableWidget(Button.builder(CommonComponents.GUI_DONE, (button) -> {
|
||||
this.minecraft.setScreen(this.parent);
|
||||
}).bounds(this.width / 2 - 100, this.height / 6 + 168, 200, 20).build());
|
||||
this.addRenderableWidget(new net.minecraft.client.gui.components.Checkbox(50, 50, 100, 20, Component.nullToEmpty("uwu checkbox"), false));
|
||||
|
||||
}
|
||||
|
||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
public void render(PoseStack matrices, int mouseX, int mouseY, float delta) {
|
||||
this.renderBackground(matrices);
|
||||
drawCenteredText(matrices, this.textRenderer, this.title, this.width / 2, 15, 16777215);
|
||||
drawCenteredString(matrices, this.font, this.title, this.width / 2, 15, 16777215);
|
||||
super.render(matrices, mouseX, mouseY, delta);
|
||||
}
|
||||
}
|
||||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package me.jonasjones.microcraft.gui.widget;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import me.jonasjones.microcraft.Microcraft;
|
||||
import me.jonasjones.microcraft.board.MicrocontrollerBoardIcon;
|
||||
import me.jonasjones.microcraft.gui.screens.ModCreditsScreen;
|
||||
|
|
@ -17,15 +18,9 @@ import net.fabricmc.api.EnvType;
|
|||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.client.gui.components.ImageButton;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.gui.widget.TexturedButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class BoardConfigwidget extends Screen {
|
||||
|
|
@ -55,25 +50,25 @@ public class BoardConfigwidget extends Screen {
|
|||
this.addRenderableWidget(ButtonWidget.builder(Component.literal("Microcraft Settings"), (buttonWidget) -> this.minecraft.setScreen(new ModSettings(this))).dimensions(this.width - 210, this.height - 55, 200, 20).build());*/
|
||||
|
||||
this.addRenderableWidget(new Button.Builder(Component.literal("About"), (buttonWidget) -> this.minecraft.setScreen(new ModCreditsScreen(this)))
|
||||
.dimensions(this.width / 2 - 154, this.height - 28, 75, 20).build());
|
||||
.bounds(this.width / 2 - 154, this.height - 28, 75, 20).build());
|
||||
this.addRenderableWidget(new Button.Builder(Component.literal("Pin Mapping"), (buttonWidget) -> this.minecraft.setScreen(new AdvancedPinMappingScreen(this)))
|
||||
.dimensions(this.width / 2 + 4 + 50, this.height - 52, 100, 20).build());
|
||||
.bounds(this.width / 2 + 4 + 50, this.height - 52, 100, 20).build());
|
||||
this.addRenderableWidget(new Button.Builder(Component.literal("Board Settings"), (buttonWidget) -> this.minecraft.setScreen(new AdvancedSettingsScreen(this)))
|
||||
.dimensions(this.width / 2 - 154, this.height - 52, 100, 20).build());
|
||||
.bounds(this.width / 2 - 154, this.height - 52, 100, 20).build());
|
||||
this.addRenderableWidget(new Button.Builder(Component.literal("Done"), (buttonWidget) -> this.minecraft.setScreen(this.parent))
|
||||
.dimensions(this.width / 2 + 4 + 76, this.height - 28, 75, 20).build());
|
||||
ButtonWidget upload = this.addRenderableWidget(new Button.Builder(Component.literal("Upload"), (buttonWidget) -> this.minecraft.setScreen(this.parent))
|
||||
.dimensions(this.width / 2, this.height - 28, 75, 20).build());
|
||||
.bounds(this.width / 2 + 4 + 76, this.height - 28, 75, 20).build());
|
||||
Button upload = this.addRenderableWidget(new Button.Builder(Component.literal("Upload"), (buttonWidget) -> this.minecraft.setScreen(this.parent))
|
||||
.bounds(this.width / 2, this.height - 28, 75, 20).build());
|
||||
upload.active = false;
|
||||
this.addRenderableWidget(new Button.Builder(Component.literal("Settings"), (buttonWidget) -> this.minecraft.setScreen(new ModSettings(this)))
|
||||
.dimensions(this.width / 2 - 75, this.height - 28, 70, 20).build());
|
||||
.bounds(this.width / 2 - 75, this.height - 28, 70, 20).build());
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
public void render(PoseStack matrices, int mouseX, int mouseY, float delta) {
|
||||
this.renderBackground(matrices);
|
||||
drawCenteredText(matrices, this.textRenderer, this.title, this.width / 2, 15, 16777215);
|
||||
drawCenteredString(matrices, this.font, this.title, this.width / 2, 15, 16777215);
|
||||
super.render(matrices, mouseX, mouseY, delta);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue