config editor
This commit is contained in:
@@ -10,6 +10,7 @@ import org.saturnclient.ui.animations.Slide;
|
||||
import org.saturnclient.ui.components.SaturnToggle;
|
||||
import org.saturnclient.ui.widgets.SaturnScroll;
|
||||
import org.saturnclient.ui.widgets.SaturnSprite;
|
||||
import org.saturnclient.ui.widgets.SaturnText;
|
||||
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
@@ -52,14 +53,16 @@ public class ConfigEditor extends SaturnUi {
|
||||
|
||||
int propWidth = (rectWidth - 15) / 2;
|
||||
|
||||
SaturnScroll modsScroll = new SaturnScroll();
|
||||
SaturnScroll configScroll = new SaturnScroll();
|
||||
|
||||
for (Map.Entry<String, Property<?>> propEntry : config.getProperties().entrySet()) {
|
||||
Property<?> prop = propEntry.getValue();
|
||||
String propName = propEntry.getKey();
|
||||
if (prop.value instanceof Boolean) {
|
||||
draw(new SaturnToggle((Property<Boolean>) prop).setX(modX).setY(modY));
|
||||
}
|
||||
|
||||
configScroll.draw(new SaturnToggle((Property<Boolean>) prop).setX(modX).setY(modY));
|
||||
configScroll.draw(
|
||||
new SaturnText(propName.substring(0, 1).toUpperCase() + propName.substring(1))
|
||||
.setX(modX + 18).setY(modY));
|
||||
col++;
|
||||
if (col < 2) {
|
||||
modX += propWidth + 21;
|
||||
@@ -70,7 +73,9 @@ public class ConfigEditor extends SaturnUi {
|
||||
}
|
||||
}
|
||||
|
||||
draw(modsScroll.setX(rectX + 17).setY(rectY + 10).setWidth(rectWidth - 17).setHeight(rectHeight - 10));
|
||||
}
|
||||
|
||||
draw(configScroll.setX(rectX + 17).setY(rectY + 10).setWidth(rectWidth - 17).setHeight(rectHeight - 10));
|
||||
|
||||
super.init();
|
||||
}
|
||||
|
||||
@@ -51,11 +51,11 @@ public class ArmorDisplay implements SaturnMod, HudMod {
|
||||
public void render(DrawContext context) {
|
||||
PlayerEntity player = MinecraftClient.getInstance().player;
|
||||
ItemStack[] items = {
|
||||
player.getEquippedStack(EquipmentSlot.MAINHAND),
|
||||
player.getEquippedStack(EquipmentSlot.FEET),
|
||||
player.getEquippedStack(EquipmentSlot.LEGS),
|
||||
player.getEquippedStack(EquipmentSlot.CHEST),
|
||||
player.getEquippedStack(EquipmentSlot.HEAD),
|
||||
player.getEquippedStack(EquipmentSlot.MAINHAND),
|
||||
};
|
||||
|
||||
int y = 60;
|
||||
@@ -70,11 +70,11 @@ public class ArmorDisplay implements SaturnMod, HudMod {
|
||||
@Override
|
||||
public void renderDummy(DrawContext context) {
|
||||
ItemStack[] items = {
|
||||
new ItemStack(Items.DIAMOND_SWORD),
|
||||
new ItemStack(Items.DIAMOND_BOOTS),
|
||||
new ItemStack(Items.DIAMOND_LEGGINGS),
|
||||
new ItemStack(Items.DIAMOND_CHESTPLATE),
|
||||
new ItemStack(Items.DIAMOND_HELMET),
|
||||
new ItemStack(Items.DIAMOND_SWORD),
|
||||
};
|
||||
|
||||
int y = 60;
|
||||
|
||||
Reference in New Issue
Block a user