mirror of
https://github.com/GTNewHorizons/NotEnoughEnergistics.git
synced 2026-11-17 19:05:01 +00:00
Fix "Combine Items" button overlap with "Use as substitution" (#25)
This commit is contained in:
1 parent
74b1ed4b9a
commit
d30875623a
3 files changed
+38
-18
No files matched your search
@@ -42,6 +42,7 @@ public class GuiEventHandler implements INEIGuiHandler {
|
||||
|
||||
private GuiImgButtonEnableCombination buttonCombination;
|
||||
private boolean hasDoubleBtn = true;
|
||||
private boolean hasBeSubstituteBtn = true;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onGuiOpen(GuiOpenEvent event) {
|
||||
@@ -97,17 +98,25 @@ public class GuiEventHandler implements INEIGuiHandler {
|
||||
} catch (NoSuchFieldException e) {
|
||||
hasDoubleBtn = false;
|
||||
}
|
||||
if (hasDoubleBtn) {
|
||||
buttonCombination = new GuiImgButtonEnableCombination(
|
||||
gui.guiLeft + 84,
|
||||
gui.guiTop + gui.ySize - 153,
|
||||
ItemCombination.valueOf(NEEConfig.itemCombinationMode));
|
||||
} else {
|
||||
buttonCombination = new GuiImgButtonEnableCombination(
|
||||
gui.guiLeft + 74,
|
||||
gui.guiTop + gui.ySize - 153,
|
||||
ItemCombination.valueOf(NEEConfig.itemCombinationMode));
|
||||
try {
|
||||
GuiPatternTerm.class.getDeclaredField("beSubstitutionsEnabledBtn");
|
||||
} catch (NoSuchFieldException e) {
|
||||
hasBeSubstituteBtn = false;
|
||||
}
|
||||
|
||||
int x, y;
|
||||
if (hasDoubleBtn && hasBeSubstituteBtn) {
|
||||
x = gui.guiLeft + 84;
|
||||
y = gui.guiTop + gui.ySize - 143;
|
||||
} else if (hasDoubleBtn) {
|
||||
x = gui.guiLeft + 84;
|
||||
y = gui.guiTop + gui.ySize - 153;
|
||||
} else {
|
||||
x = gui.guiLeft + 74;
|
||||
y = gui.guiTop + gui.ySize - 153;
|
||||
}
|
||||
buttonCombination =
|
||||
new GuiImgButtonEnableCombination(x, y, ItemCombination.valueOf(NEEConfig.itemCombinationMode));
|
||||
event.buttonList.add(buttonCombination);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user