Fixing up invisible widgets and redstone enum changes.

This commit is contained in:
AlgorithmX2 2014-01-05 02:41:03 -06:00
parent f1b32b4dfa
commit 803e62fcc7
4 changed files with 29 additions and 12 deletions

View file

@ -164,7 +164,7 @@ public abstract class AEBaseGui extends GuiContainer
int x = tooltip.xPos(); // ((GuiImgButton) c).xPosition;
int y = tooltip.yPos(); // ((GuiImgButton) c).yPosition;
if ( x < mouse_x && x + tooltip.getWidth() > mouse_x )
if ( x < mouse_x && x + tooltip.getWidth() > mouse_x && tooltip.isVisible() )
{
if ( y < mouse_y && y + tooltip.getHeight() > mouse_y )
{

View file

@ -116,17 +116,17 @@ public class GuiImgButton extends GuiButton implements ITooltip
registerApp( 16 * 10 + 3, Settings.POWER_UNITS, PowerUnits.KJ, "AppEng.GuiITooltip.PowerUnits", "AppEng.GuiITooltip.UEUnits" );
registerApp( 16 * 10 + 4, Settings.POWER_UNITS, PowerUnits.WA, "AppEng.GuiITooltip.PowerUnits", "AppEng.GuiITooltip.WUnits" );
registerApp( 3, Settings.REDSTONE_OUTPUT, RedstoneMode.IGNORE, "AppEng.GuiITooltip.RedstoneMode", "AppEng.GuiITooltip.AlwaysActive" );
registerApp( 0, Settings.REDSTONE_OUTPUT, RedstoneMode.LOW_SIGNAL, "AppEng.GuiITooltip.RedstoneMode", "AppEng.GuiITooltip.ActiveWithoutSignal" );
registerApp( 1, Settings.REDSTONE_OUTPUT, RedstoneMode.HIGH_SIGNAL, "AppEng.GuiITooltip.RedstoneMode", "AppEng.GuiITooltip.ActiveWithSignal" );
registerApp( 2, Settings.REDSTONE_OUTPUT, RedstoneMode.SIGNAL_PULSE, "AppEng.GuiITooltip.RedstoneMode", "AppEng.GuiITooltip.ActiveOnPulse" );
registerApp( 3, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE, "AppEng.GuiITooltip.RedstoneMode", "AppEng.GuiITooltip.AlwaysActive" );
registerApp( 0, Settings.REDSTONE_CONTROLLED, RedstoneMode.LOW_SIGNAL, "AppEng.GuiITooltip.RedstoneMode", "AppEng.GuiITooltip.ActiveWithoutSignal" );
registerApp( 1, Settings.REDSTONE_CONTROLLED, RedstoneMode.HIGH_SIGNAL, "AppEng.GuiITooltip.RedstoneMode", "AppEng.GuiITooltip.ActiveWithSignal" );
registerApp( 2, Settings.REDSTONE_CONTROLLED, RedstoneMode.SIGNAL_PULSE, "AppEng.GuiITooltip.RedstoneMode", "AppEng.GuiITooltip.ActiveOnPulse" );
registerApp( 3, Settings.REDSTONE_INPUT, RedstoneMode.IGNORE, "AppEng.GuiITooltip.RedstoneMode", "AppEng.GuiITooltip.AlwaysActive" );
registerApp( 0, Settings.REDSTONE_INPUT, RedstoneMode.LOW_SIGNAL, "AppEng.GuiITooltip.RedstoneMode", "AppEng.GuiITooltip.ActiveWithoutSignal" );
registerApp( 1, Settings.REDSTONE_INPUT, RedstoneMode.HIGH_SIGNAL, "AppEng.GuiITooltip.RedstoneMode", "AppEng.GuiITooltip.ActiveWithSignal" );
registerApp( 3, Settings.REDSTONE_EMITTER, RedstoneMode.IGNORE, "AppEng.GuiITooltip.RedstoneMode", "AppEng.GuiITooltip.AlwaysActive" );
registerApp( 0, Settings.REDSTONE_EMITTER, RedstoneMode.LOW_SIGNAL, "AppEng.GuiITooltip.RedstoneMode", "AppEng.GuiITooltip.ActiveWithoutSignal" );
registerApp( 1, Settings.REDSTONE_EMITTER, RedstoneMode.HIGH_SIGNAL, "AppEng.GuiITooltip.RedstoneMode", "AppEng.GuiITooltip.ActiveWithSignal" );
registerApp( 0, Settings.REDSTONE_OUTPUT, RedstoneMode.LOW_SIGNAL, "AppEng.GuiITooltip.RedstoneMode", "AppEng.GuiITooltip.EmitLevelsBelow" );
registerApp( 1, Settings.REDSTONE_OUTPUT, RedstoneMode.HIGH_SIGNAL, "AppEng.GuiITooltip.RedstoneMode", "AppEng.GuiITooltip.EmitLevelAbove" );
registerApp( 0, Settings.REDSTONE_CONTROLLED, RedstoneMode.LOW_SIGNAL, "AppEng.GuiITooltip.RedstoneMode", "AppEng.GuiITooltip.EmitLevelsBelow" );
registerApp( 1, Settings.REDSTONE_CONTROLLED, RedstoneMode.HIGH_SIGNAL, "AppEng.GuiITooltip.RedstoneMode", "AppEng.GuiITooltip.EmitLevelAbove" );
registerApp( 16 * 8 + 2, Settings.INCLUSION, IncludeExclude.WHITELIST, "AppEng.Gui.Whitelisted", "AppEng.Gui.WhitelistedDesc" );
registerApp( 16 * 8 + 3, Settings.INCLUSION, IncludeExclude.BLACKLIST, "AppEng.Gui.Blacklisted", "AppEng.Gui.BlacklistedDesc" );
@ -185,6 +185,12 @@ public class GuiImgButton extends GuiButton implements ITooltip
}
}
@Override
public boolean isVisible()
{
return drawButton;
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3)
{
@ -244,9 +250,9 @@ public class GuiImgButton extends GuiButton implements ITooltip
return 256 - 1;
}
public Enum getSetting()
public Settings getSetting()
{
return buttonSetting;
return (Settings) buttonSetting;
}
public Enum getCurrentValue()

View file

@ -93,4 +93,10 @@ public class GuiProgressBar extends GuiButton implements ITooltip
return height + 4;
}
@Override
public boolean isVisible()
{
return true;
}
}

View file

@ -42,4 +42,9 @@ public interface ITooltip
*/
int getHeight();
/**
* @return true if button being drawn
*/
boolean isVisible();
}