mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-18 19:39:06 +00:00
Enable bookmark panel hiding
This commit is contained in:
1 parent
40ff91a908
commit
fe83411c57
4 files changed
+28
-2
No files matched your search
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB |
@@ -39,6 +39,7 @@ import static codechicken.nei.NEIClientConfig.getOptionList;
|
||||
import static codechicken.nei.NEIClientConfig.getSearchExpression;
|
||||
import static codechicken.nei.NEIClientConfig.hasSMPCounterPart;
|
||||
import static codechicken.nei.NEIClientConfig.invCreativeMode;
|
||||
import static codechicken.nei.NEIClientConfig.isBookmarkPanelHidden;
|
||||
import static codechicken.nei.NEIClientConfig.isEnabled;
|
||||
import static codechicken.nei.NEIClientConfig.isHidden;
|
||||
import static codechicken.nei.NEIClientConfig.showIDs;
|
||||
@@ -198,6 +199,11 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
toggleBooleanSetting("inventory.hidden");
|
||||
return true;
|
||||
}
|
||||
if (keyID == getKeyBinding("gui.hide_bookmarks")) {
|
||||
toggleBooleanSetting("bookmarksEnabled");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isEnabled() && !isHidden()) {
|
||||
for (Widget widget : controlWidgets)
|
||||
if (inputFocused == null)
|
||||
@@ -242,6 +248,7 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
widget.draw(mousex, mousey);
|
||||
} else {
|
||||
options.draw(mousex, mousey);
|
||||
bookmarks.draw(mousex, mousey);
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
@@ -293,8 +300,13 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
VisiblityData visiblity = new VisiblityData();
|
||||
if (isHidden())
|
||||
visiblity.showNEI = false;
|
||||
|
||||
if (isBookmarkPanelHidden())
|
||||
visiblity.showBookmarkPanel = false;
|
||||
|
||||
if (gui.height - gui.ySize <= 40)
|
||||
visiblity.showSearchSection = false;
|
||||
|
||||
if (gui.guiLeft - 4 < 76)
|
||||
visiblity.showWidgets = false;
|
||||
|
||||
@@ -339,7 +351,8 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
{
|
||||
@Override
|
||||
public boolean onButtonPress(boolean rightclick) {
|
||||
return false;
|
||||
NEIClientConfig.toggleBooleanSetting("bookmarksEnabled");
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -605,6 +618,7 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
|
||||
|
||||
addWidget(options);
|
||||
addWidget(bookmarks);
|
||||
if (visiblity.showItemPanel) {
|
||||
addWidget(itemPanel);
|
||||
itemPanel.setVisible();
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import static codechicken.lib.gui.GuiDraw.drawStringC;
|
||||
import static codechicken.nei.LayoutManager.bookmarkPanel;
|
||||
import static codechicken.nei.LayoutManager.bookmarks;
|
||||
import static codechicken.nei.LayoutManager.delete;
|
||||
import static codechicken.nei.LayoutManager.dropDown;
|
||||
import static codechicken.nei.LayoutManager.gamemode;
|
||||
@@ -126,6 +127,11 @@ public class LayoutStyleMinecraft extends LayoutStyle
|
||||
options.y = isEnabled() ? gui.height - 22 : gui.height - 28;
|
||||
options.w = 80;
|
||||
options.h = 22;
|
||||
|
||||
bookmarks.x = 82 + (isEnabled() ? 0 : 6);
|
||||
bookmarks.y = isEnabled() ? gui.height - 22 : gui.height - 28;
|
||||
bookmarks.w = 80;
|
||||
bookmarks.h = 22;
|
||||
|
||||
searchField.y = gui.height - searchField.h - 2;
|
||||
|
||||
|
||||
@@ -123,6 +123,8 @@ public class NEIClientConfig
|
||||
API.addOption(new OptionTextField("command.rain"));
|
||||
tag.getTag("command.heal").setDefaultValue("");
|
||||
API.addOption(new OptionTextField("command.heal"));
|
||||
|
||||
tag.getTag("bookmarksEnabled").setComment("Enable/disable bookmarks").getBooleanValue(true);
|
||||
|
||||
setDefaultKeyBindings();
|
||||
}
|
||||
@@ -167,6 +169,7 @@ public class NEIClientConfig
|
||||
API.addKeyBind("gui.hide", Keyboard.KEY_O);
|
||||
API.addKeyBind("gui.search", Keyboard.KEY_F);
|
||||
API.addKeyBind("gui.bookmark", Keyboard.KEY_A);
|
||||
API.addKeyBind("gui.hide_bookmarks", Keyboard.KEY_B);
|
||||
API.addKeyBind("world.chunkoverlay", Keyboard.KEY_F9);
|
||||
API.addKeyBind("world.moboverlay", Keyboard.KEY_F7);
|
||||
API.addKeyBind("world.highlight_tips", Keyboard.KEY_NUMPAD0);
|
||||
@@ -281,7 +284,9 @@ public class NEIClientConfig
|
||||
public static boolean isHidden() {
|
||||
return !enabledOverride || getBooleanSetting("inventory.hidden");
|
||||
}
|
||||
|
||||
public static boolean isBookmarkPanelHidden() {
|
||||
return !getBooleanSetting("bookmarksEnabled");
|
||||
}
|
||||
public static boolean isEnabled() {
|
||||
return enabledOverride && getBooleanSetting("inventory.widgetsenabled");
|
||||
}
|
||||
@@ -433,4 +438,5 @@ public class NEIClientConfig
|
||||
if (file.isDirectory() && !saveFileNames.contains(file.getName()))
|
||||
ObfuscationRun.deleteDir(file, true);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user