mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-18 19:39:06 +00:00
Don't require holding shift to move items when overlaying recipe (#348)
* updateBuildScript * Remove redundant public modifier * Don't require holding shift to move items when overlaying recipe
This commit is contained in:
1 parent
6d0f83c499
commit
e20756a196
5 files changed
+182
-9
No files matched your search
@@ -271,6 +271,10 @@ public class NEIClientConfig {
|
||||
.getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.jei_style_cycled_ingredients", true));
|
||||
|
||||
tag.getTag("inventory.shift_overlay_recipe")
|
||||
.setComment("Require holding shift to move items when overlaying recipe").getBooleanValue(false);
|
||||
API.addOption(new OptionToggleButton("inventory.shift_overlay_recipe", true));
|
||||
|
||||
tag.getTag("tools.handler_load_from_config").setComment("ADVANCED: Load handlers from config")
|
||||
.getBooleanValue(false);
|
||||
API.addOption(new OptionToggleButton("tools.handler_load_from_config", true) {
|
||||
@@ -578,6 +582,10 @@ public class NEIClientConfig {
|
||||
return getBooleanSetting("inventory.jei_style_cycled_ingredients");
|
||||
}
|
||||
|
||||
public static boolean requireShiftForOverlayRecipe() {
|
||||
return getBooleanSetting("inventory.shift_overlay_recipe");
|
||||
}
|
||||
|
||||
public static boolean isEnabled() {
|
||||
return enabledOverride && getBooleanSetting("inventory.widgetsenabled");
|
||||
}
|
||||
|
||||
@@ -6,5 +6,5 @@ import codechicken.nei.recipe.IRecipeHandler;
|
||||
|
||||
public interface IOverlayHandler {
|
||||
|
||||
public void overlayRecipe(GuiContainer firstGui, IRecipeHandler recipe, int recipeIndex, boolean shift);
|
||||
void overlayRecipe(GuiContainer firstGui, IRecipeHandler recipe, int recipeIndex, boolean shift);
|
||||
}
|
||||
@@ -471,6 +471,7 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
|
||||
}
|
||||
|
||||
protected void overlayRecipe(int recipe, final boolean shift) {
|
||||
boolean moveItems = shift || !NEIClientConfig.requireShiftForOverlayRecipe();
|
||||
if (handler == null || !handler.hasOverlay(firstGui, firstGui.inventorySlots, recipe)) {
|
||||
mc.displayGuiScreen(firstGui);
|
||||
return;
|
||||
@@ -479,8 +480,8 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
|
||||
final IOverlayHandler overlayHandler = handler.getOverlayHandler(firstGui, recipe);
|
||||
|
||||
mc.displayGuiScreen(firstGui);
|
||||
if (renderer == null || shift) {
|
||||
overlayHandler.overlayRecipe(firstGui, currenthandlers.get(recipetype), recipe, shift);
|
||||
if (renderer == null || moveItems) {
|
||||
overlayHandler.overlayRecipe(firstGui, currenthandlers.get(recipetype), recipe, moveItems);
|
||||
} else {
|
||||
LayoutManager.overlayRenderer = renderer;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user