mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-31 05:33:00 +00:00 
			
		
		
		
	Add back the previous widget methods for back compat
Previously introduced in f765b6a487.
Fixes #87
			
			
This commit is contained in:
		| @@ -95,7 +95,7 @@ public class GuiComputer extends GuiContainer | |||||||
|         } |         } | ||||||
|         else |         else | ||||||
|         { |         { | ||||||
|             if( m_terminal.keyTyped( c, k ) ) keyHandled = true; |             if( m_terminal.onKeyTyped( c, k ) ) keyHandled = true; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -123,7 +123,7 @@ public class GuiComputer extends GuiContainer | |||||||
|     public void handleKeyboardInput() throws IOException |     public void handleKeyboardInput() throws IOException | ||||||
|     { |     { | ||||||
|         super.handleKeyboardInput(); |         super.handleKeyboardInput(); | ||||||
|         if( m_terminal.handleKeyboardInput() ) keyHandled = true; |         if( m_terminal.onKeyboardInput() ) keyHandled = true; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|   | |||||||
| @@ -95,7 +95,7 @@ public class GuiTurtle extends GuiContainer | |||||||
|         } |         } | ||||||
|         else |         else | ||||||
|         { |         { | ||||||
|             if( m_terminalGui.keyTyped( c, k ) ) keyHandled = true; |             if( m_terminalGui.onKeyTyped( c, k ) ) keyHandled = true; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -119,7 +119,7 @@ public class GuiTurtle extends GuiContainer | |||||||
|     public void handleKeyboardInput() throws IOException |     public void handleKeyboardInput() throws IOException | ||||||
|     { |     { | ||||||
|         super.handleKeyboardInput(); |         super.handleKeyboardInput(); | ||||||
|         if( m_terminalGui.handleKeyboardInput() ) keyHandled = true; |         if( m_terminalGui.onKeyboardInput() ) keyHandled = true; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     protected void drawSelectionSlot( boolean advanced ) |     protected void drawSelectionSlot( boolean advanced ) | ||||||
|   | |||||||
| @@ -7,16 +7,7 @@ | |||||||
| package dan200.computercraft.client.gui.widgets; | package dan200.computercraft.client.gui.widgets; | ||||||
|  |  | ||||||
| import net.minecraft.client.Minecraft; | import net.minecraft.client.Minecraft; | ||||||
| import net.minecraft.client.audio.PositionedSoundRecord; |  | ||||||
| import net.minecraft.client.gui.FontRenderer; |  | ||||||
| import net.minecraft.client.gui.Gui; | import net.minecraft.client.gui.Gui; | ||||||
| import net.minecraft.client.renderer.*; |  | ||||||
| import net.minecraft.client.renderer.vertex.DefaultVertexFormats; |  | ||||||
| import net.minecraft.init.SoundEvents; |  | ||||||
| import net.minecraft.item.ItemStack; |  | ||||||
| import org.lwjgl.opengl.GL11; |  | ||||||
|  |  | ||||||
| import javax.annotation.Nonnull; |  | ||||||
|  |  | ||||||
| public abstract class Widget extends Gui | public abstract class Widget extends Gui | ||||||
| { | { | ||||||
| @@ -65,17 +56,29 @@ public abstract class Widget extends Gui | |||||||
|     { |     { | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public boolean handleKeyboardInput() |     public boolean onKeyboardInput() | ||||||
|     { |     { | ||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Deprecated | ||||||
|  |     public void handleKeyboardInput() | ||||||
|  |     { | ||||||
|  |         onKeyboardInput(); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     public void mouseClicked( int mouseX, int mouseY, int mouseButton ) |     public void mouseClicked( int mouseX, int mouseY, int mouseButton ) | ||||||
|     { |     { | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public boolean keyTyped( char c, int k ) |     public boolean onKeyTyped( char c, int k ) | ||||||
|     { |     { | ||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Deprecated | ||||||
|  |     public void keyTyped( char c, int k ) | ||||||
|  |     { | ||||||
|  |         onKeyTyped( c, k ); | ||||||
|  |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -84,7 +84,7 @@ public class WidgetTerminal extends Widget | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public boolean keyTyped( char ch, int key ) |     public boolean onKeyTyped( char ch, int key ) | ||||||
|     { |     { | ||||||
|         if( m_focus ) |         if( m_focus ) | ||||||
|         { |         { | ||||||
| @@ -210,7 +210,7 @@ public class WidgetTerminal extends Widget | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public boolean handleKeyboardInput() |     public boolean onKeyboardInput() | ||||||
|     { |     { | ||||||
|         boolean handled = false; |         boolean handled = false; | ||||||
|         for( int i = m_keysDown.size() - 1; i >= 0; --i ) |         for( int i = m_keysDown.size() - 1; i >= 0; --i ) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 SquidDev
					SquidDev