mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-20 12:19:48 +00:00
Adaptive NEI Visibility based on screen size + crash prevention for default NEI layout.
Conflicts: src/main/java/tconstruct/tools/gui/CraftingStationGui.java
This commit is contained in:
1 parent
16fd95d3a2
commit
fab22bd432
3 files changed
+93
-7
No files matched your search
@@ -68,7 +68,7 @@ public class PartCrafterGui extends GuiContainer implements INEIGuiHandler
|
||||
{
|
||||
super.initGui();
|
||||
|
||||
this.xSize = CRAFT_WIDTH + DESC_WIDTH;
|
||||
this.xSize = CRAFT_WIDTH;
|
||||
this.ySize = CRAFT_HEIGHT;
|
||||
|
||||
this.craftingLeft = (this.width - CRAFT_WIDTH) / 2;
|
||||
@@ -235,6 +235,20 @@ public class PartCrafterGui extends GuiContainer implements INEIGuiHandler
|
||||
@Override
|
||||
public VisiblityData modifyVisiblity (GuiContainer gui, VisiblityData currentVisibility)
|
||||
{
|
||||
if (width - xSize < 107)
|
||||
{
|
||||
currentVisibility.showWidgets = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentVisibility.showWidgets = true;
|
||||
}
|
||||
|
||||
if (guiLeft < 58)
|
||||
{
|
||||
currentVisibility.showStateButtons = false;
|
||||
}
|
||||
|
||||
return currentVisibility;
|
||||
}
|
||||
|
||||
@@ -262,7 +276,7 @@ public class PartCrafterGui extends GuiContainer implements INEIGuiHandler
|
||||
if (y + h - 4 < guiTop || y + 4 > guiTop + ySize)
|
||||
return false;
|
||||
|
||||
if (x + 4 > guiLeft + xSize)
|
||||
if (x + 4 > guiLeft + xSize + DESC_WIDTH)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user