use of net.minecraft.client.gui.Drawable in project sodium-fabric by CaffeineMC.
the class SodiumOptionsGUI method rebuildGUI.
private void rebuildGUI() {
this.controls.clear();
this.children.clear();
this.drawable.clear();
if (this.currentPage == null) {
if (this.pages.isEmpty()) {
throw new IllegalStateException("No pages are available?!");
}
// Just use the first page for now
this.currentPage = this.pages.get(0);
}
this.rebuildGUIPages();
this.rebuildGUIOptions();
this.applyButton = new FlatButtonWidget(new Rect2i(10, this.height - 30, 80, 20), "Apply", this::applyChanges);
this.closeButton = new FlatButtonWidget(new Rect2i(96, this.height - 30, 80, 20), "Close", this::popScreen);
this.children.add(this.applyButton);
this.children.add(this.closeButton);
this.resetButton = new FlatButtonWidget(new Rect2i(this.width - 96, this.height - 30, 80, 20), "Reset", this::resetChanges);
this.children.add(this.resetButton);
for (Element element : this.children) {
if (element instanceof Drawable) {
this.drawable.add((Drawable) element);
}
}
}
use of net.minecraft.client.gui.Drawable in project sodium-fabric by CaffeineMC.
the class SodiumOptionsGUI method render.
@Override
public void render(int mouseX, int mouseY, float delta) {
super.renderBackground();
this.update(mouseX, mouseY, delta);
for (Drawable drawable : this.drawable) {
drawable.render(mouseX, mouseY, delta);
}
}
Aggregations