mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-19 20:09:39 +00:00
* Update deps * Remove dead code * Add missing `@Override` annotations * Fix generics * Add `serialVersionUID`s * Address deprecation warnings * Use `@WrapWithCondition` v2 * Misc cleanup * Use AccessTransformers if possible * Fix mixin conflicts * Add `@Mutable` annotations * Fix injection targets * Update deps
61 lines
1.0 KiB
Java
61 lines
1.0 KiB
Java
package net.coderbot.iris.gui;
|
|
|
|
import lombok.Getter;
|
|
import net.coderbot.iris.gui.element.ShaderPackOptionList;
|
|
|
|
import java.util.ArrayDeque;
|
|
import java.util.Deque;
|
|
|
|
public class NavigationController {
|
|
|
|
private ShaderPackOptionList optionList;
|
|
|
|
@Getter
|
|
private String currentScreen = null;
|
|
private final Deque<String> history = new ArrayDeque<>();
|
|
|
|
public void back() {
|
|
if (history.size() > 0) {
|
|
history.removeLast();
|
|
|
|
if (history.size() > 0) {
|
|
currentScreen = history.getLast();
|
|
} else {
|
|
currentScreen = null;
|
|
}
|
|
} else {
|
|
currentScreen = null;
|
|
}
|
|
|
|
this.rebuild();
|
|
}
|
|
|
|
public void open(String screen) {
|
|
currentScreen = screen;
|
|
history.addLast(screen);
|
|
|
|
this.rebuild();
|
|
}
|
|
|
|
public void rebuild() {
|
|
if (optionList != null) {
|
|
optionList.rebuild();
|
|
}
|
|
}
|
|
|
|
public void refresh() {
|
|
if (optionList != null) {
|
|
optionList.refresh();
|
|
}
|
|
}
|
|
|
|
public boolean hasHistory() {
|
|
return this.history.size() > 0;
|
|
}
|
|
|
|
public void setActiveOptionList(ShaderPackOptionList optionList) {
|
|
this.optionList = optionList;
|
|
}
|
|
|
|
}
|