Files
Angelica/src/main/java/net/coderbot/iris/gui/NavigationController.java
T
glowredman bb5526598e Various Mixin-related Fixes (#890)
* 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
2025-03-08 20:41:47 -08:00

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;
}
}