functional ui
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package org.auraclient.auraclient.menus;
|
||||
|
||||
import org.auraclient.auraclient.AuraClient;
|
||||
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.text.Text;
|
||||
@@ -11,8 +13,15 @@ public class CloakSelector extends Screen {
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
ButtonWidget btn = ButtonWidget.builder(Text.literal("Cloaks"), (_button) -> {}).dimensions((this.width - 50) / 2, (this.height - 30) / 2, 50, 30).build();
|
||||
int y = ((this.height - (35 * (AuraClient.list.size()))) / 2);
|
||||
|
||||
for (String cloak : AuraClient.list) {
|
||||
addDrawableChild(ButtonWidget.builder(Text.literal(cloak), (__) -> {
|
||||
AuraClient.cape = cloak;
|
||||
}).dimensions((this.width - 50) / 2, y, 50, 30).build());
|
||||
|
||||
y += 35;
|
||||
}
|
||||
|
||||
addDrawableChild(btn);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ public class MainMenu extends Screen {
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
ButtonWidget btn = ButtonWidget.builder(Text.literal("Cloaks"), (_button) -> {}).dimensions((this.width - 50) / 2, (this.height - 30) / 2, 50, 30).build();
|
||||
|
||||
addDrawableChild(btn);
|
||||
addDrawableChild(ButtonWidget.builder(Text.literal("Cloaks"), (_button) -> {
|
||||
client.setScreen(new CloakSelector());
|
||||
}).dimensions((this.width - 50) / 2, (this.height - 30) / 2, 50, 30).build());
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 494 B |
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"gui": {
|
||||
"scaling": {
|
||||
"type": "nine_slice",
|
||||
"width": 300,
|
||||
"height": 30,
|
||||
"border": 9
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 494 B |
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"gui": {
|
||||
"scaling": {
|
||||
"type": "nine_slice",
|
||||
"width": 300,
|
||||
"height": 30,
|
||||
"border": 9
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user