mirror of
https://github.com/GTNewHorizons/JustEnoughCalculation.git
synced 2026-11-28 07:35:41 +00:00
fix
This commit is contained in:
1 parent
d6ead4a4e9
commit
1c05e9d154
37 files changed
+763
-474
No files matched your search
@@ -47,29 +47,29 @@ public class WSwitcher extends WContainer {
|
||||
this.yPos = yPos;
|
||||
this.keys = keys;
|
||||
left = new WButtonIcon(xPos, yPos, SIZE, SIZE, WGT_ARR_L).setListener(i -> {
|
||||
if (temp == null) move(false);
|
||||
if (temp == null) move(-1);
|
||||
else setTemp(null);
|
||||
});
|
||||
right = new WButtonIcon(xPos + xSize - SIZE, yPos, SIZE, SIZE, WGT_ARR_R).setListener(i -> {
|
||||
if (temp == null) move(true);
|
||||
if (temp == null) move(1);
|
||||
else setTemp(null);
|
||||
});
|
||||
wRect = new WRectangle(xPos + SIZE, yPos, xSize - 2 * SIZE, SIZE, COLOR_GUI_GREY);
|
||||
wText = new WText(xPos + SIZE, yPos + 2, xSize - 2 * SIZE, SHADOW, "", true);
|
||||
index = new Circulator(keys.size());
|
||||
refresh();
|
||||
addAll(left, right, wRect, wText);
|
||||
add(left, right, wRect, wText);
|
||||
}
|
||||
|
||||
|
||||
protected void move(boolean forward) {
|
||||
if (temp == null) {
|
||||
if (forward)
|
||||
index.move(1);
|
||||
else
|
||||
index.move(-1);
|
||||
} else
|
||||
public void move(int diff) {
|
||||
if (diff == 0) return;
|
||||
if (temp != null) {
|
||||
temp = null;
|
||||
if (diff > 0) diff -= 1;
|
||||
else diff += 1;
|
||||
}
|
||||
index.move(diff);
|
||||
notifyLsnr();
|
||||
refresh();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user