Fixed more crashes relating to scrollbar in GUIs, fixes #1377
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
# Refined Storage Changelog
|
||||
|
||||
### 1.5.14
|
||||
- Fixed more crashes relating to scrollbar in GUIs (raoulvdberge)
|
||||
|
||||
### 1.5.13
|
||||
- Fixed Wireless Fluid Grid not using up energy (raoulvdberge)
|
||||
- Fixed Wireless Crafting Monitor remaining in network item list (raoulvdberge)
|
||||
|
||||
@@ -35,8 +35,10 @@ public class GuiController extends GuiBase {
|
||||
|
||||
@Override
|
||||
public void update(int x, int y) {
|
||||
scrollbar.setEnabled(getRows() > VISIBLE_ROWS);
|
||||
scrollbar.setMaxOffset(getRows() - VISIBLE_ROWS);
|
||||
if (scrollbar != null) {
|
||||
scrollbar.setEnabled(getRows() > VISIBLE_ROWS);
|
||||
scrollbar.setMaxOffset(getRows() - VISIBLE_ROWS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -82,15 +82,22 @@ public class GuiCraftingMonitor extends GuiBase {
|
||||
|
||||
@Override
|
||||
public void update(int x, int y) {
|
||||
scrollbar.setEnabled(getRows() > VISIBLE_ROWS);
|
||||
scrollbar.setMaxOffset(getRows() - VISIBLE_ROWS);
|
||||
if (scrollbar != null) {
|
||||
scrollbar.setEnabled(getRows() > VISIBLE_ROWS);
|
||||
scrollbar.setMaxOffset(getRows() - VISIBLE_ROWS);
|
||||
}
|
||||
|
||||
if (itemSelected >= getElements().size()) {
|
||||
itemSelected = -1;
|
||||
}
|
||||
|
||||
cancelButton.enabled = itemSelected != -1 && getElements().get(itemSelected).getTaskId() != -1;
|
||||
cancelAllButton.enabled = getElements().size() > 0;
|
||||
if (cancelButton != null) {
|
||||
cancelButton.enabled = itemSelected != -1 && getElements().get(itemSelected).getTaskId() != -1;
|
||||
}
|
||||
|
||||
if (cancelAllButton != null) {
|
||||
cancelAllButton.enabled = getElements().size() > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -78,10 +78,12 @@ public class GuiCraftingPreview extends GuiBase {
|
||||
|
||||
@Override
|
||||
public void update(int x, int y) {
|
||||
scrollbar.setEnabled(getRows() > VISIBLE_ROWS);
|
||||
scrollbar.setMaxOffset(getRows() - VISIBLE_ROWS);
|
||||
if (scrollbar != null) {
|
||||
scrollbar.setEnabled(getRows() > VISIBLE_ROWS);
|
||||
scrollbar.setMaxOffset(getRows() - VISIBLE_ROWS);
|
||||
}
|
||||
|
||||
if (!startButton.enabled && isCtrlKeyDown() && isShiftKeyDown()) {
|
||||
if (startButton != null && !startButton.enabled && isCtrlKeyDown() && isShiftKeyDown()) {
|
||||
startButton.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,8 +60,10 @@ public class GuiReaderWriter extends GuiBase {
|
||||
|
||||
@Override
|
||||
public void update(int x, int y) {
|
||||
scrollbar.setEnabled(getRows() > VISIBLE_ROWS);
|
||||
scrollbar.setMaxOffset(getRows() - VISIBLE_ROWS);
|
||||
if (scrollbar != null) {
|
||||
scrollbar.setEnabled(getRows() > VISIBLE_ROWS);
|
||||
scrollbar.setMaxOffset(getRows() - VISIBLE_ROWS);
|
||||
}
|
||||
|
||||
if (itemSelected >= getChannels().size()) {
|
||||
itemSelected = -1;
|
||||
|
||||
@@ -218,8 +218,10 @@ public class GuiGrid extends GuiBase implements IGridDisplay {
|
||||
|
||||
STACKS = stacks;
|
||||
|
||||
scrollbar.setEnabled(getRows() > getVisibleRows());
|
||||
scrollbar.setMaxOffset(getRows() - getVisibleRows());
|
||||
if (scrollbar != null) {
|
||||
scrollbar.setEnabled(getRows() > getVisibleRows());
|
||||
scrollbar.setMaxOffset(getRows() - getVisibleRows());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user