mirror of
https://github.com/GTNewHorizons/ThaumicEnergistics.git
synced 2026-10-25 20:32:27 +00:00
E.Term NEI
Fixed #281: Essentia terminal no longer overlayed by NEI at certain aspect ratios.
This commit is contained in:
1 parent
ee3b1309fe
commit
6876fa4b57
6 files changed
+50
-52
No files matched your search
+4
-1
@@ -1,4 +1,7 @@
|
||||
04/17/2016 1.0.0.4 - Beta
|
||||
04/17/2016 1.0.0.5 - Beta
|
||||
Fixed #281: Essentia terminal no longer overlayed by NEI at certain aspect ratios.
|
||||
|
||||
04/17/2016 1.0.0.4 - Beta
|
||||
Fixes #300 and #282: Microblock compatibility added.
|
||||
Fixes #293: Added missing redstone method to level emitter.
|
||||
Craftable essentia no longer shows in item terminals.
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ apply plugin: 'java'
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
|
||||
version = "1.0.0.4"
|
||||
version = "1.0.0.5"
|
||||
group= "thaumicenergistics" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "thaumicenergistics"
|
||||
|
||||
|
||||
@@ -173,10 +173,10 @@ public class GuiEssentiaCellTerminal
|
||||
this.player = player;
|
||||
|
||||
// Set the X size
|
||||
this.xSize = GUI_WIDTH;
|
||||
this.xSize = GuiConstants_ECT.GUI_WIDTH;
|
||||
|
||||
// Set the Y size
|
||||
this.ySize = GUI_HEIGHT;
|
||||
this.ySize = GuiConstants_ECT.GUI_HEIGHT;
|
||||
|
||||
// Set the title
|
||||
this.guiTitle = title;
|
||||
@@ -188,18 +188,18 @@ public class GuiEssentiaCellTerminal
|
||||
this.selectedInfoAmountPrefix = ThEStrings.Gui_SelectedAmount.getLocalized() + ": ";
|
||||
|
||||
// Create the widgets
|
||||
this.aspectWidgets = new WidgetAspectSelector[WIDGETS_PER_PAGE];
|
||||
this.aspectWidgets = new WidgetAspectSelector[GuiConstants_ECT.WIDGETS_PER_PAGE];
|
||||
// Rows
|
||||
for( int y = 0; y < WIDGET_ROWS_PER_PAGE; y++ )
|
||||
for( int y = 0; y < GuiConstants_ECT.WIDGET_ROWS_PER_PAGE; y++ )
|
||||
{
|
||||
// Columns
|
||||
for( int x = 0; x < WIDGETS_PER_ROW; x++ )
|
||||
for( int x = 0; x < GuiConstants_ECT.WIDGETS_PER_ROW; x++ )
|
||||
{
|
||||
WidgetAspectSelector widget = new WidgetAspectSelector( this, null,
|
||||
WIDGET_OFFSET_X + ( x * ThEWidget.WIDGET_SIZE ),
|
||||
WIDGET_OFFSET_Y + ( y * ThEWidget.WIDGET_SIZE ),
|
||||
GuiConstants_ECT.WIDGET_OFFSET_X + ( x * ThEWidget.WIDGET_SIZE ),
|
||||
GuiConstants_ECT.WIDGET_OFFSET_Y + ( y * ThEWidget.WIDGET_SIZE ),
|
||||
player );
|
||||
this.aspectWidgets[( y * WIDGETS_PER_ROW ) + x] = widget;
|
||||
this.aspectWidgets[( y * GuiConstants_ECT.WIDGETS_PER_ROW ) + x] = widget;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,9 +294,9 @@ public class GuiEssentiaCellTerminal
|
||||
private boolean isMouseOverWidgetArea( final int mouseX, final int mouseY )
|
||||
{
|
||||
return ThEGuiHelper.INSTANCE.isPointInGuiRegion(
|
||||
WIDGET_OFFSET_Y, WIDGET_OFFSET_X,
|
||||
WIDGET_ROWS_PER_PAGE * ThEWidget.WIDGET_SIZE,
|
||||
WIDGETS_PER_ROW * ThEWidget.WIDGET_SIZE,
|
||||
GuiConstants_ECT.WIDGET_OFFSET_Y, GuiConstants_ECT.WIDGET_OFFSET_X,
|
||||
GuiConstants_ECT.WIDGET_ROWS_PER_PAGE * ThEWidget.WIDGET_SIZE,
|
||||
GuiConstants_ECT.WIDGETS_PER_ROW * ThEWidget.WIDGET_SIZE,
|
||||
mouseX, mouseY, this.guiLeft, this.guiTop );
|
||||
}
|
||||
|
||||
@@ -324,10 +324,10 @@ public class GuiEssentiaCellTerminal
|
||||
private void updateScrollMaximum()
|
||||
{
|
||||
// Calculate the number of widgets the will overflow
|
||||
double overflowWidgets = Math.max( 0, this.matchingSearchStacks.size() - WIDGETS_PER_PAGE );
|
||||
double overflowWidgets = Math.max( 0, this.matchingSearchStacks.size() - GuiConstants_ECT.WIDGETS_PER_PAGE );
|
||||
|
||||
// Calculate how many rows will overflow
|
||||
int overflowRows = (int)Math.ceil( overflowWidgets / WIDGETS_PER_ROW );
|
||||
int overflowRows = (int)Math.ceil( overflowWidgets / GuiConstants_ECT.WIDGETS_PER_ROW );
|
||||
|
||||
// Update if the range has changed
|
||||
if( overflowRows != this.previousOverflowRows )
|
||||
@@ -420,7 +420,7 @@ public class GuiEssentiaCellTerminal
|
||||
int numberOfSearchMatches = this.matchingSearchStacks.size();
|
||||
|
||||
// Calculate the row offset
|
||||
int rowOffset = this.currentScroll * WIDGETS_PER_ROW;
|
||||
int rowOffset = this.currentScroll * GuiConstants_ECT.WIDGETS_PER_ROW;
|
||||
|
||||
// Update each widget
|
||||
int matchIndex = -1;
|
||||
@@ -461,7 +461,7 @@ public class GuiEssentiaCellTerminal
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture( GuiTextureManager.ESSENTIA_TERMINAL.getTexture() );
|
||||
|
||||
// Draw the gui
|
||||
this.drawTexturedModalRect( this.guiLeft, this.guiTop - GUI_OFFSET_Y, 0, 0, this.xSize, this.ySize );
|
||||
this.drawTexturedModalRect( this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize );
|
||||
|
||||
// Draw the search field.
|
||||
this.searchBar.drawTextBox();
|
||||
@@ -477,7 +477,7 @@ public class GuiEssentiaCellTerminal
|
||||
super.drawGuiContainerForegroundLayer( mouseX, mouseY );
|
||||
|
||||
// Draw the title
|
||||
this.fontRendererObj.drawString( this.guiTitle, TITLE_POS_X, TITLE_POS_Y, 0 );
|
||||
this.fontRendererObj.drawString( this.guiTitle, GuiConstants_ECT.TITLE_POS_X, GuiConstants_ECT.TITLE_POS_Y, 0 );
|
||||
|
||||
// Draw the widgets
|
||||
this.drawWidgets( mouseX, mouseY );
|
||||
@@ -500,18 +500,18 @@ public class GuiEssentiaCellTerminal
|
||||
|
||||
// Draw the name
|
||||
this.fontRendererObj.drawString( this.selectedInfoNamePrefix + aspectName,
|
||||
SELECTED_INFO_POS_X, SELECTED_INFO_NAME_POS_Y, 0 );
|
||||
GuiConstants_ECT.SELECTED_INFO_POS_X, GuiConstants_ECT.SELECTED_INFO_NAME_POS_Y, 0 );
|
||||
|
||||
// Draw the amount
|
||||
this.fontRendererObj.drawString( this.selectedInfoAmountPrefix + this.cacheAmountDisplay,
|
||||
SELECTED_INFO_POS_X, SELECTED_INFO_AMOUNT_POS_Y, 0 );
|
||||
GuiConstants_ECT.SELECTED_INFO_POS_X, GuiConstants_ECT.SELECTED_INFO_AMOUNT_POS_Y, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ScrollbarParams getScrollbarParameters()
|
||||
{
|
||||
return new ScrollbarParams( SCROLLBAR_POS_X, SCROLLBAR_POS_Y, SCROLLBAR_HEIGHT );
|
||||
return new ScrollbarParams( GuiConstants_ECT.SCROLLBAR_POS_X, GuiConstants_ECT.SCROLLBAR_POS_Y, GuiConstants_ECT.SCROLLBAR_HEIGHT );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -661,7 +661,7 @@ public class GuiEssentiaCellTerminal
|
||||
protected void onMouseWheel( final int deltaZ, final int mouseX, final int mouseY )
|
||||
{
|
||||
// Is the mouse inside of, or to the left of, the GUI?
|
||||
if( mouseX > ( this.guiLeft + GUI_WIDTH ) )
|
||||
if( mouseX > ( this.guiLeft + GuiConstants_ECT.GUI_WIDTH ) )
|
||||
{
|
||||
// Mouse is to the right of the gui
|
||||
return;
|
||||
@@ -772,9 +772,9 @@ public class GuiEssentiaCellTerminal
|
||||
|
||||
// Set up the search bar
|
||||
this.searchBar = new GuiTextField( this.fontRendererObj,
|
||||
this.guiLeft + SEARCH_X_OFFSET,
|
||||
this.guiTop + SEARCH_Y_OFFSET,
|
||||
SEARCH_WIDTH, SEARCH_HEIGHT );
|
||||
this.guiLeft + GuiConstants_ECT.SEARCH_X_OFFSET,
|
||||
this.guiTop + GuiConstants_ECT.SEARCH_Y_OFFSET,
|
||||
GuiConstants_ECT.SEARCH_WIDTH, GuiConstants_ECT.SEARCH_HEIGHT );
|
||||
|
||||
// Set the search bar to draw in the foreground
|
||||
this.searchBar.setEnableBackgroundDrawing( false );
|
||||
@@ -783,23 +783,23 @@ public class GuiEssentiaCellTerminal
|
||||
this.searchBar.setFocused( false );
|
||||
|
||||
// Set maximum length
|
||||
this.searchBar.setMaxStringLength( SEARCH_MAX_CHARS );
|
||||
this.searchBar.setMaxStringLength( GuiConstants_ECT.SEARCH_MAX_CHARS );
|
||||
|
||||
// Clear any existing buttons
|
||||
this.buttonList.clear();
|
||||
|
||||
// Add the sort mode button
|
||||
this.buttonSortingMode = new GuiButtonSortingMode( 0,
|
||||
this.guiLeft + BUTTON_SORT_MODE_POS_X,
|
||||
this.guiTop + BUTTON_SORT_MODE_POS_Y,
|
||||
MODE_BUTTON_SIZE, MODE_BUTTON_SIZE );
|
||||
this.guiLeft + GuiConstants_ECT.BUTTON_SORT_MODE_POS_X,
|
||||
this.guiTop + GuiConstants_ECT.BUTTON_SORT_MODE_POS_Y,
|
||||
GuiConstants_ECT.MODE_BUTTON_SIZE, GuiConstants_ECT.MODE_BUTTON_SIZE );
|
||||
this.buttonList.add( this.buttonSortingMode );
|
||||
|
||||
// Add view type button
|
||||
this.buttonViewMode = new GuiButtonViewType( 1,
|
||||
this.guiLeft + BUTTON_VIEW_MODE_POS_X,
|
||||
this.guiTop + BUTTON_VIEW_MODE_POS_Y,
|
||||
MODE_BUTTON_SIZE, MODE_BUTTON_SIZE );
|
||||
this.guiLeft + GuiConstants_ECT.BUTTON_VIEW_MODE_POS_X,
|
||||
this.guiTop + GuiConstants_ECT.BUTTON_VIEW_MODE_POS_Y,
|
||||
GuiConstants_ECT.MODE_BUTTON_SIZE, GuiConstants_ECT.MODE_BUTTON_SIZE );
|
||||
this.buttonList.add( this.buttonViewMode );
|
||||
}
|
||||
|
||||
|
||||
@@ -18,23 +18,18 @@ public abstract class GuiConstants_ECT
|
||||
/**
|
||||
* Sort mode button position.
|
||||
*/
|
||||
protected static final int BUTTON_SORT_MODE_POS_X = -18, BUTTON_SORT_MODE_POS_Y = -9;
|
||||
protected static final int BUTTON_SORT_MODE_POS_X = -18, BUTTON_SORT_MODE_POS_Y = 9;
|
||||
|
||||
/**
|
||||
* View mode button.
|
||||
*/
|
||||
protected static final int BUTTON_VIEW_MODE_POS_X = -18, BUTTON_VIEW_MODE_POS_Y = BUTTON_SORT_MODE_POS_Y + 20;
|
||||
protected static final int BUTTON_VIEW_MODE_POS_X = -18, BUTTON_VIEW_MODE_POS_Y = GuiConstants_ECT.BUTTON_SORT_MODE_POS_Y + 20;
|
||||
|
||||
/**
|
||||
* Size of the gui.
|
||||
*/
|
||||
protected static final int GUI_WIDTH = 195, GUI_HEIGHT = 204;
|
||||
|
||||
/**
|
||||
* Offset from the top of the screen to draw the gui at.
|
||||
*/
|
||||
protected static final int GUI_OFFSET_Y = 18;
|
||||
|
||||
/**
|
||||
* Width and height of the mode buttons.
|
||||
*/
|
||||
@@ -43,7 +38,7 @@ public abstract class GuiConstants_ECT
|
||||
/**
|
||||
* Search bar.
|
||||
*/
|
||||
protected static final int SEARCH_X_OFFSET = 98, SEARCH_Y_OFFSET = -12, SEARCH_WIDTH = 69, SEARCH_HEIGHT = 10;
|
||||
protected static final int SEARCH_X_OFFSET = 98, SEARCH_Y_OFFSET = 6, SEARCH_WIDTH = 69, SEARCH_HEIGHT = 10;
|
||||
|
||||
/**
|
||||
* The maximum number of displayable characters.
|
||||
@@ -53,22 +48,22 @@ public abstract class GuiConstants_ECT
|
||||
/**
|
||||
* Scroll bar.
|
||||
*/
|
||||
protected static final int SCROLLBAR_POS_X = 175, SCROLLBAR_POS_Y = 0, SCROLLBAR_HEIGHT = 70;
|
||||
protected static final int SCROLLBAR_POS_X = 175, SCROLLBAR_POS_Y = 18, SCROLLBAR_HEIGHT = 70;
|
||||
|
||||
/**
|
||||
* Selected aspect info positions.
|
||||
*/
|
||||
protected static final int SELECTED_INFO_POS_X = 45, SELECTED_INFO_NAME_POS_Y = 73, SELECTED_INFO_AMOUNT_POS_Y = 83;
|
||||
protected static final int SELECTED_INFO_POS_X = 45, SELECTED_INFO_NAME_POS_Y = 91, SELECTED_INFO_AMOUNT_POS_Y = 101;
|
||||
|
||||
/**
|
||||
* Position of the title.
|
||||
*/
|
||||
protected static final int TITLE_POS_X = 7, TITLE_POS_Y = -12;
|
||||
protected static final int TITLE_POS_X = 7, TITLE_POS_Y = 6;
|
||||
|
||||
/**
|
||||
* Widget offsets.
|
||||
*/
|
||||
protected static final int WIDGET_OFFSET_X = 7, WIDGET_OFFSET_Y = -1;
|
||||
protected static final int WIDGET_OFFSET_X = 7, WIDGET_OFFSET_Y = 17;
|
||||
|
||||
/**
|
||||
* Number of widgets per row.
|
||||
@@ -83,7 +78,7 @@ public abstract class GuiConstants_ECT
|
||||
/**
|
||||
* Number of widgets per page.
|
||||
*/
|
||||
protected static final int WIDGETS_PER_PAGE = WIDGETS_PER_ROW * WIDGET_ROWS_PER_PAGE;
|
||||
protected static final int WIDGETS_PER_PAGE = GuiConstants_ECT.WIDGETS_PER_ROW * GuiConstants_ECT.WIDGET_ROWS_PER_PAGE;
|
||||
|
||||
public GuiConstants_ECT( final Container container )
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ThaumicEnergistics
|
||||
/**
|
||||
* Current version of the mod.
|
||||
*/
|
||||
public static final String VERSION = "1.0.0.4"; // NOTE: don't forget to change the build.gradle file as well
|
||||
public static final String VERSION = "1.0.0.5"; // NOTE: don't forget to change the build.gradle file as well
|
||||
|
||||
/**
|
||||
* Singleton instance
|
||||
|
||||
+6
-6
@@ -54,7 +54,7 @@ public abstract class ContainerEssentiaCellTerminalBase
|
||||
/**
|
||||
* Y position for the output slot
|
||||
*/
|
||||
private static final int OUTPUT_POSITION_Y = 74;
|
||||
private static final int OUTPUT_POSITION_Y = 92;
|
||||
|
||||
/**
|
||||
* X position for the input slot
|
||||
@@ -64,17 +64,17 @@ public abstract class ContainerEssentiaCellTerminalBase
|
||||
/**
|
||||
* Y position for the input slot
|
||||
*/
|
||||
private static final int INPUT_POSITION_Y = 74;
|
||||
private static final int INPUT_POSITION_Y = ContainerEssentiaCellTerminalBase.OUTPUT_POSITION_Y;
|
||||
|
||||
/**
|
||||
* Y position for the player inventory
|
||||
*/
|
||||
private static final int PLAYER_INV_POSITION_Y = 104;
|
||||
private static final int PLAYER_INV_POSITION_Y = 122;
|
||||
|
||||
/**
|
||||
* Y position for the hotbar inventory
|
||||
*/
|
||||
private static final int HOTBAR_INV_POSITION_Y = 162;
|
||||
private static final int HOTBAR_INV_POSITION_Y = 180;
|
||||
|
||||
/**
|
||||
* The minimum amount of time to wait before playing
|
||||
@@ -719,7 +719,7 @@ public abstract class ContainerEssentiaCellTerminalBase
|
||||
break;
|
||||
}
|
||||
}
|
||||
while( this.workCounter < ESSENTIA_TRANSFER_PER_WORK_CYCLE );
|
||||
while( this.workCounter < ContainerEssentiaCellTerminalBase.ESSENTIA_TRANSFER_PER_WORK_CYCLE );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1002,7 +1002,7 @@ public abstract class ContainerEssentiaCellTerminalBase
|
||||
}
|
||||
|
||||
// Has enough time passed to play the sound again?
|
||||
if( ( System.currentTimeMillis() - this.lastSoundPlaytime ) > MINIMUM_SOUND_WAIT )
|
||||
if( ( System.currentTimeMillis() - this.lastSoundPlaytime ) > ContainerEssentiaCellTerminalBase.MINIMUM_SOUND_WAIT )
|
||||
{
|
||||
if( type == 0 )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user