mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-10-26 14:24:07 +00:00
The subset dropdown now shows only when the bookmarks aren't visible (there isn't enough room for it otherwise).
This commit is contained in:
1 parent
c0be69f85f
commit
5bfbf250cc
3 files changed
+14
-6
No files matched your search
+1
-1
@@ -2,4 +2,4 @@ mc_version=1.7.10
|
||||
forge_version=10.13.4.1614-1.7.10
|
||||
ccl_version=1.1.3.138
|
||||
ccc_version=1.0.7.+
|
||||
mod_version=2.1.0-GTNH-beta9
|
||||
mod_version=2.1.0-GTNH-beta10
|
||||
@@ -675,10 +675,9 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
if (visiblity.showBookmarkPanel) {
|
||||
addWidget(bookmarkPanel);
|
||||
bookmarkPanel.setVisible();
|
||||
}
|
||||
}
|
||||
|
||||
if (visiblity.showSearchSection) {
|
||||
addWidget(dropDown);
|
||||
addWidget(searchField);
|
||||
}
|
||||
|
||||
@@ -700,6 +699,11 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
if (canPerformAction("delete"))
|
||||
addWidget(delete);
|
||||
}
|
||||
|
||||
if (!visiblity.showBookmarkPanel) {
|
||||
// Bookmarks or Subset/dropdown
|
||||
addWidget(dropDown);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ public class LayoutStyleMinecraft extends LayoutStyle
|
||||
public int buttonCount;
|
||||
public int leftSize;
|
||||
public int numButtons;
|
||||
public int startingButtonY;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
@@ -60,6 +61,8 @@ public class LayoutStyleMinecraft extends LayoutStyle
|
||||
public void layout(GuiContainer gui, VisiblityData visiblity) {
|
||||
reset();
|
||||
|
||||
startingButtonY = visiblity.showBookmarkPanel ? 3 : 23;
|
||||
|
||||
leftSize = ItemPanels.bookmarkPanel.getWidth(gui);
|
||||
numButtons = Math.max(leftSize / 18, 1);
|
||||
|
||||
@@ -136,9 +139,10 @@ public class LayoutStyleMinecraft extends LayoutStyle
|
||||
|
||||
searchField.y = gui.height - searchField.h - 2;
|
||||
|
||||
dropDown.x = gui.guiLeft;
|
||||
dropDown.x = 2;
|
||||
dropDown.h = 20;
|
||||
dropDown.w = Math.min(itemPanel.prev.x - dropDown.x - 3, 100);
|
||||
dropDown.w = itemPanel.x - dropDown.x - 3;
|
||||
|
||||
searchField.h = 20;
|
||||
searchField.w = 150;
|
||||
searchField.x = (gui.width - searchField.w) / 2;
|
||||
@@ -151,7 +155,7 @@ public class LayoutStyleMinecraft extends LayoutStyle
|
||||
|
||||
public void layoutButton(Button button) {
|
||||
button.x = 2 + (buttonCount % numButtons) * 20;
|
||||
button.y = 3 + (buttonCount / numButtons) * 18;
|
||||
button.y = startingButtonY + (buttonCount / numButtons) * 18;
|
||||
|
||||
button.h = 17;
|
||||
button.w = button.contentWidth() + 6;
|
||||
|
||||
Reference in new issue
Block a user