mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-14 20:20:30 +00:00
Make ComputerScreenBase methods extendable
This commit is contained in:
parent
34dc915d57
commit
bbc0afa111
@ -58,7 +58,7 @@ public abstract class ComputerScreenBase<T extends ContainerComputerBase> extend
|
|||||||
protected abstract WidgetTerminal createTerminal();
|
protected abstract WidgetTerminal createTerminal();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected final void init()
|
protected void init()
|
||||||
{
|
{
|
||||||
super.init();
|
super.init();
|
||||||
minecraft.keyboardHandler.setSendRepeatsToGui( true );
|
minecraft.keyboardHandler.setSendRepeatsToGui( true );
|
||||||
@ -69,21 +69,21 @@ public abstract class ComputerScreenBase<T extends ContainerComputerBase> extend
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void removed()
|
public void removed()
|
||||||
{
|
{
|
||||||
super.removed();
|
super.removed();
|
||||||
minecraft.keyboardHandler.setSendRepeatsToGui( false );
|
minecraft.keyboardHandler.setSendRepeatsToGui( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void tick()
|
public void tick()
|
||||||
{
|
{
|
||||||
super.tick();
|
super.tick();
|
||||||
terminal.update();
|
terminal.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final boolean keyPressed( int key, int scancode, int modifiers )
|
public boolean keyPressed( int key, int scancode, int modifiers )
|
||||||
{
|
{
|
||||||
// Forward the tab key to the terminal, rather than moving between controls.
|
// Forward the tab key to the terminal, rather than moving between controls.
|
||||||
if( key == GLFW.GLFW_KEY_TAB && getFocused() != null && getFocused() == terminal )
|
if( key == GLFW.GLFW_KEY_TAB && getFocused() != null && getFocused() == terminal )
|
||||||
@ -96,7 +96,7 @@ public abstract class ComputerScreenBase<T extends ContainerComputerBase> extend
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void render( @Nonnull MatrixStack stack, int mouseX, int mouseY, float partialTicks )
|
public void render( @Nonnull MatrixStack stack, int mouseX, int mouseY, float partialTicks )
|
||||||
{
|
{
|
||||||
renderBackground( stack );
|
renderBackground( stack );
|
||||||
super.render( stack, mouseX, mouseY, partialTicks );
|
super.render( stack, mouseX, mouseY, partialTicks );
|
||||||
@ -114,7 +114,7 @@ public abstract class ComputerScreenBase<T extends ContainerComputerBase> extend
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final boolean mouseDragged( double x, double y, int button, double deltaX, double deltaY )
|
public boolean mouseDragged( double x, double y, int button, double deltaX, double deltaY )
|
||||||
{
|
{
|
||||||
return (getFocused() != null && getFocused().mouseDragged( x, y, button, deltaX, deltaY ))
|
return (getFocused() != null && getFocused().mouseDragged( x, y, button, deltaX, deltaY ))
|
||||||
|| super.mouseDragged( x, y, button, deltaX, deltaY );
|
|| super.mouseDragged( x, y, button, deltaX, deltaY );
|
||||||
|
Loading…
Reference in New Issue
Block a user